src/templates/modules/files-table.html \
src/templates/modules/footer.html \
src/templates/modules/jobs-table.html \
+ src/templates/modules/link-to-user.html \
src/templates/modules/log-entry-comment.html \
src/templates/modules/log-entry.html \
src/templates/modules/log-entry-small.html \
src/templates/modules/log-files-table.html \
src/templates/modules/log.html \
src/templates/modules/log-table.html \
- src/templates/modules/maintainer.html \
src/templates/modules/modal-base.html \
src/templates/modules/modal-build-comment.html \
src/templates/modules/modal-build-push.html \
<hr>
<p class="muted">
- {{ _("Author") }} {% module Maintainer(build.commit.author) %}
+ {{ _("Author") }} {% module LinkToUser(build.commit.author) %}
‐
{{ _("Commit") }} <a href="/distro/{{ build.distro.identifier }}/source/{{ build.pkg.commit.source.identifier }}/{{ build.pkg.commit.revision }}">{{ build.pkg.commit.revision[:7] }}</a>
</p>
</tr>
<tr>
<td>{{ _("Author") }}</td>
- <td>{% raw format_email(commit.author) %}</td>
+ <td>{% module LinkToUser(commit.author) %}</td>
</tr>
<tr>
<td>{{ _("Committer") }}</td>
- <td>{% raw format_email(commit.committer) %}</td>
+ <td>{% module LinkToUser(commit.committer) %}</td>
</tr>
{% if commit.message %}
{% if show_user %}
{% if build.type == "scratch" and build.user %}
<td>
- {% module Maintainer(build.user) %}
+ {% module LinkToUser(build.user) %}
</td>
{% elif build.type == "release" %}
- <td>{% module Maintainer(build.pkg.maintainer) %}</td>
+ <td>{% module LinkToUser(build.pkg.maintainer) %}</td>
{% else %}
<td></td>
{% end %}
<hr>
<p class="muted">
- {{ _("Author") }} {% module Maintainer(build.commit.author) %}
+ {{ _("Author") }} {% module LinkToUser(build.commit.author) %}
<span class="pull-right">{{ locale.format_date(build.created, shorter=True) }}</span>
</p>
{% else %}
{% elif build.type == "scratch" %}
<p class="muted">
- {{ _("Owner") }} {% module Maintainer(build.owner) %}
+ {{ _("Owner") }} {% module LinkToUser(build.owner) %}
<span class="pull-right">{{ locale.format_date(build.created, shorter=True) }}</span>
</p>
--- /dev/null
+{% if isinstance(user, users.User) %}
+ {% if user.is_admin() %}
+ <i class="icon-star"></i>
+ {% else %}
+ <i class="icon-user"></i>
+ {% end %}
+ <a href="/user/{{ user.name }}">
+ {{ user.realname }}
+ </a>
+{% elif user %}
+ {% import email.utils %}
+ {% set name, email_address = email.utils.parseaddr(user) %}
+
+ <i class="icon-envelope"></i>
+ <a href="mailto:{{ email_address }}">{{ name or email_address }}</a>
+{% end %}
\ No newline at end of file
+++ /dev/null
-{% if type == "string" and maintainer %}
- <i class="icon-envelope"></i>
- {% raw format_email(maintainer) %}
-{% elif type == "user" %}
- {% if maintainer.is_admin() %}
- <i class="icon-star"></i>
- {% else %}
- <i class="icon-user"></i>
- {% end %}
- <a href="/user/{{ maintainer.name }}">
- {{ maintainer.realname }}
- </a>
-{% end %}
{% if pkg.maintainer %}
<dt>{{ _("Maintainer") }}</dt>
- <dd>{% module Maintainer(pkg.maintainer) %}</dd>
+ <dd>{% module LinkToUser(pkg.maintainer) %}</dd>
{% end %}
</dl>
{% if pkg.maintainer %}
<tr>
<td>{{ _("Maintainer") }}</td>
- <td>{% module Maintainer(pkg.maintainer) %}</td>
+ <td>{% module LinkToUser(pkg.maintainer) %}</td>
</tr>
{% end %}
<tr>
"JobsTable" : ui_modules.JobsTableModule,
"CommentsTable" : ui_modules.CommentsTableModule,
"FilesTable" : ui_modules.FilesTableModule,
+ "LinkToUser" : ui_modules.LinkToUserModule,
"LogTable" : ui_modules.LogTableModule,
"LogFilesTable" : ui_modules.LogFilesTableModule,
- "Maintainer" : ui_modules.MaintainerModule,
"PackagesTable" : ui_modules.PackagesTableModule,
"PackageTable2" : ui_modules.PackageTable2Module,
"PackageHeader" : ui_modules.PackageHeaderModule,
entry=entry, u=entry.user, show_build=show_build, **args)
-class MaintainerModule(UIModule):
- def render(self, maintainer):
- if isinstance(maintainer, users.User):
- type = "user"
- else:
- type = "string"
-
- return self.render_string("modules/maintainer.html",
- type=type, maintainer=maintainer)
+class LinkToUserModule(UIModule):
+ def render(self, user):
+ return self.render_string("modules/link-to-user.html", user=user, users=users)
class BuildLogModule(UIModule):