Commits

ont committed 2861618

(f) fixing empty screen on login

Comments (0)

Files changed (6)

         run( 'hg update' )
 
 ##
-## Deploy files or database
+## Backupping database
 ##
 @task
-def sqlite():
+def backup():
     with cd( env.www_path ):
-        put('./db/db.sqlite', './db/db.sqlite')
+        get('./db/db.sqlite', './db/db.sqlite')
 
 ##
 ## Deploy files or database
 
 </head>
 <body class="mtg-body">
+    <div ng-include="'tpl/_popup_login.html'"></div>
+    <div ng-include="'tpl/_topbar.html'"></div>
+
     <div ng-view></div>
 
     <script>

js/controllers.js

     var cards = Restangular.all('cards');
 
     $scope.dmode = 'thumb';
-    $scope.dlg_login = false;
 
     /// container for filtering and sorting params
     $scope.m = {
     }
 
     /*
-     * Login form hooks.
+     * Login form global functions
+     * TODO: fix broadcasting events (send these events to sibling $scope, not parent or child)
      */
-    $scope.$on('event:auth-loginRequired',  function(){ $scope.dlg_login = true; });
-    $scope.$on('event:auth-loginCancelled', function(){ $scope.dlg_login = false; });
-    $scope.$on('event:auth-loginConfirmed', function(){ $scope.dlg_login = false; });
-
-    /*
-     * Login form global functions
-     */
-    $scope.dlg_login_show = function(){ $scope.dlg_login = true;  }
-    $scope.dlg_login_hide = function(){ $scope.dlg_login = false; }
+    $scope.dlg_login_show = function(){ $scope.$broadcast('event:auth-loginRequired');  }
+    $scope.dlg_login_hide = function(){ $scope.$broadcast('event:auth-loginCancelled'); }
 }
 
 function RightNumpadCtrl( $scope )
 function LoginCtrl( $scope, $http, authService, Restangular)
 {
     var users = Restangular.all('users');  // build API root for user (info + login API)
+    $scope.dlg_login = false;   // true - show popup
+
+    /*
+     * Login form hooks.
+     */
+    $scope.$on('event:auth-loginRequired',  function(){ $scope.dlg_login = true; });
+    $scope.$on('event:auth-loginCancelled', function(){ $scope.dlg_login = false; });
+    $scope.$on('event:auth-loginConfirmed', function(){ $scope.dlg_login = false; });
 
     $scope.bootstrap = function(){
         /// trying to get ourself and storing in global box "$scope.u"

tpl/_popup_login.html

-<div ng-class="{'mtg-visible' : dlg_login}" class="reveal-modal-bg"></div>
-<div ng-controller="LoginCtrl" ng-class="{'mtg-visible' : dlg_login}" class="reveal-modal open">
-    <h2>Login</h2>
-    <div class="row">
-        <div class="small-8">
-            <div class="row">
-                <div class="small-3 columns">
-                    <label for="email" class="right inline">Email</label>
+<div ng-controller="LoginCtrl">
+    <div ng-class="{'mtg-visible' : dlg_login}" class="reveal-modal-bg"></div>
+    <div ng-class="{'mtg-visible' : dlg_login}" class="reveal-modal open">
+        <h2>Login</h2>
+        <div class="row">
+            <div class="small-8">
+                <div class="row">
+                    <div class="small-3 columns">
+                        <label for="email" class="right inline">Email</label>
+                    </div>
+                    <div class="small-9 columns">
+                        <input ng-model="post.login" type="text" id="email" placeholder="Inline Text Input">
+                    </div>
                 </div>
-                <div class="small-9 columns">
-                    <input ng-model="post.login" type="text" id="email" placeholder="Inline Text Input">
+                <div class="row">
+                    <div class="small-3 columns">
+                        <label for="password" class="right inline">Password</label>
+                    </div>
+                    <div class="small-9 columns">
+                        <input ng-model="post.passw" type="password" id="password" placeholder="Inline Text Input">
+                    </div>
                 </div>
-            </div>
-            <div class="row">
-                <div class="small-3 columns">
-                    <label for="password" class="right inline">Password</label>
-                </div>
-                <div class="small-9 columns">
-                    <input ng-model="post.passw" type="password" id="password" placeholder="Inline Text Input">
-                </div>
-            </div>
-            <div class="row">
-                <div class="large-offset-3 small-9 columns">
-                    <a ng-click="login()" class="button success" href="#">Try to login</a>
+                <div class="row">
+                    <div class="large-offset-3 small-9 columns">
+                        <a ng-click="login()" class="button success" href="#">Try to login</a>
+                    </div>
                 </div>
             </div>
         </div>
+        <a ng-click="dlg_login = false" class="close-reveal-modal">×</a>
     </div>
-    <a ng-click="dlg_login_hide()" class="close-reveal-modal">×</a>
 </div>
-

tpl/cards_my.html

 <div>
-    <div ng-include="'tpl/_popup_login.html'"></div>
-    <div ng-include="'tpl/_topbar.html'"></div>
-
     <hr/>
 
     <div ng-include="'tpl/_cards_cmdline.html'"></div>

tpl/cards_user.html

 <div>
-    <div ng-include="'tpl/_popup_login.html'"></div>
-    <div ng-include="'tpl/_topbar.html'"></div>
-
     <hr/>
 
     <div ng-include="'tpl/_cards_numpad.html'"></div>