Link to project in notification
parent
9a53ac378c
commit
d9d12cdc4b
|
@ -32,5 +32,9 @@ section.notifications-list
|
|||
)
|
||||
.entry-content
|
||||
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}}
|
|
@ -21,10 +21,11 @@ taiga = @.taiga
|
|||
|
||||
class NotificationsService extends taiga.Service
|
||||
@.$inject = [
|
||||
"tgResources",
|
||||
"tgUserTimelinePaginationSequenceService",
|
||||
"$translate",
|
||||
"tgResources"
|
||||
"tgUserTimelinePaginationSequenceService"
|
||||
"$translate"
|
||||
"$tgNavUrls"
|
||||
"$tgSections"
|
||||
]
|
||||
|
||||
_notificationTypes = [
|
||||
|
@ -86,10 +87,11 @@ class NotificationsService extends taiga.Service
|
|||
}
|
||||
|
||||
constructor: (
|
||||
@rs,
|
||||
@userTimelinePaginationSequenceService,
|
||||
@translate,
|
||||
@rs
|
||||
@userTimelinePaginationSequenceService
|
||||
@translate
|
||||
@navUrls
|
||||
@tgSections
|
||||
) ->
|
||||
|
||||
getNotificationsList: (userId, onlyUnread) ->
|
||||
|
@ -123,8 +125,13 @@ class NotificationsService extends taiga.Service
|
|||
type = @._getType(notification)
|
||||
|
||||
title = @._getTitle(notification, event_type, type)
|
||||
|
||||
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))
|
||||
|
||||
return notification
|
||||
|
|
Loading…
Reference in New Issue