Adding translations
parent
d46a8ac2e0
commit
4b00f20443
|
@ -543,9 +543,30 @@
|
|||
"SECTION_TITLE": "Your projects",
|
||||
"PLACEHOLDER_SEARCH": "Search in...",
|
||||
"ACTION_CREATE_PROJECT": "Create project",
|
||||
"SEE_MORE_PROJECTS": "See more projects",
|
||||
"TITLE_ACTION_IMPORT": "Import project",
|
||||
"TITLE_PRVIOUS_PROJECT": "Show previous projects",
|
||||
"TITLE_NEXT_PROJECT": "Show next projects"
|
||||
"TITLE_NEXT_PROJECT": "Show next projects",
|
||||
"HELP_TITLE": "Taiga Support Page",
|
||||
"HELP": "Help",
|
||||
"FEEDBACK_TITLE": "Send feedback",
|
||||
"FEEDBACK": "Feedback",
|
||||
"NOTIFICATIONS_TITLE": "Edit your notification settings",
|
||||
"NOTIFICATIONS": "Notifications",
|
||||
"ORGANIZATIONS_TITLE": "Edit your organizations",
|
||||
"ORGANIZATIONS": "Edit organizations",
|
||||
"SETTINGS_TITLE": "Edit your settings",
|
||||
"SETTINGS": "Settings",
|
||||
"VIEW_PROFILE_TITLE": "View Profile",
|
||||
"VIEW_PROFILE": "View Profile",
|
||||
"EDIT_PROFILE_TITLE": "Edit your profile",
|
||||
"EDIT_PROFILE": "Edit Profile",
|
||||
"CHANGE_PASSWORD_TITLE": "Change password",
|
||||
"CHANGE_PASSWORD": "Change password",
|
||||
"DASHBOARD_TITLE": "Dashboard",
|
||||
"DISCOVER_TITLE": "Discover trending projects",
|
||||
"DISCOVER": "Discover"
|
||||
|
||||
},
|
||||
"IMPORT": {
|
||||
"TITLE": "Importing Project",
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#TODO: fill correctly when implemented
|
||||
a(href="#", title="Organizations")
|
||||
include ../../../svg/organizations.svg
|
||||
|
||||
|
|
|
@ -1,14 +1,20 @@
|
|||
DropdownProjectListDirective = () ->
|
||||
DropdownProjectListDirective = (projectsService) ->
|
||||
link = (scope, el, attrs, ctrl) ->
|
||||
scope.vm = {}
|
||||
|
||||
projectsService.projectsSuscription (projects) ->
|
||||
scope.vm.projects = projects
|
||||
|
||||
projectsService.getProjects()
|
||||
|
||||
directive = {
|
||||
templateUrl: "navigation-bar/dropdown-project-list/dropdown-project-list.html"
|
||||
controller: "ProjectsController"
|
||||
scope: {}
|
||||
bindToController: true
|
||||
controllerAs: "vm"
|
||||
link: link
|
||||
}
|
||||
|
||||
return directive
|
||||
|
||||
|
||||
angular.module("taigaNavigationBar").directive("tgDropdownProjectList",
|
||||
DropdownProjectListDirective)
|
||||
["tgProjects", DropdownProjectListDirective])
|
||||
|
|
|
@ -8,5 +8,14 @@ div.navbar-dropdown.dropdown-project-list
|
|||
ng-bind="::project.name"
|
||||
tg-nav="project:project=project.slug")
|
||||
|
||||
a.see-more-projects-btn.button-gray(tg-nav="projects", href="#", title="See more projects") See more
|
||||
a.create-project-btn.button-green(href="#", ng-click="vm.newProject()", title="Create project") Create project
|
||||
a.see-more-projects-btn.button-gray(
|
||||
href="#",
|
||||
tg-nav="projects",
|
||||
title="{{'PROJECT.NAVIGATION.SEE_MORE_PROJECTS' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.SEE_MORE_PROJECTS")
|
||||
|
||||
a.create-project-btn.button-green(
|
||||
href="#",
|
||||
ng-click="vm.newProject()",
|
||||
title="{{'PROJECT.NAVIGATION.ACTION_CREATE_PROJECT' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.ACTION_CREATE_PROJECT")
|
||||
|
|
|
@ -5,20 +5,56 @@ a.user-avatar(href="#", title="{{ vm.user.full_name_display }}")
|
|||
div.navbar-dropdown.dropdown-user
|
||||
ul
|
||||
li
|
||||
a(href="#", title="{{ user.fullname }} profile") View Profile
|
||||
a(
|
||||
href="#",
|
||||
title="{{'PROJECT.NAVIGATION.VIEW_PROFILE_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.VIEW_PROFILE")
|
||||
li
|
||||
a(href="#", tg-nav="user-settings-user-profile", title="Edit your profile") Edit Profile
|
||||
a(
|
||||
href="#",
|
||||
tg-nav="user-settings-user-profile",
|
||||
title="{{'PROJECT.NAVIGATION.EDIT_PROFILE_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.EDIT_PROFILE")
|
||||
li
|
||||
a(href="#", tg-nav="user-settings-user-change-password", title="Change password") Change password
|
||||
a(
|
||||
href="#",
|
||||
tg-nav="user-settings-user-change-password",
|
||||
title="{{'PROJECT.NAVIGATION.CHANGE_PASSWORD_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.CHANGE_PASSWORD")
|
||||
|
||||
//li
|
||||
// a(href="#", title="Edit your organizations") Edit Organizations
|
||||
// a(
|
||||
// href="#",
|
||||
// title="{{'PROJECT.NAVIGATION.ORGANIZATIONS_TITLE' | translate}}",
|
||||
// translate="PROJECT.NAVIGATION.ORGANIZATIONS")
|
||||
//li
|
||||
// a(href="#", title="Edit your settings") Settings
|
||||
// a(
|
||||
// href="#",
|
||||
// title="{{'PROJECT.NAVIGATION.SETTINGS_TITLE' | translate}}",
|
||||
// translate="PROJECT.NAVIGATION.SETTINGS")
|
||||
|
||||
li
|
||||
a(href="#", tg-nav="user-settings-mail-notifications", title="Edit your notifications") Notifications
|
||||
a(
|
||||
href="#",
|
||||
tg-nav="user-settings-mail-notifications",
|
||||
title="{{'PROJECT.NAVIGATION.NOTIFICATIONS_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.NOTIFICATIONS")
|
||||
|
||||
li(ng-show="vm.isFeedbackEnabled()")
|
||||
a(ng-click="vm.sendFeedback()", href="#", title="Send feedback") Feedback
|
||||
a(
|
||||
href="#",
|
||||
ng-click="vm.sendFeedback()",
|
||||
title="{{'PROJECT.NAVIGATION.FEEDBACK_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.FEEDBACK")
|
||||
li
|
||||
a(href="https://taiga.io/support/", target="_blank", title="Go to support") Help
|
||||
a(
|
||||
href="https://taiga.io/support/",
|
||||
target="_blank",
|
||||
title="{{'PROJECT.NAVIGATION.HELP_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.HELP")
|
||||
li
|
||||
a(href="#", ng-click="vm.logout()", title="Logout") Logout
|
||||
a(
|
||||
href="#",
|
||||
ng-click="vm.logout()",
|
||||
title="{{'COMMON.LOGOUT' | translate}}",
|
||||
translate="COMMON.LOGOUT")
|
||||
|
|
|
@ -1,13 +1,29 @@
|
|||
nav.navbar
|
||||
div.nav-left
|
||||
a.logo(href="#", tg-nav="home", title="Dashboard")
|
||||
a.logo(
|
||||
href="#",
|
||||
tg-nav="home",
|
||||
title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}")
|
||||
|
||||
include ../../svg/logo.svg
|
||||
|
||||
//a(href="#", title="Discover trending projects") Discover
|
||||
a(href="https://taiga.io/support/", target="_blank", title="Taiga Support Page") Help
|
||||
//a(
|
||||
// href="#",
|
||||
// title="{{'PROJECT.NAVIGATION.DISCOVER_TITLE' | translate}}",
|
||||
// translate="PROJECT.NAVIGATION.DISCOVER")
|
||||
|
||||
a(
|
||||
href="https://taiga.io/support/",
|
||||
target="_blank",
|
||||
title="{{'PROJECT.NAVIGATION.HELP_TITLE' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.HELP")
|
||||
|
||||
div.nav-right
|
||||
a(href="", tg-nav="home", title="Dashboard")
|
||||
a(
|
||||
href="#",
|
||||
tg-nav="home",
|
||||
title="{{'PROJECT.NAVIGATION.DASHBOARD_TITLE' | translate}}",
|
||||
|
||||
include ../../svg/dashboard.svg
|
||||
|
||||
div.topnav-dropdown-wrapper(tg-dropdown-project-list)
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
ProjectsListingDirective = ($rs) ->
|
||||
ProjectsListingDirective = (projectsService) ->
|
||||
link = (scope, el, attrs, ctrl) ->
|
||||
scope.vm = {}
|
||||
itemEl = null
|
||||
tdom = el.find(".js-sortable")
|
||||
|
||||
|
@ -19,22 +20,31 @@ ProjectsListingDirective = ($rs) ->
|
|||
for value, index in scope.sorted_project_ids
|
||||
sortData.push({"project_id": value, "order":index})
|
||||
|
||||
$rs.projects.bulkUpdateOrder(sortData)
|
||||
projectsService.bulkUpdateProjectsOrder(sortData)
|
||||
|
||||
scope.$watch "vm.projects", (projects) =>
|
||||
if projects?
|
||||
scope.sorted_project_ids = _.map(projects.all, (p) -> p.id)
|
||||
projectsService.projectsSuscription (projects) ->
|
||||
scope.vm.projects = projects
|
||||
scope.sorted_project_ids = _.map(projects.all, (p) -> p.id)
|
||||
|
||||
projectsService.getProjects(true)
|
||||
|
||||
"""
|
||||
projectsService.fetchProjects().then (projects) ->
|
||||
Object.defineProperty scope.vm, "projects", {
|
||||
get: () ->
|
||||
projects = projectsService.getProjects()
|
||||
if projects
|
||||
scope.sorted_project_ids = _.map(projects.all, (p) -> p.id)
|
||||
return projects
|
||||
}
|
||||
"""
|
||||
directive = {
|
||||
templateUrl: "projects/listing/listing.html"
|
||||
controller: "ProjectsController"
|
||||
scope: {}
|
||||
bindToController: true
|
||||
controllerAs: "vm"
|
||||
link: link
|
||||
}
|
||||
|
||||
return directive
|
||||
|
||||
angular.module("taigaProjects").directive("tgProjectsListing",
|
||||
["$tgResources", ProjectsListingDirective])
|
||||
["tgProjects", ProjectsListingDirective])
|
||||
|
|
|
@ -1,4 +1,8 @@
|
|||
a.create-project-btn.button-green(href="#", ng-click="vm.newProject()", title="Create project") Create project
|
||||
a.create-project-btn.button-green(
|
||||
href="#",
|
||||
ng-click="vm.newProject()",
|
||||
title="{{'PROJECT.NAVIGATION.ACTION_CREATE_PROJECT' | translate}}",
|
||||
translate="PROJECT.NAVIGATION.ACTION_CREATE_PROJECT")
|
||||
|
||||
h2 Esto es sortable y persiste en el servidor! ;)
|
||||
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
class ProjectsPageController extends taiga.Controller
|
||||
@.$inject = [
|
||||
"$scope",
|
||||
"$q",
|
||||
"$tgResources",
|
||||
"$rootScope",
|
||||
"$tgNavUrls",
|
||||
"$tgAuth",
|
||||
"$tgLocation",
|
||||
"$appTitle",
|
||||
"$projectUrl",
|
||||
"$tgConfig",
|
||||
"tgLoader",
|
||||
"tgProjects"
|
||||
]
|
||||
|
||||
constructor: (@scope, @q, @rs, @rootscope, @navUrls, @auth, @location,
|
||||
@appTitle, @projectUrl, @config, tgLoader, @projects) ->
|
||||
@appTitle.set("Projects")
|
||||
|
||||
if !@auth.isAuthenticated()
|
||||
@location.path(@navUrls.resolve("login"))
|
||||
|
||||
#TODO:
|
||||
@.user = @auth.getUser()
|
||||
|
||||
#Projects
|
||||
promise = @projects.fetchProjects()
|
||||
|
||||
# Finally
|
||||
promise.finally tgLoader.pageLoaded
|
||||
|
||||
|
||||
angular.module("taigaProjects").controller("ProjectsPage", ProjectsPageController)
|
|
@ -1 +1 @@
|
|||
div(tg-projects-listing)
|
||||
div(ng-controller="ProjectsPage", tg-projects-listing)
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
class ProjectsService extends taiga.Service
|
||||
@.$inject = ["$q", "$tgResources", "$rootScope", "$projectUrl"]
|
||||
|
||||
constructor: (@q, @rs, @rootscope, @projectUrl) ->
|
||||
@.projectsPromise = null
|
||||
@.projects = null
|
||||
@.callbacks = []
|
||||
|
||||
projectsSuscription: (callback) ->
|
||||
@.callbacks.push(callback)
|
||||
|
||||
notifySuscriptors: ->
|
||||
for callback in @.callbacks
|
||||
callback(@.projects)
|
||||
|
||||
fetchProjects: (updateSuscriptors = true) ->
|
||||
@.projectsPromise = @rs.projects.listByMember(@rootscope.user?.id).then (projects) =>
|
||||
for project in projects
|
||||
project.url = @projectUrl.get(project)
|
||||
|
||||
@.projects = {'recents': projects.slice(0, 8), 'all': projects}
|
||||
if updateSuscriptors
|
||||
@.notifySuscriptors()
|
||||
|
||||
return @.projects
|
||||
|
||||
return @.projectsPromise
|
||||
|
||||
getProjects: (updateSuscriptors = false) ->
|
||||
if not @.projectsPromise?
|
||||
promise = @.fetchProjects(not updateSuscriptors)
|
||||
else
|
||||
promise = @.projectsPromise
|
||||
|
||||
if updateSuscriptors
|
||||
promise.then =>
|
||||
@.notifySuscriptors()
|
||||
|
||||
return promise
|
||||
|
||||
bulkUpdateProjectsOrder: (sortData) ->
|
||||
@rs.projects.bulkUpdateOrder(sortData).then =>
|
||||
@.fetchProjects()
|
||||
|
||||
angular.module("taigaProjects").service("tgProjects", ProjectsService)
|
Loading…
Reference in New Issue