diff --git a/app/assets/images/merged/section_preview/section_events.jpg b/app/assets/images/merged/section_preview/section_events.jpg new file mode 100644 index 0000000..c4b94d6 Binary files /dev/null and b/app/assets/images/merged/section_preview/section_events.jpg differ diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 195fadf..344ed3f 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -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 diff --git a/app/views/events/_event.haml b/app/views/events/_event.haml index 3822960..95b6a95 100644 --- a/app/views/events/_event.haml +++ b/app/views/events/_event.haml @@ -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 diff --git a/app/views/events/_event_small.haml b/app/views/events/_event_small.haml index c374844..3bfb43e 100644 --- a/app/views/events/_event_small.haml +++ b/app/views/events/_event_small.haml @@ -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 diff --git a/app/views/events/index.html.haml b/app/views/events/index.html.haml index 4781d13..d0bdb3a 100644 --- a/app/views/events/index.html.haml +++ b/app/views/events/index.html.haml @@ -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| diff --git a/app/views/members/index.html.haml b/app/views/members/index.html.haml index 227a60b..9ac01e4 100644 --- a/app/views/members/index.html.haml +++ b/app/views/members/index.html.haml @@ -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 diff --git a/app/views/merged/view/_section_events.haml b/app/views/merged/view/_section_events.haml new file mode 100644 index 0000000..b2ea63c --- /dev/null +++ b/app/views/merged/view/_section_events.haml @@ -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 diff --git a/app/views/profiles/index.html.haml b/app/views/profiles/index.html.haml index c149b9f..a27f509 100644 --- a/app/views/profiles/index.html.haml +++ b/app/views/profiles/index.html.haml @@ -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 diff --git a/merged/section_styles.yml b/merged/section_styles.yml index dcd024e..44b5944 100644 --- a/merged/section_styles.yml +++ b/merged/section_styles.yml @@ -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 diff --git a/merged/sections.yml b/merged/sections.yml index 1ff3b29..43059d0 100644 --- a/merged/sections.yml +++ b/merged/sections.yml @@ -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: {}