Browse Source

Quelques changements d'apparence et traductions supplémentaires

recurrent
echarp 8 years ago
parent
commit
cc2ed4ee89
  1. 1
      app/assets/stylesheets/all.css.sass
  2. 3
      app/assets/stylesheets/events.css.sass
  3. 6
      app/controllers/events_controller.rb
  4. 3
      app/controllers/moderations_controller.rb
  5. 11
      app/views/events/show.html.haml
  6. 11
      app/views/moderation_mailer/moderate.text.haml
  7. 5
      config/locales/fr.yml

1
app/assets/stylesheets/all.css.sass

@ -134,6 +134,7 @@ main
@include box-shadow(5px 5px 5px lightblue)
footer.bottom nav
clear: both
margin: 26px auto -3px
font-size: smaller
a + a:before

3
app/assets/stylesheets/events.css.sass

@ -164,3 +164,6 @@ table.calendar
.actions
margin-left: 6.75em
margin-bottom: 10px
.description
text-align: left

6
app/controllers/events_controller.rb

@ -48,8 +48,10 @@ class EventsController < InheritedResources::Base
if @event.save
# Send an event creation mail to its author
EventMailer.create(@event).deliver
# Send a mail to moderators
ModerationMailer.create(@event).deliver
format.html { redirect_to @event, notice: 'Event was successfully created.' }
format.html { redirect_to @event, notice: t('.ok') }
format.json { render action: 'show', status: :created, location: @event }
else
format.html { render action: 'new' }
@ -73,7 +75,7 @@ class EventsController < InheritedResources::Base
respond_to do |format|
if @event.update(event_params)
format.html { redirect_to @event, notice: 'Event was successfully updated.' }
format.html { redirect_to @event, notice: t('.ok') }
format.json { head :no_content }
else
format.html { render action: 'edit' }

3
app/controllers/moderations_controller.rb

@ -23,6 +23,9 @@ class ModerationsController < InheritedResources::Base
respond_to do |format|
if @event.update(event_params)
# Send an update mail to its author
ModerationMailer.update(@event, current_user).deliver
format.html { redirect_to moderations_path, notice: 'Event was successfully updated.' }
format.json { head :no_content }
else

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

@ -1,4 +1,4 @@
- if request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes'
- if request.format == 'text/html' && controller.controller_name != 'moderations' && controller.controller_name != 'notes' && controller.action_name != 'edit'
#lug-list
%h1=t '.lug-list'
- if @event.region
@ -28,14 +28,15 @@
#{l @event.end_time, format: :at}.
%p
À
=t '.at'
%em= link_to(@event.city, "http://fr.wikipedia.org/wiki/#{@event.city}") + ','
= link_to @event.region.name, "http://fr.wikipedia.org/wiki/#{@event.region.name}" rescue nil
%h3 Description
= sanitize @event.description,
tags: %w(p br table tr td ul ol li a strong b em i img),
attributes: %w(href src width height)
.description
= sanitize @event.description,
tags: %w(p br table tr td ul ol li a strong b em i img),
attributes: %w(href src width height)
%h3 Informations
%p

11
app/views/moderation_mailer/moderate.text.haml

@ -3,5 +3,16 @@
=t '.body', author: @current_user
\
=====================================================
#{Event.human_attribute_name(:title)}: #{@event.title}
#{Event.human_attribute_name(:start_time)}: #{l @event.start_time, format: :at}
#{Event.human_attribute_name(:end_time)}: #{l @event.end_time, format: :at}
#{Event.human_attribute_name(:region)}: #{@event.region}
#{Event.human_attribute_name(:city)}: #{@event.city}
#{Event.human_attribute_name(:url)}: #{@event.url}
#{Event.human_attribute_name(:contact)}: #{@event.contact}
#{Event.human_attribute_name(:submitter)}: #{@event.submitter}
#{Event.human_attribute_name(:tags)}: #{@event.tags}
#{Event.human_attribute_name(:description)}: #{raw @event.description}
=====================================================
\
=t '.signature'

5
config/locales/fr.yml

@ -112,8 +112,11 @@ fr:
show:
lug-list: Groupes d'utilisateurs de la région
add_to_calendar: Ajouter à mon calendrier
at: À
new:
title: Soumettre un évènement
create:
ok: Votre évènement a bien été ajouté à la liste des évènements en attente de modération. Il apparaîtra en ligne dès qu'un modérateur l'aura validé.
edit:
title: Éditer un évènement
preview: Prévisualisation de l'évènement
@ -216,4 +219,4 @@ fr:
subject: "[Agenda du Libre] Évènement '%{subject}' modéré"
title: Bonjour,
body: L'évènement a été modéré par %{author}
signature: "Merci!\n\n-- \nAgenda du Libre"
signature: "-- \nL'équipe de modération"

Loading…
Cancel
Save