[5366] | 1 | {include file='include/tag_selection.inc.tpl'} |
---|
| 2 | |
---|
[12032] | 3 | {footer_script}{literal} |
---|
| 4 | jQuery(document).ready(function(){ |
---|
| 5 | function displayDeletionWarnings() { |
---|
| 6 | jQuery(".warningDeletion").show(); |
---|
| 7 | jQuery("input[name=destination_tag]:checked").parent("label").children(".warningDeletion").hide(); |
---|
| 8 | } |
---|
| 9 | |
---|
| 10 | displayDeletionWarnings(); |
---|
| 11 | |
---|
| 12 | jQuery("#mergeTags label").click(function() { |
---|
| 13 | displayDeletionWarnings(); |
---|
| 14 | }); |
---|
| 15 | |
---|
| 16 | jQuery("input[name=merge]").click(function() { |
---|
| 17 | if (jQuery("ul.tagSelection input[type=checkbox]:checked").length < 2) { |
---|
| 18 | alert("{/literal}{'Select at least two tags for merging'|@translate}{literal}"); |
---|
| 19 | return false; |
---|
| 20 | } |
---|
| 21 | }); |
---|
| 22 | }); |
---|
| 23 | {/literal}{/footer_script} |
---|
| 24 | |
---|
| 25 | |
---|
[2531] | 26 | <div class="titrePage"> |
---|
| 27 | <h2>{'Manage tags'|@translate}</h2> |
---|
| 28 | </div> |
---|
| 29 | |
---|
| 30 | <form action="{$F_ACTION}" method="post"> |
---|
| 31 | {if isset($EDIT_TAGS_LIST)} |
---|
| 32 | <fieldset> |
---|
| 33 | <legend>{'Edit tags'|@translate}</legend> |
---|
[3185] | 34 | <input type="hidden" name="edit_list" value="{$EDIT_TAGS_LIST}"> |
---|
[2531] | 35 | <table class="table2"> |
---|
| 36 | <tr class="throw"> |
---|
| 37 | <th>{'Current name'|@translate}</th> |
---|
| 38 | <th>{'New name'|@translate}</th> |
---|
| 39 | </tr> |
---|
| 40 | {foreach from=$tags item=tag} |
---|
| 41 | <tr> |
---|
| 42 | <td>{$tag.NAME}</td> |
---|
[17765] | 43 | <td><input type="text" name="tag_name-{$tag.ID}" value="{$tag.NAME}" size="50"></td> |
---|
[2531] | 44 | </tr> |
---|
| 45 | {/foreach} |
---|
| 46 | </table> |
---|
| 47 | |
---|
| 48 | <p> |
---|
[5931] | 49 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
[8128] | 50 | <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"> |
---|
[3185] | 51 | <input class="submit" type="reset" value="{'Reset'|@translate}"> |
---|
[2531] | 52 | </p> |
---|
| 53 | </fieldset> |
---|
| 54 | {/if} |
---|
[16526] | 55 | {if isset($DUPLIC_TAGS_LIST)} |
---|
| 56 | <fieldset> |
---|
| 57 | <legend>{'Edit tags'|@translate}</legend> |
---|
| 58 | <input type="hidden" name="edit_list" value="{$DUPLIC_TAGS_LIST}"> |
---|
| 59 | <table class="table2"> |
---|
| 60 | <tr class="throw"> |
---|
| 61 | <th>{'Source tag'|@translate}</th> |
---|
| 62 | <th>{'Name of the duplicate'|@translate}</th> |
---|
| 63 | </tr> |
---|
| 64 | {foreach from=$tags item=tag} |
---|
| 65 | <tr> |
---|
| 66 | <td>{$tag.NAME}</td> |
---|
[17765] | 67 | <td><input type="text" name="tag_name-{$tag.ID}" value="{$tag.NAME}" size="50"></td> |
---|
[16526] | 68 | </tr> |
---|
| 69 | {/foreach} |
---|
| 70 | </table> |
---|
[2531] | 71 | |
---|
[16526] | 72 | <p> |
---|
| 73 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 74 | <input class="submit" type="submit" name="duplic_submit" value="{'Submit'|@translate}"> |
---|
| 75 | <input class="submit" type="reset" value="{'Reset'|@translate}"> |
---|
| 76 | </p> |
---|
| 77 | </fieldset> |
---|
| 78 | {/if} |
---|
| 79 | |
---|
[12032] | 80 | {if isset($MERGE_TAGS_LIST)} |
---|
| 81 | <input type="hidden" name="merge_list" value="{$MERGE_TAGS_LIST}"> |
---|
| 82 | |
---|
| 83 | <fieldset id="mergeTags"> |
---|
| 84 | <legend>{'Merge tags'|@translate}</legend> |
---|
| 85 | {'Select the destination tag'|@translate}<br><br> |
---|
| 86 | {foreach from=$tags item=tag name=tagloop} |
---|
| 87 | <label><input type="radio" name="destination_tag" value="{$tag.ID}"{if $smarty.foreach.tagloop.index == 0} checked="checked"{/if}> {$tag.NAME}<span class="warningDeletion"> {'(this tag will be deleted)'|@translate}</span></label><br> |
---|
| 88 | {/foreach} |
---|
| 89 | <br><input type="submit" name="confirm_merge" value="{'Confirm merge'|@translate}"> |
---|
| 90 | </fieldset> |
---|
| 91 | {/if} |
---|
| 92 | |
---|
[2531] | 93 | <fieldset> |
---|
| 94 | <legend>{'Add a tag'|@translate}</legend> |
---|
| 95 | |
---|
| 96 | <label> |
---|
| 97 | {'New tag'|@translate} |
---|
[17765] | 98 | <input type="text" name="add_tag" size="50"> |
---|
[2531] | 99 | </label> |
---|
[22592] | 100 | |
---|
[8128] | 101 | <p><input class="submit" type="submit" name="add" value="{'Submit'|@translate}"></p> |
---|
[2531] | 102 | </fieldset> |
---|
| 103 | |
---|
| 104 | <fieldset> |
---|
| 105 | <legend>{'Tag selection'|@translate}</legend> |
---|
[17765] | 106 | {html_style} |
---|
[23426] | 107 | .showInfo{ldelim}text-indent:5px} |
---|
[17765] | 108 | {/html_style} |
---|
| 109 | {footer_script}{literal} |
---|
| 110 | jQuery('.showInfo').tipTip({ |
---|
| 111 | 'delay' : 0, |
---|
| 112 | 'fadeIn' : 200, |
---|
| 113 | 'fadeOut' : 200, |
---|
| 114 | 'maxWidth':'300px', |
---|
| 115 | 'keepAlive':true, |
---|
| 116 | 'activation':'click' |
---|
| 117 | }); |
---|
| 118 | {/literal}{/footer_script} |
---|
[22592] | 119 | {if count($all_tags)} |
---|
[23029] | 120 | <div><label><span class="icon-filter" style="visibility:hidden" id="filterIcon"></span>{'Search'|@translate}: <input id="searchInput" type="text" size="12"></label></div> |
---|
[22592] | 121 | {footer_script}{literal} |
---|
| 122 | $("#searchInput").on( "keydown", function() { |
---|
| 123 | var $this = $(this), |
---|
| 124 | timer = $this.data("timer"); |
---|
| 125 | if (timer) |
---|
| 126 | clearTimeout(timer); |
---|
| 127 | |
---|
| 128 | $this.data("timer", setTimeout( function() { |
---|
| 129 | var val = $this.val(); |
---|
[23029] | 130 | if (!val) { |
---|
[22592] | 131 | $(".tagSelection>li").show(); |
---|
[23029] | 132 | $("#filterIcon").css("visibility","hidden"); |
---|
| 133 | } |
---|
[22592] | 134 | else { |
---|
[23029] | 135 | $("#filterIcon").css("visibility","visible"); |
---|
[22592] | 136 | var regex = new RegExp( val.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g, "\\$&"), "i" ); |
---|
| 137 | $(".tagSelection>li").each( function(i, li) { |
---|
| 138 | var $li = $(li), |
---|
| 139 | text = $.trim( $("label", $li).text() ); |
---|
| 140 | if (regex.test( text )) |
---|
| 141 | $li.show(); |
---|
| 142 | else |
---|
| 143 | $li.hide(); |
---|
| 144 | }); |
---|
| 145 | } |
---|
| 146 | |
---|
| 147 | }, 300) ); |
---|
| 148 | }); |
---|
| 149 | {/literal}{/footer_script} |
---|
| 150 | {/if} |
---|
[17765] | 151 | <ul class="tagSelection"> |
---|
| 152 | {foreach from=$all_tags item=tag} |
---|
[18080] | 153 | <li>{capture name='showInfo'}<b>{$tag.name}</b> ({$pwg->l10n_dec('%d photo', '%d photos', $tag.counter)}) <br> <a href="{$tag.U_VIEW}">{'View in gallery'|@translate}</a> | <a href="{$tag.U_EDIT}">{'Manage photos'|@translate}</a>{if !empty($tag.alt_names)}<br>{$tag.alt_names}{/if}{/capture} |
---|
[23426] | 154 | <a class="icon-info-circled-1 showInfo" title="{$smarty.capture.showInfo|@htmlspecialchars}"></a> |
---|
[17765] | 155 | <label> |
---|
| 156 | <input type="checkbox" name="tags[]" value="{$tag.id}"> {$tag.name} |
---|
| 157 | </label> |
---|
| 158 | </li> |
---|
| 159 | {/foreach} |
---|
| 160 | </ul> |
---|
[2531] | 161 | |
---|
[22592] | 162 | <p> |
---|
| 163 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
| 164 | <input type="submit" name="edit" value="{'Edit selected tags'|@translate}"> |
---|
| 165 | <input type="submit" name="duplicate" value="{'Duplicate selected tags'|@translate}"> |
---|
| 166 | <input type="submit" name="merge" value="{'Merge selected tags'|@translate}"> |
---|
| 167 | <input type="submit" name="delete" value="{'Delete selected tags'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> |
---|
| 168 | </p> |
---|
[2531] | 169 | </fieldset> |
---|
| 170 | |
---|
| 171 | </form> |
---|