Adding tag support for projects
parent
f8acb6db4a
commit
7fa4d814a2
|
@ -84,12 +84,22 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
|
||||||
@scope.$emit('project:loaded', project)
|
@scope.$emit('project:loaded', project)
|
||||||
return project
|
return project
|
||||||
|
|
||||||
|
loadTagsColors: ->
|
||||||
|
return @rs.projects.tagsColors(@scope.projectId).then (tags_colors) =>
|
||||||
|
@scope.project.tags_colors = tags_colors
|
||||||
|
|
||||||
|
loadProjectProfile: ->
|
||||||
|
return @q.all([
|
||||||
|
@.loadProject(),
|
||||||
|
@.loadTagsColors()
|
||||||
|
])
|
||||||
|
|
||||||
loadInitialData: ->
|
loadInitialData: ->
|
||||||
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
||||||
@scope.projectId = data.project
|
@scope.projectId = data.project
|
||||||
return data
|
return data
|
||||||
|
|
||||||
return promise.then(=> @.loadProject())
|
return promise.then(=> @.loadProjectProfile())
|
||||||
|
|
||||||
openDeleteLightbox: ->
|
openDeleteLightbox: ->
|
||||||
@rootscope.$broadcast("deletelightbox:new", @scope.project)
|
@rootscope.$broadcast("deletelightbox:new", @scope.project)
|
||||||
|
|
|
@ -237,7 +237,10 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
||||||
|
|
||||||
link = ($scope, $el, $attrs, $model) ->
|
link = ($scope, $el, $attrs, $model) ->
|
||||||
isEditable = ->
|
isEditable = ->
|
||||||
return $scope.project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
if $attrs.requiredPerm?
|
||||||
|
return $scope.project.my_permissions.indexOf($attrs.requiredPerm) != -1
|
||||||
|
|
||||||
|
return true
|
||||||
|
|
||||||
## Render
|
## Render
|
||||||
renderTags = (tags, tagsColors) ->
|
renderTags = (tags, tagsColors) ->
|
||||||
|
@ -362,7 +365,7 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
||||||
|
|
||||||
deleteValue(value)
|
deleteValue(value)
|
||||||
|
|
||||||
bindOnce $scope, "project", (project) ->
|
bindOnce $scope, "project.tags_colors", (tags_colors) ->
|
||||||
if not isEditable()
|
if not isEditable()
|
||||||
renderInReadModeOnly()
|
renderInReadModeOnly()
|
||||||
return
|
return
|
||||||
|
@ -376,7 +379,7 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
||||||
menu.css("left", position.left)
|
menu.css("left", position.left)
|
||||||
|
|
||||||
$el.find("input").autocomplete({
|
$el.find("input").autocomplete({
|
||||||
source: _.keys(project.tags_colors)
|
source: _.keys(tags_colors)
|
||||||
position: {
|
position: {
|
||||||
my: "left top",
|
my: "left top",
|
||||||
using: positioningFunction
|
using: positioningFunction
|
||||||
|
|
|
@ -38,7 +38,8 @@
|
||||||
"TAGS": {
|
"TAGS": {
|
||||||
"PLACEHOLDER": "I'm it! Tag me...",
|
"PLACEHOLDER": "I'm it! Tag me...",
|
||||||
"DELETE": "Delete tag",
|
"DELETE": "Delete tag",
|
||||||
"ADD": "Add tag"
|
"ADD": "Add tag",
|
||||||
|
"LIST": "Tags"
|
||||||
},
|
},
|
||||||
"DESCRIPTION": {
|
"DESCRIPTION": {
|
||||||
"EMPTY": "Empty space is so boring... go on be descriptive... A rose by any other name would smell as sweet...",
|
"EMPTY": "Empty space is so boring... go on be descriptive... A rose by any other name would smell as sweet...",
|
||||||
|
|
|
@ -34,6 +34,10 @@ div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl"
|
||||||
id="total-story-points", ng-model="project.total_story_points",
|
id="total-story-points", ng-model="project.total_story_points",
|
||||||
data-type="digits", data-required="true")
|
data-type="digits", data-required="true")
|
||||||
|
|
||||||
|
fieldset
|
||||||
|
label(for="tags", translate="COMMON.TAGS.LIST")
|
||||||
|
div.tags-block(tg-tag-line, ng-model="project")
|
||||||
|
|
||||||
fieldset
|
fieldset
|
||||||
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")
|
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")
|
||||||
textarea(name="description", placeholder="{{'ADMIN.PROJECT_PROFILE.DESCRIPTION' | translate}}", id="project-description",
|
textarea(name="description", placeholder="{{'ADMIN.PROJECT_PROFILE.DESCRIPTION' | translate}}", id="project-description",
|
||||||
|
|
Loading…
Reference in New Issue