From: Michael Tremer Date: Mon, 12 Nov 2012 21:55:59 +0000 (+0100) Subject: Redesign log messages. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e434b018bcf1930eb1d5b853f1bf6de5bebfac75;p=pbs.git Redesign log messages. --- diff --git a/data/templates/modules/log-entry-comment.html b/data/templates/modules/log-entry-comment.html index d576ff11..d66f1d8b 100644 --- a/data/templates/modules/log-entry-comment.html +++ b/data/templates/modules/log-entry-comment.html @@ -2,11 +2,15 @@ {% block extra-title %} {% if entry.vote == "up" %} - +{{ entry.credit }} + + +{{ entry.credit }} + + ‐ {% elif entry.vote == "down" %} - -1 + + -{{ entry.credit }} + + ‐ {% end %} {% end %} @@ -14,6 +18,8 @@ {% if entry.get_message(current_user) %} {% module Text(entry.get_message(current_user), pre=False) %} {% else %} - {{ _("No comment given.") }} +

+ {{ _("No comment given.") }} +

{% end %} {% end %} diff --git a/data/templates/modules/log-entry-small.html b/data/templates/modules/log-entry-small.html new file mode 100644 index 00000000..4ae75f58 --- /dev/null +++ b/data/templates/modules/log-entry-small.html @@ -0,0 +1,11 @@ +
  • +
    + +
    +

    + {{ format_date(entry.time) }} +

    + + {% module Text(entry.get_message(current_user), pre=False) %} +
    +
  • diff --git a/data/templates/modules/log-entry.html b/data/templates/modules/log-entry.html index 70f3446f..c73fa920 100644 --- a/data/templates/modules/log-entry.html +++ b/data/templates/modules/log-entry.html @@ -1,40 +1,34 @@ -
    +
  • +
    + {% block body %} - {% block title %} - {% block extra-title %}{% end block %} -

    - {% if entry.system_msg %} - - {% else %} - - {% end %} + {% if u %} + + {{ u.realname }} + + {% end %} + +
    + {% block title %} +

    + {% block extra-title %}{% end block %} + {{ format_date(entry.time) }} +

    {% if entry.user %} - {% if current_user == entry.user %} - {{ _("You") }} - {% else %} - {{ entry.user.realname }} - {% end %} - {% else %} - {{ _("Pakfire Build Service") }} +

    + {% if current_user == entry.user %} + {{ _("You") }} + {% else %} + {{ entry.user.realname }} + {% end %} +

    {% end %} - - - {{ format_date(entry.time) }} -

    - {% end block %} + {% end block %} - {% block message %} -

    + {% block message %} {% module Text(entry.get_message(current_user), pre=False) %} -

    - {% end block %} - - {% block footer %} - {% if entry.get_footer(current_user) %} -

    - {{ entry.get_footer(current_user) }} -

    - {% end %} - {% end block %} + {% end block %} +
  • {% end block %} - + diff --git a/data/templates/modules/log.html b/data/templates/modules/log.html index 33f46119..755cb6ef 100644 --- a/data/templates/modules/log.html +++ b/data/templates/modules/log.html @@ -1,4 +1,4 @@ -
    +
    + diff --git a/web/ui_modules.py b/web/ui_modules.py index 15503180..59f34fe7 100644 --- a/web/ui_modules.py +++ b/web/ui_modules.py @@ -2,6 +2,7 @@ import re import string +import textile import tornado.escape import tornado.web @@ -52,7 +53,7 @@ class TextModule(UIModule): if pre: return "
    %s
    " % o - return o.replace("\n", "
    ") + return textile.textile(o) class ModalModule(UIModule): @@ -203,15 +204,19 @@ class LogModule(UIModule): class LogEntryModule(UIModule): - def render(self, entry, **args): - return self.render_string("modules/log-entry.html", - entry=entry, **args) + def render(self, entry, small=None, **args): + if small or entry.system_msg: + template = "modules/log-entry-small.html" + else: + template = "modules/log-entry.html" + + return self.render_string(template, entry=entry, u=entry.user, **args) class LogEntryCommentModule(LogEntryModule): def render(self, entry, **args): return self.render_string("modules/log-entry-comment.html", - entry=entry, **args) + entry=entry, u=entry.user, **args) class MaintainerModule(UIModule):