1 | {include file='include/tag_selection.inc.tpl'} |
---|
2 | |
---|
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 | |
---|
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> |
---|
34 | <input type="hidden" name="edit_list" value="{$EDIT_TAGS_LIST}"> |
---|
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> |
---|
43 | <td><input type="text" name="tag_name-{$tag.ID}" value="{$tag.NAME}" size="30"></td> |
---|
44 | </tr> |
---|
45 | {/foreach} |
---|
46 | </table> |
---|
47 | |
---|
48 | <p> |
---|
49 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
50 | <input class="submit" type="submit" name="submit" value="{'Submit'|@translate}"> |
---|
51 | <input class="submit" type="reset" value="{'Reset'|@translate}"> |
---|
52 | </p> |
---|
53 | </fieldset> |
---|
54 | {/if} |
---|
55 | |
---|
56 | {if isset($MERGE_TAGS_LIST)} |
---|
57 | <input type="hidden" name="merge_list" value="{$MERGE_TAGS_LIST}"> |
---|
58 | |
---|
59 | <fieldset id="mergeTags"> |
---|
60 | <legend>{'Merge tags'|@translate}</legend> |
---|
61 | {'Select the destination tag'|@translate}<br><br> |
---|
62 | {foreach from=$tags item=tag name=tagloop} |
---|
63 | <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> |
---|
64 | {/foreach} |
---|
65 | <br><input type="submit" name="confirm_merge" value="{'Confirm merge'|@translate}"> |
---|
66 | </fieldset> |
---|
67 | {/if} |
---|
68 | |
---|
69 | <fieldset> |
---|
70 | <legend>{'Add a tag'|@translate}</legend> |
---|
71 | |
---|
72 | <label> |
---|
73 | {'New tag'|@translate} |
---|
74 | <input type="text" name="add_tag" size="30"> |
---|
75 | </label> |
---|
76 | |
---|
77 | <p><input class="submit" type="submit" name="add" value="{'Submit'|@translate}"></p> |
---|
78 | </fieldset> |
---|
79 | |
---|
80 | <fieldset> |
---|
81 | <legend>{'Tag selection'|@translate}</legend> |
---|
82 | |
---|
83 | {$TAG_SELECTION} |
---|
84 | |
---|
85 | <p> |
---|
86 | <input type="hidden" name="pwg_token" value="{$PWG_TOKEN}"> |
---|
87 | <input class="submit" type="submit" name="edit" value="{'Edit selected tags'|@translate}"> |
---|
88 | <input class="submit" type="submit" name="merge" value="{'Merge selected tags'|@translate}"> |
---|
89 | <input class="submit" type="submit" name="delete" value="{'Delete selected tags'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"> |
---|
90 | </p> |
---|
91 | </fieldset> |
---|
92 | |
---|
93 | </form> |
---|