aboutsummaryrefslogtreecommitdiffstats
path: root/root
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
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')
-rw-r--r--root/html/includes/footer.tt3
-rw-r--r--root/html/includes/header.tt10
-rw-r--r--root/html/includes/mirrorslist.tt40
-rw-r--r--root/html/includes/new/checkurl.tt1
-rw-r--r--root/html/includes/new/confirm.tt6
-rw-r--r--root/html/includes/new/host_information.tt19
-rw-r--r--root/html/includes/new/invalid_mirror.tt1
-rw-r--r--root/html/includes/new/invalid_uri.tt1
-rw-r--r--root/html/includes/new/mirror_exists.tt1
-rw-r--r--root/html/includes/new/overlap_hosts.tt1
-rw-r--r--root/html/includes/new/success.tt3
-rw-r--r--root/html/includes/new/unsupported_protocol.tt1
-rw-r--r--root/html/includes/new/url_form.tt5
-rw-r--r--root/html/pages/index.tt6
-rw-r--r--root/html/pages/new/index.tt5
-rw-r--r--root/static/style.css1
16 files changed, 104 insertions, 0 deletions
diff --git a/root/html/includes/footer.tt b/root/html/includes/footer.tt
new file mode 100644
index 0000000..2a1c949
--- /dev/null
+++ b/root/html/includes/footer.tt
@@ -0,0 +1,3 @@
+<!-- $Id$ -->
+</body>
+</html>
diff --git a/root/html/includes/header.tt b/root/html/includes/header.tt
new file mode 100644
index 0000000..5319e52
--- /dev/null
+++ b/root/html/includes/header.tt
@@ -0,0 +1,10 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html>
+<!-- $Id$ -->
+<head>
+<title></title>
+<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
+[% c.prototype.define_javascript_functions %]
+</head>
+
+<body>
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 %]
diff --git a/root/html/includes/new/checkurl.tt b/root/html/includes/new/checkurl.tt
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/root/html/includes/new/checkurl.tt
@@ -0,0 +1 @@
+
diff --git a/root/html/includes/new/confirm.tt b/root/html/includes/new/confirm.tt
new file mode 100644
index 0000000..b3eb3f3
--- /dev/null
+++ b/root/html/includes/new/confirm.tt
@@ -0,0 +1,6 @@
+<div id="foo">
+[% c.prototype.form_remote_tag({ url => c.uri_for('confirm'), update => 'foo' } ) %]
+<input type="hidden" name="confirm" value="1">
+<input type="submit">
+</form>
+</div>
diff --git a/root/html/includes/new/host_information.tt b/root/html/includes/new/host_information.tt
new file mode 100644
index 0000000..78c04c2
--- /dev/null
+++ b/root/html/includes/new/host_information.tt
@@ -0,0 +1,19 @@
+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/invalid_mirror.tt b/root/html/includes/new/invalid_mirror.tt
new file mode 100644
index 0000000..f22d0f3
--- /dev/null
+++ b/root/html/includes/new/invalid_mirror.tt
@@ -0,0 +1 @@
+This url seems to not contain a valid mirror.
diff --git a/root/html/includes/new/invalid_uri.tt b/root/html/includes/new/invalid_uri.tt
new file mode 100644
index 0000000..87ced3c
--- /dev/null
+++ b/root/html/includes/new/invalid_uri.tt
@@ -0,0 +1 @@
+[% uri %] is not a valid url.
diff --git a/root/html/includes/new/mirror_exists.tt b/root/html/includes/new/mirror_exists.tt
new file mode 100644
index 0000000..f891993
--- /dev/null
+++ b/root/html/includes/new/mirror_exists.tt
@@ -0,0 +1 @@
+<p>The url [% uri | html %] has same server and same protocol than [% exists_url.0.url %].</p>
diff --git a/root/html/includes/new/overlap_hosts.tt b/root/html/includes/new/overlap_hosts.tt
new file mode 100644
index 0000000..3d60603
--- /dev/null
+++ b/root/html/includes/new/overlap_hosts.tt
@@ -0,0 +1 @@
+This server seems to be the same than [% overlap_hosts.join(', ') | html %].
diff --git a/root/html/includes/new/success.tt b/root/html/includes/new/success.tt
new file mode 100644
index 0000000..56d757d
--- /dev/null
+++ b/root/html/includes/new/success.tt
@@ -0,0 +1,3 @@
+Host added
+
+[% INCLUDE 'new/url_form.tt' %]
diff --git a/root/html/includes/new/unsupported_protocol.tt b/root/html/includes/new/unsupported_protocol.tt
new file mode 100644
index 0000000..7552c82
--- /dev/null
+++ b/root/html/includes/new/unsupported_protocol.tt
@@ -0,0 +1 @@
+Unsuported protocol
diff --git a/root/html/includes/new/url_form.tt b/root/html/includes/new/url_form.tt
new file mode 100644
index 0000000..f8840b9
--- /dev/null
+++ b/root/html/includes/new/url_form.tt
@@ -0,0 +1,5 @@
+<form action="[% c.uri_for() %]" method="POST">
+Enter the url to the top level mirror tree:<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
new file mode 100644
index 0000000..f1f0251
--- /dev/null
+++ b/root/html/pages/index.tt
@@ -0,0 +1,6 @@
+<!-- $Id$ -->
+<p>Mageia mirrors database</p>
+
+<p>Mirror not found ? <a href="[% c.uri_for('/new') %]">register it</a></p>
+
+[% INCLUDE 'mirrorslist.tt' %]
diff --git a/root/html/pages/new/index.tt b/root/html/pages/new/index.tt
new file mode 100644
index 0000000..0ef4cfd
--- /dev/null
+++ b/root/html/pages/new/index.tt
@@ -0,0 +1,5 @@
+[% INCLUDE 'new/url_form.tt' %]
+
+[% IF subtemplate %]
+[% INCLUDE $subtemplate %]
+[% END %]
diff --git a/root/static/style.css b/root/static/style.css
new file mode 100644
index 0000000..cfa1da3
--- /dev/null
+++ b/root/static/style.css
@@ -0,0 +1 @@
+// $Id$