attachment image
parent
2c1de83d85
commit
c439ca7e3f
|
@ -0,0 +1,27 @@
|
||||||
|
TimelineAttachmentDirective = ($tgTemplate, $compile) ->
|
||||||
|
validFileExtensions = [".jpg", ".jpeg", ".bmp", ".gif", ".png"]
|
||||||
|
|
||||||
|
isImage = (url) ->
|
||||||
|
url = url.toLowerCase()
|
||||||
|
|
||||||
|
return _.some validFileExtensions, (extension) =>
|
||||||
|
return url.indexOf(extension, url - extension.length) != -1
|
||||||
|
|
||||||
|
link = ($scope, $el, $attrs) ->
|
||||||
|
is_image = isImage($scope.attachment.url)
|
||||||
|
|
||||||
|
if is_image
|
||||||
|
template = $tgTemplate.get("profile/timeline/timeline-attachment-image.html")
|
||||||
|
|
||||||
|
$el.html(template)
|
||||||
|
$compile($el.contents())($scope)
|
||||||
|
|
||||||
|
return {
|
||||||
|
link: link
|
||||||
|
scope: {
|
||||||
|
attachment: "=tgTimelineAttachment"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
angular.module("taigaProfile")
|
||||||
|
.directive("tgTimelineAttachment", ["$tgTemplate", "$compile", TimelineAttachmentDirective])
|
|
@ -26,6 +26,8 @@ TimelineItemDirective = ($tgTemplate, $compile, $navUrls) ->
|
||||||
if event.type == 'change'
|
if event.type == 'change'
|
||||||
if timeline.data.comment.length
|
if timeline.data.comment.length
|
||||||
template = "profile/timeline/comment-timeline.html"
|
template = "profile/timeline/comment-timeline.html"
|
||||||
|
else if timeline.data.values_diff.attachments
|
||||||
|
template = "profile/timeline/attachment-timeline.html"
|
||||||
|
|
||||||
return $tgTemplate.get(template)
|
return $tgTemplate.get(template)
|
||||||
|
|
||||||
|
|
|
@ -1,95 +1,95 @@
|
||||||
section.profile-timeline(ng-controller="ProfileTimeline as ctrl")
|
section.profile-timeline(ng-controller="ProfileTimeline as ctrl")
|
||||||
div(ng-repeat="timeline in result.data", tg-timeline-item="timeline")
|
div(ng-repeat="timeline in result.data", tg-timeline-item="timeline")
|
||||||
// - for (var x = 0; x < 3; x++)
|
- for (var x = 0; x < 3; x++)
|
||||||
// // Simple message for favorites, updates, etc.
|
// Simple message for favorites, updates, etc.
|
||||||
// div.activity-simple)
|
div.activity-simple
|
||||||
// span.activity-date Yesterday 12.30h
|
span.activity-date Yesterday 12.30h
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ user.nickname }}")
|
a(href="", title="{{ user.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/gerrenlamson/128.jpg", alt="{{ user.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/gerrenlamson/128.jpg", alt="{{ user.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ user.nickname }} profile") Jesús Espino
|
a(href="", title="See {{ user.nickname }} profile") Jesús Espino
|
||||||
// span has updated the status of the US
|
span has updated the status of the US
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") #23 Web comercial/Ayuda from "UX" to "UX Done"
|
a(href="", title="See #{{ us.id }}{{ us.title }}") #23 Web comercial/Ayuda from "UX" to "UX Done"
|
||||||
|
|
||||||
// // Added comment in us, task or issue.
|
// Added comment in us, task or issue.
|
||||||
// div.activity-comment
|
div.activity-comment
|
||||||
// span.activity-date 3 days ago
|
span.activity-date 3 days ago
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ user.nickname }}")
|
a(href="", title="{{ user.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/tonystubblebine/128.jpg", alt="{{ user.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/tonystubblebine/128.jpg", alt="{{ user.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ user.nickname }} profile") JuanFrancisco Alcántara
|
a(href="", title="See {{ user.nickname }} profile") JuanFrancisco Alcántara
|
||||||
// span has commented in the task
|
span has commented in the task
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") #15 Revisar el contraste de los grises
|
a(href="", title="See #{{ us.id }}{{ us.title }}") #15 Revisar el contraste de los grises
|
||||||
// div.activity-comment-quote
|
div.activity-comment-quote
|
||||||
// p "He subido a GitLab unos wireframes. Echadle un vistazo por favor, a ver si falta algo o tenéis al"
|
p "He subido a GitLab unos wireframes. Echadle un vistazo por favor, a ver si falta algo o tenéis al"
|
||||||
|
|
||||||
// // Added attachment type image in us, task or issue.
|
// Added attachment type image in us, task or issue.
|
||||||
// div.activity-image
|
div.activity-image
|
||||||
// span.activity-date 5 days ago
|
span.activity-date 5 days ago
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ user.nickname }}")
|
a(href="", title="{{ user.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/jina/128.jpg", alt="{{ user.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/jina/128.jpg", alt="{{ user.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ user.nickname }} profile") Alejandro Alonso
|
a(href="", title="See {{ user.nickname }} profile") Alejandro Alonso
|
||||||
// span has uploaded an image in the US
|
span has uploaded an image in the US
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") US #23 Web comercial/Ayuda
|
a(href="", title="See #{{ us.id }}{{ us.title }}") US #23 Web comercial/Ayuda
|
||||||
// div.activity-comment-attachment
|
div.activity-comment-attachment
|
||||||
// p "Eh! Look at this amazing Taiga picture!"
|
p "Eh! Look at this amazing Taiga picture!"
|
||||||
// img(src="https://ununsplash.imgix.net/photo-1423753623104-718aaace6772?q=75&fm=jpg&w=1080&fit=max&s=f655534aa0fe8bae35c687e80a2ed399", alt="{{ attachment.name }}")
|
img(src="https://ununsplash.imgix.net/photo-1423753623104-718aaace6772?q=75&fm=jpg&w=1080&fit=max&s=f655534aa0fe8bae35c687e80a2ed399", alt="{{ attachment.name }}")
|
||||||
|
|
||||||
// // Multiple update message, etc.
|
// Multiple update message, etc.
|
||||||
// div.activity-notification
|
div.activity-notification
|
||||||
// span.activity-date 6 days ago
|
span.activity-date 6 days ago
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ user.nickname }}")
|
a(href="", title="{{ user.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/idiot/128.jpg", alt="{{ user.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/idiot/128.jpg", alt="{{ user.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ user.nickname }} profile") Jesús Espino
|
a(href="", title="See {{ user.nickname }} profile") Jesús Espino
|
||||||
// span closed
|
span closed
|
||||||
// ul.activity-notification-list
|
ul.activity-notification-list
|
||||||
// li
|
li
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") US #23 Web comercial/Ayuda
|
a(href="", title="See #{{ us.id }}{{ us.title }}") US #23 Web comercial/Ayuda
|
||||||
// li
|
li
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") #2156 Search Page UX is hardly understandable
|
a(href="", title="See #{{ us.id }}{{ us.title }}") #2156 Search Page UX is hardly understandable
|
||||||
// li
|
li
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") #456 Search for users
|
a(href="", title="See #{{ us.id }}{{ us.title }}") #456 Search for users
|
||||||
// li
|
li
|
||||||
// a(href="", title="See #{{ us.id }}{{ us.title }}") #2140 Las notificaciones de cambios están fallando
|
a(href="", title="See #{{ us.id }}{{ us.title }}") #2140 Las notificaciones de cambios están fallando
|
||||||
|
|
||||||
// // Added attachment type image in us, task or issue.
|
// Added attachment type image in us, task or issue.
|
||||||
// div.activity-member
|
div.activity-member
|
||||||
// span.activity-date a week ago
|
span.activity-date a week ago
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ organization.nickname }}")
|
a(href="", title="{{ organization.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/tofslie/128.jpg", alt="{{ organization.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/tofslie/128.jpg", alt="{{ organization.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ organization.nickname }} profile") Mozilla
|
a(href="", title="See {{ organization.nickname }} profile") Mozilla
|
||||||
// span has a new member
|
span has a new member
|
||||||
// div.activity-member-view
|
div.activity-member-view
|
||||||
// div.profile-member-picture
|
div.profile-member-picture
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/BillSKenney/128.jpg", alt="{{ organization.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/BillSKenney/128.jpg", alt="{{ organization.nickname }}")
|
||||||
// div.activity-member-info
|
div.activity-member-info
|
||||||
// a(href="", title="See {{ user.nickname }} profile")
|
a(href="", title="See {{ user.nickname }} profile")
|
||||||
// span Andrés González
|
span Andrés González
|
||||||
// p Back-end developer & Stake
|
p Back-end developer & Stake
|
||||||
|
|
||||||
// // Added comment in us, task or issue.
|
// Added comment in us, task or issue.
|
||||||
// div.activity-project
|
div.activity-project
|
||||||
// span.activity-date a week ago
|
span.activity-date a week ago
|
||||||
// div.activity-info
|
div.activity-info
|
||||||
// div.profile-contact-picture
|
div.profile-contact-picture
|
||||||
// a(href="", title="{{ organization.nickname }}")
|
a(href="", title="{{ organization.nickname }}")
|
||||||
// img(src="https://s3.amazonaws.com/uifaces/faces/twitter/ekvium/128.jpg", alt="{{ organization.nickname }}")
|
img(src="https://s3.amazonaws.com/uifaces/faces/twitter/ekvium/128.jpg", alt="{{ organization.nickname }}")
|
||||||
// p
|
p
|
||||||
// a(href="", title="See {{ user.nickname }} profile") Redhat
|
a(href="", title="See {{ user.nickname }} profile") Redhat
|
||||||
// span has a new project
|
span has a new project
|
||||||
// a(href="", title="See {{ project.name }}") Nanatubos
|
a(href="", title="See {{ project.name }}") Nanatubos
|
||||||
// div.activity-comment-quote
|
div.activity-comment-quote
|
||||||
// p We plan to build a hundred of so called "telehubs" so people from all over the world can immediately relocate their physical self at any other telehub in microseconds.
|
p We plan to build a hundred of so called "telehubs" so people from all over the world can immediately relocate their physical self at any other telehub in microseconds.
|
||||||
|
|
|
@ -9,4 +9,4 @@ div.activity-comment
|
||||||
span has commented in the {{::timeline.type }}
|
span has commented in the {{::timeline.type }}
|
||||||
a(href="{{::timeline.detail_url}}", title="See #{{::timeline.ref}} {{::timeline.subject}}") \#{{::timeline.ref}} {{::timeline.subject}}
|
a(href="{{::timeline.detail_url}}", title="See #{{::timeline.ref}} {{::timeline.subject}}") \#{{::timeline.ref}} {{::timeline.subject}}
|
||||||
div.activity-comment-quote
|
div.activity-comment-quote
|
||||||
p "{{::timeline.data.comment}}"
|
p(ng-if="timeline.data.comment") "{{::timeline.data.comment}}"
|
||||||
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
// timeline-attachment directive
|
||||||
|
div.activity-comment-attachment
|
||||||
|
img(ng-src="{{::attachment.url}}", alt="{{::attachment.filename}}")
|
|
@ -0,0 +1,12 @@
|
||||||
|
div.activity-image
|
||||||
|
span.activity-date {{::timeline.created_formated}}
|
||||||
|
div.activity-info
|
||||||
|
div.profile-contact-picture
|
||||||
|
a(tg-nav="user-profile:username=timeline.data.user.username", title="{{::timeline.data.user.name }}")
|
||||||
|
img(ng-src="{{::timeline.data.user.photo}}", alt="{{::timeline.data.user.name}}")
|
||||||
|
p
|
||||||
|
a(tg-nav="user-profile:username=timeline.data.user.username", title="See {{::timeline.data.user.name }} profile") {{::timeline.data.user.name}}
|
||||||
|
span has uploaded an image in the {{::timeline.type }}
|
||||||
|
a(href="{{::timeline.detail_url}}", title="See #{{::timeline.ref}} {{::timeline.subject}}") \#{{::timeline.ref}} {{::timeline.subject}}
|
||||||
|
div(ng-repeat="attachment in timeline.data.values_diff.attachments.new")
|
||||||
|
div(tg-timeline-attachment="attachment")
|
Loading…
Reference in New Issue