source: trunk/admin/themes/default/template/photos_add_settings.tpl @ 11212

Last change on this file since 11212 was 10552, checked in by patdenice, 13 years ago

feature:2273
Ability to crop thumbnail (fixed size)

File size: 5.4 KB
Line 
1{footer_script}
2var width = '{'Width'|@translate}';
3var height = '{'Height'|@translate}';
4var max_width = '{'Maximum Width'|@translate}';
5var max_height = '{'Maximum Height'|@translate}';
6
7{literal}
8jQuery(document).ready(function(){
9  function toggleResizeFields(prefix) {
10    var checkbox = jQuery("#"+prefix+"_resize");
11    var needToggle = jQuery("input[name^="+prefix+"_]").not(checkbox).not(jQuery("#hd_keep")).parents('tr');
12
13    if (jQuery(checkbox).is(':checked')) {
14      needToggle.show();
15
16      if (prefix == "websize") {
17        jQuery("#hd_keep").parents("fieldset").show();
18      }
19    }
20    else {
21      needToggle.hide();
22
23      if (prefix == "websize") {
24        jQuery("#hd_keep").parents("fieldset").hide();
25      }
26    }
27  }
28
29  function toggleCropFields(prefix) {
30    if (jQuery("#"+prefix+"_crop").is(':checked')) {
31      jQuery("#"+prefix+"_width_th").text(width);
32      jQuery("#"+prefix+"_height_th").text(height);
33      jQuery("#"+prefix+"_follow_orientation_tr").show();
34    }
35    else {
36      jQuery("#"+prefix+"_width_th").text(max_width);
37      jQuery("#"+prefix+"_height_th").text(max_height);
38      jQuery("#"+prefix+"_follow_orientation_tr").hide();
39    }
40
41  }
42
43  toggleResizeFields("websize");
44  jQuery("#websize_resize").click(function () {toggleResizeFields("websize")});
45
46  toggleResizeFields("hd");
47  jQuery("#hd_resize").click(function () {toggleResizeFields("hd")});
48
49  toggleCropFields("thumb");
50  jQuery("#thumb_crop").click(function () {toggleCropFields("thumb")});
51
52  function toggleHdFields() {
53    var checkbox = jQuery("#hd_keep");
54    var needToggle = jQuery("input[name^=hd_]").not(checkbox).parents('tr');
55
56    if (jQuery(checkbox).is(':checked')) {
57      needToggle.show();
58      toggleResizeFields("hd");
59    }
60    else {
61      needToggle.hide();
62    }
63  }
64
65  toggleHdFields();
66  jQuery("#hd_keep").click(function () {toggleHdFields()});
67});
68{/literal}{/footer_script}
69
70<div class="titrePage">
71  <h2>{'Upload Photos'|@translate}</h2>
72</div>
73
74<div id="photosAddContent">
75
76<form id="uploadFormSettings" enctype="multipart/form-data" method="post" action="{$F_ACTION}" class="properties">
77
78  <fieldset>
79    <legend>{'Web size photo'|@translate}</legend>
80
81    <table>
82      <tr>
83        <th><label for="websize_resize">{'Resize'|@translate}</label></th>
84        <td><input type="checkbox" name="websize_resize" id="websize_resize" {$values.websize_resize}></td>
85      </tr>
86      <tr>
87        <th>{'Maximum Width'|@translate}</th>
88        <td><input type="text" name="websize_maxwidth" value="{$values.websize_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
89      </tr>
90      <tr>
91        <th>{'Maximum Height'|@translate}</th>
92        <td><input type="text" name="websize_maxheight" value="{$values.websize_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
93      </tr>
94      <tr>
95        <th>{'Image Quality'|@translate}</th>
96        <td><input type="text" name="websize_quality" value="{$values.websize_quality}" size="3" maxlength="3"> %</td>
97      </tr>
98    </table>
99  </fieldset>
100
101  <fieldset>
102    <legend>{'Thumbnail'|@translate}</legend>
103
104    <table>
105      <tr>
106        <th><label for="thumb_crop">{'Crop'|@translate}</label></th>
107        <td><input type="checkbox" name="thumb_crop" id="thumb_crop" {$values.thumb_crop}></td>
108      </tr>
109      <tr id="thumb_follow_orientation_tr">
110        <th><label for="thumb_follow_orientation">{'Follow Orientation'|@translate}</label></th>
111        <td><input type="checkbox" name="thumb_follow_orientation" id="thumb_follow_orientation" {$values.thumb_follow_orientation}></td>
112      </tr>
113      <tr>
114        <th id="thumb_width_th">{'Maximum Width'|@translate}</th>
115        <td><input type="text" name="thumb_maxwidth" value="{$values.thumb_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
116      </tr>
117      <tr>
118        <th id="thumb_height_th">{'Maximum Height'|@translate}</th>
119        <td><input type="text" name="thumb_maxheight" value="{$values.thumb_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
120      </tr>
121      <tr>
122        <th>{'Image Quality'|@translate}</th>
123        <td><input type="text" name="thumb_quality" value="{$values.thumb_quality}" size="3" maxlength="3"> %</td>
124      </tr>
125    </table>
126  </fieldset>
127
128{if $MANAGE_HD}
129  <fieldset>
130    <legend>{'High definition'|@translate}</legend>
131
132    <table>
133      <tr>
134        <th><label for="hd_keep">{'Keep high definition'|@translate}</label></th>
135        <td><input type="checkbox" name="hd_keep" id="hd_keep" {$values.hd_keep}></td>
136      </tr>
137      <tr>
138        <th><label for="hd_resize">{'Resize'|@translate}</label></th>
139        <td><input type="checkbox" name="hd_resize" id="hd_resize" {$values.hd_resize}></td>
140      </tr>
141      <tr>
142        <th>{'Maximum Width'|@translate}</th>
143        <td><input type="text" name="hd_maxwidth" value="{$values.hd_maxwidth}" size="4" maxlength="4"> {'pixels'|@translate}</td>
144      </tr>
145      <tr>
146        <th>{'Maximum Height'|@translate}</th>
147        <td><input type="text" name="hd_maxheight" value="{$values.hd_maxheight}" size="4" maxlength="4"> {'pixels'|@translate}</td>
148      </tr>
149      <tr>
150        <th>{'Image Quality'|@translate}</th>
151        <td><input type="text" name="hd_quality" value="{$values.hd_quality}" size="3" maxlength="3"> %</td>
152      </tr>
153    </table>
154  </fieldset>
155{/if}
156
157  <p>
158    <input class="submit" type="submit" name="submit" value="{'Save Settings'|@translate}"/>
159  </p>
160
161</form>
162
163</div> <!-- photosAddContent -->
Note: See TracBrowser for help on using the repository browser.