diff --git a/app/coffee/app.coffee b/app/coffee/app.coffee index 69d9c2d3..59edfa7b 100644 --- a/app/coffee/app.coffee +++ b/app/coffee/app.coffee @@ -81,81 +81,200 @@ configure = ($routeProvider, $locationProvider, $httpProvider, $provide, $tgEven ) $routeProvider.when("/project/:pslug/search", - {templateUrl: "search/search.html", reloadOnSearch: false}) + { + templateUrl: "search/search.html", + reloadOnSearch: false, + section: "search" + } + ) $routeProvider.when("/project/:pslug/backlog", - {templateUrl: "backlog/backlog.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "backlog/backlog.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "backlog" + } + ) $routeProvider.when("/project/:pslug/kanban", - {templateUrl: "kanban/kanban.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "kanban/kanban.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "kanban" + } + ) # Milestone $routeProvider.when("/project/:pslug/taskboard/:sslug", - {templateUrl: "taskboard/taskboard.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "taskboard/taskboard.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "backlog" + } + ) # User stories $routeProvider.when("/project/:pslug/us/:usref", - {templateUrl: "us/us-detail.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "us/us-detail.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "backlog-kanban" + } + ) # Tasks $routeProvider.when("/project/:pslug/task/:taskref", - {templateUrl: "task/task-detail.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "task/task-detail.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "backlog-kanban" + } + ) # Wiki $routeProvider.when("/project/:pslug/wiki", {redirectTo: (params) -> "/project/#{params.pslug}/wiki/home"}, ) $routeProvider.when("/project/:pslug/wiki/:slug", - {templateUrl: "wiki/wiki.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "wiki/wiki.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "wiki" + } + ) # Team $routeProvider.when("/project/:pslug/team", - {templateUrl: "team/team.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "team/team.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "team" + } + ) # Issues $routeProvider.when("/project/:pslug/issues", - {templateUrl: "issue/issues.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "issue/issues.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "issues" + } + ) $routeProvider.when("/project/:pslug/issue/:issueref", - {templateUrl: "issue/issues-detail.html", resolve: {loader: tgLoaderProvider.add()}}) + { + templateUrl: "issue/issues-detail.html", + resolve: {loader: tgLoaderProvider.add()}, + section: "issues" + } + ) # Admin - Project Profile $routeProvider.when("/project/:pslug/admin/project-profile/details", - {templateUrl: "admin/admin-project-profile.html"}) + { + templateUrl: "admin/admin-project-profile.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-profile/default-values", - {templateUrl: "admin/admin-project-default-values.html"}) + { + templateUrl: "admin/admin-project-default-values.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-profile/modules", - {templateUrl: "admin/admin-project-modules.html"}) + { + templateUrl: "admin/admin-project-modules.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-profile/export", - {templateUrl: "admin/admin-project-export.html"}) + { + templateUrl: "admin/admin-project-export.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-profile/reports", - {templateUrl: "admin/admin-project-reports.html"}) + { + templateUrl: "admin/admin-project-reports.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/status", - {templateUrl: "admin/admin-project-values-status.html"}) + { + templateUrl: "admin/admin-project-values-status.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/points", - {templateUrl: "admin/admin-project-values-points.html"}) + { + templateUrl: "admin/admin-project-values-points.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/priorities", - {templateUrl: "admin/admin-project-values-priorities.html"}) + { + templateUrl: "admin/admin-project-values-priorities.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/severities", - {templateUrl: "admin/admin-project-values-severities.html"}) + { + templateUrl: "admin/admin-project-values-severities.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/types", - {templateUrl: "admin/admin-project-values-types.html"}) + { + templateUrl: "admin/admin-project-values-types.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/project-values/custom-fields", - {templateUrl: "admin/admin-project-values-custom-fields.html"}) + { + templateUrl: "admin/admin-project-values-custom-fields.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/memberships", - {templateUrl: "admin/admin-memberships.html"}) + { + templateUrl: "admin/admin-memberships.html", + section: "admin" + } + ) # Admin - Roles $routeProvider.when("/project/:pslug/admin/roles", - {templateUrl: "admin/admin-roles.html"}) + { + templateUrl: "admin/admin-roles.html", + section: "backlog-kanban" + } + ) + # Admin - Third Parties $routeProvider.when("/project/:pslug/admin/third-parties/webhooks", - {templateUrl: "admin/admin-third-parties-webhooks.html"}) + { + templateUrl: "admin/admin-third-parties-webhooks.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/third-parties/github", - {templateUrl: "admin/admin-third-parties-github.html"}) + { + templateUrl: "admin/admin-third-parties-github.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/third-parties/gitlab", - {templateUrl: "admin/admin-third-parties-gitlab.html"}) + { + templateUrl: "admin/admin-third-parties-gitlab.html", + section: "admin" + } + ) $routeProvider.when("/project/:pslug/admin/third-parties/bitbucket", - {templateUrl: "admin/admin-third-parties-bitbucket.html"}) + { + templateUrl: "admin/admin-third-parties-bitbucket.html", + section: "admin" + } + ) # Admin - Contrib Plugins $routeProvider.when("/project/:pslug/admin/contrib/:plugin", {templateUrl: "contrib/main.html"}) @@ -364,7 +483,7 @@ i18nInit = (lang, $translate) -> checksley.updateMessages('default', messages) -init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, $appTitle) -> +init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $navUrls, $appTitle, projectService) -> $log.debug("Initialize application") # Taiga Plugins @@ -392,6 +511,12 @@ init = ($log, $rootscope, $auth, $events, $analytics, $translate, $location, $na if !$auth.isAuthenticated() $location.path($navUrls.resolve("login")) + if next.section + projectService.setSection(next.section) + + if next.params.pslug + projectService.setProject(next.params.pslug) + if next.title $translate(next.title).then (text) => $appTitle.set(text) @@ -419,7 +544,6 @@ modules = [ "taigaWiki", "taigaSearch", "taigaAdmin", - "taigaNavMenu", "taigaProject", "taigaUserSettings", "taigaFeedback", @@ -467,5 +591,6 @@ module.run([ "$tgLocation", "$tgNavUrls", "$appTitle", + "tgProjectService", init ]) diff --git a/app/coffee/modules/admin/project-profile.coffee b/app/coffee/modules/admin/project-profile.coffee index 4c52c643..ada135de 100644 --- a/app/coffee/modules/admin/project-profile.coffee +++ b/app/coffee/modules/admin/project-profile.coffee @@ -106,7 +106,7 @@ module.controller("ProjectProfileController", ProjectProfileController) ## Project Profile Directive ############################################################################# -ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectsService) -> +ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, projectService) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley({"onlyOneErrorElement": true}) submit = debounce 2000, (event) => @@ -115,7 +115,6 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje return if not form.validate() $loading.start(submitButton) - promise = $repo.save($scope.project) promise.then -> $loading.finish(submitButton) @@ -123,7 +122,8 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje newUrl = $navurls.resolve("project-admin-project-profile-details", {project: $scope.project.slug}) $location.path(newUrl) $scope.$emit("project:loaded", $scope.project) - projectsService.fetchProjects() + + projectService.fetchProject() promise.then null, (data) -> $loading.finish(submitButton) @@ -137,7 +137,7 @@ ProjectProfileDirective = ($repo, $confirm, $loading, $navurls, $location, proje return {link:link} -module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjectsService", ProjectProfileDirective]) +module.directive("tgProjectProfile", ["$tgRepo", "$tgConfirm", "$tgLoading", "$tgNavUrls", "$tgLocation", "tgProjectService", ProjectProfileDirective]) ############################################################################# ## Project Default Values Directive @@ -180,7 +180,7 @@ module.directive("tgProjectDefaultValues", ["$tgRepo", "$tgConfirm", "$tgLoading ## Project Modules Directive ############################################################################# -ProjectModulesDirective = ($repo, $confirm, $loading) -> +ProjectModulesDirective = ($repo, $confirm, $loading, projectService) -> link = ($scope, $el, $attrs) -> form = $el.find("form").checksley() submit = => @@ -194,6 +194,8 @@ ProjectModulesDirective = ($repo, $confirm, $loading) -> $confirm.notify("success") $scope.$emit("project:loaded", $scope.project) + projectService.fetchProject() + promise.then null, (data) -> $loading.finish(target) $confirm.notify("error", data._error_message) @@ -222,7 +224,7 @@ ProjectModulesDirective = ($repo, $confirm, $loading) -> return {link:link} -module.directive("tgProjectModules", ["$tgRepo", "$tgConfirm", "$tgLoading", ProjectModulesDirective]) +module.directive("tgProjectModules", ["$tgRepo", "$tgConfirm", "$tgLoading", "tgProjectService", ProjectModulesDirective]) ############################################################################# diff --git a/app/coffee/modules/base/navurls.coffee b/app/coffee/modules/base/navurls.coffee index 32d10e21..7dd626df 100644 --- a/app/coffee/modules/base/navurls.coffee +++ b/app/coffee/modules/base/navurls.coffee @@ -86,7 +86,7 @@ NavigationUrlsDirective = ($navurls, $auth, $q, $location) -> link = ($scope, $el, $attrs) -> if $el.is("a") - $el.attr("href", "#") + $el.attr("href", "") $el.on "mouseenter", (event) -> target = $(event.currentTarget) diff --git a/app/coffee/modules/search.coffee b/app/coffee/modules/search.coffee index a863f7ff..e1d39507 100644 --- a/app/coffee/modules/search.coffee +++ b/app/coffee/modules/search.coffee @@ -107,7 +107,7 @@ module.controller("SearchController", SearchController) ## Search box directive ############################################################################# -SearchBoxDirective = ($lightboxService, $navurls, $location, $route)-> +SearchBoxDirective = (projectService, $lightboxService, $navurls, $location, $route)-> link = ($scope, $el, $attrs) -> project = null @@ -120,7 +120,7 @@ SearchBoxDirective = ($lightboxService, $navurls, $location, $route)-> text = $el.find("#search-text").val() - url = $navurls.resolve("project-search", {project: project.slug}) + url = $navurls.resolve("project-search", {project: project.get("slug")}) $lightboxService.close($el) $scope.$apply -> @@ -128,16 +128,29 @@ SearchBoxDirective = ($lightboxService, $navurls, $location, $route)-> $location.search("text", text).path(url) $route.reload() - $scope.$on "search-box:show", (ctx, newProject)-> - project = newProject + openLightbox = () -> + project = projectService.project + $lightboxService.open($el) - $el.find("#search-text").val("") $el.on "submit", "form", submit - return {link:link} + openLightbox() -module.directive("tgSearchBox", ["lightboxService", "$tgNavUrls", "$tgLocation", "$route", SearchBoxDirective]) + return { + templateUrl: "search/lightbox-search.html", + link:link + } + +SearchBoxDirective.$inject = [ + "tgProjectService", + "lightboxService", + "$tgNavUrls", + "$tgLocation", + "$route" +] + +module.directive("tgSearchBox", SearchBoxDirective) ############################################################################# diff --git a/app/coffee/modules/wiki/main.coffee b/app/coffee/modules/wiki/main.coffee index 75968e1a..8fd60924 100644 --- a/app/coffee/modules/wiki/main.coffee +++ b/app/coffee/modules/wiki/main.coffee @@ -109,7 +109,8 @@ class WikiDetailController extends mixOf(taiga.Controller, taiga.PageMixin) promise = @.loadProject() return promise.then (project) => @.fillUsersAndRoles(project.users, project.roles) - @q.all([@.loadWikiLinks(), @.loadWiki()]) + @q.all([@.loadWikiLinks(), @.loadWiki()]).then () => + delete: -> title = @translate.instant("WIKI.DELETE_LIGHTBOX_TITLE") diff --git a/app/index.jade b/app/index.jade index b795b201..9327e797 100644 --- a/app/index.jade +++ b/app/index.jade @@ -28,8 +28,6 @@ html(lang="en") include partials/includes/modules/lightbox-generic-error div.lightbox.lightbox-generic-loading include partials/includes/modules/lightbox-generic-loading - div.lightbox.lightbox-search(tg-search-box) - include partials/includes/modules/lightbox-search include partials/includes/modules/loader diff --git a/app/modules/components/project-menu/project-menu.controller.coffee b/app/modules/components/project-menu/project-menu.controller.coffee new file mode 100644 index 00000000..441b0a7c --- /dev/null +++ b/app/modules/components/project-menu/project-menu.controller.coffee @@ -0,0 +1,92 @@ +class ProjectMenuController + @.$inject = [ + "tgProjectService", + "tgLightboxFactory" + ] + + constructor: (@projectService, @lightboxFactory) -> + @.project = null + @.menu = Immutable.Map() + + show: () -> + @.project = @projectService.project + + @.active = @._getActiveSection() + + @._setVideoConference() + @._setMenuPermissions() + + hide: () -> + @.project = null + @.menu = {} + + search: () -> + @lightboxFactory.create("tg-search-box", { + "class": "lightbox lightbox-search" + }) + + _setVideoConference: () -> + videoconferenceUrl = @._videoConferenceUrl() + + if videoconferenceUrl + @.project = @.project.set("videoconferenceUrl", videoconferenceUrl) + + _setMenuPermissions: () -> + @.menu = Immutable.Map({ + backlog: false, + kanban: false, + issues: false, + wiki: false + }) + + if @.project.get("is_backlog_activated") && @.project.get("my_permissions").indexOf("view_us") != -1 + @.menu = @.menu.set("backlog", true) + + if @.project.get("is_kanban_activated") && @.project.get("my_permissions").indexOf("view_us") != -1 + @.menu = @.menu.set("kanban", true) + + if @.project.get("is_issues_activated") && @.project.get("my_permissions").indexOf("view_issues") != -1 + @.menu = @.menu.set("issues", true) + + if @.project.get("is_wiki_activated") && @.project.get("my_permissions").indexOf("view_wiki_pages") != -1 + @.menu = @.menu.set("wiki", true) + + _getActiveSection: () -> + sectionName = @projectService.section + sectionsBreadcrumb = @projectService.sectionsBreadcrumb + + indexBacklog = sectionsBreadcrumb.lastIndexOf("backlog") + indexKanban = sectionsBreadcrumb.lastIndexOf("kanban") + + if indexBacklog != -1 || indexKanban != -1 + if indexBacklog > indexKanban + oldSectionName = "backlog" + else + oldSectionName = "kanban" + + if sectionName == "backlog-kanban" + if oldSectionName in ["backlog", "kanban"] + sectionName = oldSectionName + else if @.project.get("is_backlog_activated") && !@.project.get("is_kanban_activated") + sectionName = "backlog" + else if !@.project.get("is_backlog_activated") && @.project.get("is_kanban_activated") + sectionName = "kanban" + + return sectionName + + _videoConferenceUrl: () -> + if @.project.get("videoconferences") == "appear-in" + baseUrl = "https://appear.in/" + else if @.project.get("videoconferences") == "talky" + baseUrl = "https://talky.io/" + else + return "" + + if @.project.get("videoconferences_salt") + url = @.project.get("slug") + "-" + @.project.get("videoconferences_salt") + else + url = @.project.get("slug") + + return baseUrl + url + +angular.module("taigaComponents").controller("ProjectMenu", ProjectMenuController) diff --git a/app/modules/components/project-menu/project-menu.controller.spec.coffee b/app/modules/components/project-menu/project-menu.controller.spec.coffee new file mode 100644 index 00000000..11c81c89 --- /dev/null +++ b/app/modules/components/project-menu/project-menu.controller.spec.coffee @@ -0,0 +1,234 @@ +describe "ProjectMenu", -> + $provide = null + $controller = null + mocks = {} + + _mockProjectService = -> + mocks.projectService = {} + + $provide.value("tgProjectService", mocks.projectService) + + _mockLightboxFactory = -> + mocks.lightboxFactory = { + create: sinon.spy() + } + + $provide.value("tgLightboxFactory", mocks.lightboxFactory) + + _mocks = -> + module (_$provide_) -> + $provide = _$provide_ + + _mockProjectService() + _mockLightboxFactory() + + return null + + _inject = -> + inject (_$controller_) -> + $controller = _$controller_ + + _setup = -> + _mocks() + _inject() + + beforeEach -> + module "taigaComponents" + + _setup() + + it "open search lightbox", () -> + ctrl = $controller("ProjectMenu") + ctrl.search() + + expectation = mocks.lightboxFactory.create.calledWithExactly("tg-search-box", { + "class": "lightbox lightbox-search" + }) + + expect(expectation).to.be.true + + describe "show menu", -> + it "project filled", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.project).to.be.equal(project) + + it "videoconference url", () -> + project = Immutable.fromJS({ + "videoconferences": "appear-in", + "videoconferences_salt": "123", + "slug": "project-slug" + }) + + mocks.projectService.project = project + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + url = "https://appear.in/project-slug-123" + + expect(ctrl.project.get("videoconferenceUrl")).to.be.equal(url) + + describe "menu permissions", () -> + it "all options disable", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + menu = ctrl.menu.toJS() + + expect(menu).to.be.eql({ + backlog: false, + kanban: false, + issues: false, + wiki: false + }) + + it "all options enabled", () -> + project = Immutable.fromJS({ + is_backlog_activated: true, + is_kanban_activated: true, + is_issues_activated: true, + is_wiki_activated: true, + my_permissions: ["view_us", "view_issues", "view_wiki_pages"] + }) + + mocks.projectService.project = project + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + menu = ctrl.menu.toJS() + + expect(menu).to.be.eql({ + backlog: true, + kanban: true, + issues: true, + wiki: true + }) + + it "all options disabled because the user doesn't have permissions", () -> + project = Immutable.fromJS({ + is_backlog_activated: true, + is_kanban_activated: true, + is_issues_activated: true, + is_wiki_activated: true, + my_permissions: [] + }) + + mocks.projectService.project = project + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + menu = ctrl.menu.toJS() + + expect(menu).to.be.eql({ + backlog: false, + kanban: false, + issues: false, + wiki: false + }) + + describe "menu active", () -> + it "backlog", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.section = "backlog" + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("backlog") + + it "backlog-kanban without parent", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.section = "backlog-kanban" + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("backlog-kanban") + + it "backlog-kanban when only kanban is enabled", () -> + project = Immutable.fromJS({ + is_kanban_activated: true, + my_permissions: [] + }) + + mocks.projectService.project = project + mocks.projectService.section = "backlog-kanban" + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("kanban") + + it "backlog-kanban when only backlog is enabled", () -> + project = Immutable.fromJS({ + is_backlog_activated: true, + my_permissions: [] + }) + + mocks.projectService.project = project + mocks.projectService.section = "backlog-kanban" + mocks.projectService.sectionsBreadcrumb = Immutable.List() + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("backlog") + + it "backlog-kanban when is child of kanban", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.section = "backlog-kanban" + mocks.projectService.sectionsBreadcrumb = Immutable.List.of("kanban", "backlog", "oo") + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("kanban") + + it "backlog-kanban when is child of backlog", () -> + project = Immutable.fromJS({}) + + mocks.projectService.project = project + mocks.projectService.section = "backlog-kanban" + mocks.projectService.sectionsBreadcrumb = Immutable.List.of("backlog", "kanban", "oo") + + ctrl = $controller("ProjectMenu") + + ctrl.show() + + expect(ctrl.active).to.be.equal("backlog") diff --git a/app/modules/components/project-menu/project-menu.directive.coffee b/app/modules/components/project-menu/project-menu.directive.coffee new file mode 100644 index 00000000..1f6346bf --- /dev/null +++ b/app/modules/components/project-menu/project-menu.directive.coffee @@ -0,0 +1,28 @@ +taiga = @.taiga + +ProjectMenuDirective = (projectService, lightboxFactory) -> + link = (scope, el, attrs, ctrl) -> + projectChange = () -> + if projectService.project + ctrl.show() + else + ctrl.hide() + + scope.$watch ( () -> + return projectService.project + ), projectChange + + return { + controller: "ProjectMenu", + templateUrl: "components/project-menu/project-menu.html", + link: link, + controllerAs: "vm", + replace: true + } + +ProjectMenuDirective.$inject = [ + "tgProjectService", + "tgLightboxFactory" +] + +angular.module("taigaComponents").directive("tgProjectMenu", ProjectMenuDirective) diff --git a/app/modules/components/project-menu/project-menu.jade b/app/modules/components/project-menu/project-menu.jade new file mode 100644 index 00000000..b3634e55 --- /dev/null +++ b/app/modules/components/project-menu/project-menu.jade @@ -0,0 +1,42 @@ +nav.menu(ng-if="vm.project") + div(class="menu-container") + ul(class="main-nav") + li(id="nav-search") + a(href="", ng-class="{active: vm.active == 'search'}", title="{{'PROJECT.SECTION.SEARCH' | translate}}", tabindex="1", ng-click="vm.search()") + span(class="icon icon-search") + span.helper(translate="PROJECT.SECTION.SEARCH") + + li(id="nav-backlog", ng-if="vm.menu.get('backlog')") + a(ng-class="{active: vm.active == 'backlog'}", title="{{'PROJECT.SECTION.BACKLOG' | translate}}", tg-nav="project-backlog:project=vm.project.get('slug')", tabindex="2") + span(class="icon icon-backlog") + span.helper(translate="PROJECT.SECTION.BACKLOG") + + li(id="nav-kanban", ng-if="vm.menu.get('kanban')") + a(ng-class="{active: vm.active == 'kanban'}", title="{{'PROJECT.SECTION.KANBAN' | translate}}", tg-nav="project-kanban:project=vm.project.get('slug')", tabindex="3") + span(class="icon icon-kanban") + span.helper(translate="PROJECT.SECTION.KANBAN") + + li(id="nav-issues", ng-if="vm.menu.get('issues')") + a(ng-class="{active: vm.active == 'issues'}", title="{{'PROJECT.SECTION.ISSUES' | translate}}", tg-nav="project-issues:project=vm.project.get('slug')", tabindex="4") + span(class="icon icon-issues") + span.helper(translate="PROJECT.SECTION.ISSUES") + + li(id="nav-wiki", ng-if="vm.menu.get('wiki')") + a(ng-class="{active: vm.active == 'wiki'}", title="{{'PROJECT.SECTION.WIKI' | translate}}", tg-nav="project-wiki:project=vm.project.get('slug')", tabindex="5") + span(class="icon icon-wiki") + span.helper(translate="PROJECT.SECTION.WIKI") + + li(id="nav-team") + a(ng-class="{active: vm.active == 'team'}", title="{{'PROJECT.SECTION.TEAM' | translate}}", tg-nav="project-team:project=vm.project.get('slug')", tabindex="6") + span(class="icon icon-team") + span.helper(translate="PROJECT.SECTION.TEAM") + + li(id="nav-video", ng-if="vm.project.get('videoconferenceUrl')") + a(ng-href="{{vm.project.get('videoconferenceUrl')}}", target="_blank", title="{{'PROJECT.SECTION.MEETUP' | translate}}", tabindex="7") + span(class="icon icon-video") + span.helper(translate="PROJECT.SECTION.MEETUP") + + li(id="nav-admin", ng-if="vm.project.get('i_am_owner')") + a(ng-class="{active: vm.active == 'admin'}", tg-nav="project-admin-home:project=vm.project.get('slug')", title="{{'PROJECT.SECTION.ADMIN' | translate}}", tabindex="8") + span(class="icon icon-settings") + span.helper(translate="PROJECT.SECTION.ADMIN") diff --git a/app/modules/projects/project/project.jade b/app/modules/projects/project/project.jade index 20884bac..e7248cfd 100644 --- a/app/modules/projects/project/project.jade +++ b/app/modules/projects/project/project.jade @@ -1,4 +1,5 @@ div.wrapper + div(tg-project-menu) div.main.centered.single-project section.single-project-intro h1 diff --git a/app/modules/services/project.service.coffee b/app/modules/services/project.service.coffee new file mode 100644 index 00000000..e1edf0f8 --- /dev/null +++ b/app/modules/services/project.service.coffee @@ -0,0 +1,30 @@ +taiga = @.taiga + +class ProjectService + @.$inject = [ + "tgProjectsService" + ] + + constructor: (@projectsService) -> + @._project = null + @._section = null + @._sectionsBreadcrumb = Immutable.List() + + taiga.defineImmutableProperty @, "project", () => return @._project + taiga.defineImmutableProperty @, "section", () => return @._section + taiga.defineImmutableProperty @, "sectionsBreadcrumb", () => return @._sectionsBreadcrumb + + setSection: (section) -> + @._section = section + @._sectionsBreadcrumb = @._sectionsBreadcrumb.unshift(@._section) + + setProject: (pslug) -> + if @._pslug != pslug + @._pslug = pslug + @.fetchProject() + + fetchProject: () -> + return @projectsService.getProjectBySlug(@._pslug).then (project) => + @._project = project + +angular.module("taigaCommon").service("tgProjectService", ProjectService) diff --git a/app/modules/services/project.service.spec.coffee b/app/modules/services/project.service.spec.coffee new file mode 100644 index 00000000..8e430631 --- /dev/null +++ b/app/modules/services/project.service.spec.coffee @@ -0,0 +1,76 @@ +describe "tgProjectService", -> + $provide = null + mocks = {} + projectService = null + + _mockProjectsService = () -> + mocks.projectsService = { + getProjectBySlug: sinon.stub().promise() + } + + $provide.value "tgProjectsService", mocks.projectsService + + _mocks = () -> + module (_$provide_) -> + $provide = _$provide_ + + _mockProjectsService() + + return null + + _setup = () -> + _mocks() + + _inject = () -> + inject (_tgProjectService_) -> + projectService = _tgProjectService_ + + beforeEach -> + module "taigaCommon" + + _setup() + _inject() + + it "update section and add it at the begginning of section breadcrumb", () -> + section = "fakeSection" + breadcrumb = ["fakeSection"] + + projectService.setSection(section) + + expect(projectService.section).to.be.equal(section) + expect(projectService.sectionsBreadcrumb.toJS()).to.be.eql(breadcrumb) + + section = "fakeSection222" + breadcrumb = ["fakeSection222","fakeSection"] + projectService.setSection(section) + + expect(projectService.sectionsBreadcrumb.toJS()).to.be.eql(breadcrumb) + + it "set project if the project slug has changed", () -> + projectService.fetchProject = sinon.spy() + + pslug = "slug-1" + + projectService.setProject(pslug) + + expect(projectService.fetchProject).to.be.calledOnce + + projectService.setProject(pslug) + + expect(projectService.fetchProject).to.be.calledOnce + + projectService.setProject("slug-2") + + expect(projectService.fetchProject).to.be.calledTwice + + it "fetch project", (done) -> + project = Immutable.Map({id: 1}) + pslug = "slug-1" + + projectService._pslug = pslug + + mocks.projectsService.getProjectBySlug.withArgs(pslug).resolve(project) + + projectService.fetchProject().then () -> + expect(projectService.project).to.be.equal(project) + done() diff --git a/app/partials/admin/admin-memberships.jade b/app/partials/admin/admin-memberships.jade index 67c08184..90a597b4 100644 --- a/app/partials/admin/admin-memberships.jade +++ b/app/partials/admin/admin-memberships.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.memberships(ng-controller="MembershipsController as ctrl", ng-init="section='admin'; sectionName='ADMIN.MEMBERSHIPS.TITLE'", tg-memberships) - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="memberships") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-default-values.jade b/app/partials/admin/admin-project-default-values.jade index 5ab040e9..6ab63645 100644 --- a/app/partials/admin/admin-project-default-values.jade +++ b/app/partials/admin/admin-project-default-values.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-project-default-values, ng-controller="ProjectProfileController as ctrl", ng-init="section='admin'; sectionName='ADMIN.PROJECT_DEFAULT_VALUES.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-export.jade b/app/partials/admin/admin-project-export.jade index 7b28020d..8a3a9204 100644 --- a/app/partials/admin/admin-project-export.jade +++ b/app/partials/admin/admin-project-export.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="ProjectProfileController as ctrl", ng-init="section='admin'; sectionName='ADMIN.PROJECT_EXPORT.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-modules.jade b/app/partials/admin/admin-project-modules.jade index ddf37af1..bbeae4fc 100644 --- a/app/partials/admin/admin-project-modules.jade +++ b/app/partials/admin/admin-project-modules.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-project-modules, ng-controller="ProjectProfileController as ctrl", ng-init="section='admin'; sectionName='ADMIN.MODULES.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-profile.jade b/app/partials/admin/admin-project-profile.jade index fb382699..dd86c30e 100644 --- a/app/partials/admin/admin-project-profile.jade +++ b/app/partials/admin/admin-project-profile.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl", ng-init="section='admin'; sectionName='ADMIN.PROJECT_PROFILE.PROJECT_DETAILS'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-reports.jade b/app/partials/admin/admin-project-reports.jade index 7ca8e6c0..0f750e86 100644 --- a/app/partials/admin/admin-project-reports.jade +++ b/app/partials/admin/admin-project-reports.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="ProjectProfileController as ctrl", ng-init="section='admin'; sectionName='ADMIN.REPORTS.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-profile") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-custom-fields.jade b/app/partials/admin/admin-project-values-custom-fields.jade index f93775d4..eb776e88 100644 --- a/app/partials/admin/admin-project-values-custom-fields.jade +++ b/app/partials/admin/admin-project-values-custom-fields.jade @@ -3,7 +3,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController", ng-init="sectionName='ADMIN.CUSTOM_FIELDS.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-points.jade b/app/partials/admin/admin-project-values-points.jade index 9fca5183..5d00e952 100644 --- a/app/partials/admin/admin-project-values-points.jade +++ b/app/partials/admin/admin-project-values-points.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-priorities.jade b/app/partials/admin/admin-project-values-priorities.jade index cfbb9554..fbeab122 100644 --- a/app/partials/admin/admin-project-values-priorities.jade +++ b/app/partials/admin/admin-project-values-priorities.jade @@ -1,7 +1,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-severities.jade b/app/partials/admin/admin-project-values-severities.jade index 91382a63..efeb3570 100644 --- a/app/partials/admin/admin-project-values-severities.jade +++ b/app/partials/admin/admin-project-values-severities.jade @@ -1,7 +1,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-status.jade b/app/partials/admin/admin-project-values-status.jade index 009ec54f..935b4ddf 100644 --- a/app/partials/admin/admin-project-values-status.jade +++ b/app/partials/admin/admin-project-values-status.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController", ng-init="section='admin'; sectionName='ADMIN.PROJECT_VALUES_STATUS.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-project-values-types.jade b/app/partials/admin/admin-project-values-types.jade index 63daf5fe..283a6a1f 100644 --- a/app/partials/admin/admin-project-values-types.jade +++ b/app/partials/admin/admin-project-values-types.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="ProjectValuesSectionController" ng-init="sectionName='ADMIN.PROJECT_VALUES_TYPES.TITLE'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="project-values") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-roles.jade b/app/partials/admin/admin-roles.jade index 8ab7a050..d102edef 100644 --- a/app/partials/admin/admin-roles.jade +++ b/app/partials/admin/admin-roles.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.roles(ng-controller="RolesController as ctrl", ng-init="section='admin'", tg-roles) - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="roles") include ../includes/modules/admin-menu diff --git a/app/partials/admin/admin-third-parties-bitbucket.jade b/app/partials/admin/admin-third-parties-bitbucket.jade index 95aabb22..45448da2 100644 --- a/app/partials/admin/admin-third-parties-bitbucket.jade +++ b/app/partials/admin/admin-third-parties-bitbucket.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.roles(tg-bitbucket-webhooks, ng-controller="BitbucketController as ctrl", ng-init="section='admin'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties") include ../includes/modules/admin-menu sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-bitbucket") diff --git a/app/partials/admin/admin-third-parties-github.jade b/app/partials/admin/admin-third-parties-github.jade index 99785f93..b5d1f999 100644 --- a/app/partials/admin/admin-third-parties-github.jade +++ b/app/partials/admin/admin-third-parties-github.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.roles(tg-github-webhooks, ng-controller="GithubController as ctrl", ng-init="section='admin'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties") include ../includes/modules/admin-menu sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-github") diff --git a/app/partials/admin/admin-third-parties-gitlab.jade b/app/partials/admin/admin-third-parties-gitlab.jade index d9d67ad4..9aff61d8 100644 --- a/app/partials/admin/admin-third-parties-gitlab.jade +++ b/app/partials/admin/admin-third-parties-gitlab.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.roles(tg-gitlab-webhooks, ng-controller="GitlabController as ctrl", ng-init="section='admin'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties") include ../includes/modules/admin-menu sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-gitlab") diff --git a/app/partials/admin/admin-third-parties-webhooks.jade b/app/partials/admin/admin-third-parties-webhooks.jade index 3eaad257..68c119db 100644 --- a/app/partials/admin/admin-third-parties-webhooks.jade +++ b/app/partials/admin/admin-third-parties-webhooks.jade @@ -2,7 +2,7 @@ doctype html div.wrapper.roles(ng-controller="WebhooksController as ctrl", ng-init="section='admin'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="third-parties") include ../includes/modules/admin-menu sidebar.menu-tertiary.sidebar(tg-admin-navigation="third-parties-webhooks") diff --git a/app/partials/backlog/backlog.jade b/app/partials/backlog/backlog.jade index 9bf5254a..5a7dd48c 100644 --- a/app/partials/backlog/backlog.jade +++ b/app/partials/backlog/backlog.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-backlog, ng-controller="BacklogController as ctrl", ng-init="section='backlog'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.extrabar.filters-bar(tg-backlog-filters) include ../includes/modules/backlog-filters section.main.backlog diff --git a/app/partials/contrib/main.jade b/app/partials/contrib/main.jade index b3eba848..81533024 100644 --- a/app/partials/contrib/main.jade +++ b/app/partials/contrib/main.jade @@ -1,7 +1,7 @@ doctype html div.wrapper.roles(ng-init="section='admin'", ng-controller="ContribController as ctrl") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-admin-navigation="contrib") include ../includes/modules/admin-menu diff --git a/app/partials/issue/issues-detail.jade b/app/partials/issue/issues-detail.jade index f53641da..000369bc 100644 --- a/app/partials/issue/issues-detail.jade +++ b/app/partials/issue/issues-detail.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="IssueDetailController as ctrl", ng-init="section='issues'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) div.main.us-detail div.us-detail-header.header-with-actions include ../includes/components/mainTitle diff --git a/app/partials/issue/issues.jade b/app/partials/issue/issues.jade index 62fe9ec8..45e2fbd0 100644 --- a/app/partials/issue/issues.jade +++ b/app/partials/issue/issues.jade @@ -1,7 +1,7 @@ doctype html div.wrapper.issues(tg-issues, ng-controller="IssuesController as ctrl", ng-init="section='issues'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.extrabar.filters-bar(tg-issues-filters) include ../includes/modules/issues-filters diff --git a/app/partials/kanban/kanban.jade b/app/partials/kanban/kanban.jade index 96b47004..06a05904 100644 --- a/app/partials/kanban/kanban.jade +++ b/app/partials/kanban/kanban.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-kanban, ng-controller="KanbanController as ctrl" ng-init="section='kanban'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) section.main.kanban include ../includes/components/mainTitle include ../includes/modules/kanban-table diff --git a/app/partials/project/project-list.jade b/app/partials/project/project-list.jade deleted file mode 100644 index 34c72020..00000000 --- a/app/partials/project/project-list.jade +++ /dev/null @@ -1,7 +0,0 @@ -div(tg-projects-pagination) - ul.projects-list - <% _.each(projects, function(project) { %> - li - a.button(href!='<%- project.url %>') - <%- project.name %> - <% }) %> diff --git a/app/partials/project/project-menu.jade b/app/partials/project/project-menu.jade deleted file mode 100644 index 75e3fbca..00000000 --- a/app/partials/project/project-menu.jade +++ /dev/null @@ -1,46 +0,0 @@ -div(class="menu-container") - ul(class="main-nav") - li(id="nav-search") - a(href="", title="{{'PROJECT.SECTION.SEARCH' | translate}}", tabindex="1") - span(class="icon icon-search") - span.helper(translate="PROJECT.SECTION.SEARCH") - <% if (project.is_backlog_activated && project.my_permissions.indexOf("view_us") != -1) { %> - li(id="nav-backlog") - a(href="" title="{{'PROJECT.SECTION.BACKLOG' | translate}}" tg-nav="project-backlog:project=project.slug", tabindex="1") - span(class="icon icon-backlog") - span.helper(translate="PROJECT.SECTION.BACKLOG") - <% } %> - <% if (project.is_kanban_activated && project.my_permissions.indexOf("view_us") != -1) { %> - li(id="nav-kanban") - a(href="" title="{{'PROJECT.SECTION.KANBAN' | translate}}" tg-nav="project-kanban:project=project.slug", tabindex="1") - span(class="icon icon-kanban") - span.helper(translate="PROJECT.SECTION.KANBAN") - <% } %> - <% if (project.is_issues_activated && project.my_permissions.indexOf("view_issues") != -1) { %> - li(id="nav-issues") - a(href="" title="{{'PROJECT.SECTION.ISSUES' | translate}}" tg-nav="project-issues:project=project.slug", tabindex="1") - span(class="icon icon-issues") - span.helper(translate="PROJECT.SECTION.ISSUES") - <% } %> - <% if (project.is_wiki_activated && project.my_permissions.indexOf("view_wiki_pages") != -1) { %> - li(id="nav-wiki") - a(href="" title="{{'PROJECT.SECTION.WIKI' | translate}}" tg-nav="project-wiki:project=project.slug", tabindex="1") - span(class="icon icon-wiki") - span.helper(translate="PROJECT.SECTION.WIKI") - <% } %> - li(id="nav-team") - a(href="" title="{{'PROJECT.SECTION.TEAM' | translate}}" tg-nav="project-team:project=project.slug", tabindex="1") - span(class="icon icon-team") - span.helper(translate="PROJECT.SECTION.TEAM") - <% if (project.videoconferences) { %> - li(id="nav-video") - a(href!="<%- project.videoconferenceUrl %>" target="_blank" title="{{'PROJECT.SECTION.MEETUP' | translate}}", tabindex="1") - span(class="icon icon-video") - span.helper(translate="PROJECT.SECTION.MEETUP") - <% } %> - <% if (project.i_am_owner) { %> - li(id="nav-admin") - a(href="" tg-nav="project-admin-home:project=project.slug" title="{{'PROJECT.SECTION.ADMIN' | translate}}", tabindex="1") - span(class="icon icon-settings") - span.helper(translate="PROJECT.SECTION.ADMIN") - <% } %> diff --git a/app/partials/project/project-navigation-list.jade b/app/partials/project/project-navigation-list.jade deleted file mode 100644 index 027d9dd8..00000000 --- a/app/partials/project/project-navigation-list.jade +++ /dev/null @@ -1,6 +0,0 @@ -<% _.each(projects, function(project) { %> -li - a(href!="<%- project.url %>") - span(class="project-name") <%- project.name %> - span(class="icon icon-arrow-right") -<% }) %> \ No newline at end of file diff --git a/app/partials/includes/modules/lightbox-search.jade b/app/partials/search/lightbox-search.jade similarity index 100% rename from app/partials/includes/modules/lightbox-search.jade rename to app/partials/search/lightbox-search.jade diff --git a/app/partials/search/search.jade b/app/partials/search/search.jade index 0b3c2916..ce618532 100644 --- a/app/partials/search/search.jade +++ b/app/partials/search/search.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-search, ng-controller="SearchController as ctrl", ng-init="section='search'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar include ../includes/modules/search-in diff --git a/app/partials/task/task-detail.jade b/app/partials/task/task-detail.jade index 89e5541e..f1b81a94 100644 --- a/app/partials/task/task-detail.jade +++ b/app/partials/task/task-detail.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="TaskDetailController as ctrl", ng-init="section='backlog-kanban'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) div.main.us-detail div.us-detail-header.header-with-actions include ../includes/components/mainTitle diff --git a/app/partials/taskboard/taskboard.jade b/app/partials/taskboard/taskboard.jade index 8f757855..8558f454 100644 --- a/app/partials/taskboard/taskboard.jade +++ b/app/partials/taskboard/taskboard.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-taskboard, ng-controller="TaskboardController as ctrl", ng-init="section='backlog'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) section.main.taskboard .taskboard-inner h1 diff --git a/app/partials/team/team.jade b/app/partials/team/team.jade index ac949f81..d9295c68 100644 --- a/app/partials/team/team.jade +++ b/app/partials/team/team.jade @@ -1,7 +1,7 @@ doctype html div.wrapper(ng-controller="TeamController as ctrl", ng-init="section='team'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary include ../includes/modules/team/team-filters section.main.team diff --git a/app/partials/us/us-detail.jade b/app/partials/us/us-detail.jade index 3d1d5f67..48bc7b4e 100644 --- a/app/partials/us/us-detail.jade +++ b/app/partials/us/us-detail.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="UserStoryDetailController as ctrl", ng-init="section='backlog-kanban'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) div.main.us-detail div.us-detail-header.header-with-actions include ../includes/components/mainTitle diff --git a/app/partials/user/mail-notifications.jade b/app/partials/user/mail-notifications.jade index d79ec9b2..1782b07a 100644 --- a/app/partials/user/mail-notifications.jade +++ b/app/partials/user/mail-notifications.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-user-notifications, ng-controller="UserNotificationsController as ctrl", ng-init="section='mail-notifications'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-user-settings-navigation="mail-notifications") include ../includes/modules/user-settings-menu diff --git a/app/partials/user/user-change-password.jade b/app/partials/user/user-change-password.jade index 0b75a899..fc574550 100644 --- a/app/partials/user/user-change-password.jade +++ b/app/partials/user/user-change-password.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-user-change-password, ng-controller="UserChangePasswordController as ctrl", ng-init="section='user-settings'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-user-settings-navigation="change-password") include ../includes/modules/user-settings-menu diff --git a/app/partials/user/user-profile.jade b/app/partials/user/user-profile.jade index d4d3ced0..cb5aea81 100644 --- a/app/partials/user/user-profile.jade +++ b/app/partials/user/user-profile.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(tg-user-profile, ng-controller="UserSettingsController as ctrl", ng-init="section='user-settings'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.sidebar.settings-nav(tg-user-settings-navigation="user-profile") include ../includes/modules/user-settings-menu diff --git a/app/partials/wiki/wiki.jade b/app/partials/wiki/wiki.jade index c90bc5a8..dd4df281 100644 --- a/app/partials/wiki/wiki.jade +++ b/app/partials/wiki/wiki.jade @@ -2,7 +2,7 @@ doctype html div.wrapper(ng-controller="WikiDetailController as ctrl", ng-init="section='wiki'") - nav.menu.hidden(tg-project-menu) + div(tg-project-menu) sidebar.menu-secondary.extrabar(tg-check-permission="view_wiki_links") section.wiki-nav(tg-wiki-nav, ng-model="wikiLinks") section.main.wiki diff --git a/app/styles/modules/common/nav.scss b/app/styles/modules/common/nav.scss index db1da2e4..74204594 100644 --- a/app/styles/modules/common/nav.scss +++ b/app/styles/modules/common/nav.scss @@ -21,8 +21,8 @@ $label-arrow-wh: 12px; position: relative; } a:hover { - //color: $fresh-taiga; background: rgba($black, .2); + color: $fresh-taiga; transition: color .3s linear; .helper { @extend %small;