Ignore:
Timestamp:
Nov 23, 2013, 4:16:27 PM (10 years ago)
Author:
mistic100
Message:
  • add quick edit form for picture (todo: album)
  • add "Delete photo" button
File:
1 edited

Legend:

Unmodified
Added
Removed
  • extensions/AdminTools/template/public_controller.tpl

    r25629 r25654  
    22{combine_css path='admin/themes/default/fontello/css/fontello.css'}
    33{combine_css path=$ADMINTOOLS_PATH|cat:'template/fontello/css/fontello-ato.css'}
     4
     5{if isset($ato.QUICK_EDIT)}
     6  {*<!-- colorbox -->*}
     7  {combine_script id='jquery.colorbox' load='footer' require='jquery' path='themes/default/js/plugins/jquery.colorbox.min.js'}
     8  {combine_css id='colorbox' path='themes/default/js/plugins/colorbox/style2/colorbox.css'}
     9
     10  {*<!-- tokeninput -->*}
     11  {combine_script id='jquery.tokeninput' load='footer' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'}
     12  {combine_css path='themes/default/js/plugins/jquery.tokeninput.css'}
     13
     14  {*<!-- datepicker -->*}
     15  {combine_script id='jquery.ui.datepicker' load='footer' path='themes/default/js/ui/jquery.ui.datepicker.js'}
     16
     17  {assign var=datepicker_language value='themes/default/js/ui/i18n/jquery.ui.datepicker-'|cat:$lang_info.code|cat:'.js'}
     18  {if 'PHPWG_ROOT_PATH'|@constant|@cat:$datepicker_language|@file_exists}
     19  {combine_script id='jquery.ui.datepicker'|cat:$lang_info.code load='footer' path=$datepicker_language}
     20  {/if}
     21
     22  {combine_css path='themes/default/js/ui/theme/jquery.ui.core.css'}
     23  {combine_css path='themes/default/js/ui/theme/jquery.ui.theme.css'}
     24  {combine_css path='themes/default/js/ui/theme/jquery.ui.datepicker.css'}
     25{/if}
     26
    427
    528<div id="ato_header_closed"><a href="#" class="icon-tools"></a></div>
     
    2144    <li class="parent"><a href="#" class="icon-pencil">{'Edit'|translate}</a>
    2245      <ul>
    23         <li><a href="#" class="icon-ato-flash edit-quick">{'Quick edit'|translate}</a></li>
     46        <li><a href="#ato_quick_edit" class="icon-ato-flash edit-quick">{'Quick edit'|translate}</a></li>
    2447        <li><a class="icon-ato-doc-text-inv" href="{$ato.U_EDIT}">{'Properties page'|translate}</a></li>
    2548      </ul>
     
    3457  {if isset($ato.IS_CATEGORY)}
    3558    <li><a class="icon-plus-circled" href="{$ato.U_SITE_ADMIN}photos_add&amp;album={$ato.CATEGORY_ID}">{'Add Photos'|translate}</a></li>
     59  {/if}
     60  {if isset($ato.IS_PICTURE)}
     61    <li><a class="icon-ato-cancel" href="{$ato.U_SELF}delete&amp;pwg_token={$ato.PWG_TOKEN}" onclick="return confirm('{'Are you sure?'|translate|escape:javascript}')">{'delete photo'|translate|ucfirst}</a></li>
    3662  {/if}
    3763
     
    7096</div>
    7197
     98{if isset($ato.QUICK_EDIT)}
     99<div style="display:none;">
     100  <div id="ato_quick_edit">
     101    <form method="post" action="{$ato.U_SELF}">
     102      <fieldset class="left">
     103        <img src="{$current.derivatives.square->get_url()}" width="100" height="100">
     104        <br><input type="submit" value="{'Save'|translate}">
     105        <br><a href="#" class="icon-ato-cancel close-edit">{'Cancel'|translate}</a>
     106      </fieldset>
     107
     108      <fieldset class="main">
     109        <label for="quick_edit_name">{'Name'|translate}</label>
     110        <input type="text" name="name" id="quick_edit_name" value="{$ato.QUICK_EDIT.name|escape:html}">
     111
     112        <label for="quick_edit_author">{'Author'|translate}</label>
     113        <input type="text" name="author" id="quick_edit_author" value="{$ato.QUICK_EDIT.author|escape:html}">
     114
     115
     116        <label for="quick_edit_date_creation">{'Creation date'|translate}</label>
     117        <input type="text" name="date_creation" id="quick_edit_date_creation" class="datepicker" value="{$ato.QUICK_EDIT.date_creation}">
     118        <input type="hidden" name="date_creation_time" value="{$ato.QUICK_EDIT.date_creation_time}">
     119
     120        <label for="quick_edit_tags">{'Tags'|translate}</label>
     121        <select name="tags" id="quick_edit_tags" class="tags">
     122        {foreach from=$ato.QUICK_EDIT.tag_selection item=tag}
     123          <option value="{$tag.id}" class="selected">{$tag.name}</option>
     124        {/foreach}
     125        </select>
     126
     127        <label for="quick_edit_comment">{'Description'|translate}</label>
     128        <textarea name="comment" id="quick_edit_comment">{$ato.QUICK_EDIT.comment}</textarea>
     129
     130        <label for="quick_edit_level">{'Who can see this photo?'|@translate}</label>
     131        <select name="level" size="1">
     132          {html_options options=$available_permission_levels selected=$ato.QUICK_EDIT.level}
     133        </select>
     134      </fieldset>
     135
     136      <input type="hidden" name="action" value="quick_edit">
     137    </form>
     138  </div>
     139</div>
     140{/if}
     141
    72142{footer_script require='jquery'}
    73143(function($){
     
    111181  });
    112182
     183{*<!-- select boxes -->*}
    113184  $ato.find('.switcher').on({
    114185    'change': function() {
     
    120191  });
    121192
     193{*<!-- toggle toolbar -->*}
    122194  $ato.find('.close-panel').on('click', function(e) {
    123195    $ato.slideUp();
     
    128200    e.preventDefault();
    129201  });
    130  
     202
    131203  $ato_closed.on('click', function(e) {
    132204    $ato.slideDown();
     
    193265{/if}
    194266
     267{* <!-- quick edit -->*}
     268{if isset($ato.QUICK_EDIT)}
     269  var $ato_edit = $('#ato_quick_edit');
     270
     271  $ato_edit.css('background-color', $("#the_page #content").css('background-color'));
     272
     273  $ato_edit.find('.close-edit').on('click', function(e) {
     274    $.colorbox.close()
     275    e.preventDefault();
     276  });
     277
     278  $ato_edit.find('.datepicker').datepicker({
     279    dateFormat: 'yy-mm-dd'
     280  });
     281
     282  $ato_edit.find('.tags').tokenInput(
     283    [{foreach from=$ato.QUICK_EDIT.tags item=tag name=tags}{ldelim}"name":"{$tag.name|escape:javascript}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
     284    {
     285      hintText: '{'Type in a search term'|@translate}',
     286      noResultsText: '{'No results'|@translate}',
     287      searchingText: '{'Searching...'|@translate}',
     288      newText: ' ({'new'|@translate})',
     289      animateDropdown: false,
     290      preventDuplicates: true,
     291      allowFreeTagging: true
     292    }
     293  );
     294
     295  $(".edit-quick").colorbox({
     296    inline: true,
     297    transition: 'none',
     298    title: '{'Quick edit'|translate|escape:javascript}',
     299    width: 500,
     300    top: 50
     301  });
     302{/if}
     303
    195304}(jQuery));
    196305{/footer_script}
Note: See TracChangeset for help on using the changeset viewer.