Ignore:
Timestamp:
11/05/15 09:26:13 (9 years ago)
Author:
nanardon
Message:

Add export status to user/email forms

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LATMOS-Accounts-Web/root/html/users/mail.tt

    r1211 r1469  
    3535[% oalias = c.model('Accounts').db.get_object('aliases', alias) %] 
    3636<input type="text" name="aliases" value="[% alias | html %]" id="[% 'aliases' _ loop.count %]"> 
    37 <span style="display:none" id="[% 'aliasesind' _ loop.count %]">Searching...</span> 
    38 <span id="[% 'aliases_span' _ loop.count %]"></span><br> 
    39 [% c.prototype.observe_field('aliases' _ loop.count, { 
    40     url => c.uri_for('/ajax', 'objexist', 'aliases'), 
    41     with   => "'val='+value+ '&attr=forward'", 
    42     update => 'aliases_span' _ loop.count, 
    43     frequency => 1, 
    44     min_chars => 1, 
    45     indicator => 'aliasesind' _ loop.count, 
    46 }) %] 
     37<span id="[% 'aliases_span' _ loop.count %]"></span> 
     38 
     39<script> 
     40$( function() { 
     41    $( "#aliases[% loop.count %]" ).on('input', function() { 
     42        $.ajax({ 
     43            method: "POST", 
     44            url: '[% c.uri_for('/ajax', 'objexist', 'aliases') %]', 
     45            data: { val: $(this).val(), attr: 'forward' }, 
     46        }). done(function( msg ) { 
     47            $( "#aliases_span[% loop.count %]" ).html (msg); 
     48        }); 
     49    }); 
     50}); 
     51</script> 
    4752[% ELSE %] 
    48 [% alias | html %]<br> 
     53[% alias | html %] 
    4954[% END %] 
     55 
     56<input type=checkbox name="expaliases" value="[% alias %]" 
     57[% 'checked' IF oalias.get_attributes('exported') %]> 
     58<br> 
     59 
    5060[% END %] 
    5161[% IF c.model('Accounts').db.check_acl(user, 'aliases', 'w') %] 
    5262[% showsubmit = 1 %] 
    53 <input type="text" name="aliases" value="" id="aliases0"><br> 
    54 <span style="display:none" id="[% 'aliasesind' _ 0 %]">Searching...</span> 
    55 <span id="[% 'aliases_span' _ 0 %]"></span><br> 
    56 [% c.prototype.observe_field('aliases' _ 0, { 
    57     url => c.uri_for('/ajax', 'objexist', 'aliases'), 
    58     with   => "'val='+value+ '&attr=forward'", 
    59     update => 'aliases_span' _ 0, 
    60     frequency => 1, 
    61     min_chars => 1, 
    62     indicator => 'aliasesind' _ 0, 
    63 }) %] 
     63<input type="text" name="aliases" value="" id="aliases0"> 
     64<span id="[% 'aliases_span' _ 0 %]"></span> 
     65 
     66<script> 
     67$( function() { 
     68    $( "#aliases0" ).on('input', function() { 
     69        $.ajax({ 
     70            method: "POST", 
     71            url: '[% c.uri_for('/ajax', 'objexist', 'aliases') %]', 
     72            data: { val: $(this).val(), attr: 'forward' }, 
     73        }). done(function( msg ) { 
     74            $( "#aliases_span0" ).html (msg); 
     75        }); 
     76    }); 
     77}); 
     78</script> 
     79 
    6480[% END %] 
    6581[% FOREACH same = samealiases %] 
     
    8197 
    8298<td> 
     99[% oalias = c.model('Accounts').db.get_object('aliases', user.id) %] 
    83100[% IF c.model('Accounts').db.check_acl(user, 'forward', 'w') %] 
    84101[% showsubmit = 1 %] 
    85102<input type="text" name="forward" value="[% user.get_c_field('forward').join(',') | html %]"> 
     103[% IF oalias %] 
     104<input type=checkbox name="expaliases" value="[% user.id %]" 
     105[% 'checked' IF oalias.get_attributes('exported')  %]> 
     106[% END %] 
    86107[% ELSE %] 
    87108[% user.get_c_field('forward').join(',') | html %] 
Note: See TracChangeset for help on using the changeset viewer.