event list for teacher page

This commit is contained in:
Torsten 2023-10-12 13:20:48 +03:00
parent 1290749bce
commit b3063a3238
5 changed files with 29 additions and 3 deletions

View File

@ -34,7 +34,7 @@ gem "net-imap"
gem "simple_form" , "5.1.0"
gem "simple_form_tailwind_css"
gem "passenger" , require: "phusion_passenger/rack_handler"
gem "passenger" , "6.0.15" , require: "phusion_passenger/rack_handler"
gem "bootsnap", require: false
group :production do

View File

@ -464,7 +464,7 @@ DEPENDENCIES
mina
net-imap
newrelic_rpm
passenger
passenger (= 6.0.15)
pg (~> 1.1)
pundit
rails (~> 7.0)

View File

@ -8,6 +8,9 @@ class ProfilesController < ApplicationController
end
def show
@events = Event.where(profile_id: @profile.id).
where("start_date > ? " , Date.today - 3.days).
order(:start_date)
end
def new

View File

@ -6,7 +6,8 @@
.flex.mt-6.py-4.flex-col.max-w-screen-lg.overflow-hidden.bg-white.border.rounded.shadow-sm.lg:flex-row.sm:mx-auto
.relative{:class => "lg:w-1/2"}
-if profile.picture_url
= image_tag profile.picture_url, class: "object-cover w-full lg:absolute h-80 lg:h-full"
= link_to profile do
= image_tag profile.picture_url, class: "object-cover w-full lg:absolute h-80 lg:h-full"
.flex.flex-col.justify-center.p-8.lg:p-16.lg:pl-10{:class => "lg:w-1/2"}
%h5.mb-3.text-3xl.font-extrabold.leading-none.sm:text-4xl
= profile.name

View File

@ -1 +1,23 @@
= render "profile" , profile: @profile , header: "#{@profile.Kind} profile"
.px-4
.flex.justify-center
.px-4.py-4.text-center
%h1.text-2xl.font-bold.tracking-tight.sm:text-4xl
Upcoming events
-@events.each do |event|
%section.overflow-hidden.grid.grid-cols-1.m-5.md:m-12.lg:m-20.md:grid-cols-2
%div
= 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
= event.name
%h4.text-xl.mt-10.md:text-2xl
= event.start_date
.mt-8{ prose_classes }
= markdown(event.text)
- unless event.info.blank?
= link_to event.info , target: :blank do
.mt-5.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400.bg-cyan-100.hover:bg-blue-300
More info