Merge pull request #450 from taigaio/adding-tag-support-for-projects
Adding tag support for projectsstable
commit
219b439ff2
|
@ -86,12 +86,22 @@ class ProjectProfileController extends mixOf(taiga.Controller, taiga.PageMixin)
|
|||
@scope.$emit('project:loaded', 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: ->
|
||||
promise = @repo.resolve({pslug: @params.pslug}).then (data) =>
|
||||
@scope.projectId = data.project
|
||||
return data
|
||||
|
||||
return promise.then(=> @.loadProject())
|
||||
return promise.then(=> @.loadProjectProfile())
|
||||
|
||||
openDeleteLightbox: ->
|
||||
@rootscope.$broadcast("deletelightbox:new", @scope.project)
|
||||
|
|
|
@ -237,7 +237,10 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
|||
|
||||
link = ($scope, $el, $attrs, $model) ->
|
||||
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
|
||||
renderTags = (tags, tagsColors) ->
|
||||
|
@ -362,7 +365,7 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
|||
|
||||
deleteValue(value)
|
||||
|
||||
bindOnce $scope, "project", (project) ->
|
||||
bindOnce $scope, "project.tags_colors", (tags_colors) ->
|
||||
if not isEditable()
|
||||
renderInReadModeOnly()
|
||||
return
|
||||
|
@ -376,7 +379,7 @@ TagLineDirective = ($rootScope, $repo, $rs, $confirm, $qqueue, $template, $compi
|
|||
menu.css("left", position.left)
|
||||
|
||||
$el.find("input").autocomplete({
|
||||
source: _.keys(project.tags_colors)
|
||||
source: _.keys(tags_colors)
|
||||
position: {
|
||||
my: "left top",
|
||||
using: positioningFunction
|
||||
|
|
|
@ -39,7 +39,8 @@
|
|||
"TAGS": {
|
||||
"PLACEHOLDER": "I'm it! Tag me...",
|
||||
"DELETE": "Delete tag",
|
||||
"ADD": "Add tag"
|
||||
"ADD": "Add tag",
|
||||
"LIST": "Tags"
|
||||
},
|
||||
"DESCRIPTION": {
|
||||
"EMPTY": "Empty space is so boring... go on be descriptive...",
|
||||
|
|
|
@ -34,6 +34,10 @@ div.wrapper(tg-project-profile, ng-controller="ProjectProfileController as ctrl"
|
|||
id="total-story-points", ng-model="project.total_story_points",
|
||||
data-type="digits", data-required="true")
|
||||
|
||||
fieldset
|
||||
label(for="tags", translate="COMMON.TAGS.LIST")
|
||||
div.tags-block(tg-tag-line, ng-model="project")
|
||||
|
||||
fieldset
|
||||
label(for="project-description", translate="ADMIN.PROJECT_PROFILE.DESCRIPTION")
|
||||
textarea(name="description", placeholder="{{'ADMIN.PROJECT_PROFILE.DESCRIPTION' | translate}}", id="project-description",
|
||||
|
|
Loading…
Reference in New Issue