src/templates/modules/commits-table.html \
src/templates/modules/commit-message.html \
src/templates/modules/files-table.html \
- src/templates/modules/jobs-table.html \
src/templates/modules/link-to-user.html \
src/templates/modules/log-files-table.html \
src/templates/modules/modal-base.html \
src/templates/modules/modal-build-comment.html \
src/templates/modules/modal-build-push.html \
src/templates/modules/modal-build-unpush.html \
- src/templates/modules/package-header.html \
src/templates/modules/packages-files-table.html \
- src/templates/modules/packages-table.html \
- src/templates/modules/package-table-detail.html \
- src/templates/modules/repo-actions-table.html \
src/templates/modules/source-table.html \
- src/templates/modules/text.html \
- src/templates/modules/watchers-sidebar-table.html
+ src/templates/modules/text.html
templates_modulesdir = $(templatesdir)/modules
+++ /dev/null
-<!--
- The documentation says <table class="table table-striped table-hover table-responsive">
- but we have to use a div class instead to get the table width enough
--->
-<div class="table-responsive">
- <table class="table table-striped table-hover">
- <thead>
- <tr>
- <th scope="col">{{ _("Arch") }}</th>
- <th scope="col">{{ _("State") }}</th>
- <th scope="col">{{ _("Host") }}</th>
- <th scope="col">{{ _("Duration") }}</th>
- </tr>
- </thead>
- <tbody>
- {% if jobs %}
- {% for job in jobs %}
- <tr>
- <td>
- <a href="/job/{{ job.uuid }}">{{ job.arch }}</a>
- </td>
- <td>
- {% if job.state == "pending" %}
- {{ _("Pending") }}
- {% elif job.state == "failed" %}
- {{ _("Failed") }}
- {% elif job.state == "dispatching" %}
- {{ _("Dispatching") }}
- {% elif job.state == "finished" %}
- {{ _("Finished") }}
- {% elif job.state == "running" %}
- {{ _("Running") }}
- {% elif job.state == "aborted" %}
- {{ _("Aborted") }}
- {% else %}
- {{ job.state }}
- {% end %}
- </td>
- <td>
- {% if job.builder %}
- <a href="/builders/{{ job.builder.name }}">{{ job.builder.name }}</a>
- {% else %}
- {{ _("N/A") }}
- {% end %}
- </td>
- <td>
- {% if job.state == "running" %}
- {{ _("Running since %s") % friendly_time(job.duration) }}
- {% elif job.duration %}
- {{ friendly_time(job.duration) }}
- {% else %}
- {{ _("Not finished, yet.") }}
- {% end %}
- </td>
- </tr>
- {% end %}
-
- {% if not build.supported_arches == "all" %}
- <tr>
- <td colspan="4">
- {{ _("This package only supports %s.") % locale.list(build.supported_arches.split()) }}
- </td>
- </tr>
- {% end %}
- {% else %}
- <tr>
- <td colspan="4">{{ _("No jobs, yet.") }}</td>
- </tr>
- {% end %}
- </tbody>
- </table>
-</div>
+++ /dev/null
-<p class="lead">
- {% module Text(pkg.description) %}
-</p>
-
-<div class="table-responsive">
- <table class="table table-hover table-sm">
- <tbody>
- {% if pkg.url %}
- <tr>
- <th >{{ _("Home") }}</th>
- <td>{% raw linkify(pkg.url, shorten=True) %}</td>
- </tr>
- {% end %}
- {% if pkg.license %}
- <tr>
- <th >{{ _("License") }}</th>
- <td>{{ pkg.license }}</td>
- </tr>
- {% end %}
-
- {% if pkg.groups %}
- <tr>
- <th >{{ _("Group", "Groups", len(pkg.groups)) }}</th>
- <td>{{ locale.list(pkg.groups) }}</td>
- </tr>
- {% end %}
-
- {% if pkg.maintainer %}
- <tr>
- <th >{{ _("Maintainer") }}</th>
- <td>{% module LinkToUser(pkg.maintainer) %}</td>
- </tr>
- {% end %}
-
- </tbody>
- </table>
-</div>
\ No newline at end of file
+++ /dev/null
-<ul class="packages">
- {% for pkg in packages %}
- <li>
- <a href="/package/{{ pkg.name }}/{{ pkg.epoch }}/{{ pkg.version }}/{{ pkg.release }}">{{ pkg.friendly_name }}</a>
- </li>
- {% end %}
-</ul>
+++ /dev/null
-<div class="table-responsive mb-2">
- <table class="table table-striped table-hover">
- <thead>
- <tr>
- <th>{{ _("Name") }}</th>
- <th>{{ _("Summary") }}</th>
- <th>{{ _("Size") }}</th>
- <th> </th>
- </tr>
- </thead>
- <tbody>
- {% for package in packages %}
- <tr>
- <td>
- <a href="/package/{{ package.uuid }}">{{ package.friendly_name }}</a>
- </td>
- <td>{{ package.summary }}</td>
- <td>{{ format_size(package.filesize) }}</td>
- <td>
- <a class="btn btn-light" href="{{ job.build.download_prefix }}/{{ package.path }}">
- <i class="icon-download"></i>{{ _("Download") }}
- </a>
- </td>
- </tr>
- {% end %}
- </tbody>
- </table>
-</div>
\ No newline at end of file
+++ /dev/null
-<div class="repo-actions">
- {% for action in actions %}
- <div class="action {{ action.action }}" id="action-{{ action.id }}">
- <a id="action-link-{{ action.id }}" href="#">{{ action.pkg.friendly_name }}</a>
- {{ _("added %s") % locale.format_date(action.time_added) }}
-
- {% if current_user and action.have_permission(current_user) %}
- <p class="buttons">
- {% if action.is_doable() %}
- <a href="javascript:action_run({{ action.id }})">{{ _("Run") }}</a>
- {% end %}
- <a href="?action=remove">{{ _("Remove action") }}</a>
- </p>
- {% end %}
-
- <div id="action-info-{{ action.id }}">
- <p>
- {% if action.score_needed %}
- {{ _("One more score needed.", "%(score)s more scores needed.", action.score_needed) % { "score" : action.score_needed } }}
- {% else %}
- {{ _("No more scores needed.") }}
- {% end %}
- <br />
- {% if action.pkg.maintainer %}
- {{ _("Maintainer: %s") % action.pkg.maintainer }}
- <br />
- {% end %}
- <a href="/package/{{ action.pkg.name }}/{{ action.pkg.epoch }}/{{ action.pkg.version }}/{{ action.pkg.release }}">{{ _("Go to package description") }}</a>
- <br />
- </p>
- </div>
-
- <script>
- $(function() {
- $("#action-info-{{ action.id }}").hide();
- $("#action-link-{{ action.id }}").toggle(
- function() { $("#action-info-{{ action.id }}").show(); },
- function() { $("#action-info-{{ action.id }}").hide(); }
- );
- });
- </script>
- </div>
- {% end %}
-</div>
-<div style="clear: both;"> </div>
+++ /dev/null
-<p>
- <a href="#watchers" data-toggle="modal">
- {% if current_user and current_user in watchers %}
- {% if len(watchers) == 1 %}
- {{ _("You.") }}
- {% elif len(watchers) == 2 %}
- {{ _("You and one other.") }}
- {% else %}
- {{ _("You and %s others.") % (len(watchers) - 1) }}
- {% end %}
- {% else %}
- {{ _("One person.", "%(num)s people.", len(watchers)) % { "num" : len(watchers) } }}
- {% end %}
- </a>
-</p>
-
-<div class="modal fade" id="watchers" tabindex="-1">
- <div class="modal-dialog modal-lg" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h3 style="word-wrap: break-word;" class="modal-title" id="watchers">
- {{ _("Watchers of %s") % build.name }}
- </h3>
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
- <span aria-hidden="true">×</span>
- </button>
- </div>
- <div class="modal-body">
- <p>
- {{ _("All users who watch this build will be automatically notified about status changes and comments.") }}
- {{ _("This is an easy way of staying up to date.") }}
- </p>
- <hr/>
-
- {% if watchers %}
- <ul>
- {% if current_user and current_user in watchers %}
- <li>
- <strong>{{ _("You.") }}</strong>
- </li>
- {% end %}
-
- {% for watcher in [w for w in watchers if current_user and not w == current_user] %}
- <li>
- <a href="/user/{{ watcher.name }}">{{ watcher.realname }}</a>
- </li>
- {% end %}
- </ul>
- {% else %}
- <p>
- {{ _("Nobody watches this build, yet. Be the first one.") }}
- </p>
- {% end %}
- </div>
-
- <div class="modal-footer">
- <div class="float-right" style="width:100%">
- {% if current_user %}
- {% if not current_user in watchers %}
- <a class="btn btn-primary mb-2" href="/build/{{ build.uuid }}/watch">{{ _("Watch this build") }}</a>
- {% end %}
- {% if current_user.is_admin() %}
- <a class="btn btn-primary mb-2" href="/build/{{ build.uuid }}/watch">{{ _("Add a watcher") }}</a>
- {% end %}
- {% end %}
- <a class="btn mb-2" data-dismiss="modal">
- {{ _("Close") }}
- </a>
- </div>
- </div>
- </div>
- </div>
-</div>
"CommitMessage" : ui_modules.CommitMessageModule,
"CommitsTable" : ui_modules.CommitsTableModule,
"JobState" : ui_modules.JobStateModule,
- "JobsTable" : ui_modules.JobsTableModule,
"FilesTable" : ui_modules.FilesTableModule,
"LinkToUser" : ui_modules.LinkToUserModule,
"LogFilesTable" : ui_modules.LogFilesTableModule,
- "PackagesTable" : ui_modules.PackagesTableModule,
- "PackageTable2" : ui_modules.PackageTable2Module,
- "PackageHeader" : ui_modules.PackageHeaderModule,
"PackageFilesTable" : ui_modules.PackageFilesTableModule,
- "RepoActionsTable" : ui_modules.RepoActionsTableModule,
"SourceTable" : ui_modules.SourceTableModule,
- "WatchersSidebarTable" : ui_modules.WatchersSidebarTableModule,
"HeadingDate" : ui_modules.HeadingDateModule,
return self.locale.format_date(date, shorter=True, relative=False)
-class PackagesTableModule(UIModule):
- def render(self, job, packages):
- return self.render_string("modules/packages-table.html", job=job,
- packages=packages)
-
-
-class PackageTable2Module(UIModule):
- def render(self, packages):
- return self.render_string("modules/package-table-detail.html",
- packages=packages)
-
-
class FilesTableModule(UIModule):
def render(self, files):
return self.render_string("modules/files-table.html", files=files)
files=files)
-class PackageHeaderModule(UIModule):
- def render(self, pkg):
- return self.render_string("modules/package-header.html", pkg=pkg)
-
-
class PackageFilesTableModule(UIModule):
def render(self, pkg, filelist):
return self.render_string("modules/packages-files-table.html",
return """<span class="%s">%s</span>""" % (" ".join(classes), text)
-class JobsTableModule(UIModule):
- def render(self, build, jobs=None, type="release"):
- if jobs is None:
- jobs = build.jobs
-
- return self.render_string("modules/jobs-table.html", build=build,
- jobs=jobs, type=type)
-
-
class JobsListModule(UIModule):
def render(self, jobs, show_arch_only=False, show_packages=False):
return self.render_string("modules/jobs/list.html", jobs=jobs,
return self.render_string("modules/build-offset.html")
-class RepoActionsTableModule(UIModule):
- def render(self, repo):
- actions = repo.get_actions()
-
- return self.render_string("modules/repo-actions-table.html",
- repo=repo, actions=actions)
-
-
-class WatchersSidebarTableModule(UIModule):
- def render(self, build, watchers, limit=5):
- # Sort the watchers by their realname.
- watchers.sort(key=lambda watcher: watcher.realname)
-
- return self.render_string("modules/watchers-sidebar-table.html",
- build=build, watchers=watchers, limit=limit)
-
-
class SelectLocaleModule(UIModule):
LOCALE_NAMES = [
# local code, English name, name