Initial import
This commit is contained in:
19
app/views/events/_form.html.haml
Normal file
19
app/views/events/_form.html.haml
Normal file
@@ -0,0 +1,19 @@
|
||||
= error_messages_for 'event'
|
||||
|
||||
%dl
|
||||
%dt
|
||||
%label{:for => "event_title"} Título
|
||||
%dd= text_field 'event', 'title'
|
||||
|
||||
%dt
|
||||
%label{:for => "event_date"} Data
|
||||
%dd= date_select 'event', 'date', :order => [:day, :month, :year]
|
||||
|
||||
%dt
|
||||
%label{:for => "event_time"} Horário
|
||||
%dd= time_select 'event', 'time'
|
||||
|
||||
%dt
|
||||
%label{:for => "event_description"} Descrição
|
||||
%dd= preserve(text_area('event', 'description', :rows => 6))
|
||||
|
||||
7
app/views/events/edit.html.haml
Normal file
7
app/views/events/edit.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Editar evento
|
||||
|
||||
%p
|
||||
- form_tag course_event_url(@course, @event), :method => :put do
|
||||
= render :partial => 'form'
|
||||
= submit_tag 'Editar'
|
||||
39
app/views/events/index.html.haml
Normal file
39
app/views/events/index.html.haml
Normal file
@@ -0,0 +1,39 @@
|
||||
- cache do
|
||||
|
||||
- last_event = nil
|
||||
|
||||
.cmd
|
||||
= action_icon 'add', 'Adicionar evento', new_course_event_url
|
||||
|
||||
%h4.title= h(@course.full_name)
|
||||
%h1.title Calendário
|
||||
|
||||
.box.div_calendario
|
||||
|
||||
- @events.each do |event|
|
||||
- if last_event != event.date
|
||||
= "</ul></div>" if last_event
|
||||
.date= event.date.strftime("%d de %B")
|
||||
= "<div><ul>"
|
||||
|
||||
%li[event]
|
||||
.time= event.time.strftime("%H:%M")
|
||||
= link_to h(event.title), course_event_url(@course, event)
|
||||
|
||||
%div.description{:style => (event.id == params[:id].to_i ? '' : 'display: none')}
|
||||
%div.cmd{:style => "height: 27px; margin-top: -27px;"}
|
||||
= action_icon 'edit', 'Editar', edit_course_event_url(@course, event)
|
||||
= action_icon 'trash', 'Excluir', course_event_url(@course, event), :confirm => 'Tem certeza que deseja excluir?', :method => :delete
|
||||
= h(event.description)
|
||||
= "Sem descrição" if event.description.empty?
|
||||
|
||||
- last_event = event.date
|
||||
|
||||
= "</ul></div>" if !@events.empty?
|
||||
|
||||
- if @events.empty?
|
||||
.box
|
||||
%ul
|
||||
%li.grey Nenhum evento
|
||||
|
||||
%br
|
||||
7
app/views/events/new.html.haml
Normal file
7
app/views/events/new.html.haml
Normal file
@@ -0,0 +1,7 @@
|
||||
%h4.title= @course.full_name
|
||||
%h1.title Adicionar evento
|
||||
|
||||
%p
|
||||
- form_tag course_event_url(@course, @event), :method => :post do
|
||||
= render :partial => 'form'
|
||||
= submit_tag "Adicionar"
|
||||
2
app/views/events/show.html.haml
Normal file
2
app/views/events/show.html.haml
Normal file
@@ -0,0 +1,2 @@
|
||||
- @events = @course.events
|
||||
= render 'events/index'
|
||||
Reference in New Issue
Block a user