mirror of
https://github.com/zhigang1992/deployd.git
synced 2026-05-24 22:17:07 +08:00
Improved breadcrumb in dashboard.
This commit is contained in:
@@ -18,7 +18,9 @@
|
||||
div.panel {margin: 0 0 18px 0; padding: 20px; box-shadow: none; border: solid 1px #e8e8e8;}
|
||||
|
||||
#bread h4 {color: #ccc;}
|
||||
#bread a {color: #000;}
|
||||
#bread a {color: #000; text-transform: capitalize;}
|
||||
|
||||
.tabs-content .panel h6, .tabs-content .panel a.button { text-transform: capitalize; }
|
||||
|
||||
/* global */
|
||||
h6 {font-weight: bold;}
|
||||
|
||||
@@ -29,8 +29,10 @@
|
||||
<div class="container">
|
||||
|
||||
<div id="bread" class="row">
|
||||
|
||||
<h4></h4>
|
||||
<hr />
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div id="menu" class="three columns">
|
||||
<div class="panel">
|
||||
|
||||
@@ -18,13 +18,16 @@ var Router = Backbone.Router.extend({
|
||||
},
|
||||
|
||||
routes: {
|
||||
'/': 'home',
|
||||
'': 'home',
|
||||
'/plugins': 'plugin',
|
||||
'/plugins/:name': 'plugin',
|
||||
'/plugins/:name/:tab': 'plugin'
|
||||
},
|
||||
home: function () {
|
||||
console.log('home');
|
||||
$('#content').html('welcome home');
|
||||
var _breadcrumbHTML = '<a href="/dashboard">'+app.get('name')+'</a>';
|
||||
$('#bread > h4').empty().append(_breadcrumbHTML);
|
||||
},
|
||||
plugin: function(name, tabId) {
|
||||
var model = app.get("plugins").getByPluginName(name);
|
||||
@@ -34,7 +37,7 @@ var Router = Backbone.Router.extend({
|
||||
var _breadcrumbHTML = '<a href="/dashboard">'+app.get('name')+'</a>';
|
||||
if (name) _breadcrumbHTML += ' » <a href="/dashboard/#/plugins/'+name+'">'+name+'</a>';
|
||||
if (tabId) _breadcrumbHTML += ' » <a href="/dashboard/#/plugins/'+tabId+'">'+model.getObjectById(tabId).get('name')+'</a>';
|
||||
$('#bread').empty().append(_breadcrumbHTML);
|
||||
$('#bread > h4').empty().append(_breadcrumbHTML);
|
||||
|
||||
if (typeof tabId !== "undefined" && tabId !== '') view.tabId = tabId;
|
||||
view.render();
|
||||
|
||||
@@ -75,7 +75,7 @@ window.PluginView = Backbone.View.extend({
|
||||
else {
|
||||
$('#plugin-tabs-nav > dd > a:first').addClass('active');
|
||||
$('.tabs-content > li:first').show();
|
||||
$('#bread').append(' » <a href="/dashboard/#/plugins/'+this.model.get('plugin')+'/'+$('#plugin-tabs-nav > dd:first').attr('id').replace('tab-link-','')+'">'+$('#plugin-tabs-nav > dd > a:first').html()+'</a>');
|
||||
$('#bread > h4').append(' » <a href="/dashboard/#/plugins/'+this.model.get('plugin')+'/'+$('#plugin-tabs-nav > dd:first').attr('id').replace('tab-link-','')+'">'+$('#plugin-tabs-nav > dd > a:first').html()+'</a>');
|
||||
}
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user