Browse Source

Contextual tags is translated, for linux presentation day and libre en fête

remotes/origin/master
echarp 3 years ago
parent
commit
18ffb15da9
  1. 3
      .gitignore
  2. 12
      app/views/events/show.html.haml
  3. 16
      app/views/pages/_search.haml
  4. 13
      app/views/tags/_context.html.haml
  5. 12
      app/views/tags/show.html.haml
  6. 1
      config/locales/views/en.yml
  7. 2
      config/locales/views/fr.yml

3
.gitignore

@ -95,8 +95,5 @@ capybara-*html
# vendor/extensions dummy applications.
vendor/extensions/**/spec/dummy
# exuberant-ctags
tags
# session secret
config/initializers/secret_token.rb

12
app/views/events/show.html.haml

@ -1,16 +1,6 @@
- set_event_meta
- if @event.tags.any? { |t| t.name.include? 'libre-en-fete' }
Cet événement s'inscrit dans le cadre de
%a(href='https://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60', alt: 'Libre en Fete',
style: 'vertical-align: middle'
- elsif @event.tags.any? { |t| t.name.include? 'linux-presentation-day' }
Cet événement s'inscrit dans le cadre de
%a(href='http://www.linux-presentation-day.org')
= image_tag 'linux-presentation-day.png',
width: '150', height: '75', alt: 'Linux presentation day',
style: 'vertical-align: middle'
= render partial: '/tags/context', locals: { tags: @event.tag_list }
%h2
- if @event.locality?

16
app/views/pages/_search.haml

@ -1,21 +1,7 @@
- if action_name == 'index' && controller_name != 'tags'
.digest
- if params[:tag].present?
%span.tag
- if params[:tag].include? 'libre-en-fete'
%a(href='https://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60',
alt: 'Libre en Fete', style: 'vertical-align: middle'
- elsif params[:tag].include? 'linux-presentation-day'
%a(href='http://www.linux-presentation-day.org')
= image_tag 'linux-presentation-day.png',
width: '150', height: '75', alt: 'Linux presentation day',
style: 'vertical-align: middle'
- else
%em.fa.fa-tag
= params[:tag]
%a(href="?tag=")
%em.fa.fa-times
= render partial: '/tags/context', locals: { tags: params[:tag] }
- if params[:near].present? && params[:near][:location].present? && params[:near][:distance].present?
%span.near

13
app/views/tags/_context.html.haml

@ -0,0 +1,13 @@
-# Used in pages header, event.show and tag.show
- if tags.include? 'libre-en-fete'
= t '.link' if action_name == 'show'
%a(href='https://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60', alt: 'Libre en Fête',
style: 'vertical-align: middle'
- elsif tags.include? 'linux-presentation-day'
= t '.link' if action_name == 'show'
%a(href='http://www.linux-presentation-day.org')
= image_tag 'linux-presentation-day.png', width: '150', height: '75',
alt: 'Linux presentation day', style: 'vertical-align: middle'

12
app/views/tags/show.html.haml

@ -1,14 +1,4 @@
- if params[:id].include? 'libre-en-fete'
Ces événements s'inscrivent dans le cadre de
%a(href='https://www.libre-en-fete.net')
= image_tag 'lef.png', width: '180', height: '60', alt: 'Libre en Fete',
style: 'vertical-align: middle'
- elsif params[:id].include? 'linux-presentation-day'
Ces événements s'inscrivent dans le cadre de
%a(href='http://www.linux-presentation-day.org')
= image_tag 'linux-presentation-day.png',
width: '150', height: '75', alt: 'Linux presentation day',
style: 'vertical-align: middle'
= render partial: '/tags/context', locals: { tags: params[:id] }
%h2
%em.fa.fa-tag

1
config/locales/views/en.yml

@ -160,6 +160,7 @@ it more readable or agreable."
zero:
one: one event
other: "%{count} events"
context: This event is part of
moderations:
index:
title: Events to moderate

2
config/locales/views/fr.yml

@ -173,6 +173,8 @@ l’évènement pour la rendre plus complète, plus lisible ou plus attrayante."
zero:
one: Un événement
other: "%{count} événements"
context:
link: Cet évènement s'inscrit dans le cadre de
moderations:
index:
title: Événements à modérer

Loading…
Cancel
Save