2015-11-21 17:29:50 +01:00
|
|
|
- title = t '.title', week: @week.cweek, year: @week.year
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
- description = capture_haml do
|
2015-12-05 00:19:45 +01:00
|
|
|
= t '.week', count: @events.count
|
2015-11-21 17:29:50 +01:00
|
|
|
\
|
2015-11-10 23:29:05 +01:00
|
|
|
|
2015-11-21 17:29:50 +01:00
|
|
|
- @events.group_by { |evt| evt.start_time.to_date }.sort.each do |day, evts|
|
2015-12-05 00:19:45 +01:00
|
|
|
* #{l day, format: :long}
|
2015-11-24 00:41:40 +01:00
|
|
|
- evts.each do |event|
|
|
|
|
\ * [**#{event.city}**] [#{event.title}](#{event_url event})
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
- second_part = capture_haml do
|
|
|
|
= title
|
|
|
|
\=====
|
2015-11-24 00:41:40 +01:00
|
|
|
|
2015-11-21 17:29:50 +01:00
|
|
|
- @events.sort_by(&:start_time).each do |event|
|
2015-12-08 00:43:26 +01:00
|
|
|
[#{event.city}] [#{event.title}](#{event_url event}) - #{display_date event}
|
|
|
|
\-----
|
|
|
|
|
|
|
|
- lines = strip_tags(event.description).split(/\r\n/).reject(&:blank?)
|
2015-12-07 23:21:55 +01:00
|
|
|
- lines[0..2].each do |p|
|
2015-12-05 00:19:45 +01:00
|
|
|
= p
|
2015-11-10 23:29:05 +01:00
|
|
|
\
|
2015-12-08 00:43:26 +01:00
|
|
|
* #{[event.place_name, event.full_address].compact.join ', '}
|
2017-04-22 11:35:37 +02:00
|
|
|
- if event.url.present?
|
|
|
|
* #{Event.human_attribute_name :url}: #{link_to event.url, event.url}
|
2015-11-24 00:41:40 +01:00
|
|
|
* #{Event.human_attribute_name :tags}:
|
2016-12-17 19:40:32 +01:00
|
|
|
#{event.tags.collect { |tag| "[#{tag}](#{tag_url tag.name})" }.join ', '}
|
2015-11-10 23:29:05 +01:00
|
|
|
\
|
|
|
|
|
|
|
|
%h1= title
|
|
|
|
|
2015-11-21 17:29:50 +01:00
|
|
|
%description
|
|
|
|
:markdown
|
|
|
|
#{description}
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
%hr
|
|
|
|
|
|
|
|
:markdown
|
|
|
|
* [April](http://april.org)
|
|
|
|
* [Agenda du Libre](http://www.agendadulibre.org)
|
2015-11-24 00:41:40 +01:00
|
|
|
* [Carte des événements]
|
|
|
|
(#{maps_url future: false, period: { year: @week.year, week: @week.cweek }})
|
2015-11-10 23:29:05 +01:00
|
|
|
* [Proposer un événement](http://www.agendadulibre.org/events/new)
|
|
|
|
* [Annuaire des organisations](http://www.agendadulibre.org/orgas)
|
|
|
|
* [Agenda pour la semaine précédante]
|
2015-11-24 00:41:40 +01:00
|
|
|
(#{digest_url :markdown, future: false, period: {
|
2015-12-07 23:21:55 +01:00
|
|
|
year: @week.year, week: (@week - 1.week).cweek }})
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
%hr
|
|
|
|
|
2015-11-21 17:29:50 +01:00
|
|
|
.second_part
|
|
|
|
:markdown
|
|
|
|
#{second_part}
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
%hr
|
|
|
|
|
|
|
|
%form(action='https://linuxfr.org/news' method='post' accept-charset='UTF-8')
|
|
|
|
%input(type='hidden' name='utf8' value='✓')
|
2016-02-20 17:12:15 +01:00
|
|
|
%input(type='hidden' name='news[cc_licensed]' value='1')
|
2015-11-10 23:29:05 +01:00
|
|
|
%input(type='hidden' name='news[section_id]' value='9')
|
2016-01-09 16:10:11 +01:00
|
|
|
%input(type='hidden' name='tags' value='agenda_du_libre')
|
2015-11-10 23:29:05 +01:00
|
|
|
%input(type='hidden' name='commit' value='Prévisualiser')
|
|
|
|
|
|
|
|
.field.title
|
|
|
|
%label(for='title') Titre
|
2015-12-07 23:21:55 +01:00
|
|
|
%input#title{ type: 'text', name: 'news[title]', value: title }
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
.field.authenticity_token
|
|
|
|
%label(for='token') Jeton
|
2016-02-20 17:12:15 +01:00
|
|
|
%input#token(type='text' name='authenticity_token' autocomplete='off')
|
2015-11-10 23:29:05 +01:00
|
|
|
|
|
|
|
.field.description
|
|
|
|
%label(for='description') Contenu
|
|
|
|
%textarea#description(name='news[wiki_body]')= description
|
|
|
|
|
|
|
|
.field.links
|
|
|
|
%input(type='hidden' name='news[links_attributes][0][title]'
|
|
|
|
value='April')
|
|
|
|
%input(type='hidden' name='news[links_attributes][0][url]'
|
|
|
|
value='http://april.org')
|
|
|
|
%input(type='hidden' name='news[links_attributes][0][lang]'
|
|
|
|
value='fr')
|
|
|
|
|
|
|
|
%input(type='hidden' name='news[links_attributes][1][title]'
|
|
|
|
value='Agenda du Libre')
|
|
|
|
%input(type='hidden' name='news[links_attributes][1][url]'
|
|
|
|
value='http://www.agendadulibre.org')
|
|
|
|
%input(type='hidden' name='news[links_attributes][1][lang]'
|
|
|
|
value='fr')
|
|
|
|
|
|
|
|
%input(type='hidden' name='news[links_attributes][2][title]'
|
|
|
|
value='Carte des événements')
|
2015-12-07 23:21:55 +01:00
|
|
|
%input{ type: 'hidden', name: 'news[links_attributes][2][url]',
|
|
|
|
value: maps_url(future: false,
|
|
|
|
period: { year: @week.year, week: @week.cweek }) }
|
2015-11-10 23:29:05 +01:00
|
|
|
%input(type='hidden' name='news[links_attributes][2][lang]'
|
|
|
|
value='fr')
|
|
|
|
|
|
|
|
%input(type='hidden' name='news[links_attributes][3][title]'
|
|
|
|
value='Proposer un événement')
|
|
|
|
%input(type='hidden' name='news[links_attributes][3][url]'
|
|
|
|
value='http://www.agendadulibre.org/events/new')
|
|
|
|
%input(type='hidden' name='news[links_attributes][3][lang]'
|
|
|
|
value='fr' size='2')
|
|
|
|
|
|
|
|
%input(type='hidden' name='news[links_attributes][4][title]'
|
|
|
|
value='Annuaire des organisations')
|
|
|
|
%input(type='hidden' name='news[links_attributes][4][url]'
|
|
|
|
value="http://www.agendadulibre.org/orgas")
|
|
|
|
%input(type='hidden' name='news[links_attributes][4][lang]'
|
|
|
|
value='fr' size='2')
|
|
|
|
|
|
|
|
%input(type='hidden' name='news[links_attributes][5][title]'
|
2016-01-09 16:10:11 +01:00
|
|
|
value='Agenda de la semaine précédente')
|
2016-02-20 17:12:15 +01:00
|
|
|
- pre = 'https://linuxfr.org/news/agenda-du-libre-pour-la-semaine-'
|
2015-12-07 23:21:55 +01:00
|
|
|
- pre += "#{(@week - 1.week).cweek}-de-l-annee-#{(@week - 1.week).year}"
|
|
|
|
%input{ type: 'hidden', name: 'news[links_attributes][5][url]', value: pre }
|
2015-11-10 23:29:05 +01:00
|
|
|
%input(type='hidden' name='news[links_attributes][5][lang]'
|
|
|
|
value='fr' size='2')
|
|
|
|
|
|
|
|
.field.description
|
|
|
|
%label(for='second_part') Seconde partie
|
|
|
|
%textarea#second_part(name='news[wiki_second_part]')= second_part
|
|
|
|
|
|
|
|
.actions
|
|
|
|
%button
|
|
|
|
%em.fa.fa-check
|
|
|
|
Prévisualiser
|