diff --git a/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections/show.erb b/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections/show.erb new file mode 100644 index 000000000..327f55770 --- /dev/null +++ b/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections/show.erb @@ -0,0 +1,21 @@ +
+
+

<%= t('title', scope: 'decidim.active_proposal_collections_content_block.content_blocks.active_proposal_collections') %>

+
+
+ <% active_proposals_components.each do |component| %> +
+
+ <%= link_to Decidim::Assemblies::Engine.routes.url_helpers.decidim_assembly_proposals_path(component.participatory_space, component), class: "card card__link", style: "background-image:url('#{component.participatory_space.attached_uploader(:hero_image).path}')" do %> +
+ <%= translated_attribute(component.settings.announcement) %> +
+ <% end %> +
+
+ <% end %> +
+ Alle Werkräume anzeigen +
+
+
diff --git a/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections_cell.rb b/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections_cell.rb new file mode 100644 index 000000000..2dbae279d --- /dev/null +++ b/app/cells/decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections_cell.rb @@ -0,0 +1,31 @@ +# frozen_string_literal: true + +module Decidim + module ActiveProposalCollectionsContentBlock + module ContentBlocks + class ActiveProposalCollectionsCell < Decidim::ViewModel + include Decidim::ApplicationHelper # html_truncate + # include Decidim::LayoutHelper # If icons are needed in the (customized) view + include Decidim::SanitizeHelper # decidim_sanitize + + delegate :current_organization, to: :controller + delegate :current_user, to: :controller + + def show + render + end + + def active_proposals_components + @active_proposals_components ||= Decidim::Component.where(participatory_space_id: public_assemblies_ids, participatory_space_type: 'Decidim::Assembly' ).where( manifest_name: 'proposals' ).where.not( published_at: nil ).where("(settings->'default_step'->>'creation_enabled')::boolean = true") + end + + private + + def public_assemblies_ids + Decidim::Assemblies::OrganizationPublishedAssemblies.new(current_organization).pluck(:id) + end + + end + end + end +end diff --git a/app/packs/stylesheets/decidim/decidim_application.scss b/app/packs/stylesheets/decidim/decidim_application.scss index 2dbe93bb7..dee4e5fef 100644 --- a/app/packs/stylesheets/decidim/decidim_application.scss +++ b/app/packs/stylesheets/decidim/decidim_application.scss @@ -683,6 +683,20 @@ ul.card-data { } } +.read-more-content, +.read-more, +.toggler { + display: none; + margin-top: 1rem; + + &.expanded { + display: block; + .read-more { + display: block; + } + } +} + .tags { a:hover { text-decoration: none; diff --git a/app/packs/stylesheets/decidim/zukunftsprozess/startpage.scss b/app/packs/stylesheets/decidim/zukunftsprozess/startpage.scss index b5c6f6a9a..08527e063 100644 --- a/app/packs/stylesheets/decidim/zukunftsprozess/startpage.scss +++ b/app/packs/stylesheets/decidim/zukunftsprozess/startpage.scss @@ -333,3 +333,100 @@ } + + +.home-section.proposals { + .card-wrapper { + position: relative; + padding-top: 66.66%; /* 3:2 Aspect Ratio or 75% for 4:3 */ + + .card { + position: absolute; + top: 0; + left: 0; + bottom: 0; + right: 0; + + background-size: cover; + + + + .teaser { + position: absolute; + bottom: 20px; + right: 20px; + z-index: 1000; + + transform: rotate(-2deg); + + width: 45%; + padding: .5rem; + + background-color: $white; + + font-weight: 400; + font-size: .9rem; + line-height: 1.1rem; + color: $black; + + .link { + font-weight: 700; + color: var(--secondary); + + svg { + height: 12px; + } + } + + // @include breakpoint(small) { + // width: 45%; + // font-size: .8rem; + // line-height: 1rem; + // padding: .3rem; + // } + + // @include breakpoint(medium) { + // width: 45%; + // height: auto; + // padding: .5rem; + + // font-size: .9rem; + // line-height: 1.1rem; + // } + + + // @include breakpoint(large) { + // width: 45%; + // padding: .5rem; + + // font-size: 1.2rem; + // line-height: 1.4rem; + // } + + a { + // text-decoration: none; + font-weight: 600; + + .icon.inline { + @include breakpoint(small) { + width: 9px; + height: 9px; + } + + @include breakpoint(medium) { + width: 10px; + height: 10px; + } + + + @include breakpoint(large) { + width: 12px; + height: 12px; + } + + } + } + } + } + } +} diff --git a/config/initializers/decidim_content_blocks.rb b/config/initializers/decidim_content_blocks.rb index f6a78d4d9..63c203f9b 100644 --- a/config/initializers/decidim_content_blocks.rb +++ b/config/initializers/decidim_content_blocks.rb @@ -6,4 +6,9 @@ Decidim.content_blocks.register(:homepage, :recent_blog_posts) do |content_block| content_block.cell = 'decidim/blog_posts_content_block/content_blocks/recent_blog_posts' content_block.public_name_key = 'decidim.blog_posts_content_block.content_blocks.recent_blog_posts.name' -end \ No newline at end of file +end + +Decidim.content_blocks.register(:homepage, :active_proposal_collections) do |content_block| + content_block.cell = 'decidim/active_proposal_collections_content_block/content_blocks/active_proposal_collections' + content_block.public_name_key = 'decidim.active_proposal_collections_content_block.content_blocks.active_proposal_collections.name' +end diff --git a/config/locales/zukunftsprozess/de.yml b/config/locales/zukunftsprozess/de.yml index 8be04c5a1..0d43d35c5 100644 --- a/config/locales/zukunftsprozess/de.yml +++ b/config/locales/zukunftsprozess/de.yml @@ -3,4 +3,9 @@ de: zukunftsprozess_content_block: content_blocks: startpage: - name: Zukunftsprozess \ No newline at end of file + name: Zukunftsprozess + active_proposal_collections_content_block: + content_blocks: + active_proposal_collections: + name: Aktive Vorschlagssammlungen + title: Hier sammeln Werkräume deine Vorschläge