Skip to content
Permalink
Browse files

Add sidebars to tags show route

  • Loading branch information...
angusmcleod committed Feb 2, 2017
1 parent 40a3b94 commit 7a345ad390aa867233a2dd9ff0adc8b81e7b32d4
@@ -28,9 +28,15 @@ var settingEnabled = function(setting, category, path) {
return siteEnabled.indexOf('category') > -1 ||
categoryEnabled && categoryEnabled.split('|').indexOf(filter) > -1
}

if (routes.indexOf('categories') > -1) {
return siteEnabled.indexOf('categories') > -1;
}

if (routes.indexOf('tags') > -1) {
return siteEnabled.indexOf('tags') > -1;
}

return siteEnabled.indexOf(filter) > -1;
}

@@ -5,6 +5,8 @@ import TopicController from 'discourse/controllers/topic';
import TopicRoute from 'discourse/routes/topic';
import TopicNavigation from 'discourse/components/topic-navigation';
import TopicList from 'discourse/components/topic-list';
import TagsShowRoute from 'discourse/routes/tags-show';
import TagsShowController from 'discourse/controllers/tags-show';
import ShowModal from 'discourse/lib/show-modal';
import NavigationBar from 'discourse/components/navigation-bar';
import NavigationItem from 'discourse/components/navigation-item';
@@ -202,6 +204,63 @@ export default {
}.property()
});

TagsShowRoute.reopen({
renderTemplate() {
this.render('sidebar-wrapper');
}
});

TagsShowController.reopen({
mainContent: 'tags/show',

@computed('application.currentPath')
leftSidebarEnabled() {
return Discourse.SiteSettings.layouts_sidebar_left_enabled.split('|').indexOf('tags') > -1
},

@computed('application.currentPath')
rightSidebarEnabled() {
return Discourse.SiteSettings.layouts_sidebar_right_enabled.split('|').indexOf('tags') > -1
},

@computed('application.currentPath')
mainStyle() {
const left = this.get('leftSidebarEnabled');
const right = this.get('rightSidebarEnabled');
return `width: ${getContentWidth(left, right)};`;
},

@computed('application.currentPath', 'loading')
mainClasses() {
const left = this.get('leftSidebarEnabled');
const right = this.get('rightSidebarEnabled');
let classes = 'tags';

if (this.get('loading')) {
return classes + ' loading'
}
if (left || right) {
classes += ' has-sidebars'
}
if (left) {
classes += ' left-sidebar'
}
if (right) {
classes += ' right-sidebar'
}
if (this.get('navigationDisabled')) {
classes += ' navigation-disabled'
}
if (this.get('headerDisabled')) {
classes += ' header-disabled'
}
if (this.get('navMenuEnabled')) {
classes += ' nav-menu-enabled'
}
return classes
}
});

NavigationBar.reopen({
@computed('navItems')
navMenuEnabled() {
@@ -9,7 +9,7 @@ export default createWidget('sidebar', {
let contents = [];
let widgets = [];

if (args.context === 'discovery') {
if (args.context === 'discovery' || args.context === 'tags/show') {
let categoryEnabled = args.category ? args.category.get(`layouts_sidebar_${args.side}_enabled`) : ''
if (!args.category || siteEnabled.indexOf('category') > -1) {
widgets.push(...siteWidgets)
@@ -154,6 +154,18 @@ aside.sidebar {
}
}

#list-area .main-content.tags {
.tag-notification-menu, .dropdown-toggle {
margin: 0;
}
.admin-tag {
margin: 0 8px;
}
.tag-show-heading {
margin: 7px 7px 0 7px;
}
}

.top-lists {
padding: 0 7px;
}
@@ -11,6 +11,7 @@ plugins:
- category
- categories
- topic
- tags
layouts_sidebar_right_enabled:
client: true
type: list
@@ -23,6 +24,7 @@ plugins:
- category
- categories
- topic
- tags
layouts_sidebar_left_widgets:
client: true
default: ''
@@ -57,6 +59,7 @@ plugins:
- top
- category
- categories
- tags
layouts_list_header_disabled:
client: true
type: list

0 comments on commit 7a345ad

Please sign in to comment.
You can’t perform that action at this time.