Add filtered sections to project settings
parent
417f9e97c7
commit
2fe9321fd3
|
@ -27,13 +27,14 @@ module = angular.module("taigaCommon")
|
||||||
SECTIONS = {
|
SECTIONS = {
|
||||||
1: {id: 1, title: 'TIMELINE', path:'timeline'}
|
1: {id: 1, title: 'TIMELINE', path:'timeline'}
|
||||||
2: {id: 2, title: 'SEARCH', path:'search'}
|
2: {id: 2, title: 'SEARCH', path:'search'}
|
||||||
3: {id: 3, title: 'BACKLOG', path:'backlog'}
|
3: {id: 3, title: 'EPICS', path:'epics'}
|
||||||
4: {id: 4, title: 'KANBAN', path:'kanban'}
|
4: {id: 4, title: 'BACKLOG', path:'backlog'}
|
||||||
5: {id: 5, title: 'ISSUES', path:'issues'}
|
5: {id: 5, title: 'KANBAN', path:'kanban'}
|
||||||
6: {id: 6, title: 'WIKI', path:'wiki'}
|
6: {id: 6, title: 'ISSUES', path:'issues'}
|
||||||
7: {id: 7, title: 'TEAM', path:'team'}
|
7: {id: 7, title: 'WIKI', path:'wiki'}
|
||||||
8: {id: 8, title: 'MEETUP', path:'meetup'}
|
8: {id: 8, title: 'TEAM', path:'team'}
|
||||||
9: {id: 9, title: 'ADMIN', path:'admin'}
|
9: {id: 9, title: 'MEETUP', path:'meetup'}
|
||||||
|
10: {id: 10, title: 'ADMIN', path:'admin'}
|
||||||
}
|
}
|
||||||
|
|
||||||
class SectionsService extends taiga.Service
|
class SectionsService extends taiga.Service
|
||||||
|
|
|
@ -44,6 +44,7 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi
|
||||||
|
|
||||||
constructor: (@scope, @tgSections, @rs, @repo, @confirm) ->
|
constructor: (@scope, @tgSections, @rs, @repo, @confirm) ->
|
||||||
@scope.sections = @tgSections.list()
|
@scope.sections = @tgSections.list()
|
||||||
|
|
||||||
promise = @.loadInitialData()
|
promise = @.loadInitialData()
|
||||||
promise.then null, @.onInitialDataError.bind(@)
|
promise.then null, @.onInitialDataError.bind(@)
|
||||||
|
|
||||||
|
@ -60,4 +61,9 @@ class UserProjectSettingsController extends mixOf(taiga.Controller, taiga.PageMi
|
||||||
|
|
||||||
@repo.save(projectSettings).then(onSuccess, onError)
|
@repo.save(projectSettings).then(onSuccess, onError)
|
||||||
|
|
||||||
|
filteredSections: (projectSettings) ->
|
||||||
|
return _.filter @scope.sections, (section) ->
|
||||||
|
section.id in projectSettings.allowed_sections
|
||||||
|
|
||||||
|
|
||||||
module.controller("UserProjectSettingsController", UserProjectSettingsController)
|
module.controller("UserProjectSettingsController", UserProjectSettingsController)
|
||||||
|
|
|
@ -28,6 +28,6 @@ div.wrapper(
|
||||||
select(
|
select(
|
||||||
id="projects-settings-{{projectSettings.id}}-homepage-dropdown"
|
id="projects-settings-{{projectSettings.id}}-homepage-dropdown"
|
||||||
ng-model="projectSettings.homepage"
|
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)"
|
ng-change="ctrl.updateCustomHomePage(projectSettings)"
|
||||||
)
|
)
|
Loading…
Reference in New Issue