diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/apps/membership/edit.html | 26 | ||||
-rw-r--r-- | templates/apps/name/name.html | 6 | ||||
-rw-r--r-- | templates/base.html | 14 |
3 files changed, 42 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> diff --git a/templates/base.html b/templates/base.html index bb59dda..64024e4 100644 --- a/templates/base.html +++ b/templates/base.html @@ -40,6 +40,20 @@ $(input).addClass("ui-state-default"); } }); + + function validUser(value,element) { + var valid = false; + $.ajax({ + url: "/user/info/"+value+".json", + async: false, + dataType: 'json', + success: function (json) { + valid = true; + } + }); + return valid; + } + $.validator.addMethod("validUser", validUser, "Please enter a valid user."); }); </script> {% block js %}{% endblock %} |