Changeset 10987 for extensions/typetags/admin/typetags_admin.tpl
- Timestamp:
- May 22, 2011, 12:52:49 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/typetags/admin/typetags_admin.tpl
r9970 r10987 7 7 {footer_script} 8 8 {literal} 9 10 11 9 $(document).ready(function(){ 10 // colorpicker 11 $('#colorpicker').farbtastic('#hexval'); 12 12 13 14 15 16 17 18 19 20 21 22 23 24 13 // déplace chaque élément dans la bonne case 14 jQuery('ul#tt-NULL li').each(function() { 15 var $target = jQuery('ul#' + jQuery(this).attr('title')); 16 jQuery(this).appendTo($target).css('float', 'left'); 17 }); 18 19 // initialise les déplacement 20 jQuery("li").draggable({ 21 revert: "invalid", 22 helper: "clone", 23 cursor: "move" 24 }); 25 25 26 27 28 29 30 31 32 33 34 35 }); 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 26 // initialise le dépôt 27 jQuery('.tt-container').droppable({ 28 accept: "li", 29 hoverClass: "active", 30 drop: function(event, ui) { 31 var $gallery = this; 32 ui.draggable.fadeOut(function() { 33 jQuery(this).appendTo($gallery).fadeIn(); 34 equilibrate(); // on rééquilibre les colonnes à chaque déplacement 35 }); 36 } 37 }); 38 39 // équilibrage des colonnes 40 equilibrate(); 41 }); 42 43 function equilibrate() { 44 jQuery("#associations").each(function(){ 45 var h=0; 46 jQuery("> ul", this).css('height', 'auto') 47 .each(function(){ h=Math.max(h,jQuery(this).height()); }) 48 .css({'height': h+'px'}); 49 }); 50 } 51 52 // génération des couples tag:typetag avant de valider le formulaire 53 function save_datas(form) { 54 var out = ''; 55 56 jQuery(".tt-container").each(function(){ 57 var section = jQuery(this).attr('id'); 58 jQuery("> li", this).each(function(){ 59 out += jQuery(this).attr('id') + ':' + section + ';'; 60 }); 61 }); 62 63 jQuery('#assoc-input').val(out); 64 submit(form); 65 } 66 66 {/literal} 67 67 {/footer_script} 68 68 69 69 <div class="titrePage"> 70 70 <h2>TypeT@gs</h2> 71 71 </div> 72 72 73 73 <form action="{$typetags_ADMIN}" method="post" name="form"> 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 74 <fieldset> 75 {if isset($edited_typetag)} 76 <legend>{'Edit typetag'|@translate}</legend> 77 <input type="hidden" name="edited_typetag" value="{$edited_typetag}" /> 78 <div class="edit-container"> 79 <div id="colorpicker" style="float:right;"></div> 80 <p><b>{'Edited TypeTag'|@translate} : <input type="text" readonly="readonly" size="18" style="background-color:{$typetag.OLD_COLOR};color:{$typetag.COLOR_TEXT};" value="{$typetag.OLD_NAME}"></b></p> 81 <p> </p> 82 <p>{'New name'|@translate} : <input type="text" size="18" name="typetag_name" value="{$typetag.NAME}"/></p> 83 <p>{'New color'|@translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{$typetag.COLOR}"/></p> 84 <p> </p> 85 <p> 86 <input class="submit" type="submit" name="edittypetag" value="{'Modify'|@translate}"/> 87 <input class="submit" type="submit" name="cancel" value="{'Reset'|@translate}"/> 88 </p> 89 </div> 90 {else} 91 <legend>{'Create a Typetag'|@translate}</legend> 92 <div class="edit-container"> 93 <div id="colorpicker" style="float:right;"></div> 94 <p> </p> 95 <p>{'New TypeTag'|@translate} : <input type="text" size="18" name="typetag_name" value="{if isset($typetag.NAME)}{$typetag.NAME}{/if}"/></p> 96 <p>{'Color TypeTag'|@translate} : <input type="text" id="hexval" name="typetag_color" size="7" maxlength="7" value="{if isset($typetag.COLOR)}{$typetag.COLOR}{else}#444444{/if}"/></p> 97 <p> </p> 98 <p> 99 <input class="submit" type="submit" name="addtypetag" value="{'Create a Typetag'|@translate}"/> 100 </p> 101 </div> 102 {/if} 103 </fieldset> 104 104 </form> 105 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 106 {if !empty($typetags_selection)} 107 <fieldset> 108 <legend>{'TypeTag selection'|@translate}</legend> 109 <ul class="tagSelection"> 110 {foreach from=$typetags_selection item=typetag} 111 <li> 112 <input type="text" readonly="readonly" style="background-color:{$typetag.color};color:{$typetag.color_text};margin:5px 0;" value="{$typetag.name}"> 113 <a href="{$typetag.u_edit}" title="{'edit'|@translate}"><img src="{$themeconf.icon_dir}/edit.png" class="button" alt="{'edit'|@translate}"/></a> 114 <a href="{$typetag.u_delete}" title="{'delete'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"><img src="{$themeconf.admin_icon_dir}/plug_delete.png" class="button" alt="{'delete'|@translate}"/></a> 115 </li> 116 {/foreach} 117 </ul> 118 </fieldset> 119 {/if} 120 120 121 121 <form action="{$typetags_ADMIN}" method="post" name="form" onsubmit="save_datas(this);"> 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 122 {if !empty($typetags_association) and !empty($typetags_selection)} 123 <fieldset> 124 <legend>{'TypeTag association'|@translate}</legend> 125 126 <ul id="tt-NULL" class="tt-container NULL"> 127 <h5>Non associés</h5> 128 {foreach from=$typetags_association item=tag} 129 <li id="t-{$tag.tagid}" title="tt-{$tag.typetagid}"> 130 {$tag.tagname} 131 </li> 132 {/foreach} 133 </ul> 134 135 <div id="associations"> 136 {foreach from=$typetags_selection item=typetag} 137 <ul id="tt-{$typetag.id}" class="tt-container" style="box-shadow:inset 0 0 5px {$typetag.color};"> 138 <h5 style="background-color:{$typetag.color};color:{$typetag.color_text};">{$typetag.name}</h5> 139 </ul> 140 {/foreach} 141 </div> 142 143 <p style="clear:both;"> 144 <input type="hidden" name="associations" id="assoc-input"/> 145 <input class="submit" type="submit" name="associate" value="{'Validate'|@translate}"/> 146 <input class="submit" type="submit" name="delete_all_assoc" value="{'Delete all associations'|@translate}" onclick="return confirm('{'Are you sure?'|@translate}');"/> 147 </p> 148 </fieldset> 149 {/if} 150 150 </form>
Note: See TracChangeset
for help on using the changeset viewer.