From ddcf19029c7b58b2ea236bd14e6c1456949f0fc0 Mon Sep 17 00:00:00 2001 From: Olivier Thauvin Date: Sun, 3 Oct 2010 15:36:00 +0000 Subject: - use google maps for location, improve messages --- root/html/includes/distrib/distrib.tt | 11 ++++++++ root/html/includes/header.tt | 10 +++++-- root/html/includes/host_information.tt | 48 ++++++++++++++++++++++++++++++++ root/html/includes/new/confirm.tt | 8 ------ root/html/includes/new/invalid_mirror.tt | 2 +- root/html/includes/new/invalid_uri.tt | 2 +- root/html/includes/new/mirror_exists.tt | 4 ++- root/html/includes/new/new_host.tt | 9 ------ root/html/includes/new/overlap_hosts.tt | 9 +++++- root/html/includes/new/url_form.tt | 3 -- root/html/pages/mirrors/mirror.tt | 19 +++++++++++++ root/html/pages/new/confirm.tt | 24 ++++++++++++++++ root/html/pages/new/index.tt | 13 ++++++++- root/html/pages/new/new_host.tt | 14 ++++++++++ root/html/pages/report/index.tt | 35 +++++++++++++++++++++++ 15 files changed, 184 insertions(+), 27 deletions(-) create mode 100644 root/html/includes/distrib/distrib.tt delete mode 100644 root/html/includes/new/confirm.tt delete mode 100644 root/html/includes/new/new_host.tt create mode 100644 root/html/pages/mirrors/mirror.tt create mode 100644 root/html/pages/new/confirm.tt create mode 100644 root/html/pages/new/new_host.tt create mode 100644 root/html/pages/report/index.tt (limited to 'root') diff --git a/root/html/includes/distrib/distrib.tt b/root/html/includes/distrib/distrib.tt new file mode 100644 index 0000000..60e5090 --- /dev/null +++ b/root/html/includes/distrib/distrib.tt @@ -0,0 +1,11 @@ +[% IF c.req.param('version') AND c.req.param('arch') %] +[% list = c.model('Mirrors').find_distributions({ + version => c.req.param('version'), + arch => c.req.param('arch'), + protocol => c.req.param('protocol'), +}) %] + +[% FOREACH l = list %] +[% l.url %]
+[% END %] +[% END %] diff --git a/root/html/includes/header.tt b/root/html/includes/header.tt index 7f8b1d5..76bace4 100644 --- a/root/html/includes/header.tt +++ b/root/html/includes/header.tt @@ -5,9 +5,15 @@ [% c.prototype.define_javascript_functions %] + -

Mageia mirrors database

+

Mageia mirrors database

-

Mirror not found ? register it

+ diff --git a/root/html/includes/host_information.tt b/root/html/includes/host_information.tt index c0cb7cb..2c9b574 100644 --- a/root/html/includes/host_information.tt +++ b/root/html/includes/host_information.tt @@ -1,4 +1,5 @@ +
@@ -18,6 +19,16 @@ + + + + + + [% FOREACH mirror = c.model('Mirrors').find_mirrors %] [% IF loop.first %] @@ -48,3 +59,40 @@
Latitude + +
Longitude + +
+
+ + + + +
+
+ + diff --git a/root/html/includes/new/confirm.tt b/root/html/includes/new/confirm.tt deleted file mode 100644 index e0bb7d4..0000000 --- a/root/html/includes/new/confirm.tt +++ /dev/null @@ -1,8 +0,0 @@ -
-

Really adding [% c.session.new_uri | html %] ?

- -[% c.prototype.form_remote_tag({ url => c.uri_for('confirm'), update => 'foo' } ) %] - - - -
diff --git a/root/html/includes/new/invalid_mirror.tt b/root/html/includes/new/invalid_mirror.tt index f22d0f3..bef66c8 100644 --- a/root/html/includes/new/invalid_mirror.tt +++ b/root/html/includes/new/invalid_mirror.tt @@ -1 +1 @@ -This url seems to not contain a valid mirror. +

This url seems to not point a valid mirror.

diff --git a/root/html/includes/new/invalid_uri.tt b/root/html/includes/new/invalid_uri.tt index 87ced3c..4d9390e 100644 --- a/root/html/includes/new/invalid_uri.tt +++ b/root/html/includes/new/invalid_uri.tt @@ -1 +1 @@ -[% uri %] is not a valid url. +

[% uri %] is not a valid url.

diff --git a/root/html/includes/new/mirror_exists.tt b/root/html/includes/new/mirror_exists.tt index f891993..3345cd2 100644 --- a/root/html/includes/new/mirror_exists.tt +++ b/root/html/includes/new/mirror_exists.tt @@ -1 +1,3 @@ -

The url [% uri | html %] has same server and same protocol than [% exists_url.0.url %].

+

The mirror [% uri.host | html %] is already registered serving the distribution via [% uri.scheme | html %] +at url [% uri | html %]

+

The URL [% exists_url.url %] cannot be added.

diff --git a/root/html/includes/new/new_host.tt b/root/html/includes/new/new_host.tt deleted file mode 100644 index a4296d2..0000000 --- a/root/html/includes/new/new_host.tt +++ /dev/null @@ -1,9 +0,0 @@ -Enter Info for [% uri.host %] - -
- - - -[% location.name %] / [% location.continent %]
- -[% INCLUDE 'host_information.tt' %] diff --git a/root/html/includes/new/overlap_hosts.tt b/root/html/includes/new/overlap_hosts.tt index 3d60603..77b4991 100644 --- a/root/html/includes/new/overlap_hosts.tt +++ b/root/html/includes/new/overlap_hosts.tt @@ -1 +1,8 @@ -This server seems to be the same than [% overlap_hosts.join(', ') | html %]. +

According IP address, host [% uri.host %] is the same than already registered +[% overlap_hosts.join(', ') | html %].

+ +

This URL cannot be added.

+ +[% IF urlmaybe %] +

You can try to add the following URL instead:

+[% END %] diff --git a/root/html/includes/new/url_form.tt b/root/html/includes/new/url_form.tt index 169fe73..49a7d66 100644 --- a/root/html/includes/new/url_form.tt +++ b/root/html/includes/new/url_form.tt @@ -1,7 +1,4 @@ -Enter the url to the top level mirror tree, supported protocol are -[% c.model('Mirrors').protocol_list.join(', ') | html %].
-
diff --git a/root/html/pages/mirrors/mirror.tt b/root/html/pages/mirrors/mirror.tt new file mode 100644 index 0000000..dad43c2 --- /dev/null +++ b/root/html/pages/mirrors/mirror.tt @@ -0,0 +1,19 @@ +

Mirror: [% hostname %]

+ +

Host information

+ +[% INCLUDE 'host_information.tt' + action = c.uri_for(hostname) +%] + +

URLs to the distribution

+ +[% FOREACH u = c.model('Mirrors').find_urls({ hostname => hostname }) %] +[% IF loop.first %] + +[% END %] +[% END %] diff --git a/root/html/pages/new/confirm.tt b/root/html/pages/new/confirm.tt new file mode 100644 index 0000000..2dde830 --- /dev/null +++ b/root/html/pages/new/confirm.tt @@ -0,0 +1,24 @@ +
+

Confirmation

+ +

The URL [% c.session.new_uri | html %] has been succefully validated.

+ +

Please confirm the addition into the database.

+ +[% IF c.session.hostinfo %] +

This URL refer to new mirror [% new_uri.host %] +[% IF c.session.hostinfo.country %] +[% cinfo = c.model('Mirrors').country_info(c.session.hostinfo.country) %] +located in [% cinfo.name | html %] ([% cinfo.continent | html %]) +[%- END -%].

+[% ELSE %] +[% END %] + +[% IF exists_url %] +

This url will replace the currently invalid url [% exists_url.url | html %].

+[% END %] + +[% c.prototype.form_remote_tag({ url => c.uri_for('confirm'), update => 'foo' } ) %] + + +
diff --git a/root/html/pages/new/index.tt b/root/html/pages/new/index.tt index 0ef4cfd..c20344c 100644 --- a/root/html/pages/new/index.tt +++ b/root/html/pages/new/index.tt @@ -1,5 +1,16 @@ -[% INCLUDE 'new/url_form.tt' %] [% IF subtemplate %] [% INCLUDE $subtemplate %] +[% ELSE %] +

Enter the url to the top level mirror tree. The URL must be in form +

PROTOCOL://SERVER/PATH

+

Supported protocol are +[%- FOREACH proto = c.model('Mirrors').protocol_list -%] +[%- IF NOT loop.first -%] +[%- IF loop.last %] or [% ELSE %], [% END %] +[%- END -%] +[%- proto | html -%] +[%- END -%].

[% END %] + +[% INCLUDE 'new/url_form.tt' %] diff --git a/root/html/pages/new/new_host.tt b/root/html/pages/new/new_host.tt new file mode 100644 index 0000000..d73600c --- /dev/null +++ b/root/html/pages/new/new_host.tt @@ -0,0 +1,14 @@ +

Unknown mirror [% uri.host %]

+ +

This server is still unknown in our database, please complete information about this mirror.

+ +[% IF location %] +

According the IP address this host is located in +[% location.name | html %] ([% location.continent | html %]).

+[% END %] + +
+ + + +[% INCLUDE 'host_information.tt' %] diff --git a/root/html/pages/report/index.tt b/root/html/pages/report/index.tt new file mode 100644 index 0000000..b360813 --- /dev/null +++ b/root/html/pages/report/index.tt @@ -0,0 +1,35 @@ + + + +
+ + + +

Synchronisation tree

+ -- cgit v1.2.1