-<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 %}‐{% 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 %}‐{% 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>
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", "")
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.