forked from decidim/decidim
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #37 from OpenSourcePolitics/develop
Develop
- Loading branch information
Showing
49 changed files
with
632 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 7 additions & 4 deletions
11
decidim-admin/app/views/decidim/admin/navbar_links/_form.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,17 @@ | ||
<div class="row column"> | ||
<%= form.translated :text_field, :title %> | ||
<%= form.translated :text_field, :title, label: t(".title") %> | ||
</div> | ||
|
||
<div class="row"> | ||
<div class="columns xlarge-6"> | ||
<%= form.text_field :link, value: navbar_link.link || "http://" %> | ||
<%= form.text_field :link, value: navbar_link.link || "http://", label: t(".link") %> | ||
</div> | ||
<div class="columns xlarge-6"> | ||
<%= form.radio_button :target, "blank", label: "Ouvrir sur un nouvel onglet" %> | ||
<%= form.radio_button :target, "", label: "Ouvrir dans le même onglet" %> | ||
<%= form.number_field :weight, value: navbar_link.weight, label: t(".weight") %> | ||
</div> | ||
<div class="columns xlarge-6"> | ||
<%= form.radio_button :target, "blank", label: t(".new_tab") %> | ||
<%= form.radio_button :target, "", label: t(".same_tab") %> | ||
</div> | ||
<%= form.hidden_field :organization_id, value: current_organization.id %> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
require "decidim/extends/project_extend.rb" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module ProjectExtend | ||
def users_to_notify_on_comment_created | ||
get_all_users_with_role | ||
end | ||
|
||
def users_to_notify_on_comment_authorized | ||
followers | ||
end | ||
end | ||
|
||
Decidim::Budgets::Project.class_eval do | ||
prepend(ProjectExtend) | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
69 changes: 69 additions & 0 deletions
69
decidim-comments/app/events/decidim/comments/comment_authorized_event.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
# frozen-string_literal: true | ||
|
||
module Decidim | ||
module Comments | ||
class CommentAuthorizedEvent < Decidim::Events::BaseEvent | ||
include Decidim::Events::EmailEvent | ||
include Decidim::Events::NotificationEvent | ||
|
||
def email_subject | ||
I18n.t( | ||
"decidim.comments.events.comment_authorized.#{comment_type}.email_subject", | ||
resource_title: resource_title, | ||
resource_url: resource_locator.url(url_params), | ||
author_name: author.name | ||
) | ||
end | ||
|
||
def email_intro | ||
I18n.t( | ||
"decidim.comments.events.comment_authorized.#{comment_type}.email_intro", | ||
resource_title: resource_title | ||
).html_safe | ||
end | ||
|
||
def email_outro | ||
I18n.t( | ||
"decidim.comments.events.comment_authorized.#{comment_type}.email_outro", | ||
resource_title: resource_title | ||
) | ||
end | ||
|
||
def notification_title | ||
I18n.t( | ||
"decidim.comments.events.comment_authorized.#{comment_type}.notification_title", | ||
resource_title: resource_title, | ||
resource_path: resource_locator.path(url_params), | ||
author_nickname: author.nickname, | ||
author_name: author.name, | ||
author_path: author.profile_path | ||
).html_safe | ||
end | ||
|
||
def email_url | ||
I18n.t( | ||
"decidim.comments.events.comment_authorized.#{comment_type}.url", | ||
resource_url: resource_locator.url(url_params) | ||
).html_safe | ||
end | ||
|
||
private | ||
|
||
def author | ||
@author ||= Decidim::UserPresenter.new(comment.author) | ||
end | ||
|
||
def comment | ||
@comment ||= Decidim::Comments::Comment.find(extra[:comment_id]) | ||
end | ||
|
||
def comment_type | ||
comment.depth.zero? ? :comment : :reply | ||
end | ||
|
||
def url_params | ||
comment_type == :comment ? {} : { anchor: "comment_#{comment.id}" } | ||
end | ||
end | ||
end | ||
end |
Oops, something went wrong.