-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor concerns, add deface (#121)
* reorder concerns & initializers * move to deface * add locales
- Loading branch information
1 parent
ffe1fba
commit 141092b
Showing
35 changed files
with
122 additions
and
767 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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
File renamed without changes.
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
25 changes: 25 additions & 0 deletions
25
app/controllers/concerns/decidim/action_delegator/needs_consultation_snippets.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,25 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module ActionDelegator | ||
module NeedsConsultationSnippets | ||
extend ActiveSupport::Concern | ||
|
||
included do | ||
helper_method :snippets | ||
end | ||
|
||
def snippets | ||
@snippets ||= Decidim::Snippets.new | ||
|
||
unless @snippets.any?(:action_delegator_consultation_questions) | ||
@snippets.add(:action_delegator_consultation_questions, ActionController::Base.helpers.stylesheet_pack_tag("decidim_action_delegator_questions")) | ||
@snippets.add(:action_delegator_consultation_questions, ActionController::Base.helpers.javascript_pack_tag("decidim_action_delegator_questions_js")) | ||
@snippets.add(:head, @snippets.for(:action_delegator_consultation_questions)) | ||
end | ||
|
||
@snippets | ||
end | ||
end | ||
end | ||
end |
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
...errides/decidim/consultations/consultations/_question/add_delegation_link.html.erb.deface
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,3 @@ | ||
<!-- insert_after "erb[loud]:contains('display_take_part_button_for(question)')" --> | ||
|
||
<%= render partial: "decidim/action_delegator/link_to_question", locals: { question: question } %> |
8 changes: 8 additions & 0 deletions
8
...decidim/consultations/question_multiple_votes/_form/add_delegation_notice.html.erb.deface
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,8 @@ | ||
<!-- insert_before ".card__content.multiple_votes_form" --> | ||
|
||
<% if delegation %> | ||
<div class="delegation-callout callout warning"> | ||
<p><%= t "action_delegator.delegations_modal.callout", scope: "decidim" %> <strong><%= delegation.granter.name %></strong></p> | ||
</div> | ||
<%= hidden_field_tag :decidim_consultations_delegation_id, delegation.id %> | ||
<% end %> |
3 changes: 3 additions & 0 deletions
3
...errides/decidim/consultations/questions/_vote_button/add_delegations_link.html.erb.deface
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,3 @@ | ||
<!-- insert_before "erb[silent]:contains('elsif question.consultation.active?')" --> | ||
|
||
<%= render partial: "decidim/action_delegator/link_to_delegations", locals: { question: question } %> |
3 changes: 3 additions & 0 deletions
3
app/overrides/decidim/consultations/questions/_vote_button/add_modal.html.erb.deface
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,3 @@ | ||
<!-- insert_before "erb[loud]:contains('javascript_pack_tag')" --> | ||
|
||
<%= render partial: "decidim/action_delegator/delegations_modal", locals: { question: question } %> |
8 changes: 8 additions & 0 deletions
8
...consultations/questions/_vote_button/replace_delegation_to_multivote_link.html.erb.deface
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,8 @@ | ||
<!-- replace_contents "erb[silent]:contains('if question.multiple?')" | ||
closing_selector "erb[silent]:contains('else')" --> | ||
|
||
<%= link_to decidim_consultations.question_question_multiple_votes_path(question, delegation: 0), | ||
class: "card__button button expanded", | ||
id: "multivote_button" do %> | ||
<div class="vote-button-caption"><%= t "questions.vote_button.vote", scope: "decidim" %></div> | ||
<% end %> |
3 changes: 3 additions & 0 deletions
3
...rrides/decidim/consultations/questions/_vote_modal/add_delegation_callout.html.erb.deface
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,3 @@ | ||
<!-- insert_after ".reveal__header" --> | ||
|
||
<%= render partial: "decidim/action_delegator/callout", locals: { consultation: question.consultation } %> |
3 changes: 3 additions & 0 deletions
3
...ecidim/consultations/questions/_vote_modal_confirm/add_delegation_callout.html.erb.deface
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,3 @@ | ||
<!-- insert_after ".reveal__header" --> | ||
|
||
<%= render partial: "decidim/action_delegator/callout", locals: { consultation: question.consultation } %> |
3 changes: 3 additions & 0 deletions
3
...ides/decidim/consultations/questions/_vote_modal_confirm/add_hidden_field.html.erb.deface
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,3 @@ | ||
<!-- insert_after "erb[loud]:contains('form.hidden_field :decidim_consultations_response_id')" --> | ||
|
||
<%= hidden_field_tag :decidim_consultations_delegation_id, nil, id: "decidim_consultations_delegation_id" %> |
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,10 @@ | ||
# frozen_string_literal: true | ||
|
||
Deface::Override.new(virtual_path: "layouts/decidim/admin/consultations", | ||
name: "remove_deprecation_warning", | ||
remove: ".callout.warning", | ||
disabled: !Decidim::ActionDelegator.remove_consultation_deprecation_warning) | ||
Deface::Override.new(virtual_path: "layouts/decidim/admin/consultation", | ||
name: "remove_deprecation_warning", | ||
remove: ".callout.warning", | ||
disabled: !Decidim::ActionDelegator.remove_consultation_deprecation_warning) |
File renamed without changes.
41 changes: 0 additions & 41 deletions
41
app/views/decidim/consultations/consultations/_question.html.erb
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
app/views/decidim/consultations/consultations/show.html.erb
This file was deleted.
Oops, something went wrong.
25 changes: 0 additions & 25 deletions
25
app/views/decidim/consultations/question_multiple_votes/_form.html.erb
This file was deleted.
Oops, something went wrong.
106 changes: 0 additions & 106 deletions
106
app/views/decidim/consultations/questions/_vote_button.html.erb
This file was deleted.
Oops, something went wrong.
30 changes: 0 additions & 30 deletions
30
app/views/decidim/consultations/questions/_vote_modal.html.erb
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
app/views/decidim/consultations/questions/_vote_modal_confirm.html.erb
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.