sarting to generalize profiles

This commit is contained in:
2023-01-16 00:17:22 +02:00
parent 485c0475b7
commit 4ffc6e3c85
26 changed files with 165 additions and 207 deletions

View File

@ -0,0 +1,13 @@
= simple_form_for @profile do |f|
= f.error_notification
= f.input :name
= f.input :bio
= f.input :picture , as: :file , label: (@profile.picture.blank? ? "Add picture" : "Change picture (optional)")
.flex.justify-between.mt-4
%button.bg-cyan-200{class: button_classes}
= f.submit 'Save'
%button.bg-cyan-200{class: button_classes}
= link_to 'Cancel', profiles_path

View File

@ -0,0 +1,4 @@
.flex.justify-center
.column
.text-xl.m-4 Edit your profile profile
= render 'form'

View File

@ -0,0 +1,14 @@
= paginate @profiles
.flex.justify-center
.grid.grid-cols-4
- @profiles.each do |profile|
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
=link_to profile do
= image_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
.p-5.text-center
.m-2.text-sm.leading-relaxed.line-clamp-3{ prose_classes }
= shorten markdown(profile.bio)

View File

@ -0,0 +1,4 @@
.flex.justify-center
.column
.text-xl.m-4 Create your profile profile
= render 'form'

View File

@ -0,0 +1,10 @@
.px-4.py-16.mx-auto.sm:max-w-xl.md:max-w-full.lg:max-w-screen-xl.md:px-24.lg:px-8.lg:py-20
.flex.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"
.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
.mb-8.text-gray-800
.prose= markdown(@profile.bio)