From: Michael Tremer Date: Sun, 18 Nov 2012 11:13:34 +0000 (+0100) Subject: Restyle package/build header. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c21cb4ec1d27df31c162ba66cbceced8088403ff;p=pbs.git Restyle package/build header. --- diff --git a/data/static/css/style.css b/data/static/css/style.css index b15748b5..cebf5109 100644 --- a/data/static/css/style.css +++ b/data/static/css/style.css @@ -61,3 +61,7 @@ body { text-align: center; margin-bottom: 15px; } + +.lead-small { + font-size: 21px; +} diff --git a/data/templates/modules/build-headline.html b/data/templates/modules/build-headline.html index 44ff3891..804525b1 100644 --- a/data/templates/modules/build-headline.html +++ b/data/templates/modules/build-headline.html @@ -13,7 +13,7 @@ {% end %} -

+

{% if prefix %} {{ prefix }}: {% end %} @@ -23,8 +23,7 @@ {% else %} {{ build.name }} {% end %} -
{{ pkg.summary }} -

+ diff --git a/data/templates/modules/package-header.html b/data/templates/modules/package-header.html index b822fa6f..dd9d0525 100644 --- a/data/templates/modules/package-header.html +++ b/data/templates/modules/package-header.html @@ -1,50 +1,30 @@ -
-
- - - {% if pkg.groups %} - - - - - {% end %} +
+ {% module Text(pkg.description) %} +
+ +
+

+ {% if pkg.url %} + + {{ _("Home") }} + + {% if pkg.license or pkg.groups %}‐{% end %} + {% end %} - {% if pkg.url %} -

- - - - {% end %} + {% if pkg.license %} + {{ _("License") }}: {{ pkg.license }} - {% if pkg.license %} - - - - - {% end %} + {% if pkg.groups %}‐{% end %} + {% end %} - {% if pkg.maintainer %} - - - - - {% end %} - -
{{ _("Group", "Groups", len(pkg.groups)) }} - {{ locale.list(pkg.groups) }} -
{{ _("Homepage") }} - {% raw linkify(pkg.url, shorten=True, extra_params='target="_blank"', permitted_protocols=["http", "https", "ftp"]) %} -
{{ _("License") }} - {{ pkg.license }} -
{{ _("Maintainer") }} - {% module Maintainer(pkg.maintainer) %} -
-
+ {% if pkg.groups %} + {{ _("Group", "Groups", len(pkg.groups)) }}: {{ locale.list(pkg.groups) }} + {% end %} +

-
-
-

{{ _("Description") }}

- {{ pkg.description }} -
-
+ {% if pkg.maintainer %} +

+ {{ _("This package is maintained by") }} {% module Maintainer(pkg.maintainer) %}. +

+ {% end %}
diff --git a/web/ui_modules.py b/web/ui_modules.py index 59f34fe7..2399ba02 100644 --- a/web/ui_modules.py +++ b/web/ui_modules.py @@ -20,7 +20,7 @@ class UIModule(tornado.web.UIModule): class TextModule(UIModule): - def render(self, text, pre=True): + def render(self, text, pre=False, remove_linebreaks=True): link = """%s""" bz_url = self.settings.get("bugzilla_url", "") @@ -31,6 +31,9 @@ class TextModule(UIModule): cve_pattern = re.compile(r"(CVE)(\s|\-)(\d{4}\-\d{4})") cve_repl = link % (cve_url % r"\3", r"\1\2\3") + if remove_linebreaks: + text = text.replace("\n", " ") + o = [] for p in text.splitlines(): # Escape the text and create make urls clickable.