Skip to content
This repository has been archived by the owner on Mar 28, 2019. It is now read-only.

Commit

Permalink
moved login to landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
Jennifer Fong committed Nov 13, 2013
1 parent df20c28 commit 508bc17
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 5 deletions.
3 changes: 2 additions & 1 deletion public/javascripts/controllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,10 @@ angular.module('chatspace.controllers', []).
persona.logout();
}
}).
controller('HomeCtrl', function ($scope, $location, persona) {
controller('HomeCtrl', function ($scope, $rootScope, $location, persona) {
$scope.login = function () {
persona.login();
$rootScope.toggleSettings();
};
}).
controller('DraftsCtrl', function ($scope, $rootScope, $location, api) {
Expand Down
4 changes: 3 additions & 1 deletion public/partials/home.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
<div class="landing-view">
<h2>landing page</h2>
<h2>Chatspaces</h2>

<a href="javascript:;" ng-click="login()" class="persona">Sign in with Persona</a>
</div>
10 changes: 10 additions & 0 deletions public/stylesheets/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ body, textarea, input {
overflow-x: auto;
}

.persona {
background-color: #bbb;
color: #eee;
display: inline-block;
font-size: 2rem;
margin-top: 20px;
padding: 10px;
text-decoration: none;
}

textarea {
height: 70px;
padding: 10px;
Expand Down
3 changes: 1 addition & 2 deletions views/index.jade
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,7 @@ block content
a(href='/drafts', ng-click='toggleSettings()') Drafts
li(ng-if='isAuthenticated')
a(href='javascript:;', ng-click='logout()') Logout
li(ng-if='!isAuthenticated')
a(href='javascript:;', ng-click='login()') Sign in

section.default
div(ng-view)

2 changes: 1 addition & 1 deletion views/layout.jade
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ html(ng-app='chatspace')
link(rel='stylesheet', href='/stylesheets/main.css')

body(ng-controller='AppCtrl')
#header
#header(ng-if='isAuthenticated')
button(class='toggle', ng-click='toggleSettings()')
a(id='notifications', href='javascript:;', ng-click='goToDashboard()', ng-class='{ on: hasNewNotifications }', ng-bind='hasNewNotifications')

Expand Down

0 comments on commit 508bc17

Please sign in to comment.