src/templates/keys-list.html \
src/templates/log.html \
src/templates/login.html \
- src/templates/package-detail.html \
src/templates/package-properties.html \
src/templates/queue.html \
src/templates/search.html \
dist_templates_packages_DATA = \
src/templates/packages/index.html \
src/templates/packages/name.html \
+ src/templates/packages/show.html \
src/templates/packages/view-file.html
templates_packagesdir = $(templatesdir)/packages
templates_packages_buildsdir = $(templates_packagesdir)/builds
+dist_templates_packages_modules_DATA = \
+ src/templates/packages/modules/info.html
+
+templates_packages_modulesdir = $(templates_packagesdir)/modules
+
dist_templates_users_DATA = \
src/templates/users/show.html
def path(self):
return self.data.path
+ @property
+ def download_url(self):
+ # XXX ???
+ return self.path
+
@property
def filename(self):
return os.path.basename(self.path)
</div>
</div>
- <a class="small secondary button" href="/package/{{ build.pkg.uuid }}">
+ <a class="expanded secondary button" href="/packages/{{ build.pkg.uuid }}">
{{ _("Source Package") }}
</a>
{% module JobsBoxes(build) %}
<p class="text-center">
- <a href="/package/{{ build.pkg.uuid }}">{{ _("Source package") }}</a>
+ <a href="/packages/{{ build.pkg.uuid }}">{{ _("Source package") }}</a>
</p>
</div>
</div>
<ul>
{% for package in job.packages %}
<li>
- <a href="/package/{{ package.uuid }}">
+ <a href="/packages/{{ package.uuid }}">
{{ package }}
</a>
</li>
+++ /dev/null
-{% extends "base.html" %}
-
-{% block title %}{{ _("Package") }} - {{ pkg }}{% end block %}
-
-{% block body %}
-
-<div class="row">
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- <nav aria-label="breadcrumb" role="navigation">
- <ol class="breadcrumb">
- <li class="breadcrumb-item"><a href="/">{{ _("Home") }}</a></li>
- <li class="breadcrumb-item"><a href="/packages">{{ _("Packages") }}</a></li>
- <li class="breadcrumb-item"><a href="/package/{{ pkg.name }}">{{ pkg.name }}</a></li>
- {% if pkg.build %}
- <li class="breadcrumb-item">
- <a href="/build/{{ pkg.build.uuid }}">{{ pkg.evr }}</a>
- </li>
- {% end %}
- {% if pkg.job %}
- <li class="breadcrumb-item">
- <a href="/job/{{ pkg.job.uuid }}">{{ pkg.job.arch }}</a>
- </li>
- {% end %}
- <li class="breadcrumb-item active">
- <a href="/package/{{ pkg.uuid }}">{{ pkg }}</a>
- </li>
- </ol>
- </nav>
- </div>
- </div>
-
- <div class="row">
- {% if pkg.build %}
- <div class="col-12 col-sm-12 col-md-9 col-lg-10 col-xl-10">
- <h2 style="word-wrap: break-word;">
- {{ _("Package") }}: {{ pkg }}
- {% if pkg.arch == "src" %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Source package") }}</span>
- {% end %}
- {% if pkg.name.endswith("-devel") %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Development package") }}</span>
- {% end %}
- {% if pkg.name.endswith("-debuginfo") %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Debuginfo package") }}</span>
- {% end %}
- <br>
- <small>{{ pkg.summary }}</small>
- </h2>
- </div>
- <div class="col-12 col-sm-12 col-md-3 col-lg-2 col-xl-2">
- <div class="dropdown">
- <button class="btn btn-block btn-light dropdown-toggle mb-2" type="button" id="dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- {{ _("Actions") }}
- </button>
- <div class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdownMenuButton">
- <a class="dropdown-item" href="{{ pkg.build.download_prefix }}/{{ pkg.path }}">
- {{ _("Download") }}
- </a>
- </div>
- </div>
- </div>
- {% else %}
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- <h2 style="word-wrap: break-word;">
- {{ _("Package") }}: {{ pkg }}
- {% if pkg.arch == "src" %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Source package") }}</span>
- {% elif pkg.name.endswith("-devel") %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Development package") }}</span>
- {% elif pkg.name.endswith("-debuginfo") %}
- <span class="badge badge-info float-lg-right float-xl-right">{{ _("Debuginfo package") }}</span>
- {% end %}
- <br>
- <small>{{ pkg.summary }}</small>
- </h2>
- </div>
- {% end %}
- </div>
-
- <div class="row">
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- {% module Text(pkg.description) %}
- </div>
- </div>
- <div class="row">
- <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
- <div class="table-responsive mb-2">
- <table class="table">
- <tbody>
- <tr>
- <td>{{ _("Homepage") }}</td>
- <td>
- <a href="{{ pkg.url }}" target="_blank">{{ pkg.url }}</a>
- </td>
- </tr>
- <tr>
- <td>{{ _("License") }}</td>
- <td>
- {{ pkg.license }}
- </td>
- </tr>
- {% if pkg.maintainer %}
- <tr>
- <td>{{ _("Maintainer") }}</td>
- <td>{% module LinkToUser(pkg.maintainer) %}</td>
- </tr>
- {% end %}
- <tr>
- <td>{{ _("Build host") }}</td>
- <td>
- <a href="/builders/{{ pkg.build_host }}">{{ pkg.build_host }}</a>
- </td>
- </tr>
- <tr>
- <td>{{ _("Build time") }}</td>
- <td>{{ locale.format_date(pkg.build_time, full_format=True) }} UTC</td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
-
- <div class="col-12 col-sm-12 col-md-6 col-lg-6 col-xl-6">
- <div class="table-responsive mb-2">
- <table class="table">
- <tbody>
- {% if not pkg.arch == "src" %}
- <tr>
- <td>{{ _("Source package") }}</td>
- <td>
- <a href="/package/{..{ pkg.build.package.uuid }..}">{..{ pkg.build.package }..}</a>
- </td>
- </tr>
- {% end %}
-
- {% if pkg.build %}
- <tr>
- <td>{{ _("Build") }}</td>
- <td>
- <a href="/build/{{ pkg.build.uuid }}">{{ pkg.build.name }}</a>
- </td>
- </tr>
- {% end %}
-
- {% if pkg.job %}
- <tr>
- <td>{{ _("Job") }}</td>
- <td>
- <a href="/job/{{ pkg.job.uuid }}">{{ pkg.job.name }}</a>
- </td>
- </tr>
- {% end %}
-
- <tr>
- <td>{{ _("Size") }}</td>
- <td>
- {{ format_size(pkg.filesize) }}
- {% if not pkg.arch == "src" and not pkg.size == pkg.filesize %}
- ({{ _("%(size)s when installed") % { "size" : format_size(pkg.size) } }})
- {% end %}
- </td>
- </tr>
-
- {% if pkg.commit %}
- <tr>
- <td>{{ _("Commit") }}</td>
- <td>
- <a href="/distro/{{ pkg.commit.distro.slug }}/source/{{ pkg.commit.source.identifier }}/commit/{{ pkg.commit.revision }}">{{ pkg.commit.revision[:7] }}</a>
- <br />{{ pkg.commit.subject }}
- </td>
- </tr>
- {% end %}
- </tbody>
- </table>
- </div>
- </div>
- </div>
-
- <div class="row">
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- <h3 style="word-wrap: break-word;">
- {% if pkg.arch == "src" %}
- {{ _("Build dependencies") }}
- {% else %}
- {{ _("Dependencies") }}
- {% end %}
- </h3>
- </div>
- </div>
-
- {% module PackagesDependencyTable(pkg) %}
-
- {% if pkg.filelist %}
- <div class="row">
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- <h3 style="word-wrap: break-word;">
- {{ _("Filelist") }}
- </h3>
- </div>
- </div>
-
- <div class="row">
- <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
- {% module PackageFilesTable(pkg, pkg.filelist) %}
- </div>
- </div>
- {% end %}
-{% end block %}
--- /dev/null
+<h2>
+ {% if show_evr %}
+ {{ package }}
+ {% else %}
+ {{ package.name }}
+ {% end %}
+
+ {% if package.summary %}
+ <small>{{ package.summary }}</small>
+ {% end %}
+</h2>
+
+<div class="callout">
+ {% module Text(package.description) %}
+
+ <ul class="menu simple">
+ {% if package.url %}
+ <li>
+ <a href="{{ package.url }}">{{ extract_hostname(package.url) }}</a>
+ </li>
+ {% end %}
+
+ {% if package.license %}
+ <li>
+ {{ package.license }}
+ </li>
+ {% end %}
+
+ {% if package.groups %}
+ <li>
+ {{ locale.list(package.groups) }}
+ </li>
+ {% end %}
+
+ {% if package.maintainer %}
+ <li>
+ {% module LinkToUser(package.maintainer) %}
+ </li>
+ {% end %}
+ </ul>
+</div>
</ul>
</nav>
- <h2>
- {{ package.name }}
-
- {% if package.summary %}
- <small>{{ package.summary }}</small>
- {% end %}
- </h2>
-
- <div class="callout">
- {% module Text(package.description) %}
-
- <ul class="menu simple">
- {% if package.url %}
- <li>
- <a href="{{ package.url }}">{{ extract_hostname(package.url) }}</a>
- </li>
- {% end %}
-
- {% if package.license %}
- <li>
- {{ package.license }}
- </li>
- {% end %}
-
- {% if package.groups %}
- <li>
- {{ locale.list(package.groups) }}
- </li>
- {% end %}
-
- {% if package.maintainer %}
- <li>
- {% module LinkToUser(package.maintainer) %}
- </li>
- {% end %}
- </ul>
- </div>
+ {% module PackageInfo(package) %}
{% for distro in backend.distros %}
<h5>{{ distro }}</h5>
--- /dev/null
+{% extends "../base.html" %}
+
+{% block title %}{{ _("Package") }} - {{ package }}{% end block %}
+
+{% block container %}
+ <nav aria-label="{{ _("You are here:") }}" role="navigation">
+ <ul class="breadcrumbs">
+ <li>
+ <a href="/">{{ _("Home") }}</a>
+ </li>
+ {% if package.build %}
+ <li>
+ <a href="/builds">{{ _("Builds") }}</a>
+ </li>
+ <li>
+ <a href="/builds/{{ package.build.uuid }}">{{ package.build }}</a>
+ </li>
+ <li>
+ {{ _("Packages") }}
+ </li>
+ {% else %}
+ <li>
+ <a href="/packages">{{ _("Packages") }}</a>
+ </li>
+ {% end %}
+ <li>
+ <span class="show-for-sr">{{ _("Current") }}: </span> {{ package }}
+ </li>
+ </ul>
+ </nav>
+
+ {% module PackageInfo(package, show_evr=True) %}
+
+ <a class="expanded primary button" href="{{ package.download_url }}">
+ {{ _("Download Package") }} ({{ format_size(package.size) }})
+ </a>
+
+ {% if package.build %}
+ <a class="expanded secondary button" href="/builds/{{ package.build.uuid }}">
+ {{ _("Build %s") % package.build }}
+ </a>
+ {% end %}
+
+ {# XXX add reference to commit for source packages #}
+
+ <div class="row">
+ <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
+ <h3 style="word-wrap: break-word;">
+ {% if package.arch == "src" %}
+ {{ _("Build dependencies") }}
+ {% else %}
+ {{ _("Dependencies") }}
+ {% end %}
+ </h3>
+ </div>
+ </div>
+
+ {% module PackagesDependencyTable(package) %}
+
+ {% if package.filelist %}
+ <div class="row">
+ <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
+ <h3 style="word-wrap: break-word;">
+ {{ _("Filelist") }}
+ </h3>
+ </div>
+ </div>
+
+ <div class="row">
+ <div class="col-12 col-sm-12 col-md-12 col-lg-12 col-xl-12">
+ {% module PackageFilesTable(package, package.filelist) %}
+ </div>
+ </div>
+ {% end %}
+{% end block %}
"JobsStatus" : ui_modules.JobsStatusModule,
# Packages
+ "PackageInfo" : packages.InfoModule,
"PackagesDependencyTable" : ui_modules.PackagesDependencyTableModule,
# Repositories
# Packages
(r"/packages", packages.IndexHandler),
+ (r"/packages/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", packages.ShowHandler),
(r"/packages/([\w\-\+]+)", packages.NameHandler),
- (r"/package/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})", packages.PackageDetailHandler),
(r"/package/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/download(.*)", packages.PackageFileDownloadHandler),
(r"/package/([\w]{8}-[\w]{4}-[\w]{4}-[\w]{4}-[\w]{12})/view(.*)", packages.PackageFileViewHandler),
(r"/package/([\w\-\+]+)/builds/scratch", packages.PackageScratchBuildsHandler),
import tornado.web
from . import base
+from . import ui_modules
from ..constants import BUFFER_SIZE
self.render("packages/name.html", package=build.pkg, bugs=bugs)
-class PackageIDDetailHandler(base.BaseHandler):
- def get(self, id):
- package = self.packages.get_by_id(id)
+class ShowHandler(base.BaseHandler):
+ def get(self, uuid):
+ package = self.backend.packages.get_by_uuid(uuid)
if not package:
- return tornado.web.HTTPError(404, "Package not found: %s" % id)
+ return tornado.web.HTTPError(404, "Could not find package: %s" % uuid)
- self.render("package-detail.html", package=package)
+ self.render("packages/show.html", package=package)
class PackageScratchBuildsHandler(base.BaseHandler):
pkg=latest_build.pkg)
-class PackageDetailHandler(base.BaseHandler):
- def get(self, uuid):
- pkg = self.backend.packages.get_by_uuid(uuid)
- if not pkg:
- raise tornado.web.HTTPError(404, "Package not found: %s" % uuid)
-
- self.render("package-detail.html", pkg=pkg)
-
- @tornado.web.authenticated
- def post(self, name, epoch, version, release):
- pkg = self.backend.packages.get_by_tuple(name, epoch, version, release)
-
- action = self.get_argument("action", None)
-
- if action == "comment":
- pkg.comment(self.current_user.id, self.get_argument("text"),
- self.get_argument("vote", None) or "none")
-
- self.render("package-detail.html", pkg=pkg)
-
-
class PackagePropertiesHandler(base.BaseHandler):
@tornado.web.authenticated
def get(self, name):
self.render("packages/view-file.html", pkg=pkg, filename=filename,
mimetype=mimetype, content=content, filesize=f.size)
+
+
+class InfoModule(ui_modules.UIModule):
+ def render(self, package, show_evr=False):
+ return self.render_string("packages/modules/info.html",
+ package=package, show_evr=show_evr)