The markdown digest evolved in appearance

This commit is contained in:
echarp 2015-11-24 00:41:40 +01:00
parent 2b9b5f946f
commit 416a4026d0
4 changed files with 22 additions and 16 deletions

View File

@ -7,26 +7,28 @@
\ \
- @events.group_by { |evt| evt.start_time.to_date }.sort.each do |day, evts| - @events.group_by { |evt| evt.start_time.to_date }.sort.each do |day, evts|
= '* ' + t('date.day_names')[day.wday].capitalize + ':' * #{t('date.day_names')[day.wday].capitalize}:
= evts.collect { |event| "[#{event.city}] [#{event.title}](#{event_url event})" }.join '; ' - evts.each do |event|
\ * [**#{event.city}**] [#{event.title}](#{event_url event})
- second_part = capture_haml do - second_part = capture_haml do
= title = title
\===== \=====
= t '.week', begin: @week.beginning_of_week.day, end: @week.end_of_week.day, = t '.short_week', begin: @week.beginning_of_week.day,
month: t('date.month_names')[@week.month], year: @week.year, end: @week.end_of_week.day, month: t('date.month_names')[@week.month],
count: @events.count year: @week.year, count: @events.count
\
- @events.sort_by(&:start_time).each do |event| - @events.sort_by(&:start_time).each do |event|
- @event = event - @event = event
\## [#{event.city}] [#{event.title}](#{event_url event}) \## [#{event.city}] [#{event.title}](#{event_url event})
= display_date = display_date
= event.full_address = [@event.place_name, event.full_address].compact.join ', '
- strip_tags(@event.description).split(/\r\n/)[0..3].reject { |p| p.blank? }.each do |p| - strip_tags(@event.description).split(/\r\n/).reject { |p| p.blank? }[0..2].each do |p|
> #{p} > #{p}
\ \
* #{Event.human_attribute_name :url}: #{link_to @event.url, @event.url} * #{Event.human_attribute_name :url}: #{link_to @event.url, @event.url}
* #{Event.human_attribute_name :tags}: #{@event.tags.split.collect { |tag| "[#{tag}](#{tag_url tag})" }.join ', '} * #{Event.human_attribute_name :tags}:
#{@event.tags.split.collect { |tag| "[#{tag}](#{tag_url tag})" }.join ', '}
\ \
%h1= title %h1= title
@ -40,12 +42,13 @@
:markdown :markdown
* [April](http://april.org) * [April](http://april.org)
* [Agenda du Libre](http://www.agendadulibre.org) * [Agenda du Libre](http://www.agendadulibre.org)
* [Carte des événements](#{maps_url period: * [Carte des événements]
{ year: @week.year, week: @week.cweek }}) (#{maps_url future: false, period: { year: @week.year, week: @week.cweek }})
* [Proposer un événement](http://www.agendadulibre.org/events/new) * [Proposer un événement](http://www.agendadulibre.org/events/new)
* [Annuaire des organisations](http://www.agendadulibre.org/orgas) * [Annuaire des organisations](http://www.agendadulibre.org/orgas)
* [Agenda pour la semaine précédante] * [Agenda pour la semaine précédante]
(http://linuxfr.org/news/agenda-pour-la-semaine-#{(@week - 1.week).cweek}-de-l-annee-#{(@week - 1.week).year}") (#{digest_url :markdown, future: false, period: {
year: @week.year, week: (@week - 1.week).cweek }})
%hr %hr
@ -90,7 +93,7 @@
%input(type='hidden' name='news[links_attributes][2][title]' %input(type='hidden' name='news[links_attributes][2][title]'
value='Carte des événements') value='Carte des événements')
%input(type='hidden' name='news[links_attributes][2][url]' %input(type='hidden' name='news[links_attributes][2][url]'
value="#{maps_url period: { year: @week.year, week: @week.cweek }}") value="#{maps_url future: false, period: { year: @week.year, week: @week.cweek }}")
%input(type='hidden' name='news[links_attributes][2][lang]' %input(type='hidden' name='news[links_attributes][2][lang]'
value='fr') value='fr')

View File

@ -1,4 +1,4 @@
development: evelopment:
adapter: sqlite3 adapter: sqlite3
pool: 5 pool: 5
timeout: 5000 timeout: 5000
@ -13,7 +13,8 @@ test:
timeout: 5000 timeout: 5000
database: db/test.sqlite3 database: db/test.sqlite3
production: roduction:
development:
adapter: mysql2 adapter: mysql2
encoding: utf8 encoding: utf8
database: adl_fr database: adl_fr

View File

@ -284,6 +284,7 @@ description."
markdown: markdown:
title: Agenda du Libre for week %{week} of the year %{year} title: Agenda du Libre for week %{week} of the year %{year}
week: Week from %{begin} to %{end} %{month} %{year}. %{count} events. week: Week from %{begin} to %{end} %{month} %{year}. %{count} events.
short_week: Week from %{begin} to %{end} %{month} %{year}. %{count} events.
devise: devise:
sessions: sessions:

View File

@ -285,7 +285,8 @@ description plus complète."
digests: digests:
markdown: markdown:
title: Agenda du Libre pour la semaine %{week} de l'année %{year} title: Agenda du Libre pour la semaine %{week} de l'année %{year}
week: Semaine du %{begin} au %{end} %{month} %{year}. %{count} événements. week: Calendrier web, regroupant des évènements liés au Libre (logiciel, salon, atelier, install party, conférence) en France, annoncés par leurs organisateurs. Voici un récapitulatif de la semaine à venir, du %{begin} au %{end} %{month} %{year}. Le détail de chacun de ces %{count} événements est en seconde partie de dépêche.
short_week: Semaine du %{begin} au %{end} %{month} %{year}. %{count} événements.
devise: devise:
sessions: sessions: