diff --git a/app/coffee/modules/backlog/main.coffee b/app/coffee/modules/backlog/main.coffee index 8bb82faa..c76c736f 100644 --- a/app/coffee/modules/backlog/main.coffee +++ b/app/coffee/modules/backlog/main.coffee @@ -747,8 +747,8 @@ module.directive("tgUsRolePointsSelector", ["$rootScope", "$tgTemplate", UsRoleP UsPointsDirective = ($repo, $tgTemplate) -> - rolesTemplate = $tgTemplate.get("backlog/us-points-roles-popover.html", true) - pointsTemplate = $tgTemplate.get("backlog/us-points-popover.html", true) + rolesTemplate = $tgTemplate.get("common/estimation/us-points-roles-popover.html", true) + pointsTemplate = $tgTemplate.get("common/estimation/us-estimation-points.html", true) link = ($scope, $el, $attrs) -> $ctrl = $el.controller() @@ -787,7 +787,7 @@ UsPointsDirective = ($repo, $tgTemplate) -> point.selected = if us.points[roleId] == point.id then false else true return point - html = pointsTemplate({"points": points}) + html = pointsTemplate({"points": points, "roleId": roleId}) # Remove any prevous state $el.find(".popover").popover().close() diff --git a/app/coffee/modules/common/estimation.coffee b/app/coffee/modules/common/estimation.coffee index 6965bd24..23bdec36 100644 --- a/app/coffee/modules/common/estimation.coffee +++ b/app/coffee/modules/common/estimation.coffee @@ -37,8 +37,8 @@ LbUsEstimationDirective = ($rootScope, $repo, $confirm, $template) -> # - Us object (ng-model) # - scope.project object - mainTemplate = $template.get("common/estimation/lb-us-estimation-points-per-role.html", true) - pointsTemplate = $template.get("common/estimation/lb-us-estimation-points.html", true) + mainTemplate = $template.get("common/estimation/us-estimation-points-per-role.html", true) + pointsTemplate = $template.get("common/estimation/us-estimation-points.html", true) link = ($scope, $el, $attrs, $model) -> render = (points) -> @@ -56,6 +56,7 @@ LbUsEstimationDirective = ($rootScope, $repo, $confirm, $template) -> ctx = { totalPoints: totalPoints roles: roles + editable: true } html = mainTemplate(ctx) $el.html(html) diff --git a/app/partials/backlog/us-points-popover.jade b/app/partials/backlog/us-points-popover.jade deleted file mode 100644 index 0e39c5f3..00000000 --- a/app/partials/backlog/us-points-popover.jade +++ /dev/null @@ -1,11 +0,0 @@ -ul.popover.pop-points-open - <% _.each(points, function(point) { %> - li - <% if (point.selected) { %> - a.point(href="", title!="<%- point.name %>", data-point-id!="<%- point.id %>") - | <%- point.name %> - <% } else { %> - a.point.active(href="", title!="<%- point.name %>", data-point-id!="<%- point.id %>") - | <%- point.name %> - <% } %> - <% }); %> diff --git a/app/partials/common/estimation/lb-us-estimation-points-per-role.jade b/app/partials/common/estimation/lb-us-estimation-points-per-role.jade deleted file mode 100644 index e49e6628..00000000 --- a/app/partials/common/estimation/lb-us-estimation-points-per-role.jade +++ /dev/null @@ -1,9 +0,0 @@ -ul.points-per-role - li.total - span.points <%- totalPoints %> - span.role total - <% _.each(roles, function(role) { %> - li.total.clickable(data-role-id!="<%- role.id %>") - span.points <%- role.points %> - span.role <%- role.name %> - <% }); %> diff --git a/app/partials/common/estimation/lb-us-estimation-points.jade b/app/partials/common/estimation/lb-us-estimation-points.jade deleted file mode 100644 index 04fbceaf..00000000 --- a/app/partials/common/estimation/lb-us-estimation-points.jade +++ /dev/null @@ -1,13 +0,0 @@ -ul.popover.pop-points-open - <% _.each(points, function(point) { %> - li - <% if (point.selected) { %> - a(href="", class="point", title!="<%- point.name %>", - data-point-id!="<%- point.id %>", data-role-id!="<%- roleId %>") - | <%- point.name %> - <% } else { %> - a(href="", class="point active", title!="<%- point.name %>", - data-point-id!="<%- point.id %>" data-role-id!="<%- roleId %>") - | <%- point.name %> - <% } %> - <% }); %> diff --git a/app/partials/backlog/us-points-roles-popover.jade b/app/partials/common/estimation/us-points-roles-popover.jade similarity index 100% rename from app/partials/backlog/us-points-roles-popover.jade rename to app/partials/common/estimation/us-points-roles-popover.jade