create and display upcoming event section

This commit is contained in:
Torsten 2023-08-31 12:48:20 +03:00
parent cac691d121
commit 973ede68b2
10 changed files with 42 additions and 17 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 534 KiB

View File

@ -19,7 +19,7 @@ module ApplicationHelper
"mr-3 inline-block rounded-lg px-3 py-2 text-md font-medium border border-gray-500"
end
def image_for(someone , classes = "")
def picture_for(someone , classes = "")
if someone.picture.blank?
image = asset_url("no_image.png")
else

View File

@ -1,6 +1,6 @@
%section.overflow-hidden.grid.grid-cols-1.m-5.md:m-12.lg:m-20.md:grid-cols-2
%div
= image_for( event , "h-56 w-full object-cover sm:h-full")
= picture_for( event , "h-56 w-full object-cover sm:h-full")
.p-8.md:p-12.lg:px-16.lg:py-24
.mx-auto.max-w-xl.text-center
%h2.text-2xl.font-bold.md:text-4xl

View File

@ -1,6 +1,6 @@
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
=link_to event do
= image_for( event , class: "h-60 w-full object-cover")
.flex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
=link_to main_app.event_path(event) do
= picture_for( event , class: "h-60 w-full object-cover")
%div
%h3.pt-5.text-2xl.bg-gray-100.text-black.font-bold.text-center
= event.name

View File

@ -1,3 +1,5 @@
.flex.justify-center
%h3.text-3xl.font-bold Upcoming Events
.flex.justify-center
.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-4
- @events.each do |event|

View File

@ -5,7 +5,7 @@
- @members.each do |member|
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
=link_to member do
= image_for( member , class: "h-60 w-full object-cover")
= picture_for( member , class: "h-60 w-full object-cover")
%h3.pt-5.text-2xl.bg-gray-100.text-black.font-bold.text-center
= member.name
%div.h-full

View File

@ -0,0 +1,10 @@
.flex.justify-around.mt-5.md:mt-12.lg:mt-20
%h3.text-3xl.font-bold
= link_to "See all events" , "/events" , class: :underline
.flex.justify-center
.grid.grid-cols-1.md:grid-cols-2.lg:grid-cols-4
- one, two , three, four = *Event.where("start_date > ? " , Date.today - 3.days).limit(4)
%div= render( "events/event_small" , event: one) if one
.hidden.md:block= render( "events/event_small" , event: two) if two
.hidden.lg:block= render( "events/event_small" , event: three) if three
.hidden.lg:block= render( "events/event_small" , event: four) if four

View File

@ -5,7 +5,7 @@
- @profiles.each do |profile|
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm
=link_to profile do
= image_for( profile , class: "h-60 w-full object-cover")
= picture_for( profile , class: "h-60 w-full object-cover")
%h3.py-5.text-2xl.bg-gray-100.text-black.font-bold.text-center
= profile.name
%div.h-full

View File

@ -1 +1,12 @@
--- []
---
- template: section_events
header: Showing latest events
text: Always the next four events
fields:
- header
- text
options:
- background
- text_color
- text_align
- item_align

View File

@ -559,13 +559,6 @@
:index: 1
:image_id: 16
:updated_by: maijanposteja@gmail.com
- :template: section_spacer
:id: 32
:updated_at: &2 2022-12-10 20:28:17.967357225 +02:00
:page_id: 6
:index: 2
:options: {}
:image_id:
- :template: section_half_image
:header: Retreats
:text: Hub Feenix is a beautiful place, ideally situated in the country, but close
@ -578,7 +571,7 @@
background: solid_blue
:image_name: retreats
:id: 33
:updated_at: *2
:updated_at: 2022-12-10 20:28:17.967357225 +02:00
:page_id: 6
:index: 3
:image_id: 27
@ -611,10 +604,11 @@
background: solid_blue
:image_name: makerspace
:id: 35
:updated_at: *2
:updated_at: 2023-08-31 11:57:17.559100941 +03:00
:page_id: 6
:index: 5
:image_id: 20
:updated_by: torsten@villataika.fi
- :template: section_half_image
:id: 36
:header: Coworking and offices
@ -1893,3 +1887,11 @@
:updated_by: torsten@villataika.fi
:id: 93
:image_id: 119
- :template: section_events
:index: 2
:page_id: 6
:updated_at: 2023-08-31 11:57:32.406973102 +03:00
:updated_by: torsten@villataika.fi
:id: 94
:card_template: ''
:options: {}