belong to epic multitemplate

stable
Xavier Julián 2016-08-09 13:58:04 +02:00 committed by David Barragán Merino
parent fcecb72b40
commit 8e901b0067
11 changed files with 57 additions and 7 deletions

View File

@ -1,5 +1,5 @@
- var hash = "#"; - var hash = "#";
.belong-to-epic-pill-wrapper(tg-repeat="epic in epics") .belong-to-epic-pill-wrapper(tg-repeat="epic in epics track by epic.get('id')")
.belong-to-epic-pill( .belong-to-epic-pill(
ng-style="{'background': epic.get('color')}" ng-style="{'background': epic.get('color')}"
title="#{hash}{{epic.get('id')}} {{epic.get('subject')}}" title="#{hash}{{epic.get('id')}} {{epic.get('subject')}}"

View File

@ -0,0 +1,10 @@
- var hash = "#";
span.belong-to-epic-text-wrapper(tg-repeat="epic in epics track by epic.get('id')")
.belong-to-epic-pill(
ng-style="{'background': epic.get('color')}"
title="#{hash}{{epic.get('id')}} {{epic.get('subject')}}"
)
a.belong-to-epic-text(
href=""
tg-nav="project-epics-detail:project=vm.project.get('slug')"
) #{hash}{{epic.get('id')}} {{epic.get('subject')}}

View File

@ -22,15 +22,21 @@ module = angular.module('taigaEpics')
BelongToEpicsDirective = () -> BelongToEpicsDirective = () ->
link = (scope, el, attrs) -> link = (scope, el, attrs) ->
if !scope.epics.isIterable if scope.epics && !scope.epics.isIterable
scope.epics = Immutable.fromJS(scope.epics) scope.epics = Immutable.fromJS(scope.epics)
if scope.project && !scope.project.isIterable
scope.project = Immutable.fromJS(scope.project)
scope.getTemplateUrl = () ->
return "components/belong-to-epics/belong-to-epics-" + attrs.format + ".html"
return { return {
link: link, link: link,
templateUrl:"components/belong-to-epics/belong-to-epics.html",
scope: { scope: {
epics: '=' epics: '='
} },
template : '<span ng-include="getTemplateUrl()"></span>'
} }
BelongToEpicsDirective.$inject = [] BelongToEpicsDirective.$inject = []

View File

@ -7,6 +7,7 @@
} }
} }
} }
.belong-to-epic-pill { .belong-to-epic-pill {
background-color: $grayer; background-color: $grayer;
border-radius: 50%; border-radius: 50%;
@ -15,3 +16,11 @@
position: relative; position: relative;
width: .7rem; width: .7rem;
} }
.belong-to-epic-text-wrapper {
margin-right: 1rem;
}
.belong-to-epic-text {
margin-left: .25rem;
}

View File

@ -8,6 +8,7 @@ h2.card-title
span(ng-if="vm.visible('ref')") {{::"#" + vm.item.getIn(['model', 'ref'])}} span(ng-if="vm.visible('ref')") {{::"#" + vm.item.getIn(['model', 'ref'])}}
span.e2e-title(ng-if="vm.visible('subject')") {{vm.item.getIn(['model', 'subject'])}} span.e2e-title(ng-if="vm.visible('subject')") {{vm.item.getIn(['model', 'subject'])}}
tg-belong-to-epics( tg-belong-to-epics(
format="pill"
ng-if="vm.item.getIn(['model', 'epics'])" ng-if="vm.item.getIn(['model', 'epics'])"
epics="vm.item.getIn(['model', 'epics'])" epics="vm.item.getIn(['model', 'epics'])"
) )

View File

@ -15,6 +15,7 @@
ng-attr-title="{{::vm.story.get('subject')}}" ng-attr-title="{{::vm.story.get('subject')}}"
) #{hash}{{::vm.story.get('ref')}} {{::vm.story.get('subject')}} ) #{hash}{{::vm.story.get('ref')}} {{::vm.story.get('subject')}}
tg-belong-to-epics( tg-belong-to-epics(
format="pill"
ng-if="vm.story.get('epics')" ng-if="vm.story.get('epics')"
epics="vm.story.get('epics')" epics="vm.story.get('epics')"
) )

View File

@ -27,6 +27,7 @@
span(tg-bo-ref="us.ref") span(tg-bo-ref="us.ref")
span(ng-bind="us.subject") span(ng-bind="us.subject")
tg-belong-to-epics( tg-belong-to-epics(
format="pill"
ng-if="us.epics" ng-if="us.epics"
epics="us.epics" epics="us.epics"
) )

View File

@ -20,6 +20,7 @@ div.sprint-table(tg-bind-scope, ng-class="{'sprint-empty-wrapper': !sprint.user_
span(tg-bo-ref="us.ref") span(tg-bo-ref="us.ref")
span(tg-bo-bind="us.subject") span(tg-bo-bind="us.subject")
tg-belong-to-epics( tg-belong-to-epics(
format="pill"
ng-if="us.epics" ng-if="us.epics"
epics="us.epics" epics="us.epics"
) )

View File

@ -55,6 +55,7 @@ div.taskboard-table(
span.us-ref(tg-bo-ref="us.ref") span.us-ref(tg-bo-ref="us.ref")
span(ng-bind="us.subject") span(ng-bind="us.subject")
tg-belong-to-epics( tg-belong-to-epics(
format="pill"
ng-if="us.epics" ng-if="us.epics"
epics="us.epics" epics="us.epics"
) )

View File

@ -29,10 +29,22 @@ div.wrapper(
div.us-title(ng-class="{blocked: us.is_blocked}") div.us-title(ng-class="{blocked: us.is_blocked}")
h2.us-title-text h2.us-title-text
span.us-number(tg-bo-ref="us.ref") span.us-number(tg-bo-ref="us.ref")
span.us-name(tg-editable-subject, ng-model="us", required-perm="modify_us") span.us-name(
tg-editable-subject
ng-model="us"
required-perm="modify_us"
)
p.belong-to-epics-wrapper(ng-if="us.epics")
span This User Story belongs to
tg-belong-to-epics(
ng-if="us.epics"
epics="us.epics"
format="text"
project="project"
)
p.us-related-task(ng-if="us.origin_issue") p.us-related-task(ng-if="us.origin_issue") {{ 'US.PROMOTED'|translate }}
| {{ 'US.PROMOTED'|translate }}
a( a(
href="" href=""
tg-check-permission="view_us" tg-check-permission="view_us"

View File

@ -142,6 +142,14 @@
margin-right: 5rem; margin-right: 5rem;
} }
} }
.belong-to-epics-wrapper {
@include font-size(small);
color: $gray-light;
margin-top: .5rem;
a:hover {
color: $primary;
}
}
.loading-spinner { .loading-spinner {
@include loading-spinner; @include loading-spinner;
max-height: 1.5rem; max-height: 1.5rem;