Us detail name and tag line edition

stable
Xavier Julián 2014-10-20 17:18:13 +02:00 committed by David Barragán Merino
parent dcbe0f6744
commit bb0b9fb86e
4 changed files with 31 additions and 16 deletions

View File

@ -447,9 +447,7 @@ EditableSubjectDirective = ($rootscope, $repo, $confirm, $loading) ->
editTemplate = _.template(""" editTemplate = _.template("""
<input type="text" value="<%- item.subject %>" data-required="true" data-maxlength="500"/> <input type="text" value="<%- item.subject %>" data-required="true" data-maxlength="500"/>
<div class="save-container">
<a class="save icon icon-floppy" href="" title="Save" /> <a class="save icon icon-floppy" href="" title="Save" />
</div>
""") """)
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->
@ -528,9 +526,7 @@ EditableDescriptionDirective = ($rootscope, $repo, $confirm, $compile, $loading)
<textarea placeholder="Write a description of your user story" <textarea placeholder="Write a description of your user story"
ng-model="item.description" ng-model="item.description"
tg-markitup="tg-markitup"><%- item.description %></textarea> tg-markitup="tg-markitup"><%- item.description %></textarea>
<div class="save-container">
<a class="save icon icon-floppy" href="" title="Save" /> <a class="save icon icon-floppy" href="" title="Save" />
</div>
""") """)
link = ($scope, $el, $attrs, $model) -> link = ($scope, $el, $attrs, $model) ->

View File

@ -95,19 +95,20 @@ TagLineDirective = ($rootscope, $log, $rs, $tgrepo, $confirm) ->
# Main directive template (rendered by angular) # Main directive template (rendered by angular)
template = """ template = """
<div class="tags-container"></div> <div class="tags-container"></div>
<input type="text" placeholder="Write tag..." class="tag-input" /> <a href="#" class="add-tag icon icon-plus" title="Add tag"></a>
<input type="text" placeholder="Write tag..." class="tag-input hidden" />
<a href="" title="Save" class="save icon icon-floppy"></a> <a href="" title="Save" class="save icon icon-floppy"></a>
""" """
# Tags template (rendered manually using lodash) # Tags template (rendered manually using lodash)
templateTags = _.template(""" templateTags = _.template("""
<% _.each(tags, function(tag) { %> <% _.each(tags, function(tag) { %>
<div class="tag" style="border-left: 5px solid <%- tag.color %>;"> <span class="tag" style="border-left: 5px solid <%- tag.color %>;">
<span class="tag-name"><%- tag.name %></span> <span class="tag-name"><%- tag.name %></span>
<% if (editable) { %> <% if (editable) { %>
<a href="" title="delete tag" class="icon icon-delete"></a> <a href="" title="delete tag" class="icon icon-delete"></a>
<% } %> <% } %>
</div> </span>
<% }); %>""") <% }); %>""")
renderTags = ($el, tags, editable, tagsColors) -> renderTags = ($el, tags, editable, tagsColors) ->
@ -201,6 +202,12 @@ TagLineDirective = ($rootscope, $log, $rs, $tgrepo, $confirm) ->
$el.on "click", ".save", saveInputTag $el.on "click", ".save", saveInputTag
$el.on "click", ".add-tag", (event) ->
event.preventDefault()
target = angular.element(event.currentTarget)
target.hide()
target.siblings('input').removeClass('hidden')
$el.on "click", ".icon-delete", (event) -> $el.on "click", ".icon-delete", (event) ->
event.preventDefault() event.preventDefault()
target = angular.element(event.currentTarget) target = angular.element(event.currentTarget)

View File

@ -33,7 +33,6 @@
vertical-align: middle; vertical-align: middle;
} }
input { input {
display: inline-block;
padding: .4rem; padding: .4rem;
width: 14rem; width: 14rem;
} }

View File

@ -86,8 +86,10 @@
display: inline-block; display: inline-block;
line-height: 2.2rem; line-height: 2.2rem;
padding-right: 1rem; padding-right: 1rem;
width: 100%;
} }
.save { .icon-edit,
.icon-floppy {
@extend %large; @extend %large;
color: $gray-light; color: $gray-light;
margin-left: .5rem; margin-left: .5rem;
@ -153,6 +155,17 @@
} }
} }
.tags-block {
.icon-plus {
@extend %large;
color: $gray-light;
vertical-align: top;
&:hover {
color: $fresh-taiga;
}
}
}
.us-content { .us-content {
textarea { textarea {
background: $white; background: $white;