Skip to content

Commit

Permalink
Merge pull request #98 from OpenSourcePolitics/fix/custos_graphiques
Browse files Browse the repository at this point in the history
fix: custos graphiques
  • Loading branch information
simonaszilinskas authored Jan 18, 2024
2 parents d54b80f + 37d9a0f commit c14ff06
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 8 deletions.
1 change: 1 addition & 0 deletions .env-example
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,4 @@ TRANSLATION_SWITCH_REGEXP=
TWILIO_ACCOUNT_SID=
TWILIO_AUTH_TOKEN=
TWILIO_SENDER=
HALF_SIGNUP_TOS=false
10 changes: 5 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@ gem "decidim-slider", git: "https://github.com/alecslupu-pfa/decidim-module-slid
gem "decidim-spam_detection"
gem "decidim-term_customizer", git: "https://github.com/opensourcepolitics/decidim-module-term_customizer.git", branch: "fix/multi-threading-compliant-0.26"

# PTP_MODULE_VERSION = { github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting" }
gem "decidim-budgets_booth", github: "OpenSourcePolitics/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-smsauth", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-sms-twilio", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"

# NOTE: Custom proposal states must be before simple_proposal
gem "decidim-custom_proposal_states", git: "https://github.com/alecslupu-pfa/decidim-module-custom_proposal_states", branch: "chore/fix-module-dependency"
gem "decidim-simple_proposal", git: "https://github.com/mainio/decidim-module-simple_proposal", branch: DECIDIM_BRANCH
Expand All @@ -46,11 +51,6 @@ gem "sys-filesystem"
gem "omniauth-rails_csrf_protection"
gem "omniauth-saml"

# PTP_MODULE_VERSION = { github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting" }
gem "decidim-budgets_booth", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-smsauth", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"
gem "decidim-sms-twilio", github: "Pipeline-to-Power/decidim-module-ptp", branch: "feature/0.26/zip-code-voting"

group :development, :test do
gem "brakeman", "~> 5.1"
gem "byebug", "~> 11.0", platform: :mri
Expand Down
12 changes: 9 additions & 3 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@ GIT
rgeo (~> 2.4)
rgeo-proj4 (~> 3.1)

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module-ptp.git
revision: 6148a817251256d6f536f1f3478c8be895a518b0
branch: feature/0.26/zip-code-voting
specs:
decidim-budgets_booth (0.26.0)
decidim-budgets (~> 0.26.0)
decidim-core (~> 0.26.0)

GIT
remote: https://github.com/OpenSourcePolitics/decidim-module_phone_authorization_handler
revision: 488cc8827845ec1c5266aa499df2ebf9b20e02a3
Expand All @@ -32,9 +41,6 @@ GIT
revision: 79f07fee09671661ab23e8a8c18e464a78d29966
branch: feature/0.26/zip-code-voting
specs:
decidim-budgets_booth (0.26.0)
decidim-budgets (~> 0.26.0)
decidim-core (~> 0.26.0)
decidim-sms-twilio (0.26.0)
decidim-core (~> 0.26.0)
twilio-ruby (~> 5.72.0)
Expand Down
20 changes: 20 additions & 0 deletions app/cells/decidim/budgets/project_vote_button/show.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<%= action_authorized_button_to(
"vote",
budget_order_line_item_path(model.budget, project_id: model),
method: vote_button_method,
remote: true,
class: "button #{scale_up} #{selected_budget} customized-budget display-block project-vote-button",
data: {
add: !resource_added?,
disable: true,
budget: model.budget_amount,
project_id: model.id,
allocation: resource_allocation,
"redirect-url": budget_voting_index_path
},
disabled: vote_button_disabled?,
title: vote_button_label
) do %>
<%= resource_added? ? t("remove_from_vote", scope: "decidim.budgets.project_vote_button") :t("add_to_vote", scope: "decidim.budgets.project_vote_button") %>
<% end %>

6 changes: 6 additions & 0 deletions app/views/layouts/decidim/_head_extra.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
});
</script>
<% end %>

<% if translation_mode?(:google) %>
<script>

Expand Down Expand Up @@ -39,6 +40,11 @@
},
'google_translate_element'
);

waitForElm("iframe.skiptranslate").then((elm) => {
$(elm).hide();
$("body").attr("style", "");
});
}
</script>
<script src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
Expand Down
5 changes: 5 additions & 0 deletions config/initializers/half_signup.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# frozen_string_literal: true

Decidim::HalfSignup.configure do |config|
config.show_tos_page_after_signup = Rails.application.secrets.dig(:decidim, :module, :half_signup, :show_tos_page_after_signup)
end
3 changes: 3 additions & 0 deletions config/secrets.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ default: &default
google_tag_manager_id: <%= ENV["GOOGLE_TAG_MANAGER_ID"] %>
decidim:
currency: <%= ENV["CURRENCY"] || "€" %>
module:
half_signup:
show_tos_page_after_signup: <%= ENV["HALF_SIGNUP_TOS"] == "true" %>
throttling_max_requests: <%= ENV["THROTTLING_MAX_REQUESTS"] || 100 %>
throttling_period: <%= ENV["THROTTLING_PERIOD"] || 1 %>
translation_mode: <%= ENV["TRANSLATION_MODE"] || "none" %>
Expand Down

0 comments on commit c14ff06

Please sign in to comment.