From a1a5f8caa6a6d7af6f3b69fe36300a0d07c53d2d Mon Sep 17 00:00:00 2001 From: Simon Cozens Date: Tue, 13 Feb 2007 08:57:55 +0000 Subject: [PATCH] More Ajaxing. git-svn-id: http://svn.simon-cozens.org/memories/trunk@32 041978f6-d955-411f-a9d7-1d8545c9c3c7 --- Memories/Photo.pm | 1 + templates/photo/sized | 30 ++++++++++++++++++++++++++++++ templates/photo/view | 28 +--------------------------- 3 files changed, 32 insertions(+), 27 deletions(-) create mode 100644 templates/photo/sized diff --git a/Memories/Photo.pm b/Memories/Photo.pm index 57a53c4..d14619e 100644 --- a/Memories/Photo.pm +++ b/Memories/Photo.pm @@ -132,6 +132,7 @@ sub exif :Exported {} sub comment :Exported {} sub tagedit :Exported {} sub similar :Exported {} +sub sized :Exported {} use Class::DBI::Plugin::Pager; use Class::DBI::Plugin::AbstractCount; diff --git a/templates/photo/sized b/templates/photo/sized new file mode 100644 index 0000000..c0a0f10 --- /dev/null +++ b/templates/photo/sized @@ -0,0 +1,30 @@ +
+ [% SET sizes = request.config.sizes %] + [% IF request.params.exists("scale") %] + [% SET size = request.params.scale %] + [% ELSIF request.session.scale %] + [% SET size = request.session.scale %] + [% ELSE; SET size = 1; END; %] + +

(Original size [%photo.dimensions %])

+

+ + Size: + [% SET i = 0; WHILE i < sizes.size %] + [% IF photo.is_bigger(sizes.$i); %] + [% IF i == size %] + [% sizes.$i %] + [% ELSIF sizes.$i == "full" %] + full + [% ELSE %] + [% sizes.$i %] + [% END %] + [% END; %] + [% SET i = i + 1 %] + [% END %] +

+ [%# Now put it back in the session %] + [% SET request.session.scale = size %] +
diff --git a/templates/photo/view b/templates/photo/view index 4671484..0fbccbb 100644 --- a/templates/photo/view +++ b/templates/photo/view @@ -61,33 +61,7 @@ photo.uploader %] END %] -
- [% SET sizes = request.config.sizes %] - [% IF request.params.exists("scale") %] - [% SET size = request.params.scale %] - [% ELSIF request.session.scale %] - [% SET size = request.session.scale %] - [% ELSE; SET size = 1; END; %] - -

(Original size [%photo.dimensions %])

-

- Size: - [% SET i = 0; WHILE i < sizes.size %] - [% IF photo.is_bigger(sizes.$i); %] - [% IF i == size %] - [% sizes.$i %] - [% ELSIF sizes.$i == "full" %] - full - [% ELSE %] - [% sizes.$i %] - [% END %] - [% END; %] - [% SET i = i + 1 %] - [% END %] -

- [%# Now put it back in the session %] - [% SET request.session.scale = size %] -
+[% PROCESS sized %] [% IF photo.description OR photo.copyright OR photo.license %]
-- 2.39.5