source: trunk/admin/themes/default/template/batch_manager_unit.tpl @ 13079

Revision 11212, 5.4 KB checked in by patdenice, 9 years ago (diff)

merge r11211 from branch 2.2 to trunk
bug:2321
Tag names must be escaped in tag input.

  • Property svn:eol-style set to LF
Line 
1{include file='include/autosize.inc.tpl'}
2{include file='include/datepicker.inc.tpl'}
3{include file='include/colorbox.inc.tpl'}
4
5{combine_script id='jquery.tokeninput' load='async' require='jquery' path='themes/default/js/plugins/jquery.tokeninput.js'}
6{footer_script require='jquery.tokeninput'}
7var tag_boxes_selector = "";
8{foreach from=$elements item=element name=element}
9{if $smarty.foreach.element.first}
10var prefix = "";
11{else}
12prefix = ", ";
13{/if}
14        tag_boxes_selector = tag_boxes_selector + prefix + "#tags-" + {$element.ID};
15{/foreach}
16
17jQuery(document).ready(function() {ldelim}
18  jQuery(tag_boxes_selector).tokenInput(
19    [{foreach from=$tags item=tag name=tags}{ldelim}"name":"{$tag.name|@escape:'javascript'}","id":"{$tag.id}"{rdelim}{if !$smarty.foreach.tags.last},{/if}{/foreach}],
20    {ldelim}
21      hintText: '{'Type in a search term'|@translate}',
22      noResultsText: '{'No results'|@translate}',
23      searchingText: '{'Searching...'|@translate}',
24      newText: ' ({'new'|@translate})',
25      animateDropdown: false,
26      preventDuplicates: true,
27      allowCreation: true
28    }
29  );
30
31  jQuery("a.preview-box").colorbox();
32});
33{/footer_script}
34
35<h2>{'Batch Manager'|@translate}</h2>
36
37<form action="{$F_ACTION}" method="POST">
38<fieldset>
39  <legend>{'Display options'|@translate}</legend>
40  <p>{'photos per page'|@translate} :
41      <a href="{$U_ELEMENTS_PAGE}&amp;display=5">5</a>
42    | <a href="{$U_ELEMENTS_PAGE}&amp;display=10">10</a>
43    | <a href="{$U_ELEMENTS_PAGE}&amp;display=50">50</a>
44    | <a href="{$U_ELEMENTS_PAGE}&amp;display=all">{'all'|@translate}</a>
45  </p>
46
47</fieldset>
48
49{if !empty($navbar) }{include file='navigation_bar.tpl'|@get_extent:'navbar'}{/if}
50
51{if !empty($elements) }
52<div><input type="hidden" name="element_ids" value="{$ELEMENT_IDS}"></div>
53{foreach from=$elements item=element}
54<fieldset class="elementEdit">
55  <legend>{$element.LEGEND}</legend>
56
57  <span class="thumb">
58    <a href="{$element.FILE_SRC}" class="preview-box" title="{$element.LEGEND}"><img src="{$element.TN_SRC}" alt=""></a>
59    <br/>
60    <a href="{$element.U_EDIT}">{'Informations'|@translate}</a>
61  </span>
62
63  <table>
64
65    <tr>
66      <td><strong>{'Name'|@translate}</strong></td>
67      <td><input type="text" class="large" name="name-{$element.ID}" value="{$element.NAME}"></td>
68    </tr>
69
70    <tr>
71      <td><strong>{'Author'|@translate}</strong></td>
72      <td><input type="text" class="large" name="author-{$element.ID}" value="{$element.AUTHOR}"></td>
73    </tr>
74
75    <tr>
76      <td><strong>{'Creation date'|@translate}</strong></td>
77      <td>
78        <label><input type="radio" name="date_creation_action-{$element.ID}" value="unset"> {'unset'|@translate}</label>
79        <label><input type="radio" name="date_creation_action-{$element.ID}" value="set" id="date_creation_action_set-{$element.ID}"> {'set to'|@translate}</label>
80
81        <select id="date_creation_day-{$element.ID}" name="date_creation_day-{$element.ID}">
82                <option value="0">--</option>
83           {section name=day start=1 loop=32}
84             <option value="{$smarty.section.day.index}" {if $smarty.section.day.index==$element.DATE_CREATION_DAY}selected="selected"{/if}>{$smarty.section.day.index}</option>
85           {/section}
86        </select>
87        <select id="date_creation_month-{$element.ID}" name="date_creation_month-{$element.ID}">
88          {html_options options=$month_list selected=$element.DATE_CREATION_MONTH}
89        </select>
90        <input id="date_creation_year-{$element.ID}"
91               name="date_creation_year-{$element.ID}"
92               type="text"
93               size="4"
94               maxlength="4"
95               value="{$element.DATE_CREATION_YEAR}">
96        <input id="date_creation_linked_date-{$element.ID}" name="date_creation_linked_date-{$element.ID}" type="hidden" size="10" disabled="disabled">
97        {footer_script}
98          pwg_initialization_datepicker("#date_creation_day-{$element.ID}", "#date_creation_month-{$element.ID}", "#date_creation_year-{$element.ID}", "#date_creation_linked_date-{$element.ID}", "#date_creation_action_set-{$element.ID}");
99        {/footer_script}
100      </td>
101    </tr>
102    <tr>
103      <td><strong>{'Who can see this photo?'|@translate}</strong></td>
104      <td>
105        <select name="level-{$element.ID}">
106          {html_options options=$level_options selected=$element.LEVEL}
107        </select>
108      </td>
109    </tr>
110
111    <tr>
112      <td><strong>{'Tags'|@translate}</strong></td>
113      <td>
114
115<select id="tags-{$element.ID}" name="tags-{$element.ID}">
116{foreach from=$element.TAGS item=tag}
117  <option value="{$tag.id}" class="selected">{$tag.name}</option>
118{/foreach}
119</select>
120
121      </td>
122    </tr>
123
124    <tr>
125      <td><strong>{'Description'|@translate}</strong></td>
126      <td><textarea cols="50" rows="5" name="description-{$element.ID}" id="description-{$element.ID}" class="description">{$element.DESCRIPTION}</textarea></td>
127    </tr>
128
129  </table>
130
131</fieldset>
132{/foreach}
133
134<p>
135  <input class="submit" type="submit" value="{'Submit'|@translate}" name="submit">
136  <input class="submit" type="reset" value="{'Reset'|@translate}">
137</p>
138{/if}
139
140</form>
141
142<script type="text/javascript">// <![CDATA[
143{literal}$(document).ready(function() {
144        $(".elementEdit img").fadeTo("slow", 0.6); // Opacity on page load
145        $(".elementEdit img").hover(function(){
146                $(this).fadeTo("slow", 1.0); // Opacity on hover
147        },function(){
148                $(this).fadeTo("slow", 0.6); // Opacity on mouseout
149        });
150});{/literal}
151// ]]>
152</script>
Note: See TracBrowser for help on using the repository browser.