Libre en fête icons and banner added to the main calendar page
This commit is contained in:
parent
ad748f04da
commit
8d7c7e7f02
BIN
app/assets/images/lef-small.png
Normal file
BIN
app/assets/images/lef-small.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.1 KiB |
BIN
app/assets/images/lef.png
Normal file
BIN
app/assets/images/lef.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
@ -48,4 +48,10 @@ module EventsHelper
|
|||||||
def wrap(s, width = 78)
|
def wrap(s, width = 78)
|
||||||
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
|
s.gsub(/(.{1,#{width}})(\s+|\Z)/, "\\1\n")
|
||||||
end
|
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
|
end
|
||||||
|
8
app/views/events/_event.haml
Normal file
8
app/views/events/_event.haml
Normal file
@ -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
|
@ -17,15 +17,7 @@
|
|||||||
= month_calendar do |date|
|
= month_calendar do |date|
|
||||||
- capture_haml do
|
- capture_haml do
|
||||||
.day_number= date.day
|
.day_number= date.day
|
||||||
%ul.events.fa-ul
|
%ul.events.fa-ul= render month_events(@events, date)
|
||||||
- @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
|
|
||||||
|
|
||||||
- else
|
- else
|
||||||
-# One month calendar
|
-# One month calendar
|
||||||
@ -33,15 +25,7 @@
|
|||||||
= month_calendar do |date|
|
= month_calendar do |date|
|
||||||
- capture_haml do
|
- capture_haml do
|
||||||
.day_number= date.day
|
.day_number= date.day
|
||||||
%ul.events.fa-ul
|
%ul.events.fa-ul= render month_events(@events, date)
|
||||||
- @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
|
|
||||||
|
|
||||||
.formats
|
.formats
|
||||||
%em.fa.fa-rss
|
%em.fa.fa-rss
|
||||||
@ -53,7 +37,11 @@
|
|||||||
ical: link_to('iCal', events_path(:rss,
|
ical: link_to('iCal', events_path(:rss,
|
||||||
tag: params[:tag], format: :ics, region: params[:region]))
|
tag: params[:tag], format: :ics, region: params[:region]))
|
||||||
|
|
||||||
%a#banner(href='http://april.org/campagne')
|
%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',
|
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
|
||||||
width: '374', height: '48',
|
width: '374', height: '48',
|
||||||
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
|
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
|
||||||
|
Loading…
Reference in New Issue
Block a user