Skip to content
This repository has been archived by the owner on Oct 6, 2022. It is now read-only.

Commit

Permalink
Merge pull request #12 from ricardo-devis-agullo/custom-logo-and-title
Browse files Browse the repository at this point in the history
added customization for logo and title
  • Loading branch information
tombuildsstuff authored Dec 8, 2016
2 parents a2ca6db + 1b30c1d commit 7f660c8
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 12 deletions.
2 changes: 1 addition & 1 deletion client/configuration/config.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion client/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ featureToggleFrontend.config(function ($routeProvider, $locationProvider, $httpP
$httpProvider.defaults.headers.post = {'Content-Type': 'application/json'};
});

featureToggleFrontend.run(function (editableOptions) {
featureToggleFrontend.run(function ($rootScope, editableOptions, ENV) {
editableOptions.theme = 'bs3';
$rootScope.$on('$routeChangeSuccess', function (event, current, previous) {
$rootScope.title = current.$$route.title || ENV.customization.title;
});
});
2 changes: 2 additions & 0 deletions client/js/controllers/loginController.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
'use strict';

featureToggleFrontend.controller('LoginController', ['$scope', '$window', 'ENV', function ($scope, $window, ENV) {
$scope.logo = ENV.customization.logo;

if (ENV.RequiresAuth) {
var authProvider = Object.keys(ENV.AuthProviders)[0];

Expand Down
3 changes: 2 additions & 1 deletion client/js/controllers/sideBarController.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
'use strict';

featureToggleFrontend.controller('SideBarController', ['$scope', 'applicationService', 'authorisationService', '$location', 'focus', 'CurrentUser', function ($scope, applicationService, authorisationService, $location, focus, CurrentUser) {
featureToggleFrontend.controller('SideBarController', ['$scope', 'applicationService', 'authorisationService', '$location', 'focus', 'CurrentUser', 'ENV', function ($scope, applicationService, authorisationService, $location, focus, CurrentUser, ENV) {
$scope.applications = [];
$scope.newApplicationName = '';
$scope.adding = false;
$scope.CurrentUser = CurrentUser;
$scope.logo = ENV.customization.logo;

var loadApplications = function () {
applicationService.getApplications(
Expand Down
8 changes: 4 additions & 4 deletions client/views/login.pug
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
doctype html
html(lang='en')
html(lang='en' ng-app='featureToggleFrontend' ng-cloak)
head
meta(name='viewport', content='width=device-width, initial-scale=1')
title Opentable Feature Toggles
title(ng-bind="$root.title")
link(href='/bower_components/bootstrap/dist/css/bootstrap.min.css', media='all', rel='stylesheet')
link(href='/css/dashboard.css', media='all', rel='stylesheet')
link(href='/css/toggleswitch.css', media='all', rel='stylesheet')
link(href='/bower_components/bootstrap-social/bootstrap-social.css', media='all', rel='stylesheet')
link(href='/bower_components/font-awesome/css/font-awesome.css', media='all', rel='stylesheet')
script(src='/bower_components/jquery/dist/jquery.min.js')
body(ng-app='featureToggleFrontend' ng-cloak)
body
#wrapper
#sidebar-wrapper
ul.sidebar-nav(ng-controller="LoginController")
li.sidebar-brand
a.navbar-brand.logo(href='/')
img(src='/img/opentable-hr-mono.png')
img(ng-src='{{logo}}')
a(href='/auth/google',ng-if="authProvider == 'GoogleAuth'").btn.btn-block.btn-social.btn-google-plus.sign-in
i.fa.fa-google-plus
| Sign in with Google
Expand Down
6 changes: 3 additions & 3 deletions client/views/main.pug
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
doctype html
html(lang='en')
html(lang='en' ng-app='featureToggleFrontend')
head
meta(name='viewport', content='width=device-width, initial-scale=1')
title Opentable Feature Toggles
title(ng-bind="$root.title")
link(href='/bower_components/bootstrap/dist/css/bootstrap.min.css', media='all', rel='stylesheet')
link(href='/css/dashboard.css', media='all', rel='stylesheet')
link(href='/bower_components/angular-xeditable/dist/css/xeditable.css' rel='stylesheet')
Expand All @@ -11,7 +11,7 @@ html(lang='en')
script(src='/bower_components/jquery/dist/jquery.min.js')
script(type="text/javascript").
window.user = !{JSON.stringify(user || {}, null, 2)};
body(ng-app='featureToggleFrontend')
body
#wrapper
include ./sidebar.pug
#page-content-wrapper
Expand Down
2 changes: 1 addition & 1 deletion client/views/sidebar.pug
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
ul.sidebar-nav
li.sidebar-brand
a.navbar-brand.logo(href='/')
img(src='/img/opentable-hr-mono.png')
img(ng-src='{{logo}}')
li
.profile
img.media-object.img-circle(ng-src='{{CurrentUser.getPicture()}}', alt='avatar')
Expand Down
6 changes: 5 additions & 1 deletion config/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,9 @@
},
"hooks": [
"server/exampleHook.js"
]
],
"customization": {
"logo": "/img/opentable-hr-mono.png",
"title": "Opentable Feature Toggles"
}
}

0 comments on commit 7f660c8

Please sign in to comment.