Add color to timeline

stable
Xavier Julián 2016-09-14 09:36:36 +02:00 committed by David Barragán Merino
parent 61e42eb4fa
commit 10533a933d
5 changed files with 40 additions and 12 deletions

View File

@ -1594,6 +1594,7 @@
"WIKI_UPDATED": "{{username}} has updated the wiki page {{obj_name}}", "WIKI_UPDATED": "{{username}} has updated the wiki page {{obj_name}}",
"EPIC_UPDATED": "{{username}} has updated the attribute \"{{field_name}}\" of the epic {{obj_name}}", "EPIC_UPDATED": "{{username}} has updated the attribute \"{{field_name}}\" of the epic {{obj_name}}",
"EPIC_UPDATED_WITH_NEW_VALUE": "{{username}} has updated the attribute \"{{field_name}}\" of the epic {{obj_name}} to {{new_value}}", "EPIC_UPDATED_WITH_NEW_VALUE": "{{username}} has updated the attribute \"{{field_name}}\" of the epic {{obj_name}} to {{new_value}}",
"EPIC_UPDATED_WITH_NEW_COLOR": "{{username}} has updated the \"{{field_name}}\" of the epic {{obj_name}} to <span class=\"new-color\" style=\"background: {{new_value}}\"></span>",
"NEW_COMMENT_US": "{{username}} has commented in the US {{obj_name}}", "NEW_COMMENT_US": "{{username}} has commented in the US {{obj_name}}",
"NEW_COMMENT_ISSUE": "{{username}} has commented in the issue {{obj_name}}", "NEW_COMMENT_ISSUE": "{{username}} has commented in the issue {{obj_name}}",
"NEW_COMMENT_TASK": "{{username}} has commented in the task {{obj_name}}", "NEW_COMMENT_TASK": "{{username}} has commented in the task {{obj_name}}",

View File

@ -288,6 +288,15 @@ timelineType = (timeline, event) ->
key: 'TIMELINE.EPIC_UPDATED', key: 'TIMELINE.EPIC_UPDATED',
translate_params: ['username', 'field_name', 'obj_name'] translate_params: ['username', 'field_name', 'obj_name']
}, },
{ # EpicUpdated color
check: (timeline, event) ->
return event.obj == 'epic' &&
event.type == 'change' &&
timeline.hasIn(['data', 'value_diff']) &&
timeline.getIn(['data', 'value_diff', 'key']) == 'color'
key: 'TIMELINE.EPIC_UPDATED_WITH_NEW_COLOR',
translate_params: ['username', 'field_name', 'obj_name', 'new_value']
},
{ # EpicUpdated general { # EpicUpdated general
check: (timeline, event) -> check: (timeline, event) ->
return event.obj == 'epic' && return event.obj == 'epic' &&

View File

@ -1,22 +1,22 @@
div.activity-item .activity-item
span.activity-date {{::timeline.get('created') | momentFromNow}} span.activity-date {{::timeline.get('created') | momentFromNow}}
div.activity-info(tg-user-timeline-title="timeline") .activity-info(tg-user-timeline-title="timeline")
div.activity-info .activity-info
// profile image with url // profile image with url
div.profile-contact-picture(ng-if="timeline.getIn(['data', 'user', 'is_profile_visible'])") .profile-contact-picture(ng-if="timeline.getIn(['data', 'user', 'is_profile_visible'])")
a(tg-nav="user-profile:username=timeline.getIn(['data', 'user', 'username'])", title="{{::timeline.getIn(['data', 'user', 'name']) }}") a(tg-nav="user-profile:username=timeline.getIn(['data', 'user', 'username'])", title="{{::timeline.getIn(['data', 'user', 'name']) }}")
img( img(
tg-avatar="timeline.getIn(['data', 'user'])" tg-avatar="timeline.getIn(['data', 'user'])"
alt="{{::timeline.getIn(['data', 'user', 'name'])}}" alt="{{::timeline.getIn(['data', 'user', 'name'])}}"
) )
// profile image without url // profile image without url
div.profile-contact-picture(ng-if="!timeline.getIn(['data', 'user', 'is_profile_visible'])") .profile-contact-picture(ng-if="!timeline.getIn(['data', 'user', 'is_profile_visible'])")
img( img(
tg-avatar="timeline.getIn(['data', 'user'])" tg-avatar="timeline.getIn(['data', 'user'])"
alt="{{::timeline.getIn(['data', 'user', 'name'])}}" alt="{{::timeline.getIn(['data', 'user', 'name'])}}"
) )
p(tg-compile-html="timeline.get('title_html')") p(tg-compile-html="timeline.get('title_html')")

View File

@ -1,7 +1,16 @@
section.profile-timeline section.profile-timeline
div(ng-if="!vm.timelineList.size") div(ng-if="!vm.timelineList.size")
div.spin div.spin
img(src="/#{v}/svg/spinner-circle.svg", alt="Loading...") img(
src="/#{v}/svg/spinner-circle.svg"
alt="Loading..."
)
div(infinite-scroll="vm.loadTimeline()", infinite-scroll-disabled="vm.scrollDisabled") div(
div(tg-repeat="timeline in vm.timelineList", tg-user-timeline-item="timeline") infinite-scroll="vm.loadTimeline()"
infinite-scroll-disabled="vm.scrollDisabled"
)
div(
tg-repeat="timeline in vm.timelineList"
tg-user-timeline-item="timeline"
)

View File

@ -56,6 +56,15 @@
width: 100%; width: 100%;
} }
} }
.new-color {
border-radius: 50%;
display: inline-block;
height: 1rem;
margin-left: .2rem;
position: relative;
top: .1rem;
width: 1rem;
}
} }
.activity-member-view { .activity-member-view {
display: flex; display: flex;