made page title dynamic and configurable, addresses #310 #311

pull/334/head
Justin Richer 2013-04-29 14:59:53 -04:00
parent b78d499801
commit 39e06292fd
6 changed files with 29 additions and 8 deletions

View File

@ -9,7 +9,7 @@
<base href="${fn:substring(url, 0, fn:length(url) - fn:length(pageContext.request.requestURI))}${pageContext.request.contextPath}/" />
<meta charset="utf-8">
<title>OpenID Connect - ${title}</title>
<title>${config.topbarTitle} - ${title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
@ -104,6 +104,12 @@
<!-- Load jQuery up here so that we can use in-page functions -->
<script type="text/javascript" src="resources/js/lib/jquery.js"></script>
<script type="text/javascript">
// safely set the title of the application
function setPageTitle(title) {
document.title = "${config.topbarTitle} - " + title;
}
</script>
</head>
<body>

View File

@ -4,7 +4,7 @@
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
<o:header title="welcome"/>
<o:header title="About"/>
<o:topbar pageName="About"/>
<div class="container-fluid main">
<div class="row-fluid">

View File

@ -4,7 +4,7 @@
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
<o:header title="welcome"/>
<o:header title="Contact"/>
<o:topbar pageName="Contact"/>
<div class="container-fluid main">
<div class="row-fluid">

View File

@ -1,14 +1,14 @@
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@ taglib prefix="o" tagdir="/WEB-INF/tags" %>
<o:header title="welcome"/>
<o:header title="Management Console"/>
<o:topbar />
<div class="container-fluid main">
<div class="row-fluid">
<o:sidebar/>
<div class="span10">
<div class="content span12">
<o:breadcrumbs crumb="Manage Clients"/>
<o:breadcrumbs crumb="Manage"/>
<span id="content">
loading...
</span>

View File

@ -4,7 +4,7 @@
<!-- TODO: highlight proper section of topbar; what is the right way to do this? -->
<o:header title="welcome"/>
<o:header title="Statistics"/>
<o:topbar pageName="Statistics"/>
<div class="container-fluid main">
<div class="row-fluid">
@ -13,8 +13,6 @@
<div class="hero-unit">
<o:statsContent/>
</div>
</div>
</div>
</div>

View File

@ -369,6 +369,7 @@ var AppRouter = Backbone.Router.extend({
$('#content').html(this.clientListView.render().el);
this.clientListView.delegateEvents();
setPageTitle("Mange Clients");
},
@ -393,6 +394,7 @@ var AppRouter = Backbone.Router.extend({
this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el);
setPageTitle("New Client");
},
editClient:function(id) {
@ -425,6 +427,8 @@ var AppRouter = Backbone.Router.extend({
this.clientFormView = new ClientFormView({model:client});
$('#content').html(this.clientFormView.render().el);
setPageTitle("Edit Client");
},
whiteList:function () {
@ -436,6 +440,8 @@ var AppRouter = Backbone.Router.extend({
$('#content').html(this.whiteListListView.render().el);
this.whiteListListView.delegateEvents();
setPageTitle("Manage Whitelists");
},
newWhitelist:function(cid) {
@ -459,6 +465,7 @@ var AppRouter = Backbone.Router.extend({
this.whiteListFormView = new WhiteListFormView({model: whiteList, client: client});
$('#content').html(this.whiteListFormView.render().el);
setPageTitle("Create New Whitelist");
} else {
console.log('ERROR: no client found for ' + cid);
}
@ -482,6 +489,8 @@ var AppRouter = Backbone.Router.extend({
if (client != null) {
this.whiteListFormView = new WhiteListFormView({model: whiteList, client: client});
$('#content').html(this.whiteListFormView.render().el);
setPageTitle("Edit Whitelist");
} else {
console.log('ERROR: no client found for ' + whiteList.get('clientId'));
}
@ -503,6 +512,7 @@ var AppRouter = Backbone.Router.extend({
this.approvedSiteList.fetch({success:
function(collection, response, options) {
$('#content').html(view.render().el);
setPageTitle("Manage Approved Sites");
}
});
@ -520,6 +530,8 @@ var AppRouter = Backbone.Router.extend({
this.blackListList.fetch({success:
function(collection, response, options) {
$('#content').html(view.render().el);
setPageTitle("Mange Blacklist");
}
});
},
@ -533,6 +545,8 @@ var AppRouter = Backbone.Router.extend({
$('#content').html(this.systemScopeListView.render().el);
this.systemScopeListView.delegateEvents();
setPageTitle("Mange System Scopes");
},
newScope:function() {
@ -547,6 +561,8 @@ var AppRouter = Backbone.Router.extend({
this.systemScopeFormView = new SystemScopeFormView({model:scope});
$('#content').html(this.systemScopeFormView.render().el);
setPageTitle("New System Scope");
},
editScope:function(sid) {
@ -561,6 +577,7 @@ var AppRouter = Backbone.Router.extend({
this.systemScopeFormView = new SystemScopeFormView({model:scope});
$('#content').html(this.systemScopeFormView.render().el);
setPageTitle("Edit System Scope");
}