aboutsummaryrefslogtreecommitdiffstats
path: root/root/html/includes/mirrorslist.tt
diff options
context:
space:
mode:
authorOlivier Thauvin <nanardon@mageia.org>2010-09-27 10:51:18 +0000
committerOlivier Thauvin <nanardon@mageia.org>2010-09-27 10:51:18 +0000
commit7c16f1d36bd584c36f187bd0401fb39e94771765 (patch)
tree2bf89b42bc81f1d4b4f8c557a717cbc25d446195 /root/html/includes/mirrorslist.tt
parent57beda663bb4448ad838b599e5df5bf50375a5cb (diff)
downloadmgamirrors-7c16f1d36bd584c36f187bd0401fb39e94771765.tar
mgamirrors-7c16f1d36bd584c36f187bd0401fb39e94771765.tar.gz
mgamirrors-7c16f1d36bd584c36f187bd0401fb39e94771765.tar.bz2
mgamirrors-7c16f1d36bd584c36f187bd0401fb39e94771765.tar.xz
mgamirrors-7c16f1d36bd584c36f187bd0401fb39e94771765.zip
- code base
Diffstat (limited to 'root/html/includes/mirrorslist.tt')
-rw-r--r--root/html/includes/mirrorslist.tt40
1 files changed, 40 insertions, 0 deletions
diff --git a/root/html/includes/mirrorslist.tt b/root/html/includes/mirrorslist.tt
new file mode 100644
index 0000000..fd855f5
--- /dev/null
+++ b/root/html/includes/mirrorslist.tt
@@ -0,0 +1,40 @@
+<form action="[% c.uri_for() %]">
+<select name="country">
+<option value="">--</option>
+[% FOREACH country = c.model('Mirrors').country_list %]
+<option value="[% country.code %]" [% "selected=select" IF country.code == c.req.param('country') %]>[% country.name | html %]</option>
+[% END %]
+</select>
+<input type="submit">
+</form>
+
+[% db = c.model('Mirrors') %]
+[% mirrorslist = db.find_mirrors({
+ 'protocol' => c.req.param('protocol'),
+ 'country' => c.req.param('country'),
+}) %]
+[% FOREACH item = mirrorslist %]
+[% IF loop.first %]
+<table border=1>
+<tr><th>Server name</th><th>Location</th><th>Urls</th><tr>
+[% END %]
+<tr>
+[% urls = db.find_urls({ "hostname" => item.hostname }) %]
+<td>
+[% item.hostname | html %]
+</td>
+<td>
+[% IF item.name %]
+[% item.continent | html %], [% item.name | html %]
+[% END %]
+</td>
+<td>
+[% FOREACH u = urls %]
+<a href="[% u.url %]">[% u.protocol %]</a>
+[% END %]
+</td>
+</tr>
+[% IF loop.last %]
+</table>
+[% END %]
+[% END %]