-
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.
- Loading branch information
1 parent
43876d6
commit 8f1169d
Showing
9 changed files
with
100 additions
and
14 deletions.
There are no files selected for viewing
14 changes: 14 additions & 0 deletions
14
app/controllers/decidim/action_delegator/questions_summary_controller.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,14 @@ | ||
# frozen_string_literal: true | ||
|
||
module Decidim | ||
module ActionDelegator | ||
# This controller handles user profile actions for this module | ||
class QuestionsSummaryController < ActionDelegator::ApplicationController | ||
include Decidim::Consultations::NeedsQuestion | ||
|
||
def show | ||
render partial: "decidim/consultations/question_votes/callout" | ||
end | ||
end | ||
end | ||
end |
2 changes: 1 addition & 1 deletion
2
...des/decidim/consultations/admin/consultations/results/add_ongoing_warning.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 |
---|---|---|
@@ -1,3 +1,3 @@ | ||
<!-- insert_before '.table-list' --> | ||
|
||
<%= render "decidim/action_delegator/admin/consultations/ongoing_consultation_warning", consultation: current_consultation %> | ||
<%= render "decidim/action_delegator/admin/consultations/ongoing_consultation_warning", consultation: current_consultation %> |
1 change: 0 additions & 1 deletion
1
...errides/decidim/consultations/questions/_vote_button/add_modal_javascript.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 |
---|---|---|
@@ -1,4 +1,3 @@ | ||
<!-- insert_before "erb[loud]:contains('javascript_pack_tag')" --> | ||
|
||
<%= javascript_pack_tag "decidim_action_delegator_questions" %> | ||
|
6 changes: 5 additions & 1 deletion
6
app/overrides/layouts/decidim/_question_header/add_consultation_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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
<!-- insert_before 'h2' --> | ||
|
||
<%= render partial: "decidim/consultations/question_votes/callout" %> | ||
<% if user_signed_in? %> | ||
<div id="user-answers-summary" data-summary-path="<%= decidim_action_delegator.questions_summary_path(current_question) %>"> | ||
<%= render partial: "decidim/consultations/question_votes/callout" %> | ||
</div> | ||
<% 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
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,24 @@ | ||
$(() => { | ||
const $usersAnswers = $("#user-answers-summary"); | ||
const path = $usersAnswers.data("summaryPath"); | ||
let $button = $("#consultations-questions-summary-button"); | ||
let $modal = $("#consultations-questions-summary-modal"); | ||
const $div = $(".question-vote-cabin").parent(); | ||
const openModal = (evt) => { | ||
evt.preventDefault(); | ||
$modal.foundation("open"); | ||
}; | ||
|
||
$button.on("click", openModal); | ||
|
||
$div.bind("DOMSubtreeModified", function() { | ||
// console.log("tree changed", path); | ||
$usersAnswers.load(path, () => { | ||
$button = $usersAnswers.find("#consultations-questions-summary-button"); | ||
$modal = $usersAnswers.find("#consultations-questions-summary-modal"); | ||
// console.log("usersanswer loaded") | ||
$usersAnswers.foundation(); | ||
$button.on("click", openModal); | ||
}); | ||
}); | ||
}); |
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