backoffice: revamp appearance of journal (#7125)
This commit is contained in:
parent
ecc5ae9792
commit
10681daa53
|
@ -223,7 +223,7 @@ class FormStatusPage(Directory):
|
|||
r = TemplateIO(html=True)
|
||||
r += htmltext('<div class="bo-block" id="evolution-log">')
|
||||
r += htmltext('<h2 class="foldable">%s</h2>') % _('Log')
|
||||
r += htmltext('<dl id="evolutions">')
|
||||
r += htmltext('<ul id="evolutions">')
|
||||
hidden = False
|
||||
for evo in self.filled.evolution:
|
||||
if evo.status:
|
||||
|
@ -235,44 +235,61 @@ class FormStatusPage(Directory):
|
|||
if hidden:
|
||||
continue
|
||||
|
||||
r += htmltext("<dt>%s") % misc.localstrftime(evo.time)
|
||||
evo_author = None
|
||||
evo_author_more = None
|
||||
klass = 'msg-system'
|
||||
if evo.who:
|
||||
evo_author = None
|
||||
if evo.who == '_submitter':
|
||||
klass = 'msg-in'
|
||||
evo_author = _('Original Submitter')
|
||||
if get_request().user and self.filled.is_submitter(get_request().user):
|
||||
evo_author = get_request().user.display_name
|
||||
elif self.filled.user_id:
|
||||
try:
|
||||
evo_author = _('Original Submitter (%s)') % \
|
||||
get_publisher().user_class.get(self.filled.user_id).display_name
|
||||
evo_author = get_publisher().user_class.get(self.filled.user_id).display_name
|
||||
evo_author_more = _('(Original Submitter)')
|
||||
except KeyError:
|
||||
pass
|
||||
else:
|
||||
klass = 'msg-out'
|
||||
try:
|
||||
evo_author = evo.get_author_name()
|
||||
except KeyError:
|
||||
pass
|
||||
if evo_author:
|
||||
r += htmltext(' <span class="user">%s</span>') % evo_author
|
||||
r += htmltext('</dt>')
|
||||
r += htmltext('<dd>')
|
||||
|
||||
r += htmltext('<li class="%s">' % klass)
|
||||
r += htmltext('<div>')
|
||||
r += htmltext('<div class="evolution-metadata">')
|
||||
r += htmltext('<span class="time">%s</span> ') % misc.localstrftime(evo.time)
|
||||
if evo.status:
|
||||
r += htmltext('<span class="status">%s</span> ') % self.filled.get_status_label(evo.status)
|
||||
if evo_author:
|
||||
r += htmltext('<span class="user">%s') % evo_author
|
||||
if evo_author_more:
|
||||
r += htmltext(' <span>%s</span>') % evo_author_more
|
||||
r+= htmltext('</span>')
|
||||
r += htmltext('</div>') # <-- .evolution-metadata -->
|
||||
parts = TemplateIO(html=True)
|
||||
if evo.comment:
|
||||
if evo.comment.startswith(str('#pre')):
|
||||
r += htmltext('<div class="comment"><pre>%s</pre></div>') % evo.comment[4:]
|
||||
parts += htmltext('<div class="comment"><pre>%s</pre></div>') % evo.comment[4:]
|
||||
else:
|
||||
r += htmltext('<div class="comment">')
|
||||
r += htmltext('<p>')
|
||||
r += htmltext('<p>') + htmltext('\n').join(
|
||||
parts += htmltext('<div class="comment">')
|
||||
parts += htmltext('<p>')
|
||||
parts += htmltext('<p>') + htmltext('\n').join(
|
||||
[(x or htmltext('</p><p>')) for x in evo.comment.splitlines()])
|
||||
r += htmltext('</p>')
|
||||
r += htmltext('</div>')
|
||||
parts += htmltext('</p>')
|
||||
parts += htmltext('</div>')
|
||||
for t in evo.display_parts():
|
||||
r += t
|
||||
r += htmltext('</dd>')
|
||||
r += htmltext('</dl>')
|
||||
parts += t
|
||||
parts_value = parts.getvalue()
|
||||
if parts_value:
|
||||
r += htmltext('<div class="msg">')
|
||||
r += htmltext(parts_value)
|
||||
r += htmltext('</div')
|
||||
r += htmltext('</div>')
|
||||
r += htmltext('</li>')
|
||||
r += htmltext('</ul>')
|
||||
r += htmltext('</div>') # .bo-block #evolution-log
|
||||
return r.getvalue()
|
||||
|
||||
|
|
|
@ -384,12 +384,9 @@ ul.biglist li.user-has-roles {
|
|||
border-left: 5px solid #cc00ff;
|
||||
}
|
||||
|
||||
dl#evolutions dt {
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
dl#evolutions dd {
|
||||
border-bottom: 1px solid #006699;
|
||||
ul#evolutions span.time:before {
|
||||
font-family: FontAwesome;
|
||||
content: "\f017 "; /* clock-o */
|
||||
}
|
||||
|
||||
div.page {
|
||||
|
|
|
@ -422,3 +422,59 @@ fieldset.form-plus legend:after {
|
|||
position: absolute;
|
||||
right: 1em;
|
||||
}
|
||||
|
||||
ul#evolutions {
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
background: linear-gradient(to right, transparent 0%, transparent 30px, #666 30px, #aaa 32px, #666 34px, transparent 24px, transparent 100%) no-repeat;
|
||||
}
|
||||
|
||||
ul#evolutions li {
|
||||
margin: 1em 0 2em 0;
|
||||
}
|
||||
|
||||
ul#evolutions div.evolution-metadata {
|
||||
width: 70%;
|
||||
background: white;
|
||||
padding: 1ex;
|
||||
border: 1px solid #666;
|
||||
margin-bottom: 0;
|
||||
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
ul#evolutions span.time {
|
||||
}
|
||||
|
||||
ul#evolutions span.status {
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
padding-left: 1em;
|
||||
padding-bottom: 1ex;
|
||||
}
|
||||
|
||||
ul#evolutions span.user {
|
||||
display: block;
|
||||
}
|
||||
|
||||
ul#evolutions span.user span {
|
||||
font-size: 80%;
|
||||
}
|
||||
|
||||
ul#evolutions li div.msg {
|
||||
padding: 1ex;
|
||||
border: 1px solid #666;
|
||||
margin-top: -1px;
|
||||
box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
|
||||
ul#evolutions li.msg-in div.msg {
|
||||
margin-left: 60px;
|
||||
margin-right: 20%;
|
||||
background: #dfd;
|
||||
}
|
||||
|
||||
ul#evolutions li.msg-out div.msg {
|
||||
margin-left: 30%;
|
||||
background: #ddf;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue