source: extensions/header_manager/admin/template/add.tpl @ 24010

Last change on this file since 24010 was 24010, checked in by mistic100, 11 years ago

"Add banner" in album page make the user redirected to the same page after cropping

File size: 4.0 KB
Line 
1{combine_css path=$HEADER_MANAGER_PATH|@cat:"admin/template/style.css"}
2
3<div class="titrePage">
4        <h2>Header Manager</h2>
5</div>
6
7{if $IN_CROP}
8{combine_css path="themes/default/js/plugins/jquery.Jcrop.css"}
9{combine_script id='jquery.jcrop' load='footer' require='jquery' path='themes/default/js/plugins/jquery.Jcrop.min.js'}
10
11{footer_script require="jquery"}
12var jcrop_api;
13
14jQuery("#jcrop").Jcrop({ldelim}
15    boxWidth: {$crop.display_width},
16    boxHeight: {$crop.display_height},
17    setSelect: [{$crop.l}, {$crop.t}, {$crop.r}, {$crop.b}],
18    onChange: jOnChange,
19    onRelease: jOnRelease
20        },
21  function(){ldelim}
22    jcrop_api = this;
23  });
24 
25function jOnChange(sel) {ldelim}
26        jQuery("input[name='x']").val(sel.x);
27        jQuery("input[name='y']").val(sel.y);
28        jQuery("input[name='x2']").val(sel.x2);
29        jQuery("input[name='y2']").val(sel.y2);
30 
31  jQuery("#width").html(sel.x2-sel.x);
32  jQuery("#height").html(sel.y2-sel.y);
33}
34 
35function jOnRelease() {ldelim}
36        jcrop_api.setSelect([{$crop.l}, {$crop.t}, {$crop.r}, {$crop.b}]);
37}
38{/footer_script}
39
40<form method="post" action="{$F_ACTION}">
41<fieldset>
42  <legend>{'Crop banner image'|@translate}</legend>
43  {'Choose the part of the image you want to use as your header.'|@translate}<br>
44 
45  <img id="jcrop" src="{$picture.banner_src}" width="{$crop.display_width}" height="{$crop.display_height}">
46 
47  <ul>
48    <li><b>{'Width'|@translate}:</b> <span id="width"></span>px</li>
49    <li><b>{'Height'|@translate}:</b> <span id="height"></span>px</li>
50  </ul>
51 
52  <input type="hidden" name="x">
53  <input type="hidden" name="y">
54  <input type="hidden" name="x2">
55  <input type="hidden" name="y2">
56  <input type="hidden" name="picture_file" value="{$picture.filename}">
57 
58  <input type="submit" name="submit_crop" value="{'Submit'|@translate}">
59  <input type="submit" name="cancel_crop" value="{'Cancel'|@translate}">
60</fieldset>
61</form>
62
63{else}
64{footer_script require="jquery"}{literal}
65jQuery(".showInfo").tipTip({
66  delay: 0,
67  fadeIn: 200,
68  fadeOut: 200,
69  maxWidth: '300px',
70});
71
72$("input").bind("keydown", function(event) {
73  var keycode = event.keyCode ? event.keyCode : (event.which ? event.which : event.charCode);
74  if (keycode == 13 && $("input[name='picture_id']").val() != '') {
75    $("input[name='upload_gallery_image']").click();
76    return false;
77  } else {
78    return true;
79  }
80});
81{/literal}{/footer_script}
82
83<form method="post" action="{$F_ACTION}" ENCTYPE="multipart/form-data">
84  <fieldset>
85    <legend>{'Default banner size'|@translate}</legend>
86   
87    <label>
88      {'Width'|@translate}:
89      <input type="text" name="width" size="4" value="{$BANNER_WIDTH}"> px
90    </label>
91    <br>
92    <br>
93    <label>
94      {'Height'|@translate}:
95      <input type="text" name="height" size="4" value="{$BANNER_HEIGHT}"> px
96    </label>
97    <br>
98    <br>
99    <i>{'For MontBlancXL and BlancMontXL, advised size is 900&times;190.'|@translate}</i>
100  </fieldset>
101 
102  <fieldset>
103    <legend>{'Select an image'|@translate}</legend>
104    {'You can upload a custom header image or select one from your gallery. On the next screen you will be able to crop the image.'|@translate}
105    <br><br>
106   
107    <b>{'Choose an image from your computer'|@translate}</b>
108    <blockquote>
109      {'Maximum file size: %sB.'|@translate|@sprintf:$upload_max_filesize_shorthand} {'Allowed file types: %s.'|@translate|@sprintf:'jpg, png, gif'}<br>
110      <input type="file" name="new_image">
111      <input type="hidden" name="MAX_FILE_SIZE" value="{$upload_max_filesize}">
112      <input type="submit" name="upload_new_image" value="{'Upload'|@translate}" class="submit">
113    </blockquote>
114   
115    <b>{'or choose a picture from the gallery'|@translate}</b>
116    <blockquote>
117      {'Picture id.'|@translate} <a class="icon-info-circled-1 showInfo" title="{'The numeric identifier can be found on the picture edition page, near the thumbnail.'|@translate}"></a>
118      <input type="text" name="picture_id" size="5">
119      <input type="submit" name="upload_gallery_image" value="{'Use'|@translate}" class="submit">
120    </blockquote>
121  </fieldset>
122</form>
123
124{/if}
Note: See TracBrowser for help on using the repository browser.