From: Martin Mares Date: Wed, 26 Dec 2012 19:50:02 +0000 (+0100) Subject: Gallery2: Plain theme X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=42aa8d92ead61bc53773af56d8fd2c52a6047588;p=gallery.git Gallery2: Plain theme --- diff --git a/gal2/Makefile b/gal2/Makefile index e19fbcf..69b7e12 100644 --- a/gal2/Makefile +++ b/gal2/Makefile @@ -1,5 +1,6 @@ $(eval $(dir-setup)) -$(call lib-copy, UCW/Gallery.pm UCW/Gallery/Web.pm UCW/Gallery/Web/NrtBlue.pm) +$(call lib-copy, UCW/Gallery.pm UCW/Gallery/Web.pm UCW/Gallery/Web/NrtBlue.pm UCW/Gallery/Web/Plain.pm) $(call copy, $(addprefix nrt-blue/,back.png bot.png left.png next.png prev.png right.png top.png style.css)) +$(call copy, $(addprefix plain/,back.png next.png prev.png style.css)) diff --git a/gal2/UCW/Gallery/Web.pm b/gal2/UCW/Gallery/Web.pm index 63a7568..34a7691 100644 --- a/gal2/UCW/Gallery/Web.pm +++ b/gal2/UCW/Gallery/Web.pm @@ -37,9 +37,7 @@ Content-Type: text/html -$hextras -$theme_hextras -$title +$hextras$theme_hextras$title $textras EOF @@ -48,7 +46,7 @@ EOF sub html_bot($) { my ($self) = @_; - print $self->get('WebBotExtras'), "\n\n"; + print $self->get('WebBotExtras'), "\n"; } sub show_img($) { diff --git a/gal2/UCW/Gallery/Web/NrtBlue.pm b/gal2/UCW/Gallery/Web/NrtBlue.pm index de05937..0d327f1 100644 --- a/gal2/UCW/Gallery/Web/NrtBlue.pm +++ b/gal2/UCW/Gallery/Web/NrtBlue.pm @@ -1,5 +1,5 @@ # NRT Theme for MJ's Photo Gallery -# (c) 2003--2004 Martin Mares ; GPL'ed +# (c) 2003--2012 Martin Mares ; GPL'ed # Theme images taken from the cthumb package (c) Carlos Puchol package UCW::Gallery::Web::NrtBlue; @@ -25,13 +25,13 @@ my $bot_h = 18; sub theme_dir($) { my ($self) = @_; - return $self->get('ThemeUrlPrefix') . "/" . $theme_name; + return $self->get('ThemeUrlPrefix') . $theme_name; } sub theme_head_extras($) { my ($self) = @_; my $stylesheet = $self->theme_dir . "/style.css"; - return ""; + return "\n"; } sub show_links($$$$) { @@ -70,8 +70,7 @@ sub show_thumb($) { print "Photo\n"; print "\n"; print "\n"; - print "\n"; - print "\n\n"; + print "\n\n"; } sub attach($$) { diff --git a/gal2/UCW/Gallery/Web/Plain.pm b/gal2/UCW/Gallery/Web/Plain.pm new file mode 100644 index 0000000..885095b --- /dev/null +++ b/gal2/UCW/Gallery/Web/Plain.pm @@ -0,0 +1,71 @@ +# Plain Theme for MJ's Photo Gallery +# (c) 2012 Martin Mares ; GPL'ed + +package UCW::Gallery::Web::Plain; + +use strict; +use warnings; + +use UCW::Gallery; +use UCW::Gallery::Web; + +our @ISA = qw(UCW::Gallery::Web); + +my $theme_name = "plain"; +my $navw = 48; +my $navh = 48; +my $box_w = 130; +my $box_h = 110; +my $thumb_w = 114; +my $thumb_h = 94; + +sub theme_dir($) { + my ($self) = @_; + return $self->get('ThemeUrlPrefix') . $theme_name; +} + +sub theme_head_extras($) { + my ($self) = @_; + my $stylesheet = $self->theme_dir . "/style.css"; + return "\n"; +} + +sub show_links($$$$) { + my ($self, $prev, $up, $next) = @_; + my $theme = $self->theme_dir; + print "

"; + print ""; + print "Back" if $prev ne ""; + print "\n"; + printf ""; + printf "Forward" if $next ne ""; + print "\n"; + printf "Up" if $up ne ""; +} + +sub show_thumb($) { + my ($self, $meta, $photo_id, $click_url) = @_; + my $theme = $self->theme_dir; + my $m = $meta->{photo}->{$photo_id}; + my $annot = UCW::CGI::html_escape($m->{title}); + my $tf = $self->{thumb_fmt}; + my $tm = $meta->{thumb}->{$tf}->{$photo_id} or die "No thumbnails for format $tf found!\n"; + my $tw = $tm->{w}; + my $th = $tm->{h}; + my $thumb = $self->get('ThumbUrlPrefix') . "$tf/$photo_id.jpg"; + print "

\n"; + my $ol = int(($box_w - $tw)/2); + my $ot = int(($box_h - $th)/2); + my $tit = ($annot ne "") ? " title=\"$annot\"" : ""; + print "Photo\n"; + print "
\n\n"; +} + +sub attach($$) { + my ($class, $gal) = @_; + my $self = $class->SUPER::attach($gal); + $self->{thumb_fmt} = $gal->require_thumbnails($thumb_w, $thumb_h); + return $self; +} + +1; diff --git a/gal2/plain/back.png b/gal2/plain/back.png new file mode 100644 index 0000000..501909c Binary files /dev/null and b/gal2/plain/back.png differ diff --git a/gal2/plain/next.png b/gal2/plain/next.png new file mode 100644 index 0000000..bdd1011 Binary files /dev/null and b/gal2/plain/next.png differ diff --git a/gal2/plain/prev.png b/gal2/plain/prev.png new file mode 100644 index 0000000..68b2514 Binary files /dev/null and b/gal2/plain/prev.png differ diff --git a/gal2/plain/style.css b/gal2/plain/style.css new file mode 100644 index 0000000..4e86e31 --- /dev/null +++ b/gal2/plain/style.css @@ -0,0 +1,13 @@ +.thf { margin: 0 0 0 0; padding: 0 0 0 0; float: left; border: none; } +.thumb { position: relative; width: 130px; height: 110px; } +.ti { position: absolute; border: 1px solid #505; } +IMG { border: none; } +H1 { text-align: center; } +H2 { text-align: center; margin-bottom: 3ex; } +P { clear: both; } +H2 { clear: both; } +.parent { text-align: center; } +.large { text-align: center; } +.back { float: left; } +.fwd { float: right; } +A[href]:hover { background-color: #11001d; }