diff --git a/app/assets/stylesheets/moderations.css.sass b/app/assets/stylesheets/moderations.css.sass index 5f0db2ef..81c36afa 100644 --- a/app/assets/stylesheets/moderations.css.sass +++ b/app/assets/stylesheets/moderations.css.sass @@ -1,3 +1,6 @@ +h2.warning + color: red + .events.edit, .events.update, .events.cancel, .moderations, .notes table.list width: 100% diff --git a/app/models/event.rb b/app/models/event.rb index a13da890..b304b7a4 100644 --- a/app/models/event.rb +++ b/app/models/event.rb @@ -1,4 +1,5 @@ # TODO migrate moderated column to a SQL bool type +# TODO migrate locality column to a SQL bool type class Event < ActiveRecord::Base extend SimpleCalendar @@ -29,11 +30,11 @@ class Event < ActiveRecord::Base start_date.beginning_of_week, start_date.next_month.end_of_week } - scope :region, -> region { where 'region = ? or locality', region } + scope :region, -> region { where 'region = ? or locality = 1', region } scope :tag, -> tag { where 'tags like ?', "%#{tag}%" } - before_validation(on: :create) do + before_validation on: :create do self.submission_time = Date.today self.decision_time = Date.today diff --git a/app/views/moderations/validate.html.haml b/app/views/moderations/validate.html.haml index d04110ec..dca91493 100644 --- a/app/views/moderations/validate.html.haml +++ b/app/views/moderations/validate.html.haml @@ -4,6 +4,8 @@ =t '.title' .box + - if @event.locality == 1 + %h2.warning=t '.warning' %h2=t '.question' = form_for @moderation, url: { action: :accept }, html: { method: :put } do |f| diff --git a/config/locales/fr.yml b/config/locales/fr.yml index 952f0278..d36cf975 100644 --- a/config/locales/fr.yml +++ b/config/locales/fr.yml @@ -197,6 +197,7 @@ fr: ok: Événement mis à jour validate: title: Validation de l'évènement + warning: Attention, cet évènement est à portée nationale! question: Confirmez-vous la validation de cet évènement? ok: Oui ko: Non