Slight partial reorganisation for events' aside

This commit is contained in:
echarp 2018-07-14 21:56:39 +02:00
parent 6ef85409ea
commit e913c28f66
7 changed files with 60 additions and 55 deletions

View File

@ -0,0 +1,47 @@
%aside#orga-list
- if @event.region.present? && @event.region.orgas.present?
%h1{ title: @event.region }
= link_to orgas_path region: @event.region do
%em.fa.fa-users
= t '.orga-list'
%ul.fa-ul
- @event.region.orgas.select(&:active).each do |orga|
%li
= link_to orga do
- if orga.kind
%em.fa.fa-li{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
= orga.name
= image_tag orga.url + '/favicon.ico', alt: '', class: :favicon
%h1
%em.fa.fa-wrench
= t '.actions'
%h2
= link_to event_path @event, protocol: :webcal, format: :ics do
%em.fa.fa-lg.fa-calendar
= t '.add_to_calendar'
%h2
= link_to preview_events_path(event: { title: @event.title,
start_time: @event.start_time + 1.month,
end_time: @event.end_time + 1.month,
description: @event.description,
place_name: @event.place_name,
address: @event.address,
city: @event.city,
region_id: @event.region.id,
locality: @event.locality,
url: @event.url,
tag_list: @event.tag_list.to_s }),
method: :post do
%em.fa.fa-copy
= t '.copy'
- if user_signed_in?
%h2
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-edit
= t '.edit'
%h2
= link_to cancel_event_path @event, secret: @event.secret do
%em.fa.fa-lg.fa-thumbs-down
= t '.cancel'

View File

@ -31,7 +31,7 @@
= month_calendar events: @events do |date, events| = month_calendar events: @events do |date, events|
- capture_haml do - capture_haml do
.day_number= date.day .day_number= date.day
%ul.events.fa-ul= render events %ul.events.fa-ul= render events, cached: true
.links .links
= raw t '.calendar_in', = raw t '.calendar_in',

View File

@ -14,54 +14,7 @@
%em.city{ title: @event.full_address }= @event.city %em.city{ title: @event.full_address }= @event.city
= title @event.title = title @event.title
- if controller.controller_name == 'events' && controller.action_name == 'show' = render 'aside' if [controller_name, action_name] == %w[events show]
%aside#orga-list
- if @event.region.present? && @event.region.orgas.present?
%h1{ title: @event.region }
= link_to orgas_path region: @event.region do
%em.fa.fa-users
= t '.orga-list'
%ul.fa-ul
- @event.region.orgas.select(&:active).each do |orga|
%li
= link_to orga do
- if orga.kind
%em.fa.fa-li{ class: "fa-#{orga.kind.icon}",
title: Kind.human_attribute_name("name_#{orga.kind.name}") }
= orga.name
= image_tag orga.url + '/favicon.ico', alt: '', class: :favicon
%h1
%em.fa.fa-wrench
= t '.actions'
%h2
= link_to event_path @event, protocol: :webcal, format: :ics do
%em.fa.fa-lg.fa-calendar
= t '.add_to_calendar'
%h2
= link_to preview_events_path(event: { title: @event.title,
start_time: @event.start_time + 1.month,
end_time: @event.end_time + 1.month,
description: @event.description,
place_name: @event.place_name,
address: @event.address,
city: @event.city,
region_id: @event.region.id,
locality: @event.locality,
url: @event.url,
tag_list: @event.tag_list.to_s }),
method: :post do
%em.fa.fa-copy
= t '.copy'
- if user_signed_in?
%h2
= link_to edit_moderation_path @event do
%em.fa.fa-lg.fa-edit
= t '.edit'
%h2
= link_to cancel_event_path @event, secret: @event.secret do
%em.fa.fa-lg.fa-thumbs-down
= t '.cancel'
%h3= t '.dateAndPlace' %h3= t '.dateAndPlace'

View File

@ -17,9 +17,8 @@
type: 'text/javascript', defer: true, async: Rails.env.production? type: 'text/javascript', defer: true, async: Rails.env.production?
= csrf_meta_tags = csrf_meta_tags
- classes = [request.domain ? request.domain.split('.')[0] : '', - sub = request.domain ? request.domain.split('.')[0] : ''
controller.controller_name, controller.action_name] %body{ class: [sub, controller_name, action_name] }
%body{ class: classes }
%header.top %header.top
- cache "regions_filter_#{session[:region]}" do - cache "regions_filter_#{session[:region]}" do
= render '/regions/filter' = render '/regions/filter'

View File

@ -43,6 +43,7 @@ en:
test other syntaxes here test other syntaxes here
description: Description description: Description
infos: Informations infos: Informations
aside:
actions: Actions actions: Actions
edit: Edit event edit: Edit event
cancel: Cancel event cancel: Cancel event
@ -245,11 +246,12 @@ description."
index: index:
title: Organisations title: Organisations
new: Add an organisation new: Add an organisation
show: aside:
links: See also links: See also
actions: Actions actions: Actions
edit: Edit edit: Edit
cancel: Delete cancel: Delete
show:
future: Coming future: Coming
past: In the past past: In the past
count: count:

View File

@ -43,6 +43,7 @@ fr:
tester d'autres syntaxes ici tester d'autres syntaxes ici
description: Description description: Description
infos: Informations infos: Informations
aside:
actions: Actions actions: Actions
edit: Éditer événement edit: Éditer événement
cancel: Annuler événement cancel: Annuler événement
@ -262,11 +263,12 @@ description plus complète."
index: index:
title: Organisations title: Organisations
new: Ajouter une organisation new: Ajouter une organisation
show: aside:
links: Voir aussi links: Voir aussi
actions: Actions actions: Actions
edit: Éditer edit: Éditer
cancel: Supprimer cancel: Supprimer
show:
future: Prochainement future: Prochainement
past: Dans le passé past: Dans le passé
count: count:

View File

@ -43,6 +43,7 @@ pt-BR:
Você pode testar outras sintaxes aqui Você pode testar outras sintaxes aqui
description: Descrição description: Descrição
infos: Informações infos: Informações
aside:
actions: Ações actions: Ações
edit: Editar evento edit: Editar evento
cancel: Cancelar evento cancel: Cancelar evento
@ -246,11 +247,12 @@ descrição mais completa."
index: index:
title: Organizações title: Organizações
new: Adicione uma organização new: Adicione uma organização
show: aside:
links: Veja também links: Veja também
actions: Ações actions: Ações
edit: Editar edit: Editar
cancel: Excluir cancel: Excluir
show:
future: A realizar future: A realizar
past: Realizado past: Realizado
count: count: