From 2690b8a0d7019b68509897881cd152717cb41ed0 Mon Sep 17 00:00:00 2001 From: dakkar Date: Wed, 9 Nov 2005 21:44:02 +0000 Subject: un po' di stylesheet --- lib/Bookmarks.pm | 2 +- lib/Bookmarks/C/Main.pm | 7 +++ lib/Bookmarks/M/DB/Tags.pm | 2 +- root/add_form | 48 +++++++++++------ root/closewin | 7 ++- root/links | 103 +++++++++++++++++++----------------- root/notag | 12 ++--- root/style.css | 129 +++++++++++++++++++++++++++++++++++++++++++++ root/tags | 28 ++++++---- 9 files changed, 256 insertions(+), 82 deletions(-) create mode 100644 root/style.css diff --git a/lib/Bookmarks.pm b/lib/Bookmarks.pm index 810a64f..63d6578 100644 --- a/lib/Bookmarks.pm +++ b/lib/Bookmarks.pm @@ -1,7 +1,7 @@ package Bookmarks; use strict; -use Catalyst qw/-Debug Prototype DefaultEnd/; +use Catalyst qw/-Debug Prototype DefaultEnd Static::Simple/; use HTML::Element; our $VERSION = '0.01'; diff --git a/lib/Bookmarks/C/Main.pm b/lib/Bookmarks/C/Main.pm index 244abab..b272c64 100644 --- a/lib/Bookmarks/C/Main.pm +++ b/lib/Bookmarks/C/Main.pm @@ -192,6 +192,13 @@ sub new { return bless {c=>$c,base=>$c->req->base()},$class; } +sub stylesheet { + my ($self)=@_; + return URI->new( + $self->{base} . 'style.css' + )->as_string(); +} + sub tag_info { my ($self, $tag)=@_; return URI->new( diff --git a/lib/Bookmarks/M/DB/Tags.pm b/lib/Bookmarks/M/DB/Tags.pm index cc675f7..4ca832a 100644 --- a/lib/Bookmarks/M/DB/Tags.pm +++ b/lib/Bookmarks/M/DB/Tags.pm @@ -18,7 +18,7 @@ __PACKAGE__->set_sql('popularity', <<'END_SQL'); SELECT tags.pk, COUNT(links_tags.link) AS how_many FROM tags, links_tags WHERE tags.pk = links_tags.tag -GROUP BY links_tags.tag +GROUP BY tags.pk ORDER BY how_many DESC END_SQL diff --git a/root/add_form b/root/add_form index ce0d181..b031299 100644 --- a/root/add_form +++ b/root/add_form @@ -1,18 +1,34 @@ - -[% IF mode=='edit'; 'Edit link'; ELSE; 'Add link'; END %] -[% c.prototype.auto_complete_stylesheet() %] -[% c.prototype.define_javascript_functions() %] - - -
-

Link:

-

Title:

-

Description:

-

Tags:

-
- - [% IF mode=='edit' %][% END %] -
- + + [% IF mode=='edit'; 'Edit link'; ELSE; 'Add link'; END %] + [% c.prototype.auto_complete_stylesheet() %] + [% c.prototype.define_javascript_functions() %] + + + +
+

+ + +

+

+ + +

+

+ + +

+

+ + +

+
+ + + [% IF mode=='edit' -%] + + [%- END %] +
+ \ No newline at end of file diff --git a/root/closewin b/root/closewin index 2e1d5eb..7fcc514 100644 --- a/root/closewin +++ b/root/closewin @@ -1 +1,6 @@ -close this window + + + + + + diff --git a/root/links b/root/links index a23eaff..fa78da8 100644 --- a/root/links +++ b/root/links @@ -7,64 +7,73 @@ ', ' UNLESS loop.last; END %] +

[% IF tagset.size() == 1 %]Tag:[% ELSE %]Tags:[% END %]

- +
diff --git a/root/notag b/root/notag index 005d359..e5d7b02 100644 --- a/root/notag +++ b/root/notag @@ -1,8 +1,8 @@ - -no tag - - -

Il tag [% tagname %] non esiste

- + + No such tag + + +

Il tag [% tagname %] non esiste

+ diff --git a/root/style.css b/root/style.css new file mode 100644 index 0000000..859eae8 --- /dev/null +++ b/root/style.css @@ -0,0 +1,129 @@ +/* general */ +body +{ + font-size: 8pt; + width: 100%; + margin:0;padding:0;border:0; +} +a +{ + text-decoration: none; + color: black; +} +li:hover +{ + background-color: rgb(100,100,100); +} + +/* tags */ +div#all-tags ol +{ + list-style: none; + margin:0;padding:0;border:0; +} +div#all-tags li +{ + padding: 1px; + position: relative; + display: block; + clear: both; +} +div#all-tags li span.tag.name a +{ + display: block; +} +div#all-tags li span.tag.count +{ + display: block; + position: absolute;top:0;right:0; + text-align: right; +} + +/* links */ +div#tagset, +div#related +{ + position: fixed; + top:0; + width: 49%; height: 80px; + border: solid thin black; + background-color: white; +} +div#tagset h2, +div#related h2 +{ + position: absolute; + top: 0; left: 5px; + margin:0;padding:0;border:0; + background-color: white; +} +div#tagset +{ + left: 0; +} +div#related +{ + right:0; +} +div#tagset > div, +div#related > div +{ + overflow: auto; + height: 60px; + width: 100%; + margin-top: 20px; +} +div#tagset ul, +div#related ul +{ + list-style: none; + margin:0;border:0;padding:0; +} +div#tagset ul li, +div#related ul li +{ + padding: 1px; + position: relative; + display: block; + clear: both; +} +div#tagset ul li span.tag.name a, +div#related ul li span.tag.name a +{ + display: block; +} +div#tagset ul li span.tag.remove, +div#related ul li span.tag.add +{ + display: block; + position: absolute;top:0;right:1px; + text-align: right; + background-color: red; +} +div#tagset ul li span.tag.remove a, +div#related ul li span.tag.add a +{ + display: block; + width: 15px; + text-align: center; +} + +div#links +{ + padding:0;border:0;margin:0; + margin-top: 85px; +} +div#links h2 +{ + display: none; +} +div#links ol +{ + list-style: none; + padding:0;margin:0;border:0; +} +div#links ol > li +{ + padding:0;margin:0;border:0; + margin-bottom: 5px; +} \ No newline at end of file diff --git a/root/tags b/root/tags index 2df62e5..244ae32 100644 --- a/root/tags +++ b/root/tags @@ -1,12 +1,20 @@ - -tags - - -
    -[% FOR tag IN tags %] -
  1. [% tag.name %] ([% tag.how_many %])
  2. -[% END %] -
- + + Tags + + + +
+
    + [% FOR tag IN tags %] +
  1. + + [% tag.name %] + + [% tag.how_many() %] +
  2. + [% END %] +
+
+ -- cgit v1.2.3