Commit d63f82ae by Tom Giannattasio

moved error message into form area; tweaked cancel behavior

parent 763e4722
...@@ -32,6 +32,21 @@ ...@@ -32,6 +32,21 @@
padding: 15px 20px; padding: 15px 20px;
background: $mediumGrey; background: $mediumGrey;
#result {
display: none;
float: left;
margin-bottom: 15px;
padding: 3px 15px;
border-radius: 3px;
background: $error-red;
font-size: 14px;
color: #fff;
}
.form-elements {
clear: both;
}
label { label {
display: inline-block; display: inline-block;
margin-right: 10px; margin-right: 10px;
......
...@@ -20,9 +20,12 @@ ...@@ -20,9 +20,12 @@
</div> </div>
%if allow_actions: %if allow_actions:
<div class="new-user-form"> <div class="new-user-form">
<label>email: </label><input type="text" id="email" class="email-input" autocomplete="off" placeholder="email@example.com"> <div id="result"></div>
<a href="#" id="add_user" class="add-button">add user</a> <div class="form-elements">
<a href="#" class="cancel-button">cancel</a> <label>email: </label><input type="text" id="email" class="email-input" autocomplete="off" placeholder="email@example.com">
<a href="#" id="add_user" class="add-button">add user</a>
<a href="#" class="cancel-button">cancel</a>
</div>
</div> </div>
%endif %endif
<div> <div>
...@@ -42,8 +45,6 @@ ...@@ -42,8 +45,6 @@
% endfor % endfor
</ol> </ol>
</div> </div>
<div id="result"></div>
</article> </article>
</div> </div>
</div> </div>
...@@ -61,6 +62,8 @@ ...@@ -61,6 +62,8 @@
function hideNewUserForm(e) { function hideNewUserForm(e) {
e.preventDefault(); e.preventDefault();
$newUserForm.slideUp(150); $newUserForm.slideUp(150);
$('#result').hide();
$('#email').val('');
} }
$(document).ready(function() { $(document).ready(function() {
...@@ -78,7 +81,7 @@ ...@@ -78,7 +81,7 @@
data:JSON.stringify({ 'email': $('#email').val()}), data:JSON.stringify({ 'email': $('#email').val()}),
}).done(function(data) { }).done(function(data) {
if (data.ErrMsg != undefined) if (data.ErrMsg != undefined)
$('#result').empty().append(data.ErrMsg); $('#result').show().empty().append(data.ErrMsg);
else else
location.reload(); location.reload();
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment