Allow editing users' email address via /u/
Also reloads the user info after a succesful edit.
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
li {{ error }}
|
||||
| {% endfor %}
|
||||
| {% endif %}
|
||||
|
||||
span.field-description {{ field.description }}
|
||||
|
||||
| {% endif %}
|
||||
|
||||
@@ -77,7 +77,11 @@ script(type="text/javascript").
|
||||
//- console.log($(this).serialize());
|
||||
$.post($(this).attr('action'), $(this).serialize())
|
||||
.done(function(data){
|
||||
$('#user-edit-notification').addClass('success').html('Success!');
|
||||
// This function is defined in index.jade.
|
||||
displayUser('{{ user._id }}')
|
||||
.done(function() {
|
||||
$('#user-edit-notification').addClass('success').html('Success!');
|
||||
});
|
||||
})
|
||||
.fail(function(data){
|
||||
$('#user-edit-notification').addClass('fail').html('Houston!');
|
||||
|
@@ -1,5 +1,12 @@
|
||||
| {% extends 'layout.html' %}
|
||||
| {% block page_title %}Users{% endblock %}
|
||||
| {% block head %}
|
||||
style.
|
||||
span.field-description {
|
||||
font-size: smaller;
|
||||
color: #999;
|
||||
}
|
||||
| {% endblock %}
|
||||
|
||||
| {% block body %}
|
||||
|
||||
@@ -96,9 +103,10 @@ script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.select
|
||||
|
||||
script(type="text/javascript").
|
||||
|
||||
// This function is also used in edit_embed.jade.
|
||||
function displayUser(userId) {
|
||||
var url = '/u/' + userId + '/edit?embed=1';
|
||||
$.get(url, function(dataHtml){
|
||||
return $.get(url, function(dataHtml){
|
||||
$('#search-hit-container')
|
||||
.html(dataHtml)
|
||||
.show();
|
||||
|
Reference in New Issue
Block a user