]> git.ipfire.org Git - pbs.git/commitdiff
Restyle package/build header.
authorMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Nov 2012 11:13:34 +0000 (12:13 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Sun, 18 Nov 2012 11:13:34 +0000 (12:13 +0100)
data/static/css/style.css
data/templates/modules/build-headline.html
data/templates/modules/package-header.html
web/ui_modules.py

index b15748b566648111b62ba4e9fe3643aaf4c03bcc..cebf5109e3320dafa77bc5752f3868f55deb4584 100644 (file)
@@ -61,3 +61,7 @@ body {
        text-align: center;
        margin-bottom: 15px;
 }
+
+.lead-small {
+       font-size: 21px;
+}
index 44ff38912f727ec0c5e0eaa023439d10c6c7f301..804525b1948f357339c9335834f1870c67f651db 100644 (file)
@@ -13,7 +13,7 @@
                {% end %}
        </div>
 
-       <h1>
+       <h2>
                {% if prefix %}
                        {{ prefix }}:
                {% end %}
@@ -23,8 +23,7 @@
                {% else %}
                        {{ build.name }}
                {% end %}
-               <br>
 
                <small>{{ pkg.summary }}</small>
-       </h1>
+       </h2>
 </div>
index b822fa6f6b09be7ff7cf36a465786f6f4d1aa6c2..dd9d0525ae172440c67f04c96ef8d81cbb4d1802 100644 (file)
@@ -1,50 +1,30 @@
-<div class="row">
-       <div class="span6">
-               <table class="table">
-                       <tbody>
-                               {% if pkg.groups %}
-                                       <tr>
-                                               <td>{{ _("Group", "Groups", len(pkg.groups)) }}</td>
-                                               <td>
-                                                       {{ locale.list(pkg.groups) }}
-                                               </td>
-                                       </tr>
-                               {% end %}
+<div class="lead lead-small">
+       {% module Text(pkg.description) %}
+</div>
+
+<div class="muted">
+       <p class="pull-right">
+               {% if pkg.url %}
+                       <i class="icon-home"></i>
+                       <a href="{{ pkg.url }}" target="_blank">{{ _("Home") }}</a>
+
+                       {% if pkg.license or pkg.groups %}&dash;{% end %}
+               {% end %}
 
-                               {% if pkg.url %}
-                                       <tr>
-                                               <td>{{ _("Homepage") }}</td>
-                                               <td>
-                                                       {% raw linkify(pkg.url, shorten=True, extra_params='target="_blank"', permitted_protocols=["http", "https", "ftp"]) %}
-                                               </td>
-                                       </tr>
-                               {% end %}
+               {% if pkg.license %}
+                       {{ _("License") }}: {{ pkg.license }}
 
-                               {% if pkg.license %}
-                                       <tr>
-                                               <td>{{ _("License") }}</td>
-                                               <td>
-                                                       {{ pkg.license }}
-                                               </td>
-                                       </tr>
-                               {% end %}
+                       {% if pkg.groups %}&dash;{% end %}
+               {% end %}
 
-                               {% if pkg.maintainer %}
-                                       <tr>
-                                               <td>{{ _("Maintainer") }}</td>
-                                               <td>
-                                                       {% module Maintainer(pkg.maintainer) %}
-                                               </td>
-                                       </tr>
-                               {% end %}
-                       </tbody>
-               </table>
-       </div>
+               {% if pkg.groups %}
+                       {{ _("Group", "Groups", len(pkg.groups)) }}: {{ locale.list(pkg.groups) }}
+               {% end %}
+       </p>
 
-       <div class="span6">
-               <div class="well">
-                       <h3>{{ _("Description") }}</h3>
-                       {{ pkg.description }}
-               </div>
-       </div>
+       {% if pkg.maintainer %}
+               <p>
+                       {{ _("This package is maintained by") }} {% module Maintainer(pkg.maintainer) %}.
+               </p>
+       {% end %}
 </div>
index 59f34fe70eafd2fd9327f510bc252e6d73b5f03a..2399ba02f5074bb4ba594f8f5296f52e93716039 100644 (file)
@@ -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 = """<a href="%s" target="_blank">%s</a>"""
 
                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.