1 <div class="photoview" id="photoview">
2 [% SET sizes = request.config.sizes %]
3 [% IF request.params.exists("scale") %]
4 [% SET size = request.params.scale %]
5 [% ELSIF request.session.scale %]
6 [% SET size = request.session.scale %]
7 [% ELSE; SET size = 1; END; %]
8 <img src="[% photo.sized_url(size) %]" id="thephoto">
9 <p> (Original size [%photo.dimensions %]) </p>
11 <script> function change_size(size) {
12 new Ajax.Updater("photoview", "[%base%]/photo/sized/[%photo.id%]?scale="+size);
15 [% SET i = 0; WHILE i < sizes.size %]
16 [% IF photo.is_bigger(sizes.$i); %]
19 [% ELSIF sizes.$i == "full" %]
20 <a href="[%photo.path("url")%]">full</a>
22 <a href="javascript:change_size([%i%])">[% sizes.$i %]</a>
28 [%# Now put it back in the session %]
29 [% SET request.session.scale = size %]