Changeset 25678 for extensions/UserCollections/template/collection_edit.tpl
- Timestamp:
- Nov 24, 2013, 6:09:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/UserCollections/template/collection_edit.tpl
r25674 r25678 1 {strip} 1 2 {combine_css path=$USER_COLLEC_PATH|cat:'template/style_collections.css'} 2 3 … … 4 5 5 6 {*<!-- datepicker and timepicker -->*} 6 {include file='include/datepicker.inc.tpl'} 7 {combine_script id='jquery.ui.timepicker' load='footer' require='jquery.ui.datepicker,jquery.ui.slider' path=$USER_COLLEC_PATH|cat:'template/resources/jquery-timepicker/jquery-ui-timepicker-addon.js'} 8 9 {assign var="timepicker_language" value=$USER_COLLEC_PATH|cat:'template/resources/jquery-timepicker/i18n/jquery-ui-timepicker-'|cat:$lang_info.code|cat:'.js'} 10 {if "PHPWG_ROOT_PATH"|@constant|@cat:$timepicker_language|@file_exists} 11 {combine_script id="jquery.ui.timepicker-$lang_info.code" load='footer' require='jquery.ui.timepicker' path=$timepicker_language} 7 {combine_script id='jquery.ui.datepicker' load='footer' path='themes/default/js/ui/jquery.ui.datepicker.js'} 8 {combine_script id='jquery.ui.timepicker' load='footer' require='jquery.ui.slider' path=$USER_COLLEC_PATH|cat:'template/resources/jquery-timepicker/jquery-ui-timepicker-addon.js'} 9 10 {assign var=datepicker_language value='themes/default/js/ui/i18n/jquery.ui.datepicker-'|cat:$lang_info.code|cat:'.js'} 11 {if 'PHPWG_ROOT_PATH'|constant|cat:$datepicker_language|file_exists} 12 {combine_script id='jquery.ui.datepicker-'|cat:$lang_info.code load='footer' require='jquery.ui.datepicker' path=$datepicker_language} 13 {/if} 14 15 {assign var=timepicker_language value=$USER_COLLEC_PATH|cat:'template/resources/jquery-timepicker/i18n/jquery-ui-timepicker-'|cat:$lang_info.code|cat:'.js'} 16 {if 'PHPWG_ROOT_PATH'|constant|cat:$timepicker_language|file_exists} 17 {combine_script id='jquery.ui.timepicker-'|cat:$lang_info.code load='footer' require='jquery.ui.timepicker' path=$timepicker_language} 12 18 {/if} 13 19 14 20 {combine_css path='themes/default/js/ui/theme/jquery.ui.core.css'} 15 21 {combine_css path='themes/default/js/ui/theme/jquery.ui.theme.css'} 22 {combine_css path='themes/default/js/ui/theme/jquery.ui.datepicker.css'} 16 23 {combine_css path='themes/default/js/ui/theme/jquery.ui.slider.css'} 17 24 {combine_css path=$USER_COLLEC_PATH|cat:'template/resources/jquery-timepicker/jquery-ui-timepicker-addon.css'} 18 19 20 {footer_script require='jquery ,jquery.ui.timepicker'}21 var bg_color = $('#the_page #content').css('background-color');22 if (!bg_color || bg_color=='transparent') { ldelim}23 bg_color = $('body').css('background-color');25 {/strip} 26 27 {footer_script require='jquery'} 28 var bg_color = jQuery('#the_page #content').css('background-color'); 29 if (!bg_color || bg_color=='transparent') { 30 bg_color = jQuery('body').css('background-color'); 24 31 } 25 32 26 33 {if isset($U_SHARE)} 27 {literal}28 34 var $share_form = jQuery('#share_form'); 29 35 30 36 // functions 31 37 jQuery.fn.extend({ 32 38 hideVis: function() { 33 $(this).css('visibility', 'hidden');39 jQuery(this).css('visibility', 'hidden'); 34 40 return this; 35 41 }, 36 42 showVis: function() { 37 $(this).css('visibility', 'visible');43 jQuery(this).css('visibility', 'visible'); 38 44 return this; 39 45 }, 40 46 toggleVis: function(toggle) { 41 if ( $(this).css('visibility')=='hidden' || toggle === true){42 return $(this).showVis();47 if (jQuery(this).css('visibility')=='hidden' || toggle === true){ 48 return jQuery(this).showVis(); 43 49 } else { 44 return $(this).hideVis();50 return jQuery(this).hideVis(); 45 51 } 46 52 } 47 53 }); 48 54 49 55 function enterShareKeyEdit() { 50 56 $share_form.find('.url-edit').show(); 51 57 $share_form.find('.url-normal').hide(); 52 jQuery( ".share_colorbox_open").colorbox.resize({speed:0});58 jQuery('.share_colorbox_open').colorbox.resize({ldelim}speed:0}); 53 59 } 54 60 function exitShareKeyEdit() { 55 61 $share_form.find('.url-edit').hide(); 56 62 $share_form.find('.url-normal').show(); 57 jQuery( ".share_colorbox_open").colorbox.resize({speed:0});63 jQuery('.share_colorbox_open').colorbox.resize({ldelim}speed:0}); 58 64 } 59 65 60 66 // hide some inputs 61 67 exitShareKeyEdit(); 62 68 63 69 // display key 64 70 $share_form.find('.url-more').text($share_form.find('input[name="share_key"]').val()); 65 71 66 72 // url edition 67 $share_form.find('.edit_share_key').on('click', function( ) {73 $share_form.find('.edit_share_key').on('click', function(e) { 68 74 enterShareKeyEdit(); 69 return false;70 }); 71 $share_form.find('.set_share_key').on('click', function( ) {75 e.preventDefault(); 76 }); 77 $share_form.find('.set_share_key').on('click', function(e) { 72 78 if ($share_form.find('input[name="share_key"]').val().length < 8) { 73 alert( "{/literal}{'The key must be at least 8 characters long'|@translate|escape:javascript}{literal}");79 alert('{'The key must be at least 8 characters long'|translate|escape:javascript}'); 74 80 } 75 81 else { … … 77 83 exitShareKeyEdit(); 78 84 } 79 return false;80 }); 81 $share_form.find('.cancel_share_key').on('click', function( ) {85 e.preventDefault(); 86 }); 87 $share_form.find('.cancel_share_key').on('click', function(e) { 82 88 $share_form.find('input[name="share_key"]').val($share_form.find('.url-more').text()); 83 89 exitShareKeyEdit(); 84 return false;90 e.preventDefault(); 85 91 }); 86 92 $share_form.find('.url-more').on('dblclick', function() { 87 93 enterShareKeyEdit(); 88 94 }); 89 95 90 96 // optional inputs 91 97 $share_form.find('.share-option').each(function() { 92 $share_form.find('input[name="'+ $(this).data('for') +'"]').hideVis();98 $share_form.find('input[name="'+ jQuery(this).data('for') +'"]').hideVis(); 93 99 }).on('change', function() { 94 $share_form.find('input[name="'+ $(this).data('for') +'"]').toggleVis($(this).is(':checked'));95 }); 96 100 $share_form.find('input[name="'+ jQuery(this).data('for') +'"]').toggleVis($(this).is(':checked')); 101 }); 102 97 103 // datetime picker 98 104 $share_form.find('input[name="share_deadline"]').datetimepicker({ … … 100 106 minDate: new Date() 101 107 }); 102 103 108 109 104 110 // popup 105 jQuery( ".share_colorbox_open").colorbox({106 { /literal}{if isset($share.open)}open: true, transition:"none",{/if}{literal}111 jQuery('.share_colorbox_open').colorbox({ 112 {if isset($share.open)}open: true, transition:"none",{/if} 107 113 inline:true 108 114 }); 109 jQuery(".share_colorbox_close").click(function() { 110 jQuery(".share_colorbox_open").colorbox.close(); 111 return false; 112 }); 113 jQuery("#share_form").css('background-color', bg_color); 114 {/literal} 115 jQuery('.share_colorbox_close').click(function(e) { 116 jQuery('.share_colorbox_open').colorbox.close(); 117 e.preventDefault(); 118 }); 119 jQuery('#share_form').css('background-color', bg_color); 115 120 {/if} 116 121 117 122 {if isset($U_MAIL)} 118 {literal} 119 jQuery(".mail_colorbox_open").colorbox({ 120 {/literal}{if isset($contact.open)}open: true, transition:"none",{/if}{literal} 123 jQuery('.mail_colorbox_open').colorbox({ 124 {if isset($contact.open)}open: true, transition:"none",{/if} 121 125 inline:true 122 126 }); 123 jQuery(".mail_colorbox_close").click(function() { 124 jQuery(".mail_colorbox_open").colorbox.close(); 125 return false; 126 }); 127 128 129 jQuery("#mail_form").css('background-color', bg_color); 130 {/literal} 131 {/if} 132 133 {literal} 134 jQuery("#edit_form_show").click(function() { 135 jQuery("#edit_form_show").hide(); 136 jQuery(".additional_info").hide(); 137 jQuery("#edit_form").show(); 127 jQuery('.mail_colorbox_close').click(function(e) { 128 jQuery('.mail_colorbox_open').colorbox.close(); 129 e.preventDefault(); 130 }); 131 132 133 jQuery('#mail_form').css('background-color', bg_color); 134 {/if} 135 136 jQuery('#edit_form_show').click(function() { 137 jQuery('#edit_form_show').hide(); 138 jQuery('.additional_info').hide(); 139 jQuery('#edit_form').show(); 138 140 }); 139 jQuery( "#edit_form_hide").click(function() {140 jQuery( "#edit_form_show").show();141 jQuery( ".additional_info").show();142 jQuery( "#edit_form").hide();141 jQuery('#edit_form_hide').click(function() { 142 jQuery('#edit_form_show').show(); 143 jQuery('.additional_info').show(); 144 jQuery('#edit_form').hide(); 143 145 }); 144 {/literal}145 146 {/footer_script} 146 147 147 148 148 {* <!-- Menubar & titrePage --> *}149 {if $themeconf.name == "stripped" or $themeconf.parent == "stripped"}150 {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/stripped.tpl'}151 {assign var="clear" value="true"}152 {elseif $themeconf.name == "simple-grey" or $themeconf.parent == "simple"}153 {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/simple.tpl'}154 {assign var="clear" value="true"}155 {else}156 {include file=$USER_COLLEC_ABS_PATH|@cat:'template/themes/default.tpl'}157 {/if}158 159 {if isset($errors) or not empty($infos)}160 {include file='infos_errors.tpl'}161 {/if}162 163 164 149 {if isset($collection)} 165 150 166 {if !empty($CONTENT_DESCRIPTION)} 167 <div class="additional_info"> 168 {$CONTENT_DESCRIPTION} 169 </div> 170 {/if} 171 172 <p style="text-align:center;"><input type="submit" id="edit_form_show" value="{'Edit'|@translate}"></p> 151 <p style="text-align:center;"><input type="submit" id="edit_form_show" value="{'Edit'|translate}"></p> 173 152 174 153 {* <!-- edit collection -->*} 175 154 <form action="{$F_ACTION}" method="post" id="edit_form" style="display:none;"> 176 155 <fieldset id="colProperties"> 177 <legend>{' Properties'|@translate}</legend>178 179 <p class="title"><label for="name">{'Name'| @translate}</label></p>156 <legend>{'Edit'|translate}</legend> 157 158 <p class="title"><label for="name">{'Name'|translate}</label></p> 180 159 <p><input type="text" name="name" id="name" value="{$collection.NAME|escape:html}" size="60"></p> 181 182 <p class="title"><label for="comment">{'Description'| @translate}</label></p>160 161 <p class="title"><label for="comment">{'Description'|translate}</label></p> 183 162 <p><textarea name="comment" id="comment" style="width:400px;height:100px;">{$collection.COMMENT}</textarea></p> 184 163 185 164 <p> 186 <input type="submit" name="save_col" value="{'Save'| @translate}">187 <a id="edit_form_hide">{'Cancel'| @translate}</a>165 <input type="submit" name="save_col" value="{'Save'|translate}"> 166 <a id="edit_form_hide">{'Cancel'|translate}</a> 188 167 </p> 189 168 </fieldset> … … 195 174 <form id="share_form" class="uc_form" action="{$F_ACTION}" method="post"> 196 175 {include file='infos_errors.tpl' errors=$share.errors infos=$share.infos} 197 176 198 177 <table> 199 178 <tr> … … 201 180 <span class="url-base">{$U_SHARE}</span><span class="url-more url-normal"></span> 202 181 <input type="text" name="share_key" class="url-edit" size="20" value="{$share.share_key}"> 203 <button class="url-normal edit_share_key">{'Edit'| @translate}</button>204 <button class="url-edit set_share_key">{'OK'| @translate}</button>205 <a href="#" class="url-edit cancel_share_key">{'Cancel'| @translate}</button>182 <button class="url-normal edit_share_key">{'Edit'|translate}</button> 183 <button class="url-edit set_share_key">{'OK'|translate}</button> 184 <a href="#" class="url-edit cancel_share_key">{'Cancel'|translate}</button> 206 185 </td> 207 186 </tr> 208 187 <tr> 209 188 <td class="title"><label> 210 {'Password'| @translate}189 {'Password'|translate} 211 190 <input type="checkbox" name="use_share_password" data-for="share_password" class="share-option"> 212 191 </label></td> 213 192 <td> 214 <input type="text" name="share_password" size="25" maxlength="25" value="{$share.password}" placeholder="{'Password'| @translate}">193 <input type="text" name="share_password" size="25" maxlength="25" value="{$share.password}" placeholder="{'Password'|translate}"> 215 194 </td> 216 195 </tr> 217 196 <tr> 218 197 <td class="title"><label> 219 {'Expiration date'| @translate}198 {'Expiration date'|translate} 220 199 <input type="checkbox" name="use_share_deadline" data-for="share_deadline" class="share-option"> 221 200 </label></td> 222 201 <td> 223 <input type="text" name="share_deadline" size="25" value="{$share.deadline}" placeholder="{'Date'| @translate}">202 <input type="text" name="share_deadline" size="25" value="{$share.deadline}" placeholder="{'Date'|translate}"> 224 203 </td> 225 204 </tr> … … 227 206 <td class="title"> </td> 228 207 <td> 229 <input class="submit" type="submit" name="add_share" value="{'Add'| @translate}">230 <a class="share_colorbox_close" href="#">{'Cancel'| @translate}</a>208 <input class="submit" type="submit" name="add_share" value="{'Add'|translate}"> 209 <a class="share_colorbox_close" href="#">{'Cancel'|translate}</a> 231 210 <input type="hidden" name="key" value="{$UC_TKEY}"> 232 211 </td> 233 212 </tr> 234 213 </table> 235 214 236 215 {if not empty($collection.SHARES)} 237 216 <table class="shares_list"> 238 217 <tr class="header"> 239 <th>{'Share key'| @translate}</th>240 <th>{'Creation date'| @translate}</th>241 <th>{'Password'| @translate}</th>242 <th>{'Expiration date'| @translate}</th>218 <th>{'Share key'|translate}</th> 219 <th>{'Creation date'|translate}</th> 220 <th>{'Password'|translate}</th> 221 <th>{'Expiration date'|translate}</th> 243 222 <th></th> 244 223 </tr> … … 247 226 <td><a href="{$share.url}">{$share.share_key}</a></td> 248 227 <td>{$share.add_date_readable}</td> 249 <td>{if $share.params.password}{'Yes'| @translate}{else}{'No'|@translate}{/if}</td>250 <td>{if $share.params.deadline}{$share.params.deadline_readable}{else}{'No'| @translate}{/if}</td>251 <td><a href="{$share.u_delete}" onClick="return confirm('{'Are you sure?'| @translate}');">228 <td>{if $share.params.password}{'Yes'|translate}{else}{'No'|translate}{/if}</td> 229 <td>{if $share.params.deadline}{$share.params.deadline_readable}{else}{'No'|translate}{/if}</td> 230 <td><a href="{$share.u_delete}" onClick="return confirm('{'Are you sure?'|translate}');"> 252 231 <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png" width=16 height=16></a> 253 232 </td> … … 268 247 <table> 269 248 <tr> 270 <td class="title"><label for="sender_name">{'Your name'| @translate}</label></td>249 <td class="title"><label for="sender_name">{'Your name'|translate}</label></td> 271 250 <td> 272 251 <input type="text" name="sender_name" id="sender_name" size="40" value="{$contact.sender_name}"> … … 274 253 </tr> 275 254 <tr> 276 <td class="title"><label for="sender_email">{'Your e-mail'| @translate}</label></td>255 <td class="title"><label for="sender_email">{'Your e-mail'|translate}</label></td> 277 256 <td> 278 257 <input type="text" name="sender_email" id="sender_email" size="40" value="{$contact.sender_email}"> … … 280 259 </tr> 281 260 <tr> 282 <td class="title"><label for="recipient_name">{'Recipient name'| @translate}</label></td>261 <td class="title"><label for="recipient_name">{'Recipient name'|translate}</label></td> 283 262 <td> 284 263 <input type="text" name="recipient_name" id="recipient_name" size="40" value="{$contact.recipient_name}"> … … 286 265 </tr> 287 266 <tr> 288 <td class="title"><label for="recipient_email">{'Recipient e-mail'| @translate}</label></td>267 <td class="title"><label for="recipient_email">{'Recipient e-mail'|translate}</label></td> 289 268 <td> 290 269 <input type="text" name="recipient_email" id="recipient_email" size="40" value="{$contact.recipient_email}"> … … 292 271 </tr> 293 272 <tr> 294 <td class="title"><label for="nb_images">{'Number of images'| @translate}</label></td>273 <td class="title"><label for="nb_images">{'Number of images'|translate}</label></td> 295 274 <td> 296 275 <select name="nb_images"> … … 302 281 </tr> 303 282 <tr> 304 <td class="title"><label for="message">{'Message (optional)'| @translate}</label></td>283 <td class="title"><label for="message">{'Message (optional)'|translate}</label></td> 305 284 <td><textarea name="message" id="message" rows="6" style="width:350px;">{$contact.message}</textarea></td> 306 285 </tr> … … 308 287 <td class="title"> </td> 309 288 <td> 310 <input class="submit" type="submit" name="send_mail" value="{'Send'| @translate}">311 <a class="mail_colorbox_close" href="#">{'Cancel'| @translate}</a>289 <input class="submit" type="submit" name="send_mail" value="{'Send'|translate}"> 290 <a class="mail_colorbox_close" href="#">{'Cancel'|translate}</a> 312 291 <input type="hidden" name="key" value="{$UC_TKEY}"> 313 292 </td> … … 318 297 {/if} 319 298 320 321 {* <!-- collection content -->*} 322 {if $collection.NB_IMAGES > 0} 323 <ul class="thumbnails" id="thumbnails"> 324 {$THUMBNAILS} 325 </ul> 326 {else} 327 <p><i>{'This collection is empty'|@translate}</i></p> 328 {/if} 329 330 {if !empty($navbar)}{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if} 331 332 {/if} 333 334 {if isset($clear)}<div style="clear: both;"></div> 335 </div>{/if} 336 </div>{* <!-- content --> *} 299 {if empty($THUMBNAILS)} 300 <p><i>{'This collection is empty'|translate}</i></p> 301 {/if} 302 303 {/if}
Note: See TracChangeset
for help on using the changeset viewer.