Ignore:
Timestamp:
Nov 24, 2013, 6:09:57 PM (10 years ago)
Author:
mistic100
Message:

very big update for Piwigo 2.6

File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/UserCollections/template/collection_edit.tpl

    r25674 r25678  
     1{strip}
    12{combine_css path=$USER_COLLEC_PATH|cat:'template/style_collections.css'}
    23
     
    45
    56{*<!-- 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}
    1218{/if}
    1319
    1420{combine_css path='themes/default/js/ui/theme/jquery.ui.core.css'}
    1521{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'}
    1623{combine_css path='themes/default/js/ui/theme/jquery.ui.slider.css'}
    1724{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'}
     28var bg_color = jQuery('#the_page #content').css('background-color');
     29if (!bg_color || bg_color=='transparent') {
     30  bg_color = jQuery('body').css('background-color');
    2431}
    2532
    2633{if isset($U_SHARE)}
    27 {literal}
    2834  var $share_form = jQuery('#share_form');
    29  
     35
    3036  // functions
    3137  jQuery.fn.extend({
    3238      hideVis: function() {
    33           $(this).css('visibility', 'hidden');
     39          jQuery(this).css('visibility', 'hidden');
    3440          return this;
    3541      },
    3642      showVis: function() {
    37           $(this).css('visibility', 'visible');
     43          jQuery(this).css('visibility', 'visible');
    3844          return this;
    3945      },
    4046      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();
    4349          } else {
    44               return $(this).hideVis();
     50              return jQuery(this).hideVis();
    4551          }
    4652      }
    4753  });
    48  
     54
    4955  function enterShareKeyEdit() {
    5056      $share_form.find('.url-edit').show();
    5157      $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});
    5359  }
    5460  function exitShareKeyEdit() {
    5561      $share_form.find('.url-edit').hide();
    5662      $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});
    5864  }
    59  
     65
    6066  // hide some inputs
    6167  exitShareKeyEdit();
    62  
     68
    6369  // display key
    6470  $share_form.find('.url-more').text($share_form.find('input[name="share_key"]').val());
    65  
     71
    6672  // url edition
    67   $share_form.find('.edit_share_key').on('click', function() {
     73  $share_form.find('.edit_share_key').on('click', function(e) {
    6874      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) {
    7278      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}');
    7480      }
    7581      else {
     
    7783          exitShareKeyEdit();
    7884      }
    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) {
    8288      $share_form.find('input[name="share_key"]').val($share_form.find('.url-more').text());
    8389      exitShareKeyEdit();
    84       return false;
     90      e.preventDefault();
    8591  });
    8692  $share_form.find('.url-more').on('dblclick', function() {
    8793      enterShareKeyEdit();
    8894  });
    89  
     95
    9096  // optional inputs
    9197  $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();
    9399  }).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
    97103  // datetime picker
    98104  $share_form.find('input[name="share_deadline"]').datetimepicker({
     
    100106      minDate: new Date()
    101107  });
    102  
    103  
     108
     109
    104110  // 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}
    107113    inline:true
    108114  });
    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);
    115120{/if}
    116121
    117122{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}
    121125    inline:true
    122126  });
    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
     136jQuery('#edit_form_show').click(function() {
     137  jQuery('#edit_form_show').hide();
     138  jQuery('.additional_info').hide();
     139  jQuery('#edit_form').show();
    138140});
    139 jQuery("#edit_form_hide").click(function() {
    140   jQuery("#edit_form_show").show();
    141   jQuery(".additional_info").show();
    142   jQuery("#edit_form").hide();
     141jQuery('#edit_form_hide').click(function() {
     142  jQuery('#edit_form_show').show();
     143  jQuery('.additional_info').show();
     144  jQuery('#edit_form').hide();
    143145});
    144 {/literal}
    145146{/footer_script}
    146147
    147148
    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 
    164149{if isset($collection)}
    165150
    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>
    173152
    174153{* <!-- edit collection -->*}
    175154<form action="{$F_ACTION}" method="post" id="edit_form" style="display:none;">
    176155<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>
    180159  <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>
    183162  <p><textarea name="comment" id="comment" style="width:400px;height:100px;">{$collection.COMMENT}</textarea></p>
    184163
    185164  <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>
    188167  </p>
    189168</fieldset>
     
    195174  <form id="share_form" class="uc_form" action="{$F_ACTION}" method="post">
    196175    {include file='infos_errors.tpl' errors=$share.errors infos=$share.infos}
    197    
     176
    198177    <table>
    199178      <tr>
     
    201180          <span class="url-base">{$U_SHARE}</span><span class="url-more url-normal"></span>
    202181          <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>
    206185        </td>
    207186      </tr>
    208187      <tr>
    209188        <td class="title"><label>
    210           {'Password'|@translate}
     189          {'Password'|translate}
    211190          <input type="checkbox" name="use_share_password" data-for="share_password" class="share-option">
    212191        </label></td>
    213192        <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}">
    215194        </td>
    216195      </tr>
    217196      <tr>
    218197        <td class="title"><label>
    219           {'Expiration date'|@translate}
     198          {'Expiration date'|translate}
    220199          <input type="checkbox" name="use_share_deadline" data-for="share_deadline" class="share-option">
    221200        </label></td>
    222201        <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}">
    224203        </td>
    225204      </tr>
     
    227206        <td class="title">&nbsp;</td>
    228207        <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>
    231210          <input type="hidden" name="key" value="{$UC_TKEY}">
    232211        </td>
    233212      </tr>
    234213    </table>
    235    
     214
    236215  {if not empty($collection.SHARES)}
    237216    <table class="shares_list">
    238217      <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>
    243222        <th></th>
    244223      </tr>
     
    247226        <td><a href="{$share.url}">{$share.share_key}</a></td>
    248227        <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}');">
    252231          <img src="{$ROOT_URL}{$USER_COLLEC_PATH}template/resources/delete.png" width=16 height=16></a>
    253232        </td>
     
    268247    <table>
    269248      <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>
    271250        <td>
    272251          <input type="text" name="sender_name" id="sender_name" size="40" value="{$contact.sender_name}">
     
    274253      </tr>
    275254      <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>
    277256        <td>
    278257          <input type="text" name="sender_email" id="sender_email" size="40" value="{$contact.sender_email}">
     
    280259      </tr>
    281260      <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>
    283262        <td>
    284263          <input type="text" name="recipient_name" id="recipient_name" size="40" value="{$contact.recipient_name}">
     
    286265      </tr>
    287266      <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>
    289268        <td>
    290269          <input type="text" name="recipient_email" id="recipient_email" size="40" value="{$contact.recipient_email}">
     
    292271      </tr>
    293272      <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>
    295274        <td>
    296275          <select name="nb_images">
     
    302281      </tr>
    303282      <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>
    305284        <td><textarea name="message" id="message" rows="6" style="width:350px;">{$contact.message}</textarea></td>
    306285      </tr>
     
    308287        <td class="title">&nbsp;</td>
    309288        <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>
    312291          <input type="hidden" name="key" value="{$UC_TKEY}">
    313292        </td>
     
    318297{/if}
    319298
    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.