Skip to content

Commit

Permalink
Merge pull request #98 from rit-sse/design-changes
Browse files Browse the repository at this point in the history
Browse link switching and plan overflow fix
  • Loading branch information
khanny17 authored May 6, 2017
2 parents 30cd30a + 5a00f83 commit 6910431
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
8 changes: 5 additions & 3 deletions public/js/controllers/home-controller.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
'use strict';

var app = angular.module("HomeController", ['PlanService', 'NotificationService', 'EditPlanDetailsModal']);
var app = angular.module("HomeController", ['PlanService', 'NotificationService', 'AuthService', 'EditPlanDetailsModal']);

app.controller('homeController', ['$scope','$http', 'planService', 'notificationService', 'user', 'editPlanDetailsModal',
function($scope, $http, planService, notificationService, user, editPlanDetailsModal) {
app.controller('homeController', ['$scope','$http', 'planService', 'notificationService', 'user', 'authService', 'editPlanDetailsModal',
function($scope, $http, planService, notificationService, user, authService, editPlanDetailsModal) {
$scope.user = user;
notificationService.on('user-changed', function(user){
$scope.user = user;
Expand All @@ -23,4 +23,6 @@ function($scope, $http, planService, notificationService, user, editPlanDetailsM
editPlanDetailsModal.open($scope.plan);
};

$scope.isAuthenticated = authService.isAuthenticated;

}]);
4 changes: 4 additions & 0 deletions public/sass/browse.scss
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,7 @@
margin-bottom: 10px;
}
}

.open-plan-preview {
overflow-x: scroll;
}
2 changes: 1 addition & 1 deletion public/views/browse.html
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ <h1>Public Plans</h1>
<button class="btn btn-default btn-sm load-btn" ng-click="load(plan)"
ng-if="selectedPlan === plan">Load</button>
</div>
<div class="panel-body" ng-if="selectedPlan === plan">
<div class="panel-body open-plan-preview" ng-if="selectedPlan === plan">
<years plan="::selectedPlan" readonly="true"></years>
</div>
</div>
Expand Down
7 changes: 5 additions & 2 deletions public/views/empty-view.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
<div class="container" id="empty-view">
<div class="container" id="empty-view" ng-switch="isAuthenticated()">
<h3>To get started, click "Add Year" below.</h3>
<h3>If you log in, you can <a href="/browse"><b>Browse</b></a> and select someone else's shared plan.</h3>
<h3>If you log in, you can
<a ng-switch-when="true" href="/browse"><b>Browse</b></a>
<span ng-switch-default>browse</span>
and select someone else's shared plan.</h3>
</div>
3 changes: 2 additions & 1 deletion public/views/home.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
<div class="home">
<navbar user="user"></navbar>
<div class="content">
<h3 class="plan-title" ng-click="editPlanDetails()">{{plan.title}}</h3>
<h3 class="plan-title" ng-click="editPlanDetails()" style="cursor:pointer;">
{{plan.title}}<i class="fa fa-pencil fa-fw" aria-hidden="true"></i></h3>
<!-- Display for when there are no years -->
<div ng-if="plan.years.length === 0" ng-include="'views/empty-view.html'"></div>

Expand Down

0 comments on commit 6910431

Please sign in to comment.