Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hs proposal startpage moule #27

Open
wants to merge 5 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<section class="wrapper-home home-section proposals">
<div class="row" id="assemblies-with-active-proposals">
<h3 class="section-heading"><%= t('title', scope: 'decidim.active_proposal_collections_content_block.content_blocks.active_proposal_collections') %></h3>
<div class="row collapse">
<div class="row small-up-1 medium-up-2 large-up-3 card-grid">
<% active_proposals_components.each do |component| %>
<div class="column">
<div class="card-wrapper">
<%= 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 %>
<div class="teaser">
<%= translated_attribute(component.settings.announcement) %>
</div>
<% end %>
</div>
</div>
<% end %>
</div>
<a class="button expanded hollow button--sc home-section__cta" title="Link zur konKreationen-Seite die alle Werkräume anzeigt" href="/processes">Alle Werkräume anzeigen</a>
</div>
</div>
</section>
Original file line number Diff line number Diff line change
@@ -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
14 changes: 14 additions & 0 deletions app/packs/stylesheets/decidim/decidim_application.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
97 changes: 97 additions & 0 deletions app/packs/stylesheets/decidim/zukunftsprozess/startpage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

}
}
}
}
}
}
7 changes: 6 additions & 1 deletion config/initializers/decidim_content_blocks.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
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
7 changes: 6 additions & 1 deletion config/locales/zukunftsprozess/de.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,9 @@ de:
zukunftsprozess_content_block:
content_blocks:
startpage:
name: Zukunftsprozess
name: Zukunftsprozess
active_proposal_collections_content_block:
content_blocks:
active_proposal_collections:
name: Aktive Vorschlagssammlungen
title: Hier sammeln Werkräume deine Vorschläge