diff --git a/app/coffee/modules/common/sections.coffee b/app/coffee/modules/common/sections.coffee index e352fb21..2725bf9a 100644 --- a/app/coffee/modules/common/sections.coffee +++ b/app/coffee/modules/common/sections.coffee @@ -27,13 +27,14 @@ module = angular.module("taigaCommon") SECTIONS = { 1: {id: 1, title: 'TIMELINE', path:'timeline'} 2: {id: 2, title: 'SEARCH', path:'search'} - 3: {id: 3, title: 'BACKLOG', path:'backlog'} - 4: {id: 4, title: 'KANBAN', path:'kanban'} - 5: {id: 5, title: 'ISSUES', path:'issues'} - 6: {id: 6, title: 'WIKI', path:'wiki'} - 7: {id: 7, title: 'TEAM', path:'team'} - 8: {id: 8, title: 'MEETUP', path:'meetup'} - 9: {id: 9, title: 'ADMIN', path:'admin'} + 3: {id: 3, title: 'EPICS', path:'epics'} + 4: {id: 4, title: 'BACKLOG', path:'backlog'} + 5: {id: 5, title: 'KANBAN', path:'kanban'} + 6: {id: 6, title: 'ISSUES', path:'issues'} + 7: {id: 7, title: 'WIKI', path:'wiki'} + 8: {id: 8, title: 'TEAM', path:'team'} + 9: {id: 9, title: 'MEETUP', path:'meetup'} + 10: {id: 10, title: 'ADMIN', path:'admin'} } class SectionsService extends taiga.Service diff --git a/app/coffee/modules/user-settings/user-project-settings.coffee b/app/coffee/modules/user-settings/user-project-settings.coffee index cecf11f5..81be563b 100644 --- a/app/coffee/modules/user-settings/user-project-settings.coffee +++ b/app/coffee/modules/user-settings/user-project-settings.coffee @@ -44,6 +44,7 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi constructor: (@scope, @tgSections, @rs, @repo, @confirm) -> @scope.sections = @tgSections.list() + promise = @.loadInitialData() promise.then null, @.onInitialDataError.bind(@) @@ -60,4 +61,9 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi @repo.save(projectSettings).then(onSuccess, onError) + filteredSections: (projectSettings) -> + return _.filter @scope.sections, (section) -> + section.id in projectSettings.allowed_sections + + module.controller("UserProjectSettingsController", UserProjectSettingsController) diff --git a/app/partials/user/user-project-settings.jade b/app/partials/user/user-project-settings.jade index 776fb76c..64d72fb0 100644 --- a/app/partials/user/user-project-settings.jade +++ b/app/partials/user/user-project-settings.jade @@ -28,6 +28,6 @@ div.wrapper( select( id="projects-settings-{{projectSettings.id}}-homepage-dropdown" ng-model="projectSettings.homepage" - ng-options="section.id as section.title for section in sections" + ng-options="section.id as section.title for section in ctrl.filteredSections(projectSettings)" ng-change="ctrl.updateCustomHomePage(projectSettings)" ) \ No newline at end of file