-
Notifications
You must be signed in to change notification settings - Fork 0
/
package.html
157 lines (148 loc) · 6.59 KB
/
package.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
{% extends "layouts/base.html" %}
{% import "parts/package-item.html" as package_item %}
{% block title %} {{ pkg.title }} — {{ super() }}{% endblock %}
{% block meta %}
{{ meta.open_graph_site(pkg.title, pkg.web_url(), pkg.icon.remote_url | fallback_icon, pkg.summary) }}
{% endblock meta %}
{% macro info_block(cond, title, var=cond) -%}
{% if cond %}
<div>
<dt>{{ title }}</dt>
<dd>{{ var }}</dd>
</div>
{% endif %}
{%- endmacro %}
{% macro pkg_link(link, title, cond=link) -%}
{% if cond %}
<li><a href="{{ link | to_public_url }}">{{ title }}</a></li>
{% endif %}
{%- endmacro %}
{% block main %}
<section>
<header class="pkg-header">
{{ package_item.package_icon(pkg, "pkg-icon") }}
<h1 class="pkg-title">{{ pkg.title }} </h1>
<p class="pkg-summary">{{ pkg.summary }}</p>
<div class="pkg-version" title="Version {{ pkg.version.to_full_str() }}"> v{{ pkg.version.to_short_str() }}</div>
</header>
{% if pkg.screenshots %}
<section class="pkg-screenshots">
{% for screenshot in pkg.screenshots %}
<img src="{{ screenshot.remote_url }}" alt="Screenshot of {{ pkg.name }}" />
{% endfor %}
</section>
{% endif %}
<p>
{% if pkg.markdown_url %}
{{ pkg.description }}
{% else %}
{{ pkg.description | paragraphise | safe }}
{% endif %}
</p>
<section>
<header><h2>Download</h2></header>
{% if pkg.name not in config.chum_installer_pkgs %}
<p>The easiest way to download and install this software is by the <a href="{{ "apps/%s/" | format(chum_installer) | to_public_url }}">SailfishOS:Chum GUI app</a>.
If you wish to download the RPM file by yourself, please expand the section below.
</p>
<details>
<summary>Download links</summary>
{% endif %}
<ul class="link-list">
{% for arch, url in pkg.download_url | dictsort %}
<li><a href="{{ pkg.get_download_url(arch) }}" class="pkg-download-{{ arch }}">{{ pkg.name }}-{{ arch }}.rpm ({{ pkg.download_size[arch] | bytes }})</a></li>
{% endfor %}
</ul>
{% if pkg.name not in config.chum_installer_pkgs %}
</details>
{% endif %}
</section>
{% if pkg.changelog_entries|length > 0 %}
<section>
<header><h2>Changelog</h2></header>
<h3>{{ pkg.changelog_entries[0].version }} ({{ pkg.changelog_entries[0].timestamp | format_date }})</h3>
<pre>{{ pkg.changelog_entries[0].text }}</pre>
{% if pkg.changelog_entries|length > 1 %}
<details>
<summary><h3 style="display: inline-block; margin: 0.5em 0;">Older changelogs</h3></summary>
{% for entry in pkg.changelog_entries[1:] %}
<h4>{{ entry.version }} ({{ entry.timestamp | format_date }})</h4>
<pre>{{ entry.text }}</pre>
{% endfor %}
</details>
{% endif %}
</section>
{% endif %}
<section>
<header><h2>App information</h2></header>
<dl>
{{ info_block(pkg.name, "Package name") }}
{{ info_block(pkg.version.to_full_str(), "Version") }}
{{ info_block(pkg.licence, "Licence") }}
{{ info_block(pkg.developer_name, "Developer") }}
{{ info_block(pkg.packager_name, "Packager") }}
{{ info_block(pkg.updated | format_datetime, "Last updated") }}
</dl>
</section>
<section>
<header>
<h2>
<label for="pkg-arch-selector">Package information</label>
<select id="pkg-arch-selector" data-pref-id="architecture" autocomplete="off">
{% for arch in pkg.archs | sort %}
<option>{{ arch }}</option>
{% endfor %}
</select>
</h2>
</header>
<noscript><p>JavaScript is required to display information for other architectures than {{ pkg.archs | first }}</p></noscript>
{% for arch in pkg.archs %}
<dl data-relevant-architecture="{{ arch }}" {{ ({"style": "display: none;"} if loop.index0 > 0 else {}) | xmlattr | safe }}>
{{ info_block(arch in pkg.download_size, "Download size", pkg.download_size[arch]|bytes) }}
{{ info_block(arch in pkg.install_size, "Installed size", pkg.install_size[arch]|bytes) }}
{{ info_block(arch in pkg.checksum_value, "Checksum (%s)" % pkg.checksum_type[arch], pkg.checksum_value[arch])}}
</dl>
{% endfor %}
</section>
</section>
{% if config.debug %}
<section>
<header><h2>Debug</h2></header>
<h3>YAML MetaData</h3>
<pre>{{ pkg.debug_yaml }} </pre>
<h3>Parse errors</h3>
{% for error in pkg.debug_yaml_errors %}
<p>
<pre>{{ error }}</pre>
</p>
{% else %}
<p>No errors found!</p>
{% endfor %}
</section>
{% endif %}
{% endblock main %}
{% block sidebar %}
<section>
<header><h2>Links</h2></header>
<ul class="link-list">
{{ pkg_link(pkg.repo_url, "Source code repo") }}
{{ pkg_link(pkg.packaging_repo_url, "Packaging repo") }}
{% for title, link in pkg.links.items() %}
<li><a href="{{link}}">{{ title | title }}</a></li>
{% else %}
{% if pkg.url %}
<li><a href="{{ pkg.url }}">Project home</a></li>
{% endif %}
{% endfor %}
</ul>
</section>
{% if pkg.debuginfo_package or pkg.debugsource_package %}
<section>
<header><h2>Debug packages</h2></header>
<ul class="link-list">
{{ pkg_link( pkg.debuginfo_package.web_url(), "Debug information", pkg.debuginfo_package) }}
{{ pkg_link( pkg.debugsource_package.web_url(), "Debug source", pkg.debugsource_package) }}
</ul>
</section>
{% endif %}
{% endblock %}