OSDN Git Service

Add login page
authorhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 22 Jul 2015 05:01:42 +0000 (14:01 +0900)
committerhimetani_cafe <fumifumi@yasunaga-lab.bio.kyutech.ac.jp>
Wed, 22 Jul 2015 05:01:42 +0000 (14:01 +0900)
client/app/app.js
client/app/components/login/login.controller.js [new file with mode: 0644]
client/app/components/login/login.css [new file with mode: 0644]
client/app/components/login/login.html [new file with mode: 0644]
client/app/components/login/login.js [new file with mode: 0644]
client/index.html
gulpfile.js
package.json
server/auth/login/index.js [new file with mode: 0644]
server/routes.js

index fc582c3..ac1c26b 100644 (file)
@@ -6,6 +6,6 @@ angular.module('zephyrApp', ['ui.bootstrap', 'ui.router', 'restangular'])
         enabled: true,
         requireBase: false
     })
-    $urlRouterProvider.otherwise('/board/new')
+    $urlRouterProvider.otherwise('/')
     $httpProvider.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest'
 })
diff --git a/client/app/components/login/login.controller.js b/client/app/components/login/login.controller.js
new file mode 100644 (file)
index 0000000..35dc03b
--- /dev/null
@@ -0,0 +1,7 @@
+'use strict';
+
+angular.module('zephyrApp')
+.controller('LoginController', function ($scope, $modal, Restangular, $state) {
+
+
+});
diff --git a/client/app/components/login/login.css b/client/app/components/login/login.css
new file mode 100644 (file)
index 0000000..f2d18db
--- /dev/null
@@ -0,0 +1,41 @@
+body {
+    /*padding-top: 40px;*/
+    /*padding-bottom: 40px;*/
+    background-color: #eee;
+}
+
+.form-signin {
+    max-width: 330px;
+    padding: 15px;
+    margin: 0 auto;
+}
+.form-signin .form-signin-heading,
+.form-signin .checkbox {
+    margin-bottom: 10px;
+}
+.form-signin .checkbox {
+    font-weight: normal;
+}
+.form-signin .form-control {
+    position: relative;
+    height: auto;
+    -webkit-box-sizing: border-box;
+    -moz-box-sizing: border-box;
+    box-sizing: border-box;
+    padding: 10px;
+    font-size: 16px;
+}
+.form-signin .form-control:focus {
+    z-index: 2;
+}
+.form-signin input[type="email"] {
+    margin-bottom: -1px;
+    border-bottom-right-radius: 0;
+    border-bottom-left-radius: 0;
+}
+.form-signin input[type="password"] {
+    margin-bottom: 10px;
+    border-top-left-radius: 0;
+    border-top-right-radius: 0;
+}
+
diff --git a/client/app/components/login/login.html b/client/app/components/login/login.html
new file mode 100644 (file)
index 0000000..b845690
--- /dev/null
@@ -0,0 +1,17 @@
+<div class="container">
+
+<form class="form-signin" method="post" action="/auth/login" ng-model="auth" >
+    <h2 class="form-signin-heading">Login</h2>
+    <label for="inputEmail" class="sr-only">Email address</label>
+    <input type="email" id="inputEmail" class="form-control" placeholder="Email address" required autofocus>
+    <label for="inputPassword" class="sr-only">Password</label>
+    <input type="password" id="inputPassword" class="form-control" placeholder="Password" required>
+    <div class="checkbox">
+        <label>
+            <input type="checkbox" value="remember-me"> Remember me
+        </label>
+    </div>
+    <button class="btn btn-lg btn-primary btn-block" type="submit">Sign in</button>
+</form>
+
+</div> 
diff --git a/client/app/components/login/login.js b/client/app/components/login/login.js
new file mode 100644 (file)
index 0000000..fb53443
--- /dev/null
@@ -0,0 +1,19 @@
+'use strict';
+
+angular.module('zephyrApp')
+.config(function($stateProvider) {
+    $stateProvider
+    .state('login', {
+        url:'/',
+        templateUrl:'/client/app/components/login/login.html',
+        controller: 'LoginController',
+        css: '/client/app/components/login/login.css'
+    })
+    /*
+    .state('note', {
+        url: '/board/:note'
+        //templateUrl:'/client/app/components/board/board.html',
+        //controller: 'BoardController'
+    })
+    */
+});
index 9857d68..f820e8d 100644 (file)
@@ -7,6 +7,9 @@
         <link rel="stylesheet" href="/client/assets/vendor/bootstrap.min.css">
         <link rel="stylesheet" href="/client/assets/vendor/font-awesome.min.css">
         <!-- endinject -->
+        <!-- components:css -->
+        <link rel="stylesheet" href="/client/app/components/login/login.css">
+        <!-- endinject -->
     </head>
     <body ng-app="zephyrApp">
         <div ui-view></div>
         <!-- endinject -->
 
         <!-- shared:js -->
-        <script src="/client/app/shared/navbar/navbar.controller.js"></script>
-        <script src="/client/app/shared/navbar/navbar.directive.js"></script>
         <script src="/client/app/shared/my-command/my-command.controller.js"></script>
         <script src="/client/app/shared/my-command/my-command.js"></script>
+        <script src="/client/app/shared/navbar/navbar.controller.js"></script>
+        <script src="/client/app/shared/navbar/navbar.directive.js"></script>
         <script src="/client/app/shared/tagFileter/tagFilter.filter.js"></script>
         <!-- endinject -->
         <!-- components:js -->
         <script src="/client/app/components/board/board.controller.js"></script>
         <script src="/client/app/components/board/board.js"></script>
+        <script src="/client/app/components/commandModal/commandModal.controller.js"></script>
+        <script src="/client/app/components/login/login.controller.js"></script>
+        <script src="/client/app/components/login/login.js"></script>
         <script src="/client/app/components/notes/notes.controller.js"></script>
         <script src="/client/app/components/notes/notes.js"></script>
-        <script src="/client/app/components/commandModal/commandModal.controller.js"></script>
         <script src="/client/app/components/previewModal/previewModal.controller.js"></script>
         <script src="/client/app/components/saveFileModal/saveFileModal.controller.js"></script>
         <script src="/client/app/components/workspace/workspace.controller.js"></script>
index fbb32a7..bdb9a70 100644 (file)
@@ -19,7 +19,7 @@ var paths = {
     vendor     : ['./client/assets/vendor/*.js', './client/assets/vendor/*.css'],
     app        : ['./client/app/*.js'],
     shared     : ['./client/app/shared/**/*.js'],
-    components : ['./client/app/components/**/*.js'],
+    components : ['./client/app/components/**/*.js', './client/app/components/**/*.css'],
     templates   : ['./client/app/**/*.html']
 };
 
index 78d0448..7ac37f2 100644 (file)
@@ -9,6 +9,8 @@
     "ejs": "^2.3.1",
     "express": "^4.12.3",
     "lodash": "^3.8.0",
+    "passport": "^0.2.2",
+    "sqlite3": "^3.0.9",
     "thunkify": "^2.1.2"
   },
   "devDependencies": {
diff --git a/server/auth/login/index.js b/server/auth/login/index.js
new file mode 100644 (file)
index 0000000..901ebbf
--- /dev/null
@@ -0,0 +1,12 @@
+'use strict'
+
+var express = require('express'),
+    router  = express.Router(),
+    path    = require('path')
+
+router.post('/', function(req, res) {
+    console.log(req)
+    res.sendStatus(401)
+})
+
+module.exports = router
index eaad173..b0eceb7 100644 (file)
@@ -11,6 +11,7 @@ module.exports = function(app) {
     app.use('/api/commandExecution', require('./api/commandExecution'))
     app.use('/api/noteCreation', require('./api/noteCreation'))
     app.use('/api/noteInfo', require('./api/noteInfo'))
+    app.use('/auth/login', require('./auth/login'))
     app.route('/*')
     .get(function(req, res) {
         if(app.get('env') === 'development') {