story validation, member link
This commit is contained in:
parent
621efd8a9c
commit
3f53b6b21b
@ -3,6 +3,9 @@ class Story < ApplicationRecord
|
|||||||
|
|
||||||
mount_uploader :picture, PictureUploader
|
mount_uploader :picture, PictureUploader
|
||||||
|
|
||||||
|
validates :text, length: { maximum: 1000 }
|
||||||
|
validates :header , length: { minimum: 5 }
|
||||||
|
|
||||||
def name
|
def name
|
||||||
header
|
header
|
||||||
end
|
end
|
||||||
|
@ -4,9 +4,11 @@
|
|||||||
.grid.grid-cols-4
|
.grid.grid-cols-4
|
||||||
- @members.each do |member|
|
- @members.each do |member|
|
||||||
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
|
.fex.flex-col.overflow-hidden.rounded-lg.border.border-gray-100.shadow-sm.m-10
|
||||||
= image_for( member , class: "h-60 w-full object-cover")
|
=link_to member do
|
||||||
%h3.p-5.text-2xl.bg-gray-100.text-black.font-bold.text-center= member.name
|
= image_for( member , class: "h-60 w-full object-cover")
|
||||||
|
%h3.p-5.text-2xl.bg-gray-100.text-black.font-bold.text-center
|
||||||
|
= member.name
|
||||||
%div.h-full
|
%div.h-full
|
||||||
.p-5.text-center
|
.p-5.text-center
|
||||||
.m-2.text-sm.leading-relaxed.line-clamp-3{ prose_classes }
|
.m-2.text-sm.leading-relaxed.line-clamp-3{ prose_classes }
|
||||||
= markdown(member.bio)
|
= shorten markdown(member.bio)
|
||||||
|
@ -6,16 +6,11 @@
|
|||||||
.flex.flex-col.justify-center.p-8.lg:p-16.lg:pl-10{:class => "lg:w-1/2"}
|
.flex.flex-col.justify-center.p-8.lg:p-16.lg:pl-10{:class => "lg:w-1/2"}
|
||||||
%div
|
%div
|
||||||
%p.inline-block.px-3.py-px.mb-4.text-xs.font-semibold.tracking-wider.text-teal-900.uppercase.rounded-full.bg-teal-accent-400
|
%p.inline-block.px-3.py-px.mb-4.text-xs.font-semibold.tracking-wider.text-teal-900.uppercase.rounded-full.bg-teal-accent-400
|
||||||
Role ?
|
Arrived
|
||||||
%h5.mb-3.text-3xl.font-extrabold.leading-none.sm:text-4xl
|
%h5.mb-3.text-3xl.font-extrabold.leading-none.sm:text-4xl
|
||||||
= @member.name
|
= @member.name
|
||||||
.mb-8.text-gray-800
|
.mb-8.text-gray-800
|
||||||
.prose= markdown(@member.bio)
|
.prose= markdown(@member.bio)
|
||||||
.flex.items-center
|
|
||||||
%a.inline-flex.items-center.font-semibold.transition-colors.duration-200.text-deep-purple-accent-400.hover:text-deep-purple-800{"aria-label" => "", :href => "/"}
|
|
||||||
Learn More
|
|
||||||
%svg.inline-block.w-3.ml-2{:fill => "currentColor", :viewbox => "0 0 12 12"}
|
|
||||||
%path{:d => "M9.707,5.293l-5-5A1,1,0,0,0,3.293,1.707L7.586,6,3.293,10.293a1,1,0,1,0,1.414,1.414l5-5A1,1,0,0,0,9.707,5.293Z"}
|
|
||||||
|
|
||||||
- if current_member == @member
|
- if current_member == @member
|
||||||
.flex.justify-around
|
.flex.justify-around
|
||||||
|
Loading…
Reference in New Issue
Block a user