Browse Source

Libre en fête icons and banner added to the main calendar page

recurrent
echarp 6 years ago
parent
commit
8d7c7e7f02
  1. BIN
      app/assets/images/lef-small.png
  2. BIN
      app/assets/images/lef.png
  3. 6
      app/helpers/events_helper.rb
  4. 8
      app/views/events/_event.haml
  5. 32
      app/views/events/index.html.haml

BIN
app/assets/images/lef-small.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

BIN
app/assets/images/lef.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.2 KiB

6
app/helpers/events_helper.rb

@ -48,4 +48,10 @@ module EventsHelper
def wrap(s, width = 78)
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
end
# Select the events to display in a month, sorted
def month_events(events, date)
events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
.sort_by(&:city)
end
end

8
app/views/events/_event.haml

@ -0,0 +1,8 @@
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
- elsif event.tags.include? 'libre-en-fete'
= image_tag 'lef-small.png', alt: 'LEF', width: 16, height: 16
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title

32
app/views/events/index.html.haml

@ -17,15 +17,7 @@
= month_calendar do |date|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul
- @events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title
%ul.events.fa-ul= render month_events(@events, date)
- else
-# One month calendar
@ -33,15 +25,7 @@
= month_calendar do |date|
- capture_haml do
.day_number= date.day
%ul.events.fa-ul
- @events.select { |e| (e.start_time.to_date..e.end_time.to_date).cover? date }
- .sort_by { |e| e.city }.each do |event|
%li.event{ title: display_date(event) }
- if event.locality?
%em.locality.fa.fa-globe
= link_to event do
%strong.city{ title: event.address }= event.city
= event.title
%ul.events.fa-ul= render month_events(@events, date)
.formats
%em.fa.fa-rss
@ -53,9 +37,13 @@
ical: link_to('iCal', events_path(:rss,
tag: params[:tag], format: :ics, region: params[:region]))
%a#banner(href='http://april.org/campagne')
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
width: '374', height: '48',
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
%a#banner(href='http://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60', alt: 'Libre en Fete'
/
%a#banner(href='http://april.org/campagne')
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
width: '374', height: '48',
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
- set_events_meta

Loading…
Cancel
Save