@if(count($notifications))
@foreach ($notifications as $index => $notification)
@if((isset($notification->details->object) && isset($notification->details->object->permalink_url) && isset($notification->details->host)) || (isset($notification->details->object->object->object->permalink_url) && isset($notification->details->host)))
action == 'sharedMusic')
href="{{ route('frontend.user.posts', ['username' => $notification->details->host->username, 'id' => $notification->object_id]) }}"
@elseif ($notification->action == 'commentMusic' || $notification->action == 'commentMentioned' || $notification->action == 'replyComment')
href="{{ $notification->details->object->permalink_url }}?comment_id={{ $notification->object_id }}"
@elseif ($notification->action == 'reactComment')
href="{{ $notification->details->object->object->object->permalink_url }}?comment_id={{ $notification->object_id }}"
@elseif ($notification->action == 'inviteCollaboration' || $notification->action == 'acceptedCollaboration')
href="{{ $notification->details->object->permalink_url }}"
@elseif ($notification->action == 'addToPlaylist')
@elseif ($notification->action == 'followUser')
href="{{ route('frontend.user', ['username' => $notification->details->host->username]) }}"
@elseif ($notification->action == 'followArtist')
@elseif ($notification->action == 'followPlaylist')
@elseif ($notification->action == 'addEvent')
href="{{ route('frontend.artist.events', ['id' => $notification->details->model->id, 'slug' => $notification->details->model->name]) }}"
@endif
data-notification-id="{{ $notification->id }}"
>
@if ($notification->action == 'sharedMusic')
@switch($notification->notificationable_type)
@case('App\Models\Song')
{!! __('web.NOTIFICATION_USER_SHARE', ['user' => $notification->details->host->name, 'object' => trans('web.SONG_ARTICLE')])!!}
@break
@case('App\Models\Album')
{!! __('web.NOTIFICATION_USER_SHARE', [
'user' => $notification->details->host->name,
'object' => trans('web.ALBUM_ARTICLE')
])
!!}
@break
@case('App\Models\Playlist')
{!! __('web.NOTIFICATION_USER_SHARE', [
'user' => $notification->details->host->name,
'object' => trans('web.PLAYLIST_ARTICLE')
])
!!}
@break
@case('App\Models\Artist')
{!! __('web.NOTIFICATION_USER_SHARE', [
'user' => $notification->details->host->name,
'object' => trans('web.ARTIST_ARTICLE'),
])
!!}
@break
@endswitch
@elseif ($notification->action == 'commentMusic')
@switch($notification->notificationable_type)
@case('App\Models\Song')
{!! __('web.NOTIFICATION_USER_COMMENT', [
'user' => $notification->details->host->name,
'object' => trans('web.SONG_ARTICLE'),
])
!!}
@break
@case('App\Models\Activity')
{!! __('web.NOTIFICATION_USER_COMMENT', [
'user' => $notification->details->host->name,
'object' => 'your activity',
])
!!}
@break
@case('App\Models\Playlist')
{!! __('web.NOTIFICATION_USER_COMMENT', [
'user' => $notification->details->host->name,
'object' => trans('web.PLAYLIST_ARTICLE'),
])
!!}
@break
@case('App\Models\User')
{!! __('web.NOTIFICATION_USER_COMMENT', [
'user' => $notification->details->host->name,
'object' => 'your profile page',
])
!!}
@break
@endswitch
@elseif ($notification->action == 'commentMentioned')
{!! __('web.NOTIFICATION_USER_GET_COMMENT_MENTIONED', [
'user' => $notification->details->host->name,
'object' => trans('web.SONG_ARTICLE'),
])
!!}
@elseif ($notification->action == 'inviteCollaboration')
{!! __('web.NOTIFICATION_INVITED_COLLABORATION', [
'user' => $notification->details->host->name
])
!!}
@elseif ($notification->action == 'acceptedCollaboration')
{!! __('web.NOTIFICATION_ACCEPTED_COLLABORATION', [
'user' => $notification->details->host->name,
'object' => $notification->details->object->title,
])
!!}
@elseif ($notification->action == 'replyComment')
{!! __('web.NOTIFICATION_USER_REPLY_COMMENT', [
'user' => $notification->details->host->name
])
!!}
@elseif ($notification->action == 'reactComment')
{!! __('web.NOTIFICATION_USER_REACT_COMMENT', [
'user' => $notification->details->host->name,
'content' => str_limit(strip_tags($notification->details->object->object->content), 30),
])
!!}
@elseif ($notification->action == 'followUser')
{!! __('web.NOTIFICATION_USER_FOLLOW', ['user' => $notification->details->host->name,])
!!}
@elseif ($notification->action == 'followArtist')
{!! __(count($notification->details->objects) == 1 ? 'web.FEED2_USER_FOLLOWING' : 'web.FEED2_USER_FOLLOWING', [
'user' => htmlLink($notification->user->name, route('frontend.user', ['username' => $notification->user->username]), 'user-link'),
'objectCount' => count($notification->details->objects),
'object' => htmlLink($notification->details->objects[0]->name, $notification->details->objects[0]->permalink_url, 'artist-link'),
'objects' => trans('web.ARTIST_PLURAL')
])
!!}
@elseif ($notification->action == 'followPlaylist')
{!! __($notification->details->object->user->id == auth()->user()->id ? 'web.NOTIFICATION_USER_SUBSCRIBED_YOUR' : 'web.NOTIFICATION_USER_SUBSCRIBED', [
'user' => htmlLink($notification->details->host->name, route('frontend.user', ['username' => $notification->details->host->username]), 'user-link'),
'object' => htmlLink($notification->details->object->user->id == auth()->user()->id ? trans('web.PLAYLIST') : $notification->details->object->title, $notification->details->object->permalink_url, 'playlist-link'),
])
!!}
@elseif ($notification->action == 'addSong')
@if(isset($notification->details->model))
{!! __(count($notification->details->objects) == 1 ? 'web.FEED2_ARTIST_UPLOADED' : 'web.FEED2_ARTIST_UPLOADED_MANY', [
'artist' => htmlLink($notification->details->model->name, route('frontend.artist', ['id' => $notification->details->model->id, 'slug' => $notification->details->model->name]), 'user-link'),
'objectCount' => count($notification->details->objects),
'objects' => trans('web.SONG_PLURAL'),
'object' => htmlLink(trans('web.SONG_ARTICLE'), $notification->details->objects[0]->permalink_url, 'song-link'),
'destination' => htmlLink($notification->details->model->title, $notification->details->model->permalink_url, 'user-collection-link'),
])
!!}
@endif
@endif
{{ timeElapsedString($notification->created_at) }}
@if ($notification->action == 'addEvent')
@if(isset($notification->details->model))
{!! __('web.FEED2_ARTIST_ADDED_EVENT', [
'artist' => $notification->details->model->name,
'object' => trans('web.EVENT_ARTICLE'),
])
!!}
@endif
@elseif ($notification->action == 'addToPlaylist')
@if(isset($notification->details->model))
{!! __(count($notification->details->objects) == 1 ? 'web.NOTIFICATION_USER_ADDED' : 'web.NOTIFICATION_USER_ADDED_MANY', [
'user' => $notification->user->name,
'objectCount' => count($notification->details->objects),
'objects' => trans('web.SONG_PLURAL'),
'object' => trans('web.SONG_ARTICLE'),
'destination' => $notification->details->model->title,
])
!!}
@endif
@elseif ($notification->action == 'addSong')
@if(isset($notification->details->model))
{!! __(count($notification->details->objects) == 1 ? 'web.NOTIFICATION_ARTIST_UPLOADED' : 'web.NOTIFICATION_ARTIST_UPLOADED_MANY', [
'artist' => $notification->details->model->name,
'objectCount' => count($notification->details->objects),
'objects' => trans('web.SONG_PLURAL'),
'object' => trans('web.SONG_ARTICLE'),
])
!!}
@endif
@endif
{{ timeElapsedString($notification->created_at) }}
{{ __('web.YOU_HAVE_NO_NOTIFS') }}
@endif