[i18n] Translate the team page and fix the filter

stable
David Barragán Merino 2015-04-27 18:43:28 +02:00
parent 18d9376812
commit a33ecb9570
9 changed files with 67 additions and 41 deletions

View File

@ -45,7 +45,8 @@ class TeamController extends mixOf(taiga.Controller, taiga.PageMixin)
"$translate"
]
constructor: (@scope, @rootscope, @repo, @rs, @params, @q, @location, @navUrls, @appTitle, @auth, tgLoader, @translate) ->
constructor: (@scope, @rootscope, @repo, @rs, @params, @q, @location, @navUrls, @appTitle, @auth, tgLoader,
@translate) ->
@scope.sectionName = "TEAM.SECTION_NAME"
promise = @.loadInitialData()
@ -138,6 +139,7 @@ class TeamController extends mixOf(taiga.Controller, taiga.PageMixin)
module.controller("TeamController", TeamController)
#############################################################################
## Team Filters Directive
#############################################################################
@ -149,6 +151,7 @@ TeamFiltersDirective = () ->
module.directive("tgTeamFilters", [TeamFiltersDirective])
#############################################################################
## Team Member Stats Directive
#############################################################################
@ -167,6 +170,7 @@ TeamMemberStatsDirective = () ->
module.directive("tgTeamMemberStats", TeamMemberStatsDirective)
#############################################################################
## Team Current User Directive
#############################################################################
@ -186,6 +190,7 @@ TeamMemberCurrentUserDirective = () ->
module.directive("tgTeamCurrentUser", TeamMemberCurrentUserDirective)
#############################################################################
## Team Members Directive
#############################################################################
@ -208,6 +213,7 @@ TeamMembersDirective = () ->
module.directive("tgTeamMembers", TeamMembersDirective)
#############################################################################
## Leave project Directive
#############################################################################
@ -236,10 +242,17 @@ LeaveProjectDirective = ($repo, $confirm, $location, $rs, $navurls, $translate)
link: link
}
module.directive("tgLeaveProject", ["$tgRepo", "$tgConfirm", "$tgLocation", "$tgResources", "$tgNavUrls", LeaveProjectDirective])
module.directive("tgLeaveProject", ["$tgRepo", "$tgConfirm", "$tgLocation", "$tgResources", "$tgNavUrls",
LeaveProjectDirective])
module.filter 'membersRoleFilter', () ->
(input, filtersRole) ->
if filtersRole?
return _.filter(input, {role: filtersRole.id})
return input
#############################################################################
## Team Filters
#############################################################################
membersFilter = ->
return (members, filtersQ, filtersRole) ->
return _.filter members, (m) -> (not filtersRole or m.role == filtersRole.id) and
(not filtersQ or m.full_name.search(new RegExp(filtersQ, "i")) >= 0)
module.filter('membersFilter', membersFilter)

View File

@ -818,7 +818,7 @@
"TEAM": {
"SECTION_NAME": "Team",
"APP_TITLE": "TEAM - {{projectName}}",
"PLACEHOLDER_INPUT_SEARCH": "Search by username or role...",
"PLACEHOLDER_INPUT_SEARCH": "Search by full name...",
"COLUMN_MR_WOLF": "Mr. Wolf",
"EXPLANATION_COLUMN_MR_WOLF": "Closed issues",
"COLUMN_IOCAINE": "Iocaine Drinker",

View File

@ -815,7 +815,7 @@
"TEAM": {
"SECTION_NAME": "Equipo",
"APP_TITLE": "EQUIPO - {{projectName}}",
"PLACEHOLDER_INPUT_SEARCH": "Buscar por nombre de usuario o rol",
"PLACEHOLDER_INPUT_SEARCH": "Buscar por nombre completo...",
"COLUMN_MR_WOLF": "Sr. Lobo",
"EXPLANATION_COLUMN_MR_WOLF": "Peticiones cerradas",
"COLUMN_IOCAINE": "Bebedor de Iocaína",
@ -831,7 +831,7 @@
"SECTION_TITLE_TEAM": "Equipo >",
"SECTION_FILTER_ALL": "Todo",
"CONFIRM_LEAVE_PROJECT": "¿Esta seguro que desea dejar el proyecto?",
"ACTION_LEAVE_PROJECT": "Abandonar esté proyecto"
"ACTION_LEAVE_PROJECT": "Abandonar este proyecto"
},
"CHANGE_PASSWORD": {
"SECTION_NAME": "Cambiar contraseña",

View File

@ -815,7 +815,7 @@
"TEAM": {
"SECTION_NAME": "Equipe",
"APP_TITLE": "EQUIPE - {{projectName}}",
"PLACEHOLDER_INPUT_SEARCH": "Rechercher par nom ou par rôle...",
"PLACEHOLDER_INPUT_SEARCH": "Rechercher par nom...",
"COLUMN_MR_WOLF": "Mr. Wolf",
"EXPLANATION_COLUMN_MR_WOLF": "Bugs fermés",
"COLUMN_IOCAINE": "Buveur de iocaine",

View File

@ -1,3 +1,3 @@
a.leave-project(ng-click='leave()', href='')
a.leave-project(ng-click="leave()", href="")
span.icon.icon-delete
| {{"TEAM.ACTION_LEAVE_PROJECT" | translate}}
| {{ 'TEAM.ACTION_LEAVE_PROJECT' | translate }}

View File

@ -1,10 +1,10 @@
ul
li
a(ng-class='{active: !filtersRole.id}', ng-click='ctrl.setRole()', href='')
a(ng-class="{active: !filtersRole.id}", ng-click="ctrl.setRole()", href="")
span.title(translate="TEAM.SECTION_FILTER_ALL")
span.icon.icon-arrow-right
li(ng-repeat='role in roles')
a(ng-class='{active: role.id == filtersRole.id}', ng-click='ctrl.setRole(role)', href='')
span.title(tg-bo-bind='role.name')
span.icon.icon-arrow-right
li(ng-repeat="role in roles")
a(ng-class="{active: role.id == filtersRole.id}", ng-click="ctrl.setRole(role)", href="")
span.title(tg-bo-bind="role.name")
span.icon.icon-arrow-right

View File

@ -1,13 +1,17 @@
.row
.username
figure.avatar
img(tg-bo-src='currentUser.photo', tg-bo-alt='currentUser.full_name')
img(tg-bo-src="currentUser.photo", tg-bo-alt="currentUser.full_name")
figcaption
span.name(tg-bo-bind='currentUser.full_name')
figcaption
span.name(tg-bo-bind="currentUser.full_name")
span.position(tg-bo-bind='currentUser.role_name')
span.position(tg-bo-bind="currentUser.role_name")
div(tg-leave-project='', projectid='{{projectId}}')
div(tg-leave-project="", projectid="{{projectId}}")
.member-stats(tg-team-member-stats, stats="stats", user="currentUser.user", issuesEnabled="issuesEnabled", tasksenabled="tasksEnabled", wikienabled="wikiEnabled")
.member-stats(tg-team-member-stats, stats="stats",
user="currentUser.user",
issuesEnabled="issuesEnabled",
tasksenabled="tasksEnabled",
wikienabled="wikiEnabled")

View File

@ -1,17 +1,22 @@
.attribute(ng-if='issuesEnabled')
span.icon.icon-briefcase(ng-style="{'opacity': stats.closed_bugs[userId]}", ng-class="{'top': stats.closed_bugs[userId] == 1}")
.attribute(ng-if="issuesEnabled")
span.icon.icon-briefcase(ng-style="{'opacity': stats.closed_bugs[userId]}",
ng-class="{'top': stats.closed_bugs[userId] == 1}")
.attribute(ng-if='tasksEnabled')
span.icon.icon-iocaine(ng-style="{'opacity': stats.iocaine_tasks[userId]}", ng-class="{'top': stats.iocaine_tasks[userId] == 1}")
.attribute(ng-if="tasksEnabled")
span.icon.icon-iocaine(ng-style="{'opacity': stats.iocaine_tasks[userId]}",
ng-class="{'top': stats.iocaine_tasks[userId] == 1}")
.attribute(ng-if='wikiEnabled')
span.icon.icon-writer(ng-style="{'opacity': stats.wiki_changes[userId]}", ng-class="{'top': stats.wiki_changes[userId] == 1}")
.attribute(ng-if="wikiEnabled")
span.icon.icon-writer(ng-style="{'opacity': stats.wiki_changes[userId]}",
ng-class="{'top': stats.wiki_changes[userId] == 1}")
.attribute(ng-if='issuesEnabled')
span.icon.icon-bug(ng-style="{'opacity': stats.created_bugs[userId]}", ng-class="{'top': stats.created_bugs[userId] == 1}")
.attribute(ng-if="issuesEnabled")
span.icon.icon-bug(ng-style="{'opacity': stats.created_bugs[userId]}",
ng-class="{'top': stats.created_bugs[userId] == 1}")
.attribute(ng-if='tasksEnabled')
span.icon.icon-tasks(ng-style="{'opacity': stats.closed_tasks[userId]}", ng-class="{'top': stats.closed_tasks[userId] == 1}")
.attribute(ng-if="tasksEnabled")
span.icon.icon-tasks(ng-style="{'opacity': stats.closed_tasks[userId]}",
ng-class="{'top': stats.closed_tasks[userId] == 1}")
.attribute
span.points(ng-bind='stats.totals[userId]')
span.points(ng-bind="stats.totals[userId]")

View File

@ -1,11 +1,15 @@
.row.member(ng-repeat='user in memberships | filter:filtersQ | membersRoleFilter:filtersRole')
.row.member(ng-repeat="user in memberships | membersFilter:filtersQ:filtersRole")
.username
figure.avatar
img(tg-bo-src='user.photo', tg-bo-alt='user.full_name')
img(tg-bo-src="user.photo", tg-bo-alt="user.full_name")
figcaption
span.name(tg-bo-bind='user.full_name')
figcaption
span.name(tg-bo-bind="user.full_name")
span.position(tg-bo-bind='user.role_name')
span.position(tg-bo-bind="user.role_name")
.member-stats(tg-team-member-stats, stats="stats", user="user.user", issuesEnabled="issuesEnabled", tasksenabled="tasksEnabled", wikienabled="wikiEnabled")
.member-stats(tg-team-member-stats, stats="stats",
user="user.user",
issuesEnabled="issuesEnabled",
tasksenabled="tasksEnabled",
wikienabled="wikiEnabled")