Ignore:
Timestamp:
Jul 13, 2012, 12:09:19 PM (12 years ago)
Author:
mistic100
Message:

-rework the main menu
-bug when a collection is create through AJAX
-add "Remove from collection" on colorbox
-minor interfaces changes

Location:
extensions/UserCollections/template
Files:
6 edited

Legend:

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

    r16658 r16688  
    2323  delay: 0,
    2424  defaultPosition: 'right'
     25});
     26
     27jQuery("#actions input").click(function() {ldelim}
     28  if (confirm("{'Are you sure?'|@translate}")) {ldelim}
     29    document.location.href = jQuery(this).data("href");
     30  }
     31  return false;
    2532});
    2633{if $collection.PUBLIC}bindZclip();{/if}
     
    4956
    5057
    51 {if $collection and not $collection.IS_TEMP}
     58{if $collection}
    5259<form action="{$F_ACTION}" method="post">
    5360<fieldset id="colProperties">
     
    6875</fieldset>
    6976</form>
    70 {/if}
    7177
    7278
    73 {if !empty($THUMBNAILS)}
     79{if $collection.NB_IMAGES > 0}
    7480<ul class="thumbnails" id="thumbnails">
    7581{$THUMBNAILS}
     
    8288
    8389
    84 <p style="text-align:center;font-weight:bold;margin:20px;"><a href="{$U_LIST}" rel="nofollow">{'Return to collections list'|@translate}</a></p>
     90<form id="actions" style="text-align:center;">
     91<input type="submit" data-href="{$collection.U_CLEAR}" value="{'Clear collection'|@translate}">
     92<input type="submit" data-href="{$collection.U_DELETE}" value="{'Delete'|@translate}">
     93</form>
     94{/if}
     95
    8596
    8697</div>{* <!-- content --> *}
  • extensions/UserCollections/template/list.tpl

    r16658 r16688  
    5656        | <a href="{$col.U_SAVE}" class="save_col" rel="nofollow">{'save'|@translate}</a>
    5757        {if $col.U_DOWNLOAD}| <a href="{$col.U_DOWNLOAD}" rel="nofollow">{'download'|@translate}</a>{/if}
    58         | <a href="{$col.U_DELETE}" onClick="return confirm('{'Are you sure?'|@translate}');" rel="nofollow">{'delete'|@translate}</a>
     58        | <a href="{$col.U_DELETE}" onClick="return confirm('{'Are you sure?'|@translate}');" rel="nofollow">{'Delete'|@translate}</a>
    5959        {if not $col.active}| <a href="{$col.U_ACTIVE}" rel="nofollow">{'set active'|@translate}</a>{/if}
    6060      </p>
     
    8383        <a href="{$col.U_EDIT}" rel="nofollow">{'Edit'|@translate}</a>
    8484        {if $col.U_DOWNLOAD}| <a href="{$col.U_DOWNLOAD}" rel="nofollow">{'download'|@translate}</a>{/if}
    85         | <a href="{$col.U_DELETE}" onClick="return confirm('{'Are you sure?'|@translate}');" rel="nofollow">{'delete'|@translate}</a>
     85        | <a href="{$col.U_DELETE}" onClick="return confirm('{'Are you sure?'|@translate}');" rel="nofollow">{'Delete'|@translate}</a>
    8686        {if not $col.active}| <a href="{$col.U_ACTIVE}" rel="nofollow">{'set active'|@translate}</a>{/if}
    8787      </p>
  • extensions/UserCollections/template/menublock_user_collec.tpl

    r16625 r16688  
    11<dt>{$block->get_title()}</dt>
    22<dd>
    3 {if $block->data.current}
    4   {assign var="nb_images" value='<span class="nbImagesCollec">'|@cat:$block->data.current.NB_IMAGES|@cat:'</span>'}
    5   <p>{'Current collection:'|@translate} <b>{$block->data.current.NAME}</b>, {'%d photos'|@translate|replace:'%d':'%s'|sprintf:$nb_images}</p>
    6         <ul>{strip}
    7                 {foreach from=$block->data.links item=link}
    8                 <li><a href="{$link.URL}" title="{$link.TITLE}" rel="nofollow">{$link.NAME}</a></li>
     3  <p><a href="{$block->data.U_LIST}">{'You have %d collections'|@translate|sprintf:$block->data.NB_COL}</a></p>
     4  {if $block->data.collections}
     5  <ul>{strip}
     6                {foreach from=$block->data.collections item=col}
     7                <li>{if $col.active}
     8      <a href="{$col.U_EDIT}" style="font-weight:bold;" rel="nofollow">{$col.name}</a> <i class="menuInfoCat">({'active'|@translate})</i> <span class="menuInfoCat">[<span class="nbImagesCollec">{$col.nb_images}</span>]</span>
     9    {else}
     10      <a href="{$col.U_EDIT}" rel="nofollow">{$col.name}</a> <span class="menuInfoCat">[{$col.nb_images}]</span>
     11    {/if}</li>
    912                {/foreach}
     13    {if $block->data.MORE}<li class="menuInfoCat">{'%d more...'|@translate|sprintf:$block->data.MORE}</li>{/if}
    1014        {/strip}</ul>
    11 {/if}
    12   <p><a href="{$block->data.U_LIST}" rel="nofollow">{'See all my collections'|@translate}</a></p>
     15  {/if}
     16  <p><a href="{$block->data.U_CREATE}" rel="nofollow">{'Create a new collection'|@translate}</a></p>
    1317</dd>
  • extensions/UserCollections/template/thumbnails.tpl

    r16658 r16688  
    55  rel: ".preview-box",
    66  title: function() {ldelim}
    7     return $(this).attr("title") +' · <a href="'+ $(this).data('url') +'" target="_blank">{'jump to photo'|@translate} →</a>';
     7    var title = $(this).attr("title");
     8    {if $F_ACTION} title+= ' · <a href="{$collection_toggle_url}&amp;collection_toggle='+ $(this).data('id') +'" class="addCollection" data-id="'+ $(this).data('id') +'">{'Remove from collection'|@translate}</a>';{/if}
     9    title+= ' · <a href="'+ $(this).data('url') +'" target="_blank">{'jump to photo'|@translate} →</a>';
     10    return  title;
    811  }
     12});
     13jQuery(document).on("click", "#cboxTitle .addCollection", function() {ldelim}
     14  jQuery.colorbox.close();
     15  jQuery("#thumbnails a.addCollection[data-id='"+ $(this).data('id')+"']").trigger("click");
     16  return false;
    917});
    1018{/footer_script}
     
    4250        <span class="wrap1">
    4351                <span class="wrap2">
    44                 <a href="{$thumbnail.FILE_SRC}" class="preview-box" title="{$thumbnail.NAME}" data-url="{$thumbnail.URL}">
     52                <a href="{$thumbnail.FILE_SRC}" class="preview-box" title="{$thumbnail.NAME}" data-url="{$thumbnail.URL}" data-id="{$thumbnail.id}">
    4553                        <img class="thumbnail" {if $derivative->is_cached()}src="{$derivative->get_url()}"{else}src="{$ROOT_URL}{$themeconf.img_dir}/ajax-loader-small.gif" data-src="{$derivative->get_url()}"{/if} alt="{$thumbnail.TN_ALT}" title="{$thumbnail.TN_TITLE}">
    4654                </a>
  • extensions/UserCollections/template/thumbnails_css_js.tpl

    r16658 r16688  
    11{html_style}
    22.thumbnails .wrap1 {ldelim} position:relative !important; }
    3 .addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:10px;z-index:100;color:#eee;white-space:nowrap; }
     3.wrap1 .addCollection {ldelim} width:100%;height:16px;display:none;position:absolute;top:0;background:rgba(0,0,0,0.8);padding:2px;border-radius:2px;font-size:10px;z-index:100;color:#eee;white-space:nowrap; }
    44.wrap1:hover .addCollection {ldelim} display:block; }
    55{/html_style}
  • extensions/UserCollections/template/view.tpl

    r16658 r16688  
    3232
    3333
    34 {if $U_LIST}<p style="text-align:center;font-weight:bold;margin:20px;"><a href="{$U_LIST}" rel="nofollow">{'Return to collections list'|@translate}</a></p>{/if}
    35 
    3634</div>{* <!-- content --> *}
Note: See TracChangeset for help on using the changeset viewer.