Fix belong-to-epic to use labels instead of pill

stable
David Barragán Merino 2016-09-01 12:00:15 +02:00
parent a12047bc1c
commit 862efde74a
4 changed files with 19 additions and 11 deletions

View File

@ -1,5 +1,5 @@
- var hash = "#";
.belong-to-epic-pill-wrapper(tg-repeat="epic in epics track by epic.get('id')")
span.belong-to-epic-pill-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')}}"

View File

@ -1,10 +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=epic.getIn(['project', 'slug']),ref=epic.get('ref')"
) #{hash}{{epic.get('id')}} {{epic.get('subject')}}
span.belong-to-epic-label(
ng-style="::{'background-color': epic.get('color')}"
translate="EPICS.EPIC"
)

View File

@ -25,19 +25,18 @@ BelongToEpicsDirective = () ->
if scope.epics && !scope.epics.isIterable
scope.epics = Immutable.fromJS(scope.epics)
scope.getTemplateUrl = () ->
if attrs.format
return "components/belong-to-epics/belong-to-epics-" + attrs.format + ".html"
return "components/belong-to-epics/belong-to-epics-pill.html"
templateUrl = (el, attrs) ->
if attrs.format
return "components/belong-to-epics/belong-to-epics-" + attrs.format + ".html"
return "components/belong-to-epics/belong-to-epics-pill.html"
return {
link: link,
scope: {
epics: '='
},
template : '<span ng-include="getTemplateUrl()"></span>'
templateUrl: templateUrl
}
BelongToEpicsDirective.$inject = []
module.directive("tgBelongToEpics", BelongToEpicsDirective)

View File

@ -25,3 +25,12 @@
.belong-to-epic-text {
margin-left: .25rem;
}
.belong-to-epic-label {
@include font-type(light);
@include font-size(xsmall);
background: $grayer;
border-radius: .25rem;
color: $white;
margin: 0 .5rem;
padding: .1rem .25rem;
}