diff options
author | Leif Johansson <leifj@sunet.se> | 2011-03-04 23:59:48 +0100 |
---|---|---|
committer | Leif Johansson <leifj@sunet.se> | 2011-03-04 23:59:48 +0100 |
commit | 9e23094460e43806d1ae2ef370e73c95ba917a24 (patch) | |
tree | 448b45ab5554626ebe2715530fe8673d0144ca16 /templates/apps | |
parent | 7ca77e22ed201c859ac6d3ed7a97624a9c965ea9 (diff) |
adding users now has custom validation
Diffstat (limited to 'templates/apps')
-rw-r--r-- | templates/apps/membership/edit.html | 26 | ||||
-rw-r--r-- | templates/apps/name/name.html | 6 |
2 files changed, 28 insertions, 4 deletions
diff --git a/templates/apps/membership/edit.html b/templates/apps/membership/edit.html index 8174aea..06d033b 100644 --- a/templates/apps/membership/edit.html +++ b/templates/apps/membership/edit.html @@ -3,6 +3,30 @@ $('#wizard').formwizard({ validationEnabled: true, focusFirstInput: true, - textSubmit: "Finish" + textSubmit: "Finish", + validationOptions: { + rules: { + username: 'validUser' + } + } + }); + $('#id_username').autocomplete({ + source: "/user/search.json", + focus: function(event, ui) { + $('#id_username').val(ui.item.label); + return false; + }, + select: function(event, ui) { + $('#id_username').val(ui.item.label); + $('#id_user').val(ui.item.value); + return false; + }, + minLength: 2, + open: function() { + $( this ).removeClass( "ui-corner-all" ).addClass( "ui-corner-top" ); + }, + close: function() { + $( this ).removeClass( "ui-corner-top" ).addClass( "ui-corner-all" ); + } }); {% endblock %}
\ No newline at end of file diff --git a/templates/apps/name/name.html b/templates/apps/name/name.html index 01de064..f8d667a 100644 --- a/templates/apps/name/name.html +++ b/templates/apps/name/name.html @@ -60,13 +60,13 @@ <h3 class="listheader">{{m.user|lastidentifier}}</h3> <div> <div> - {{m.user|userdisplay}} ({{m.user|lastidentifier}}) became a member of {{name.shortname}} {{m.timecreated|datehumanize}} - and has the following role{{m.tags|pluralize}}: + {{m.user|userdisplay}} ({{m.user|lastidentifier}}) became a member of {{name.shortname}} {{m.timecreated|datehumanize}} + {% if m.tags %}and has the following role{{m.tags|pluralize}}: <ul> {% for tag in m.tags %} <li>{{ tag|escape }}</li> {% endfor %} - </ul> + </ul>{%endif%}. </div> <div class="rlist button"> <ul> |