source: extensions/ContestResults/admin/template/new.tpl @ 9975

Last change on this file since 9975 was 9975, checked in by mistic100, 13 years ago
  • many corrections
File size: 6.5 KB
Line 
1{combine_script id='jquery.ui.sortable'}
2{combine_script id='jquery.cluetip' require='jquery' path='themes/default/js/plugins/jquery.cluetip.js'}
3
4{combine_css path=$CR_PATH|@cat:'admin/template/style.css'}
5{include file='include/autosize.inc.tpl'}
6{include file='include/datepicker.inc.tpl'}
7
8{footer_script require='jquery'}
9        // AJOUTE UN CHAMP DE RESULTAT
10        function CreateDescField(j, new_desc){ldelim}
11                // Si il n'y a aucun résultats on efface le message
12                if(new_desc) jQuery('#categoryUl').html('');
13               
14                // Ajoute à la fin de la liste une nouvelle ligne de résultat vide
15                jQuery('<li id="desc_'+ j +'" class="categoryLi virtual_cat"></li>').appendTo('#categoryUl');
16               
17                // Contenu de la ligne
18                jQuery('#desc_'+ j).html('<ul class="categoryActions"> '+
19                                '<li> '+
20                                        '<a href="#" title="{'CR_delete_desc'|@translate}" onclick="jQuery(\'#desc_'+ j +'\').remove();return false;"> '+
21                                                '<img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/> '+
22                                        '</a> '+
23                                '</li> '+
24                        '</ul> '+
25                        '<p> '+
26                                '<img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}"> '+
27                                '<input type="text" size="65" name="description['+ j +'][name]" value=""/> '+
28                                '<textarea class="result_comment" name="description['+ j +'][content]"></textarea> '+
29                        '</p> '+
30                        '<p class="catPos">{'CR_rank'|@translate} : <input type="text" name="description['+ j +'][rank]" value=""/></p>');
31               
32                // Remplace le lien de création
33                jQuery('#AddLink').html('<input class="submit" type="reset" onclick="CreateDescField('+ (j+1) +');return false;" value="{'CR_addfield'|@translate}"/>');
34               
35                // Réinitiliase les fonctions jQuery
36                jQuery('.catPos').hide();
37                jQuery('.drag_button').show();
38                jQuery('.categoryLi').css('cursor', 'move');
39                jQuery('textarea').autogrow();
40                jQuery('textarea').css('overflow-y', 'hidden');
41        }
42
43{literal}
44        jQuery().ready(function(){
45                //  Drag-and-Drop
46                jQuery('.catPos').hide();
47                jQuery('.drag_button').show();
48                jQuery('.categoryLi').css('cursor', 'move');
49                jQuery('.categoryUl').sortable({
50                        axis: 'y',
51                        opacity: 0.8
52                });
53                jQuery('#categoryOrdering').submit(function(){
54                        ar = jQuery('.categoryUl').sortable('toArray');
55                        for(i=0; i<ar.length; i++) {
56                                cat = ar[i].split('desc_');
57                                document.getElementsByName('description[' + cat[1] + '][rank]')[0].value = i+1;
58                        }
59                });
60                // Cluetip
61                jQuery('.cluetip').cluetip({
62                        width: 550,
63                        splitTitle: '|'
64                });
65        });
66
67        $(function() {
68                $('#DateBegin').datepicker({dateFormat:'yy-mm-dd', firstDay:1});
69                $('#DateEnd').datepicker({dateFormat:'yy-mm-dd', firstDay:1});
70        });
71{/literal}
72{/footer_script}
73
74{html_head}
75<style type="text/css">
76        .cluetip:after {ldelim}
77                content:url('{$themeconf.admin_icon_dir}/help.png');
78        }
79</style>
80{/html_head}
81
82<h2 class="version_title">{$CR_VERSION}</h2>
83
84<div class="titrePage">
85        <h2>
86        {if isset($ID)}
87                {'CR_edit_tab'|@translate|cat:' : '|cat:$NAME}
88        {else}
89                {'CR_new_tab'|@translate}
90        {/if}
91        </h2>
92</div>
93
94<form method="post" action="" class="properties" id="categoryOrdering">
95        <fieldset>
96                <legend>{'Configuration'|@translate}</legend>
97               
98                <table>
99                        <tr>
100                                <td><span class="title cluetip" title="{'CR_title'|@translate}|{'CR_help_title'|@translate}">{'CR_title'|@translate}</span></td>
101                                <td colspan="3"><input type="text" size="65" maxlength="255" name="name" value="{$NAME}"/></td>
102                        </tr>
103                       
104                        <tr><td colspan="4"><br/></td></tr>
105                       
106                        <tr>
107                                <td><span class="title cluetip" title="{'CR_visible'|@translate}|{'CR_help_visible'|@translate}">{'CR_visible'|@translate}</span></td>
108                                <td>
109                                        <label><input type="radio" name="visible" value="1" {if $VISIBLE == 1}checked="checked"{/if}> {'Yes'|@translate}</label>
110                                        <label><input type="radio" name="visible" value="0" {if $VISIBLE == 0}checked="checked"{/if}> {'No'|@translate}</label>
111                                </td>
112                                <td colspan="2"></td>
113                        </tr>
114                        <tr>
115                                <td><span class="title">{'CR_dateB'|@translate}</span></td>
116                                <td><input type="text" maxlength="10" value="{$DATE_BEGIN}" id="DateBegin" class="inputdate" name="date_begin"/></td>
117                                <td><span class="title">{'CR_dateE'|@translate}</span></td>
118                                <td><input type="text" maxlength="10" value="{$DATE_END}" id="DateEnd" class="inputdate" name="date_end"/></td>
119                        </tr>
120
121                        <tr><td colspan="4"><br/></td></tr>
122                       
123                        <tr>
124                                <td><span class="title">{'CR_logo'|@translate}</span></td>
125                                <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$LOGO}" name="logo"/></td>
126                        </tr>
127                        <tr>
128                                <td><span class="title">{'CR_banner'|@translate}</span></td>
129                                <td colspan="3"><input type="text" style="width:100%;" maxlength="255" value="{$BANNER}" name="banner"/></td>
130                        </tr>
131                       
132                        <tr><td colspan="4"><br/></td></tr>
133                       
134                        <tr>
135                                <td><span class="title cluetip" title="{'CR_summary'|@translate}|{'CR_help_summary'|@translate}">{'CR_summary'|@translate}</span></td>
136                                <td colspan="3"><textarea name="summary" rows="4" style="width:100%;">{$SUMMARY}</textarea></td>
137                        </tr>
138                </table>
139        </fieldset>
140       
141        <fieldset>
142                <legend><span class="title cluetip" title="{'CR_textareas'|@translate}|{'CR_help_textareas'|@translate}">{'CR_textareas'|@translate}</span></legend>
143               
144                <ul class="categoryUl" id="categoryUl">
145                {counter start=0 assign=i}
146                {if isset($description)}
147                        {foreach from=$description item=desc}
148                                <li class="categoryLi" id="desc_{$i}">
149                                        <ul class="categoryActions">
150                                                <li>
151                                                        <a href="#" title="{'CR_delete_desc'|@translate}" onclick="jQuery('#desc_{$i}').remove();return false;">
152                                                                <img src="{$themeconf.admin_icon_dir}/category_delete.png" class="button" alt="{'CR_delete_result'|@translate}"/>
153                                                        </a>
154                                                </li>
155                                        </ul>
156                                       
157                                        <p>
158                                                <img src="{$themeconf.admin_icon_dir}/cat_move.png" class="button drag_button" style="display:none;" title="{'Drag to re-order'|@translate}">
159                                                <input type="text" size="65" name="description[{$i}][name]" value="{$desc.NAME}"/>
160                                                <textarea class="result_comment" name="description[{$i}][content]">{$desc.CONTENT}</textarea>
161                                        </p>
162                                        <p class="catPos">{'CR_rank'|@translate} : <input type="text" name="description[{$i}][rank]" value="{$desc.RANK}"/></p>
163                                </li>
164                                {counter}
165                        {/foreach}
166                {else}
167                        {'CR_no_result'|@translate}
168                {/if}
169                </ul>
170               
171                <span id="AddLink"><input class="submit" type="reset" onclick="CreateDescField({$i}{if !isset($description)}, true{/if});return false;" value="{'CR_addfield'|@translate}"/></span>
172        </fieldset>
173
174        <p><input class="submit" type="submit" value="{'Submit'|@translate}" name="new_submit"/></p>
175</form>
Note: See TracBrowser for help on using the repository browser.