Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Browse link switching and plan overflow fix #98

Merged
merged 5 commits into from
May 6, 2017
Merged
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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>