Skip to content

Commit

Permalink
add donate buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
microstudi committed Oct 10, 2024
1 parent 79d3b71 commit e64199e
Show file tree
Hide file tree
Showing 15 changed files with 77 additions and 45 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div class="space-y-8">
<%= render :title %>
</div>

<div class="participatory-space__gpc-container" id="donate-zone">
<%= cell "donate" %>

<% if nav_items.present? %>
<%= cell "decidim/nav_links", nav_items %>
<% end %>

</div>
15 changes: 15 additions & 0 deletions app/cells/donate/show.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
<div class="donate-box<%= "mb-0" if chat? %>">
<p><%= t("gpc.donate_text_1") %></p>
<p><a href="<%= generic_donate_url %>" class="button button__primary <%= button_class %> lg:w-full my-4" target="_blank">
<%= icon("flashlight-line") + " " + t("gpc.donate_button") %>
</a></p>
<p><%= t("gpc.donate_text_2") %></p>
</div>

<% if chat? %>
<div class="donate-box" style="padding:0">
<p><a href="<%= generic_chat_url %>" class="button button__primary <%= button_class %> lg:w-full my-4" target="_blank">
<%= icon("flashlight-line") + " " + t("gpc.donate_button") %>
</a></p>
</div>
<% end %>
17 changes: 17 additions & 0 deletions app/cells/donate_cell.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# frozen_string_literal: true

class DonateCell < Decidim::ViewModel
def show
render if generic_donate_url.present?
end

def button_class
return options[:button_class] if options[:button_class].present?

"button__lg"
end

def chat?
options[:chat] == true
end
end

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,17 +1,3 @@
<!-- replace '.section:first' -->
<!-- insert_before '.conference__nav-container' -->

<% if generic_donate_url || generic_chat_url %>
<div class="row">
<div class="column medium-9">
<h3 class="section-heading"><%= t("conferences.show.introduction", scope: "decidim") %></h3>
<%= decidim_sanitize_editor_admin translated_attribute(current_participatory_space.short_description) %>
</div>
<div class="column medium-3">
<%= render "decidim/donate" %>
<%= render "decidim/chat" %>
</div>
</div>
<% else %>
<h3 class="section-heading"><%= t("conferences.show.introduction", scope: "decidim") %></h3>
<%= decidim_sanitize_editor_admin translated_attribute(current_participatory_space.short_description) %>
<% end %>
<%= render "decidim/conferences/aside" %>

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<!-- replace 'erb[loud]:contains("yield :aside")' -->

<%= cell "donate", nil, { button_class: "button__sm" } %>

<%= yield :aside %>
18 changes: 18 additions & 0 deletions app/packs/stylesheets/decidim/decidim_application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -59,3 +59,21 @@ $small: 576px;
// }
// }
// }

.donate-box {
@apply bg-primary p-3 m-0 mb-6 rounded bg-background text-center;

p {
@apply text-sm text-gray-2;
}
}

.participatory-space {
&__gpc-container {
@apply ml-0 w-full md:w-auto self-start;

.participatory-space__nav-container {
@apply ml-0;
}
}
}
7 changes: 0 additions & 7 deletions app/views/decidim/_chat.html.erb

This file was deleted.

9 changes: 0 additions & 9 deletions app/views/decidim/_donate.html.erb

This file was deleted.

3 changes: 3 additions & 0 deletions app/views/decidim/conferences/_aside.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<div class="px-6 -mb-6">
<%= cell "donate", nil, chat: generic_chat_url.present? %>
</div>
2 changes: 2 additions & 0 deletions config/initializers/gpc_overrides.rb
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,6 @@

Decidim::Amendable::Accept.include(AmendableAcceptOverride)
Decidim::Amendable::Reject.include(AmendableRejectOverride)

Decidim.icons.register(name: "flashlight-line", icon: "flashlight-line", category: "system", description: "", engine: :core)
end
3 changes: 2 additions & 1 deletion spec/lib/overrides_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"/app/views/decidim/devise/shared/_omniauth_buttons.html.erb" => "de3f80dda35889bc1947d8e6eff3c19a",
"/app/views/decidim/shared/_login_modal.html.erb" => "a29d4fcebe8c689044e3c15f6144f3d1",
# cells
"/app/cells/decidim/content_blocks/participatory_space_main_data/content.rb" => "f3b3b3b3b3b3b3b3b3b3b3b3b3b3b3b3",
"/app/cells/decidim/card_metadata_cell.rb" => "3e9ee8e6a82728c0c88c4ec53a279a21",
# "/app/cells/decidim/diff/attribute.erb" => "d648bc8e71e27c404d82132d6e3c3241",
# "/app/cells/decidim/diff/diff_mode_dropdown.erb" => "770563c121c875159a88cd5e142658e3",
Expand Down Expand Up @@ -74,7 +75,7 @@
"/app/helpers/decidim/proposals/application_helper.rb" => "317b0347528e697fa405a792bcfa3db8",
# "/app/views/decidim/proposals/proposals/index.html.erb" => "48fbf7a8332f5f4c026b793e7922bdbc",
# "/app/views/decidim/proposals/proposals/show.html.erb" => "23188e6a12cc1ac6ce44c857b3b81a4c",
"/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb" => "99565100beee10448dac976d6d5e8b87",
"/app/cells/decidim/proposals/highlighted_proposals_for_component_cell.rb" => "99565100beee10448dac976d6d5e8b87"
# "/app/views/decidim/proposals/proposals/_proposals.html.erb" => "a4057670154210aff98e5f206d0fdfc2",
# "/app/views/decidim/proposals/proposals/_wizard_aside.html.erb" => "45dc17085fabc549bee6474b8a3e79df",
}
Expand Down
2 changes: 1 addition & 1 deletion tailwind.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ module.exports = {
// This content is generated automatically by decidim:webpacker:install task, it
// should not be updated manually.
// The array must contain all the decidim modules active in the application
content: ['/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-core','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-comments','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-accountability','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-admin','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-api','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-assemblies','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-blogs','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-budgets','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-debates','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-forms','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-generators','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-meetings','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-pages','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-participatory_processes','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-proposals','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-sortitions','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-surveys','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-system','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-verifications','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-calendar-c53255842434','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-civicrm-78e77fb7377f','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-conferences','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-decidim_awesome-84374037d34a','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-dev','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-templates','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-term_customizer-9133eea57ebf','.'].flatMap(directory => [
content: ['/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-core','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-comments','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-accountability','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-admin','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-api','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-assemblies','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-blogs','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-budgets','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-debates','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-forms','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-generators','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-meetings','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-pages','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-participatory_processes','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-proposals','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-sortitions','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-surveys','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-system','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-verifications','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-calendar-c53255842434','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-civicrm-78e77fb7377f','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-conferences','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-decidim_awesome-8bd03912f77e','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-dev','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-2e7ffcefff77/decidim-templates','/home/admin/.rbenv/versions/3.1.6/lib/ruby/gems/3.1.0/bundler/gems/decidim-module-term_customizer-9133eea57ebf','.'].flatMap(directory => [
`${directory}/app/views/**/*.html.erb`,
`${directory}/app/cells/**/*.{rb,erb}`,
`${directory}/app/helpers/**/*.rb`,
Expand Down

0 comments on commit e64199e

Please sign in to comment.