La validation d'un événement à portée nationale comporte un warning rouge
This commit is contained in:
parent
6029301415
commit
95073337a8
@ -1,3 +1,6 @@
|
|||||||
|
h2.warning
|
||||||
|
color: red
|
||||||
|
|
||||||
.events.edit, .events.update, .events.cancel, .moderations, .notes
|
.events.edit, .events.update, .events.cancel, .moderations, .notes
|
||||||
table.list
|
table.list
|
||||||
width: 100%
|
width: 100%
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
# TODO migrate moderated column to a SQL bool type
|
# TODO migrate moderated column to a SQL bool type
|
||||||
|
# TODO migrate locality column to a SQL bool type
|
||||||
|
|
||||||
class Event < ActiveRecord::Base
|
class Event < ActiveRecord::Base
|
||||||
extend SimpleCalendar
|
extend SimpleCalendar
|
||||||
@ -29,11 +30,11 @@ class Event < ActiveRecord::Base
|
|||||||
start_date.beginning_of_week,
|
start_date.beginning_of_week,
|
||||||
start_date.next_month.end_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}%" }
|
scope :tag, -> tag { where 'tags like ?', "%#{tag}%" }
|
||||||
|
|
||||||
|
|
||||||
before_validation(on: :create) do
|
before_validation on: :create do
|
||||||
self.submission_time = Date.today
|
self.submission_time = Date.today
|
||||||
self.decision_time = Date.today
|
self.decision_time = Date.today
|
||||||
|
|
||||||
|
@ -4,6 +4,8 @@
|
|||||||
=t '.title'
|
=t '.title'
|
||||||
|
|
||||||
.box
|
.box
|
||||||
|
- if @event.locality == 1
|
||||||
|
%h2.warning=t '.warning'
|
||||||
%h2=t '.question'
|
%h2=t '.question'
|
||||||
|
|
||||||
= form_for @moderation, url: { action: :accept }, html: { method: :put } do |f|
|
= form_for @moderation, url: { action: :accept }, html: { method: :put } do |f|
|
||||||
|
@ -197,6 +197,7 @@ fr:
|
|||||||
ok: Événement mis à jour
|
ok: Événement mis à jour
|
||||||
validate:
|
validate:
|
||||||
title: Validation de l'évènement
|
title: Validation de l'évènement
|
||||||
|
warning: Attention, cet évènement est à portée nationale!
|
||||||
question: Confirmez-vous la validation de cet évènement?
|
question: Confirmez-vous la validation de cet évènement?
|
||||||
ok: Oui
|
ok: Oui
|
||||||
ko: Non
|
ko: Non
|
||||||
|
Loading…
Reference in New Issue
Block a user