Link added from organisation to its events

This commit is contained in:
echarp 2016-10-19 14:31:00 +02:00
parent d574b1624a
commit ce956fcd11
3 changed files with 29 additions and 11 deletions

View File

@ -5,11 +5,13 @@
-# Whole year calendar -# Whole year calendar
- @events = @events.year params[:year] - @events = @events.year params[:year]
%header.calendar-header.year %header.calendar-header.year
= link_to '<<', year: params[:year].to_i - 1, tag: params[:tag], = link_to year: params[:year].to_i - 1, tag: params[:tag],
region: params[:region] region: params[:region] do
%em.fa.fa-backward
= params[:year] = params[:year]
= link_to '>>', year: params[:year].to_i + 1, tag: params[:tag], = link_to year: params[:year].to_i + 1, tag: params[:tag],
region: params[:region] region: params[:region] do
%em.fa.fa-forward
- (1..12).each do |i| - (1..12).each do |i|
- params[:start_date] = "#{params[:year]}-#{i}-01" - params[:start_date] = "#{params[:year]}-#{i}-01"

View File

@ -19,6 +19,10 @@
class: :back do class: :back do
%em.fa.fa-li.fa-arrow-left %em.fa.fa-li.fa-arrow-left
= Orga.model_name.human.pluralize = Orga.model_name.human.pluralize
%li
= link_to tag_path @orga.name_as_tag do
%em.fa.fa-li.fa-tag
= Event.model_name.human.pluralize
%li %li
= link_to events_path tag: @orga.name_as_tag do = link_to events_path tag: @orga.name_as_tag do
%em.fa.fa-li.fa-calendar %em.fa.fa-li.fa-calendar
@ -118,8 +122,16 @@
%dd= l @orga.updated_at.to_date, format: :long %dd= l @orga.updated_at.to_date, format: :long
- if @events_future && @events_future.any? - if @events_future && @events_future.any?
%dt= t '.future' %dt
%dd= t '.count', count: @events_future.count %em.fa.fa-forward
= t '.future'
%dd
= link_to tag_path @orga.name_as_tag do
= t '.count', count: @events_future.count
- if @events_future && @events_past.any? - if @events_future && @events_past.any?
%dt= t '.past' %dt
%dd= t '.count', count: @events_past.count %em.fa.fa-backward
= t '.past'
%dd
= link_to tag_path @orga.name_as_tag do
= t '.count', count: @events_past.count

View File

@ -1,6 +1,6 @@
%h2 %h2
%em.fa.fa-tag %em.fa.fa-tag
%em= title params[:id] = title params[:id]
%aside %aside
%h1 %h1
@ -35,7 +35,9 @@
- if @events_future.any? || @events_past.any? - if @events_future.any? || @events_past.any?
- if @events_future.any? - if @events_future.any?
%h3= raw t '.future' %h3
%em.fa.fa-forward
= t '.future'
%ul.fa-ul %ul.fa-ul
- @events_future.order('start_time asc').each do |event| - @events_future.order('start_time asc').each do |event|
%li %li
@ -49,7 +51,9 @@
.date= display_date event .date= display_date event
- if @events_past.any? - if @events_past.any?
%h3= raw t '.past' %h3
%em.fa.fa-backward
= t '.past'
%ul.fa-ul %ul.fa-ul
- @events_past.order('start_time desc').each do |event| - @events_past.order('start_time desc').each do |event|
%li %li