starting with events, tied to profiles (not accounts)
This commit is contained in:
14
app/views/events/_form.html.haml
Normal file
14
app/views/events/_form.html.haml
Normal file
@ -0,0 +1,14 @@
|
||||
= simple_form_for @event do |f|
|
||||
= f.error_notification
|
||||
|
||||
= f.input :name
|
||||
= f.input :text
|
||||
.grid.grid-cols-2.gap-10
|
||||
= f.input :start_date
|
||||
= f.input :end_date
|
||||
= f.input :profile_id , as: :hidden
|
||||
= f.input :picture , as: :file
|
||||
%button.mt-6.bg-cyan-200.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
|
||||
= f.submit 'Save'
|
||||
%button.ml-20.mr-3.inline-block.rounded-lg.px-4.py-3.text-md.font-medium.border.border-gray-400
|
||||
= link_to 'Back', @story
|
6
app/views/events/edit.html.haml
Normal file
6
app/views/events/edit.html.haml
Normal file
@ -0,0 +1,6 @@
|
||||
.flex.justify-center
|
||||
.column
|
||||
.text-xl.m-4
|
||||
Editing event
|
||||
|
||||
= render 'form'
|
31
app/views/events/index.html.haml
Normal file
31
app/views/events/index.html.haml
Normal file
@ -0,0 +1,31 @@
|
||||
%h1 Listing events
|
||||
|
||||
%table
|
||||
%thead
|
||||
%tr
|
||||
%th Name
|
||||
%th Text
|
||||
%th Start date
|
||||
%th End date
|
||||
%th Profile
|
||||
%th Picture
|
||||
%th
|
||||
%th
|
||||
%th
|
||||
|
||||
%tbody
|
||||
- @events.each do |event|
|
||||
%tr
|
||||
%td= event.name
|
||||
%td= event.text
|
||||
%td= event.start_date
|
||||
%td= event.end_date
|
||||
%td= event.profile
|
||||
%td= event.picture
|
||||
%td= link_to 'Show', event
|
||||
%td= link_to 'Edit', edit_event_path(event)
|
||||
%td= link_to 'Destroy', event, method: :delete, data: { confirm: 'Are you sure?' }
|
||||
|
||||
%br
|
||||
|
||||
= link_to 'New Event', new_event_path
|
6
app/views/events/new.html.haml
Normal file
6
app/views/events/new.html.haml
Normal file
@ -0,0 +1,6 @@
|
||||
.flex.justify-center
|
||||
.column
|
||||
.text-xl.m-4
|
||||
New event
|
||||
|
||||
= render 'form'
|
24
app/views/events/show.html.haml
Normal file
24
app/views/events/show.html.haml
Normal file
@ -0,0 +1,24 @@
|
||||
%p#notice= notice
|
||||
|
||||
%p
|
||||
%b Name:
|
||||
= @event.name
|
||||
%p
|
||||
%b Text:
|
||||
= @event.text
|
||||
%p
|
||||
%b Start date:
|
||||
= @event.start_date
|
||||
%p
|
||||
%b End date:
|
||||
= @event.end_date
|
||||
%p
|
||||
%b Profile:
|
||||
= @event.profile
|
||||
%p
|
||||
%b Picture:
|
||||
= @event.picture
|
||||
|
||||
= link_to 'Edit', edit_event_path(@event)
|
||||
\|
|
||||
= link_to 'Back', events_path
|
Reference in New Issue
Block a user