This repository has been archived by the owner on May 23, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 32
/
list.html
102 lines (96 loc) · 3.69 KB
/
list.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
{% extends "layout.html" %}
{% block content %}
{% macro link(href,desc='') -%}
{% if desc == '' %}
<a href={{href}}>{{href}}</a>
{% else%}
<a href={{href}}>{{desc}}</a>
{%endif%}
{%- endmacro%}
<script>
function refresh()
{
var xmlhttp;
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else
{// code for IE6, IE5
xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
}
xmlhttp.open("GET","update",true);
xmlhttp.send();
location.reload(true);
}
</script>
<h1>{{ _("Available packages") }}</h1>
<div class="panel">
<input class="col-md-4 btn btn-default" onclick='refresh()' type="button" name="update" value="{{ _('Update available packages') }}"/>
<input class="col-md-4 span4 btn btn-default" onclick="location.href='/cleanup'" type="button" name="cleanup" value="{{ _('Clear package cache') }}"/>
<input class="col-md-4 span4 btn btn-success" onclick="location.href='/upgrade'" type="button" name="upgrade" value="{{ _ ('Upgrade system') }}"/>
</div>
<br/>
<form class="navbar-form navbar-left" role="search" method="GET" action="/list">
<div class="form-group">
<input type="text" name="q" class="form-control" placeholder="Rechercher..." value="{{ request.args.q }}">
<input type="checkbox" name="all_versions" class="form-control">{{ _('Show all versions?') }}
</div>
</form>
{{ pagination.links }}
{% set cols = ['package','install_version','install_status','install_date'] %}
{% set cols_header = [_('package'),_('install_version'),_('install_status'),_('install_date')] %}
<table id="main_table" class="table table-striped" cellspacing=0 cellpadding=4 class=sample>
<thead>
{% for c in cols_header %}
<th>{{c or "###"}}</th>
{% endfor %}
<th>{{ _("Action") }}</th>
</thead>
{% for p in packages %}
{%set package_version = p.asrequirement() %}
{%set package_section = p.section %}
{%if package_section != 'restricted' %}
{%if p.install_status == 'OK'%}
{%if p.install_version < p.version %}
<tr class=status-upgradable>
{%elif p.install_version == p.version %}
<tr class=status-installed>
{%else%}
<tr>
{%endif%}
{%elif p.install_status == 'ERROR' %}
<tr class=status-error>
{%else%}
<tr>
{%endif%}
{% for c in cols %}
<td>
{%if c=='install_date' and p[c] %}
{{format_isodate(p[c])}}
{%elif c=='package'%}
<img class=package-icon src="/package_icon?package={{p.package}}">
<p>{{link("/package_details?package="+package_version,p[c])}}
<span class="package-version">{{p.version}}</span>
<span class="package-singner"> (by: {{p.signer}})</span></p>
<p class="package-description">{{p.description}}</p>
{%else%}
<span class={{'package-'+c}}>{{p[c] or ""}}</span>
{%endif%}
</td>
{% endfor %}
{% if p.install_status and p.install_version == p.version %}
<td><a class="package-remove" href="/remove?package={{p.package}}">{{ _("Remove") }}</a></td>
{% elif p.install_status and p.install_version > p.version %}
<td><a class="package-downgrade" href="/install?package={{'%s(=%s)' % (p.package,p.version)}}">{{ _("Downgrade") }}</a></td>
{% elif p.install_status and p.install_version < p.version %}
<td><a class="package-upgrade" href="/install?package={{'%s(=%s)' % (p.package,p.version)}}">{{ _("Upgrade") }}</a></td>
{% else %}
<td><a class="package-install" href="/install?package={{'%s(=%s)' % (p.package,p.version)}}">{{ _("Install") }}</a></td>
{% endif %}
</tr>
{% endif %}
{% endfor %}
</table>
{{ pagination.links }}
{% endblock %}