]> jfr.im git - z_archive/KronOS.git/commitdiff
Added error messages for failed login
authorConny Sjöblom <redacted>
Tue, 16 Oct 2012 09:29:00 +0000 (12:29 +0300)
committerConny Sjöblom <redacted>
Tue, 16 Oct 2012 09:29:00 +0000 (12:29 +0300)
application/models/core.php
public/js/application.js

index 1f25e3814b4d35d781175bb405a8b103423d701a..487a3d8278a2755b42f80b7c6939307cd8509ab9 100644 (file)
@@ -18,9 +18,11 @@ class Core extends CI_Model {
                        </div>
                        <form class="form-horizontal" method="post" action="javascript:submitLogin();void(0);">
                                <div class="modal-body">
-                                       <div class="alert alert-block">
-                                               <button type="button" class="close" data-dismiss="alert">&times;</button>
-                                               <strong>Noitce!</strong> site is still being developed.
+                                       <div class="messagebody">
+                                               <div class="alert alert-block alert-info">
+                                                       <button type="button" class="close" data-dismiss="alert">&times;</button>
+                                                       <strong>Notice!</strong> site is still being developed.
+                                               </div>
                                        </div>
                                        <div class="control-group">
                                                <label class="control-label" for="inputUsername">Username</label>
index 1a85954f84ed97aa8d5a3464824cb6eb2cbe976a..2acce4099e72f50479c27d71c73d3b499393fec3 100644 (file)
@@ -59,10 +59,17 @@ function submitLogin() {
                        jQuery('#loginModal').modal('hide');
                        loadMenu();
                        loadBackground();
+               } else {
+                       throwError(resp.error, 'error', '.messagebody');
                }
        }, "json");
 }
 
+function throwError(e, t, c) {
+       error = '<div class="alert alert-block alert-' + t + '"><button type="button" class="close" data-dismiss="alert">&times;</button>' + e + '</div>'
+       jQuery(c).append(error);
+}
+
 jQuery(function () {
        state = {}