diff options
author | Olivier Thauvin <nanardon@mageia.org> | 2010-10-02 13:31:35 +0000 |
---|---|---|
committer | Olivier Thauvin <nanardon@mageia.org> | 2010-10-02 13:31:35 +0000 |
commit | a9ade04230fc99e5d12e7bd1af1e2dd31907d15a (patch) | |
tree | 32f25d1699e483eb219400e44e2e96d782feb7ea /root | |
parent | 6f42c4ffb976cdffa257a09e4dcb33119750abfc (diff) | |
download | mgamirrors-a9ade04230fc99e5d12e7bd1af1e2dd31907d15a.tar mgamirrors-a9ade04230fc99e5d12e7bd1af1e2dd31907d15a.tar.gz mgamirrors-a9ade04230fc99e5d12e7bd1af1e2dd31907d15a.tar.bz2 mgamirrors-a9ade04230fc99e5d12e7bd1af1e2dd31907d15a.tar.xz mgamirrors-a9ade04230fc99e5d12e7bd1af1e2dd31907d15a.zip |
- handle distributions, protocol andothers things
Diffstat (limited to 'root')
-rw-r--r-- | root/html/includes/header.tt | 3 | ||||
-rw-r--r-- | root/html/includes/host_information.tt | 50 | ||||
-rw-r--r-- | root/html/includes/mirrorslist.tt | 29 | ||||
-rw-r--r-- | root/html/includes/new/confirm.tt | 2 | ||||
-rw-r--r-- | root/html/includes/new/host_information.tt | 19 | ||||
-rw-r--r-- | root/html/includes/new/new_host.tt | 9 | ||||
-rw-r--r-- | root/html/includes/new/url_form.tt | 4 | ||||
-rw-r--r-- | root/html/pages/index.tt | 3 |
8 files changed, 95 insertions, 24 deletions
diff --git a/root/html/includes/header.tt b/root/html/includes/header.tt index 5319e52..7f8b1d5 100644 --- a/root/html/includes/header.tt +++ b/root/html/includes/header.tt @@ -8,3 +8,6 @@ </head> <body> +<p>Mageia mirrors database</p> + +<p>Mirror not found ? <a href="[% c.uri_for('/new') %]">register it</a></p> diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt new file mode 100644 index 0000000..c0cb7cb --- /dev/null +++ b/root/html/includes/host_information.tt @@ -0,0 +1,50 @@ +<!-- $Id$ --> +<form action="[% action || c.uri_for() %]" method="POST"> +<input type="hidden" name="hostinfo" value="1"> +<table border=0> +<tr><th>Country</th> +<td> +<select name="country"> +<option value=""></option> +[% FOREACH country = c.model('Mirrors').country_list %] +<option value="[% country.code %]" [% "selected=select" IF country.code == host.country %]>[% country.name | html %]</option> +[% END %] +</select> +</td> +</tr> + +<tr><th>City</th> +<td> +<input type="text" name="city" value="[% host.city | html %]"> +</td> +</tr> + +[% FOREACH mirror = c.model('Mirrors').find_mirrors %] +[% IF loop.first %] +<tr><th>Synchronized from</th> +<td> +<select name="syncfrom"> +<option value="">Unknown</option> +[% END %] +[% IF mirror.public %] +<option value="[% mirror.hostname | html %]" [% "selected=select" IF host.syncfrom == mirror.hostname %]>[% mirror.hostname | html %]</option> +[% END %] +[% IF loop.last %] +</select> +</td> +</tr> +[% END %] +[% END %] +<tr><th>Approximated bandwidth</th> +<td> +<select name="bandwidth"> +<option value=""></option> +[% FOREACH bd = c.model('Mirrors').bandwidth_list %] +<option value="[% bd.value %]" [% "selected=select" IF host.bandwidth == bd.value %]>[% bd.name | html %]</option> +[% END %] +</select> +</td> +</tr> +</table> +<input type="submit"> +</form> diff --git a/root/html/includes/mirrorslist.tt b/root/html/includes/mirrorslist.tt index fd855f5..0986717 100644 --- a/root/html/includes/mirrorslist.tt +++ b/root/html/includes/mirrorslist.tt @@ -5,6 +5,13 @@ <option value="[% country.code %]" [% "selected=select" IF country.code == c.req.param('country') %]>[% country.name | html %]</option> [% END %] </select> +<select name="protocol"> +<option value="">--</option> +[% FOREACH p = c.model('Mirrors').protocol_list %] +<option value="[% p %]" [% "selected=select" IF p == c.req.param('protocol') %]>[% p %]</option> +[% END %] +</select> + <input type="submit"> </form> @@ -16,7 +23,13 @@ [% FOREACH item = mirrorslist %] [% IF loop.first %] <table border=1> -<tr><th>Server name</th><th>Location</th><th>Urls</th><tr> +<tr> + <th>Server name</th> + <th>Location</th> + <th>Bandwidth</th> + <th>Source</th> + <th>Urls</th> +<tr> [% END %] <tr> [% urls = db.find_urls({ "hostname" => item.hostname }) %] @@ -29,8 +42,22 @@ [% END %] </td> <td> +[% c.model('Mirrors').bandwidth_name(item.bandwidth) | html %] +</td> +<td> +[% item.syncfrom | html %] +</td> +<td> +[% IF item.public %] [% FOREACH u = urls %] +[% IF u.valid %] <a href="[% u.url %]">[% u.protocol %]</a> +[% ELSE %] +<span style="color: red">[% u.protocol %]</span> +[% END %] +[% END %] +[% ELSE %] +Private access [% END %] </td> </tr> diff --git a/root/html/includes/new/confirm.tt b/root/html/includes/new/confirm.tt index b3eb3f3..e0bb7d4 100644 --- a/root/html/includes/new/confirm.tt +++ b/root/html/includes/new/confirm.tt @@ -1,4 +1,6 @@ <div id="foo"> +<p>Really adding [% c.session.new_uri | html %] ?</p> + [% c.prototype.form_remote_tag({ url => c.uri_for('confirm'), update => 'foo' } ) %] <input type="hidden" name="confirm" value="1"> <input type="submit"> diff --git a/root/html/includes/new/host_information.tt b/root/html/includes/new/host_information.tt deleted file mode 100644 index 78c04c2..0000000 --- a/root/html/includes/new/host_information.tt +++ /dev/null @@ -1,19 +0,0 @@ -Enter Info for [% uri.host %] - -<form action="[% c.uri_for() %]" method="POST"> -<input type="hidden" name="url" value="[% uri | html %]"> -<input type="hidden" name="hostinfo" value="1"> - -[% location.name %] / [% location.continent %]<br> - -Country: -<select name="country"> -<option value="">--</option> -[% FOREACH country = c.model('Mirrors').country_list %] -<option value="[% country.code %]" [% "selected=select" IF country.code == location.code %]>[% country.name | html %]</option> -[% END %] -</select> - -City: <input type="text" name="city"> -<input type="submit"> -</form> diff --git a/root/html/includes/new/new_host.tt b/root/html/includes/new/new_host.tt new file mode 100644 index 0000000..a4296d2 --- /dev/null +++ b/root/html/includes/new/new_host.tt @@ -0,0 +1,9 @@ +Enter Info for [% uri.host %] + +<form action="[% c.uri_for() %]" method="POST"> +<input type="hidden" name="url" value="[% uri | html %]"> +<input type="hidden" name="hostinfo" value="1"> + +[% location.name %] / [% location.continent %]<br> + +[% INCLUDE 'host_information.tt' %] diff --git a/root/html/includes/new/url_form.tt b/root/html/includes/new/url_form.tt index f8840b9..169fe73 100644 --- a/root/html/includes/new/url_form.tt +++ b/root/html/includes/new/url_form.tt @@ -1,5 +1,7 @@ <form action="[% c.uri_for() %]" method="POST"> -Enter the url to the top level mirror tree:<br> +Enter the url to the top level mirror tree, supported protocol are +[% c.model('Mirrors').protocol_list.join(', ') | html %].<br> + <input type="text" name="url" size=40 value="[% c.req.param('url') | html %]"> <input type=submit> </form> diff --git a/root/html/pages/index.tt b/root/html/pages/index.tt index f1f0251..9acd3cd 100644 --- a/root/html/pages/index.tt +++ b/root/html/pages/index.tt @@ -1,6 +1,3 @@ <!-- $Id$ --> -<p>Mageia mirrors database</p> - -<p>Mirror not found ? <a href="[% c.uri_for('/new') %]">register it</a></p> [% INCLUDE 'mirrorslist.tt' %] |