aboutsummaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authorjpl2017-05-02 13:42:02 +0200
committerRobert2017-05-02 16:44:25 +0200
commit04f4b5f519a9c12e9f161fb2d86ad20a1e96302b (patch)
tree1f880de772950dc9b57d4a0bbdce087c55e032ef /app
parente9a07b3d9208e4adba0947fd46c931472244ea9e (diff)
downloadchouette-core-04f4b5f519a9c12e9f161fb2d86ad20a1e96302b.tar.bz2
Refs #3265: updating calendars#show layout
Diffstat (limited to 'app')
-rw-r--r--app/views/calendars/show.html.slim68
1 files changed, 24 insertions, 44 deletions
diff --git a/app/views/calendars/show.html.slim b/app/views/calendars/show.html.slim
index c0671fa94..3886cefaa 100644
--- a/app/views/calendars/show.html.slim
+++ b/app/views/calendars/show.html.slim
@@ -1,46 +1,26 @@
-= title_tag t('.title', calendar: @calendar.name)
+/ PageHeader
+= pageheader 'map-marker',
+ @calendar.name,
+ '',
+ t('last_update', time: l(@calendar.updated_at, format: :short)),
+ (policy(@calendar).edit? ? link_to(t('actions.edit'), edit_calendar_path(@calendar), class: 'btn btn-default') : '') do
-p
- label => "#{Calendar.human_attribute_name('name')} : "
- = @calendar.name
-p
- label => "#{Calendar.human_attribute_name('short_name')} : "
- = @calendar.short_name
+ / Below is secondary actions & optional contents (filters, ...)
+ .row.mb-sm
+ .col-lg-12.text-right
+ - if policy(@calendar).destroy?
+ = link_to calendar_path(@calendar), method: :delete, data: { confirm: t('calendars.actions.destroy_confirm') }, class: 'btn btn-primary' do
+ span.fa.fa-trash
+ span = t('actions.destroy')
-.row
- .col-xs-4
- p
- label => "#{Calendar.human_attribute_name('dates')} : "
- table.table.table-condensed
- tbody
- - @calendar.dates.each do |date|
- tr
- td= l date
- p
- label => "#{Calendar.human_attribute_name('date_ranges')} : "
- table.table.table-condensed
- thead
- th= t('simple_form.labels.calendar.ranges.begin')
- th= t('simple_form.labels.calendar.ranges.end')
- tbody
- - @calendar.date_ranges.each do |date_range|
- tr
- td= l date_range.begin
- td= l date_range.end
-
-p
- label => "#{Calendar.human_attribute_name('shared')} : "
- = @calendar.shared
-p
- label => "#{Organisation.model_name.human} : "
- = @calendar.organisation.name
-
-
-- content_for(:sidebar) do
- ul.actions
- - if policy(@calendar).edit?
- li
- = link_to t('calendars.actions.edit'), edit_calendar_path(@calendar), class: 'edit'
- - if policy(@calendar).destroy?
- li
- = link_to t('calendars.actions.destroy'), calendar_path(@calendar), method: :delete, data: { confirm: t('calendars.actions.destroy_confirm') }, class: 'remove'
+/ PageContent
+.page_content
+ .container-fluid
+ .row
+ .col-lg-6.col-md-6.col-sm-12.col-xs-12
+ = definition_list t('metadatas'),
+ { 'Nom court' => @calendar.try(:short_name),
+ Calendar.human_attribute_name(:shared) => t("#{@calendar.shared}"),
+ 'Organisation' => @calendar.organisation.name,
+ Calendar.human_attribute_name(:dates) => @calendar.dates.collect{|d| l(d, format: :short)}.join(', ').html_safe,
+ Calendar.human_attribute_name(:date_ranges) => @calendar.date_ranges.collect{|d| t('validity_range', debut: l(d.begin, format: :short), end: l(d.end, format: :short))}.join('<br>').html_safe }