Class: Decidim::Proposals::CoauthorAcceptedInviteEvent
- Inherits:
-
Events::BaseEvent
- Object
- Events::BaseEvent
- Decidim::Proposals::CoauthorAcceptedInviteEvent
show all
- Includes:
- Events::NotificationEvent
- Defined in:
- app/events/decidim/proposals/coauthor_accepted_invite_event.rb
Instance Method Summary
collapse
Instance Method Details
#author ⇒ Object
24
25
26
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 24
def author
resource.creator_author
end
|
#author_path ⇒ Object
16
17
18
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 16
def author_path
profile_path(author.nickname)
end
|
#coauthor ⇒ Object
28
29
30
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 28
def coauthor
@coauthor ||= Decidim::User.find_by(id: ["coauthor_id"])
end
|
#coauthor_path ⇒ Object
20
21
22
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 20
def coauthor_path
profile_path(coauthor.nickname) if coauthor
end
|
#i18n_options ⇒ Object
36
37
38
39
40
41
42
43
44
45
46
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 36
def i18n_options
{
scope: i18n_scope,
coauthor_name:,
coauthor_path:,
author_name:,
author_path:,
resource_path:,
resource_title:
}
end
|
#i18n_scope ⇒ Object
32
33
34
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 32
def i18n_scope
event_name
end
|
#notification_title ⇒ Object
9
10
11
|
# File 'app/events/decidim/proposals/coauthor_accepted_invite_event.rb', line 9
def notification_title
I18n.t("notification_title", **i18n_options).html_safe
end
|