Link to project in notification
parent
9a53ac378c
commit
d9d12cdc4b
|
@ -32,5 +32,9 @@ section.notifications-list
|
||||||
)
|
)
|
||||||
.entry-content
|
.entry-content
|
||||||
p(tg-compile-html="notification.get('title_html')")
|
p(tg-compile-html="notification.get('title_html')")
|
||||||
span.entry-project {{::notification.getIn(['data', 'project', 'name'])}}
|
p
|
||||||
|
a.entry-project(
|
||||||
|
href=""
|
||||||
|
ng-click="vm.setAsRead(notification, notification.get('projectUrl'))"
|
||||||
|
) {{::notification.getIn(['data', 'project', 'name'])}}
|
||||||
.entry-date {{::notification.get('created') | momentFromNow}}
|
.entry-date {{::notification.get('created') | momentFromNow}}
|
|
@ -21,10 +21,11 @@ taiga = @.taiga
|
||||||
|
|
||||||
class NotificationsService extends taiga.Service
|
class NotificationsService extends taiga.Service
|
||||||
@.$inject = [
|
@.$inject = [
|
||||||
"tgResources",
|
"tgResources"
|
||||||
"tgUserTimelinePaginationSequenceService",
|
"tgUserTimelinePaginationSequenceService"
|
||||||
"$translate",
|
"$translate"
|
||||||
"$tgNavUrls"
|
"$tgNavUrls"
|
||||||
|
"$tgSections"
|
||||||
]
|
]
|
||||||
|
|
||||||
_notificationTypes = [
|
_notificationTypes = [
|
||||||
|
@ -86,10 +87,11 @@ class NotificationsService extends taiga.Service
|
||||||
}
|
}
|
||||||
|
|
||||||
constructor: (
|
constructor: (
|
||||||
@rs,
|
@rs
|
||||||
@userTimelinePaginationSequenceService,
|
@userTimelinePaginationSequenceService
|
||||||
@translate,
|
@translate
|
||||||
@navUrls
|
@navUrls
|
||||||
|
@tgSections
|
||||||
) ->
|
) ->
|
||||||
|
|
||||||
getNotificationsList: (userId, onlyUnread) ->
|
getNotificationsList: (userId, onlyUnread) ->
|
||||||
|
@ -123,8 +125,13 @@ class NotificationsService extends taiga.Service
|
||||||
type = @._getType(notification)
|
type = @._getType(notification)
|
||||||
|
|
||||||
title = @._getTitle(notification, event_type, type)
|
title = @._getTitle(notification, event_type, type)
|
||||||
|
|
||||||
notification = notification.set('title_html', title)
|
notification = notification.set('title_html', title)
|
||||||
|
|
||||||
|
projectSlug = notification.getIn(['data', 'project', 'slug'])
|
||||||
|
projectSectionPath = @tgSections.getPath(projectSlug)
|
||||||
|
projectUrl = @navUrls.resolve("project-#{projectSectionPath}", { project: projectSlug })
|
||||||
|
notification = notification.set('projectUrl', projectUrl)
|
||||||
|
|
||||||
notification = notification.set('obj', @._getNotificationObject(notification))
|
notification = notification.set('obj', @._getNotificationObject(notification))
|
||||||
|
|
||||||
return notification
|
return notification
|
||||||
|
|
Loading…
Reference in New Issue