Changeset 17945 for extensions/ContactForm/admin/template/emails.tpl
- Timestamp:
- Sep 16, 2012, 5:20:39 PM (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
extensions/ContactForm/admin/template/emails.tpl
r17483 r17945 1 1 {combine_css path=$CONTACT_FORM_PATH|@cat:"admin/template/style.css"} 2 2 3 {footer_script}{literal}4 jQuery(document).on('change', '.delete', function() {5 if ($(this).is(':checked')) {6 $(this).parents('tr').addClass('delete');7 } else {8 $(this).parents('tr').removeClass('delete');9 }10 });11 {/literal}{/footer_script}12 3 13 4 <div class="titrePage"> 14 5 <h2>Contact Form</h2> 15 6 </div> 7 16 8 17 9 <form method="post" action="{$CONTACT_FORM_ADMIN}-emails" class="properties"> … … 20 12 <th>{'Name'|@translate}</th> 21 13 <th>{'Email address'|@translate}</th> 14 <th>{'Category'|@translate}</th> 22 15 <th>{'Active'|@translate}</th> 23 16 <th>{'Delete'|@translate}</th> … … 27 20 <tr class="{if $i is odd}row1{else}row2{/if}"> 28 21 <td> 29 <input type="text" name="emails[{$i}][name]" value="{$entry.name }" size="20">22 <input type="text" name="emails[{$i}][name]" value="{$entry.name|escape:html}" size="20"> 30 23 </td> 31 24 <td> 32 25 <input type="text" name="emails[{$i}][email]" value="{$entry.email}" size="30"> 26 </td> 27 <td> 28 <select name="emails[{$i}][group_name]" class="groups"> 29 <option value="-1">------------</option> 30 {html_options values=$GROUPS output=$GROUPS selected=$entry.group_name} 31 </select> 33 32 </td> 34 33 <td style="text-align:center;"> … … 42 41 {/foreach} 43 42 <tr class="{if $i is odd}row1{else}row2{/if}" id="addEntryContainer"> 44 <td colspan=" 4">43 <td colspan="2" style="text-align:center;"> 45 44 <a id="addEntry">{'+ Add an email'|@translate}</a> 45 </td> 46 <td> 47 <a id="addGroup">{'+ Add a category'|@translate}</a> 48 </td> 49 <td colspan="2" style="text-align:center;"> 50 <input type="submit" name="save_emails" value="{'Submit'|@translate}" class="submit"> 46 51 </td> 47 52 </tr> 48 53 </table> 49 54 {footer_script}var entry = {$i};{/footer_script} 50 51 <p><input type="submit" name="save_emails" value="{'Submit'|@translate}" class="submit"></p>52 55 </form> 53 56 54 {footer_script}{literal} 57 58 59 {footer_script} 60 var group_options = new Array; 61 {foreach from=$GROUPS item=entry} 62 group_options[group_options.length] = '<option value="{$entry|escape:javascript}">{$entry|escape:javascript}</option>'; 63 {/foreach} 64 65 {literal} 66 var doBlink = function(obj,start,finish) { jQuery(obj).fadeOut(300).fadeIn(300); if(start!=finish) { start=start+1; doBlink(obj,start,finish); } }; 67 jQuery.fn.blink = function(start,finish) { return this.each(function() { doBlink(this,start,finish) }); }; 68 69 jQuery(document).on('change', '.delete', function() { 70 if ($(this).is(':checked')) { 71 $(this).parents('tr').addClass('delete'); 72 } else { 73 $(this).parents('tr').removeClass('delete'); 74 } 75 }); 76 55 77 jQuery('#addEntry').click(function() { 56 78 entry++; 57 79 i = entry; 58 80 59 $('#emails').append(81 content = 60 82 '<tr class="row'+ (i%2+1) +'">'+ 61 83 '<td>'+ … … 64 86 '<td>'+ 65 87 '<input type="text" name="emails['+ i +'][email]" size="30">'+ 88 '</td>'+ 89 '<td>'+ 90 '<select name="emails['+ i +'][group_name]" class="groups">'+ 91 '<option value="-1">------------</option>'; 92 for (var j in group_options) { 93 content+= group_options[j]; 94 } 95 content+= '</select>'+ 66 96 '</td>'+ 67 97 '<td style="text-align:center;">'+ … … 72 102 '</td>'+ 73 103 '</tr>' 74 104 $('#emails').append(content); 75 105 76 106 $('#addEntryContainer') … … 79 109 .appendTo($('#emails')); 80 110 }); 111 112 jQuery('#addGroup').click(function() { 113 name = prompt("{/literal}{'Name'|@translate}{literal}:"); 114 if (name != null && name != "") { 115 name = name.replace(new RegExp('"','g'),"'"); 116 content = '<option value="'+ name +'">'+ name +'</option>'; 117 group_options[group_options.length] = content; 118 $("select.groups").append(content).blink(1,2); 119 } 120 }); 81 121 {/literal}{/footer_script}
Note: See TracChangeset
for help on using the changeset viewer.