Commit 654be5de06c35feb72b5e31e0b1cb940b7368baf

Authored by Melody

Merge branch 'master' of git.ucsd.edu:110swag/flashy-frontend

Showing 6 changed files Side-by-side Diff

1   -.angucomplete-dropdown {
  1 +.diclaimer {
  2 + color:#00AFD8;
  3 +}
  4 +
  5 +.form-section {
  6 + width: 330px;
  7 + top: 50%;
  8 + position: relative;
  9 +}
  10 +
  11 +.form-inputs {
  12 + margin-top: 0px;
  13 + border: 0px none;
  14 + font: 16px/1.4 "Helvetica Neue","HelveticaNeue",Helvetica,Arial;
  15 + padding: 5px 10px 11px 13px;
  16 + width: 100%;
  17 + box-sizing: border-box;
  18 +}
  19 +
  20 +.form-buttons {
  21 + margin-top: 10px;
  22 + width: 100%;
  23 + font-size: 16px;
  24 +}
  25 +
  26 +.form-buttons .last-button {
  27 + float: right;
  28 +}
  29 +
  30 +.container {
  31 + position: relative;
  32 + width: 600px;
  33 + height: 80px;
  34 +}
  35 +
  36 +.angucomplete-dropdown {
2 37 border-color: #ececec;
3 38 border-width: 1px;
4 39 border-style: solid;
scripts/DeckController.js View file @ 654be5d
1 1 var app = angular.module('flashy.DeckController', ['ui.router']);
2 2  
3   -app.controller('DeckController', ['$scope', function($scope) {
4   - $scope.hello = function() {
5   - alert('hello');
6   - };
  3 +app.controller('DeckController', ['$scope', '$http', function($scope, $http) {
  4 +
  5 +
  6 +
  7 + $scope.cards = [];
  8 +
  9 +
  10 +
  11 + $scope.cards[0] = { "id": 1, "title": "title1", "content": "abc" };
  12 + $scope.cards[1] = { "id": 2, "title": "title2", "content": "xyz" };
  13 + $scope.cards[2] = { "id": 2, "title": "title3", "content": "qwe" };
  14 +
  15 +
  16 + $scope.removeCard = function (item) {
  17 +
  18 +
  19 + var index = $scope.cards.indexOf(item);
  20 +
  21 + $scope.cards.splice(index, 1);
  22 +
  23 + alert("removed card");
  24 + }
  25 +
  26 +
  27 + $http.get('/api/sections/{pk}/deck').
  28 + success(function (data) {
  29 +
  30 +
  31 + for (var i = 0; i < data.length; i++) {
  32 + cards.push({ "title": data[i].title, "content": data[i].content });
  33 + }
  34 + }).
  35 + error(function (data) {
  36 +
  37 + console.log("no cards?!!");
  38 +
  39 + });
  40 +
  41 +
  42 +
  43 +
7 44 }]);
scripts/RequestResetController.js View file @ 654be5d
... ... @@ -21,8 +21,8 @@
21 21 console.log(data);
22 22 });
23 23 };
24   - $scope.cancel = function() {
25   - $state.go('home');
  24 + $scope.cancelReset = function() {
  25 + $state.go('login');
26 26 };
27 27 }
28 28 ]);
templates/deck.html View file @ 654be5d
1   -<!DOCTYPE html>
2   -<html ng-app="flashy">
3   - <head>
4   -
5   - <link rel="stylesheet" href="styles/bootstrap-3.3.4-dist/css/bootstrap.css" />
6   - <link rel="stylesheet" href="flashy.css" />
  1 +<div class="row">
7 2  
8   - </head>
9   - <body ng-controller="DeckController">
  3 + <div ng-repeat="card in cards">
10 4  
11   - <button type="button" ng-click="hello()">SUPPPP</button>
  5 + <div class="col s6">
12 6  
13   - <script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.15/angular.js"></script>
14   - <script src="https://cdnjs.cloudflare.com/ajax/libs/angular-ui-router/0.2.14/angular-ui-router.js"></script>
15   - <script src="/app/config.js"></script>
16   - <!--<script src="controller.js"></script>-->
  7 + <div class="card">
17 8  
18   - <script src="DeckController.js"></script>
19   - </body>
20   -</html>
21 9  
22 10  
23   - <script src="viewDeckController.js"></script>
24   - </body>
25   -</html>
  11 + <div class="card-image">
  12 + <span class="card-title">{{card.title}}</span>
  13 + </div>
  14 + <div class="card-content">
  15 +
  16 +
  17 +
  18 + <p>
  19 + {{card.content}}
  20 +
  21 +
  22 + </p>
  23 + </div>
  24 +
  25 +
  26 +
  27 + <div class="card-action">
  28 +
  29 +
  30 + <button type="button" class="waves-effect waves-light btn" ng-click="removeCard()">Remove</button>
  31 +
  32 +
  33 + </div>
  34 +
  35 + </div>
  36 +
  37 + </div>
  38 +
  39 +
  40 + </div>
  41 +</div>
  42 +
templates/login.html View file @ 654be5d
1 1 <div class="container">
2 2 <div class="row">
3   - <form id="loginform" class="col s12 right-align" ng-submit="login(loginEmail, loginPassword)">
  3 + <div class="col s6">
  4 + <ul class="tabs" tabs>
  5 + <li class="tab col s3"><a href="#register-tab">Sign Up</a></li>
  6 + <li class="tab col s3"><a class="active" href="#login-tab">Login</a></li>
  7 + </ul>
  8 + </div>
  9 + <!--LOGIN TAB-->
  10 + <div id="login-tab" class="col s12">
4 11 <div class="check-element animate-show" role="alert" ng-show="loginError">
5   - <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
6 12 <span style="color:#8E2323">Invalid username or password!!</span>
7 13 </div>
8 14 <div class="row">
9 15 <div class="input-field col s6">
10   - <input type="email" class="validate" ng-model="loginEmail" required/>
  16 + <input type="email" class="validate" ng-model="loginEmail" placeholder="Email" required/>
11 17 <label for="email">Email</label>
12 18 </div>
  19 + </div>
  20 + <div class="row">
13 21 <div class="input-field col s6">
14   - <input type="password" class="validate" ng-model="loginPassword" required/>
  22 + <input type="password" class="validate" ng-model="loginPassword" placeholder="Password" required/>
15 23 <label for="password">Password</label>
16 24 </div>
17 25 </div>
18   - <button class="btn waves-effect waves-light right-align" type="" name="action"
19   - ng-click="signUp(loginEmail, loginPassword)">Register
20   - </button>
21   - <button class="btn waves-effect waves-light right-align" type="submit" name="action"
22   - ng-click="login(loginEmail, loginPassword)">Login
23   - </button>
24   -
25   - </form>
26   - <a class="trigger-password-reset" ng-click="triggerPasswordReset()" href="#">Forgot Password?</a>
  26 + <div class="row">
  27 + <button class="btn waves-effect waves-light right-align" type="submit" name="action"
  28 + ng-click="login(loginEmail, loginPassword)">Login
  29 + </button>
  30 + </div>
  31 + </div>
  32 + <!--REGISTER TAB-->
  33 + <div id="register-tab" class="col s12">
  34 + <div class="row">
  35 + <div class="input-field col s6">
  36 + <input type="email" class="validate" ng-model="loginEmail" placeholder="Email" required/>
  37 + <label for="email">Email</label>
  38 + </div>
  39 + </div>
  40 + <div class="row">
  41 + <div class="input-field col s6">
  42 + <input type="password" class="validate" ng-model="registerPassword" placeholder="Password" required/>
  43 + <label for="password">Password</label>
  44 + </div>
  45 + </div>
  46 + <div class="row">
  47 + <button class="btn waves-effect waves-light left-align" type="" name="action"
  48 + ng-click="signUp(loginEmail, registerPassword)">Register
  49 + </button>
  50 + </div>
  51 + </div>
27 52 </div>
  53 + <a class="trigger-password-reset" ng-click="triggerPasswordReset()" href="#">Forgot Password?</a>
28 54 </div>
templates/requestpasswordreset.html View file @ 654be5d
... ... @@ -5,15 +5,15 @@
5 5 <div name="passreset" class="form-section">
6 6 <form class="form-inputs" name="passreset_form">
7 7 <div class="check-element animate-show" role="alert" ng-show="invalid">
8   - <span class="glyphicon glyphicon-exclamation-sign" aria-hidden="true"></span>
9 8 <span style="color:#8E2323">Enter a valid email!</span>
10 9 </div>
  10 + <!--FORM INPUTS-->
11 11 <div class="form-group">
12 12 <input type="email" class="form-control" ng-model="user_email" placeholder="Email" required />
13 13 </div>
14   - <div class="form-buttons">
  14 + <div class="row">
15 15 <div class="btn-group">
16   - <button type="button" class="btn btn-default" ng-click="cancel()"><strong>Cancel</strong></button>
  16 + <button type="button" class="btn btn-default" ng-click="cancelReset()"><strong>Cancel</strong></button>
17 17 </div>
18 18 <div class="last-button">
19 19 <div class="btn-group">