storyboard-webclient/src/app/profile/controller/profile_preferences_controller.js
Michael Krotscheck 359297afab Added user preference handling
From comments on our paging review, it became clear that we need some kind
of user preference support. This commit provides a client-side
implementation with an abstraction layer that allows us to connect the API
at a later time. Actions taken:

- Added currentUser resolution for routes.
- Added new profile module to handle user profile management.
- Added navigation in menu.
- Small fix to logout button in mobile, to make sure it doesn't show up.
- New route and UI for /profile/preferences
- Created preference provider factory that allows any module to
register/inject their own preferences with defaults. See
services/resource/preference.js as an example.

Change-Id: I2d72a40a9e0c3a142da6c1d1e5f9dd4da7ca58a1
2014-03-17 15:29:50 -07:00

31 lines
1.1 KiB
JavaScript

/*
* Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may
* not use this file except in compliance with the License. You may obtain
* a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
* License for the specific language governing permissions and limitations
* under the License.
*/
/**
* Preferences controller for our user profile. Allows explicit editing of
* individual preferences.
*/
angular.module('sb.profile').controller('ProfilePreferencesController',
function ($scope, Preference) {
'use strict';
$scope.pageSize = Preference.$get('page_size');
$scope.save = function () {
Preference.$set('page_size', $scope.pageSize);
$scope.message = 'Preferences Saved!';
};
});