Adding notificacion when saving issue
parent
02e10715df
commit
c554d26d22
|
@ -81,17 +81,22 @@ class ConfirmService extends taiga.Service
|
|||
# Types: error, success
|
||||
|
||||
selector = ".notification-message-#{type}"
|
||||
@.el = angular.element(selector)
|
||||
|
||||
body = angular.element("body")
|
||||
body.find(".notification-message").addClass("hidden")
|
||||
body.find(selector).removeClass("hidden")
|
||||
|
||||
if @.tsem
|
||||
cancelTimeout(@.tsem)
|
||||
clearTimeout(@.tsem)
|
||||
|
||||
@.tsem = timeout 4000, =>
|
||||
body.find(selector).addClass("hidden")
|
||||
delete @.sem
|
||||
delete @.tsem
|
||||
|
||||
@.el.on "click", ".icon-delete", (event) =>
|
||||
body.find(selector).addClass("hidden")
|
||||
|
||||
|
||||
module = angular.module("taigaBase")
|
||||
module.service("$tgConfirm", ["$q", ConfirmService])
|
||||
|
|
|
@ -137,7 +137,7 @@ module.controller("IssueDetailController", IssueDetailController)
|
|||
## Issue Main Directive
|
||||
#############################################################################
|
||||
|
||||
IssueDirective = ($tgrepo, $log, $location) ->
|
||||
IssueDirective = ($tgrepo, $log, $location, $confirm) ->
|
||||
linkSidebar = ($scope, $el, $attrs, $ctrl) ->
|
||||
|
||||
link = ($scope, $el, $attrs) ->
|
||||
|
@ -146,6 +146,7 @@ IssueDirective = ($tgrepo, $log, $location) ->
|
|||
|
||||
$el.on "click", ".save-issue", (event) ->
|
||||
$tgrepo.save($scope.issue).then ->
|
||||
$confirm.notify("success")
|
||||
$location.path("/project/#{$scope.project.slug}/issues/#{$scope.issue.ref}")
|
||||
|
||||
$el.on "click", ".add-comment a.button-green", (event) ->
|
||||
|
@ -159,7 +160,7 @@ IssueDirective = ($tgrepo, $log, $location) ->
|
|||
|
||||
return {link:link}
|
||||
|
||||
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", IssueDirective])
|
||||
module.directive("tgIssueDetail", ["$tgRepo", "$log", "$tgLocation", "$tgConfirm", IssueDirective])
|
||||
|
||||
|
||||
#############################################################################
|
||||
|
|
|
@ -1,15 +1,15 @@
|
|||
section.us-activity.hidden
|
||||
div.activity-single(tg-comment, ng-repeat="comment in comments")
|
||||
div.activity-single(tg-comment, ng-repeat="change in history")
|
||||
div.activity-user
|
||||
a.avatar(href="", tg-bo-title="ctrl.getUserFullName(comment.user.pk)")
|
||||
img(tg-bo-src="ctrl.getUserAvatar(comment.user.pk)", tg-bo-alt="ctrl.getUserFullName(comment.user.pk)")
|
||||
a.avatar(href="", tg-bo-title="ctrl.getUserFullName(change.user.pk)")
|
||||
img(tg-bo-src="ctrl.getUserAvatar(change.user.pk)", tg-bo-alt="ctrl.getUserFullName(change.user.pk)")
|
||||
|
||||
div.activity-content
|
||||
div.activity-username
|
||||
a.username(href="TODO", tg-bo-title="ctrl.getUserFullName(comment.user.pk)" tg-bo-html="ctrl.getUserFullName(comment.user.pk)")
|
||||
span.date {{ comment.created_at | date:'yyyy-MM-dd HH:mm' }}
|
||||
a.username(href="TODO", tg-bo-title="ctrl.getUserFullName(change.user.pk)" tg-bo-html="ctrl.getUserFullName(change.user.pk)")
|
||||
span.date {{ change.created_at | date:'yyyy-MM-dd HH:mm' }}
|
||||
|
||||
div.activity-inner(ng-repeat="(key, change) in comment.values_diff")
|
||||
div.activity-inner(ng-repeat="(key, change) in change.values_diff")
|
||||
div.activity-changed
|
||||
span(tg-bo-html="key")
|
||||
div.activity-fromto
|
||||
|
|
|
@ -13,6 +13,7 @@ section.us-comments
|
|||
include comment-activity
|
||||
p.comment {{ comment.comment }}
|
||||
p.date {{ comment.created_at | date:'yyyy-MM-dd HH:mm' }}
|
||||
|
||||
//a.delete-comment.icon.icon-delete(href="", title="delete comment")
|
||||
|
||||
//a.more-comments(href="", title="show more comments")
|
||||
|
|
Loading…
Reference in New Issue