Gros nettoyage des formulaires, en utilisant des fieldset pour regrouper les éléments
This commit is contained in:
parent
514115b000
commit
d085e37c8a
@ -122,7 +122,7 @@ GEM
|
|||||||
lumberjack (~> 1.0)
|
lumberjack (~> 1.0)
|
||||||
pry (>= 0.9.12)
|
pry (>= 0.9.12)
|
||||||
thor (>= 0.18.1)
|
thor (>= 0.18.1)
|
||||||
guard-brakeman (0.8.1)
|
guard-brakeman (0.8.2)
|
||||||
brakeman (>= 2.1.1)
|
brakeman (>= 2.1.1)
|
||||||
guard (>= 1.1.0)
|
guard (>= 1.1.0)
|
||||||
guard-bundler (2.0.0)
|
guard-bundler (2.0.0)
|
||||||
@ -189,7 +189,7 @@ GEM
|
|||||||
multi_json (1.10.1)
|
multi_json (1.10.1)
|
||||||
mysql2 (0.3.16)
|
mysql2 (0.3.16)
|
||||||
orm_adapter (0.5.0)
|
orm_adapter (0.5.0)
|
||||||
parser (2.2.0.pre.3)
|
parser (2.2.0.pre.4)
|
||||||
ast (>= 1.1, < 3.0)
|
ast (>= 1.1, < 3.0)
|
||||||
slop (~> 3.4, >= 3.4.5)
|
slop (~> 3.4, >= 3.4.5)
|
||||||
polyamorous (1.0.0)
|
polyamorous (1.0.0)
|
||||||
@ -297,7 +297,7 @@ GEM
|
|||||||
polyglot (>= 0.3.1)
|
polyglot (>= 0.3.1)
|
||||||
turbolinks (2.2.2)
|
turbolinks (2.2.2)
|
||||||
coffee-rails
|
coffee-rails
|
||||||
tzinfo (1.2.1)
|
tzinfo (1.2.2)
|
||||||
thread_safe (~> 0.1)
|
thread_safe (~> 0.1)
|
||||||
uglifier (2.5.3)
|
uglifier (2.5.3)
|
||||||
execjs (>= 0.3.0)
|
execjs (>= 0.3.0)
|
||||||
|
@ -25,7 +25,7 @@ ActiveAdmin.register_page 'Dashboard' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
panel 'ActiveAdmin' do
|
panel 'ActiveAdmin' do
|
||||||
para %(Currently deployed: #{`git describe --tags --abbrev=0`},
|
para %(Actuellement déployé:
|
||||||
#{link_to(`git rev-parse --short HEAD`,
|
#{link_to(`git rev-parse --short HEAD`,
|
||||||
"https://gitorious.org/agenda-du-libre-rails/agenda-du-libre-rails/commit/
|
"https://gitorious.org/agenda-du-libre-rails/agenda-du-libre-rails/commit/
|
||||||
#{`git rev-parse HEAD`}")})
|
#{`git rev-parse HEAD`}")})
|
||||||
|
@ -34,18 +34,12 @@ a:link, a:visited
|
|||||||
a:hover, a:active, a:focus
|
a:hover, a:active, a:focus
|
||||||
color: #2E97FF
|
color: #2E97FF
|
||||||
|
|
||||||
#flash_messages
|
#flash_messages .flash
|
||||||
left: 0
|
|
||||||
width: 100%
|
|
||||||
z-index: 1000
|
|
||||||
position: absolute
|
|
||||||
margin-top: -2.5em
|
|
||||||
.flash
|
|
||||||
color: white
|
color: white
|
||||||
border: solid 1px #007ba0
|
border: solid 1px #007ba0
|
||||||
margin: 1em auto
|
margin: 1em auto
|
||||||
padding: 0.5em 1.1em
|
padding: 0.5em 1.1em
|
||||||
max-width: 40em
|
max-width: 50em
|
||||||
font-size: x-large
|
font-size: x-large
|
||||||
text-align: justify
|
text-align: justify
|
||||||
background-color: #008cba
|
background-color: #008cba
|
||||||
@ -58,6 +52,17 @@ a:hover, a:active, a:focus
|
|||||||
border-color: #de2b0f
|
border-color: #de2b0f
|
||||||
background-color: #f04124
|
background-color: #f04124
|
||||||
|
|
||||||
|
h3.warning
|
||||||
|
color: white
|
||||||
|
margin: 0
|
||||||
|
padding: 1em
|
||||||
|
display: inline-block
|
||||||
|
text-align: center
|
||||||
|
border-color: #de2b0f
|
||||||
|
background-color: #f04124
|
||||||
|
@include box-shadow(0 0 0.3em gray)
|
||||||
|
@include border-radius(1em)
|
||||||
|
|
||||||
.fa:before
|
.fa:before
|
||||||
font-style: normal
|
font-style: normal
|
||||||
font-weight: normal !important
|
font-weight: normal !important
|
||||||
@ -94,7 +99,7 @@ header.top
|
|||||||
padding-top: 10px
|
padding-top: 10px
|
||||||
letter-spacing: 2px
|
letter-spacing: 2px
|
||||||
h2
|
h2
|
||||||
font-size: 0.8em
|
font-size: 1.2em
|
||||||
font-style: italic
|
font-style: italic
|
||||||
font-weight: normal
|
font-weight: normal
|
||||||
margin-bottom: 22px
|
margin-bottom: 22px
|
||||||
@ -128,6 +133,21 @@ main
|
|||||||
hr
|
hr
|
||||||
margin: 10px 20px
|
margin: 10px 20px
|
||||||
|
|
||||||
|
fieldset
|
||||||
|
border: none
|
||||||
|
margin: 1em auto
|
||||||
|
padding: 1em
|
||||||
|
@include box-shadow(1px 1px 5px gray)
|
||||||
|
@include border-radius(0.4em)
|
||||||
|
legend
|
||||||
|
float: left
|
||||||
|
color: gray
|
||||||
|
padding: 0 1em
|
||||||
|
margin-top: -1.6em
|
||||||
|
background-color: white
|
||||||
|
h2
|
||||||
|
margin-top: 0
|
||||||
|
|
||||||
label
|
label
|
||||||
text-align: right
|
text-align: right
|
||||||
padding-right: 0.4em
|
padding-right: 0.4em
|
||||||
@ -149,6 +169,10 @@ input, textarea, select, a.button
|
|||||||
&:focus
|
&:focus
|
||||||
background-color: #F0F8FF
|
background-color: #F0F8FF
|
||||||
@include box-shadow(1px 1px 4px gray)
|
@include box-shadow(1px 1px 4px gray)
|
||||||
|
&[type=radio]
|
||||||
|
@include box-shadow(none)
|
||||||
|
&[type=radio] + label
|
||||||
|
text-align: left
|
||||||
&[type=submit], &.button
|
&[type=submit], &.button
|
||||||
color: black
|
color: black
|
||||||
border: none
|
border: none
|
||||||
|
@ -20,14 +20,13 @@ header.calendar-header
|
|||||||
a
|
a
|
||||||
margin: 0
|
margin: 0
|
||||||
a
|
a
|
||||||
margin: 0 0.3em
|
|
||||||
font-weight: normal
|
font-weight: normal
|
||||||
&.month_selector
|
&.month_selector
|
||||||
display: block
|
display: block
|
||||||
font-weight: bolder
|
font-weight: bolder
|
||||||
margin-bottom: -2.1em
|
margin-bottom: -2.1em
|
||||||
&.year_selector
|
&:first-child, &:last-child
|
||||||
margin: 0
|
margin: 0 0.3em
|
||||||
|
|
||||||
.events, .event
|
.events, .event
|
||||||
.city:after
|
.city:after
|
||||||
@ -120,6 +119,14 @@ a#banner
|
|||||||
margin-left: 5%
|
margin-left: 5%
|
||||||
padding-left: 2px
|
padding-left: 2px
|
||||||
|
|
||||||
|
body.events.show main
|
||||||
|
padding: 1em
|
||||||
|
max-width: 60em
|
||||||
|
@include box-shadow(1px 1px 5px gray)
|
||||||
|
@include border-radius(0.4em)
|
||||||
|
h2
|
||||||
|
margin-top: 1em
|
||||||
|
|
||||||
sidebar#lug-list
|
sidebar#lug-list
|
||||||
float: right
|
float: right
|
||||||
width: 16em
|
width: 16em
|
||||||
@ -127,6 +134,7 @@ sidebar#lug-list
|
|||||||
margin: 0 1.2em
|
margin: 0 1.2em
|
||||||
padding: 5px
|
padding: 5px
|
||||||
font-size: 0.7em
|
font-size: 0.7em
|
||||||
|
margin-right: -4em
|
||||||
background-color: #D6ECFF
|
background-color: #D6ECFF
|
||||||
@include box-shadow(4px 4px 1em gray)
|
@include box-shadow(4px 4px 1em gray)
|
||||||
@include border-radius(10px)
|
@include border-radius(10px)
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
h2.warning
|
h2.warning
|
||||||
color: red
|
color: red
|
||||||
|
|
||||||
.events.edit, .events.update, .events.cancel, .moderations, .notes
|
.moderations, .notes
|
||||||
table.list
|
table.list
|
||||||
min-width: 90%
|
min-width: 90%
|
||||||
margin-top: 15px
|
margin-top: 15px
|
||||||
@ -31,18 +31,3 @@ h2.warning
|
|||||||
padding: 0.2em
|
padding: 0.2em
|
||||||
display: inline-block
|
display: inline-block
|
||||||
font-weight: normal
|
font-weight: normal
|
||||||
|
|
||||||
main > h3
|
|
||||||
font-size: inherit
|
|
||||||
line-height: 1.3em
|
|
||||||
font-weight: normal
|
|
||||||
margin-left: 5em
|
|
||||||
margin-right: 5em
|
|
||||||
background-color: #CCC
|
|
||||||
|
|
||||||
.box
|
|
||||||
width: 70%
|
|
||||||
margin: auto
|
|
||||||
padding: 1em
|
|
||||||
margin-bottom: 10px
|
|
||||||
background-color: #CCC
|
|
||||||
|
@ -2,26 +2,21 @@
|
|||||||
# This is a central part to this project
|
# This is a central part to this project
|
||||||
class EventsController < ApplicationController
|
class EventsController < ApplicationController
|
||||||
before_action :set_events, only: [:index]
|
before_action :set_events, only: [:index]
|
||||||
before_action :set_event, only: [:show, :edit, :update, :cancel, :destroy]
|
before_action :set_event, only:
|
||||||
before_action :check_secret, only: [:edit, :update, :cancel, :destroy]
|
[:show, :edit, :preview, :update, :cancel, :destroy]
|
||||||
|
before_action :check_secret, only:
|
||||||
|
[:edit, :preview, :update, :cancel, :destroy]
|
||||||
before_action :set_mailer_host
|
before_action :set_mailer_host
|
||||||
|
|
||||||
def index
|
def index
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
format.html do
|
format.html
|
||||||
if params[:year]
|
|
||||||
# Whole year calendar
|
|
||||||
@events = @events.year params[:year].to_i
|
|
||||||
else
|
|
||||||
@events = @events.month params[:start_date].try(:to_date) || Date.today
|
|
||||||
end
|
|
||||||
end
|
|
||||||
format.rss do
|
format.rss do
|
||||||
@events = @events.future.includes :related_city
|
@events = @events.future_30.includes :related_city
|
||||||
@events = @events.limit params[:daylimit] if params[:daylimit]
|
@events = @events.limit params[:daylimit] if params[:daylimit]
|
||||||
end
|
end
|
||||||
format.ics { @events = @events.last_year.order :id }
|
format.ics { @events = @events.last_year.order :id }
|
||||||
format.xml { @events = @events.order :id }
|
format.xml { @events = @events.includes(:related_region).order :id }
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -32,11 +27,17 @@ class EventsController < ApplicationController
|
|||||||
@event.end_time ||= Time.now.change(min: 0) + 1.day + 2.hour
|
@event.end_time ||= Time.now.change(min: 0) + 1.day + 2.hour
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# POST /events/preview
|
||||||
|
def preview_create
|
||||||
|
@event = Event.new event_params
|
||||||
|
@event.valid?
|
||||||
|
render action: :new
|
||||||
|
end
|
||||||
|
|
||||||
# POST /events
|
# POST /events
|
||||||
# POST /events.json
|
# POST /events.json
|
||||||
def create
|
def create
|
||||||
@event = Event.new event_params
|
@event = Event.new event_params
|
||||||
preview && return if params[:visu]
|
|
||||||
|
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @event.save && send_creation_mails
|
if @event.save && send_creation_mails
|
||||||
@ -49,11 +50,16 @@ class EventsController < ApplicationController
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# PATCH/PUT /events/1/preview
|
||||||
|
def preview
|
||||||
|
@event.attributes = event_params
|
||||||
|
@event.valid?
|
||||||
|
render action: :edit
|
||||||
|
end
|
||||||
|
|
||||||
# PATCH/PUT /events/1
|
# PATCH/PUT /events/1
|
||||||
# PATCH/PUT /events/1.json
|
# PATCH/PUT /events/1.json
|
||||||
def update
|
def update
|
||||||
preview_update && return if params[:visu]
|
|
||||||
|
|
||||||
@older_event = Event.new @event.attributes
|
@older_event = Event.new @event.attributes
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @event.update(event_params) && send_update_mails
|
if @event.update(event_params) && send_update_mails
|
||||||
@ -83,13 +89,6 @@ class EventsController < ApplicationController
|
|||||||
@events = @events.region params[:region] \
|
@events = @events.region params[:region] \
|
||||||
if params[:region].present? && params[:region] != 'all'
|
if params[:region].present? && params[:region] != 'all'
|
||||||
@events = @events.tag(params[:tag]) if params[:tag]
|
@events = @events.tag(params[:tag]) if params[:tag]
|
||||||
|
|
||||||
if params[:year]
|
|
||||||
# Whole year calendar
|
|
||||||
@events = @events.year params[:year].to_i
|
|
||||||
else
|
|
||||||
@events = @events.month params[:start_date].try(:to_date) || Date.today
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# Use callbacks to share common setup or constraints between actions.
|
# Use callbacks to share common setup or constraints between actions.
|
||||||
@ -110,8 +109,9 @@ class EventsController < ApplicationController
|
|||||||
:locality, :url, :contact, :submitter, :tags
|
:locality, :url, :contact, :submitter, :tags
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# Check that you can only edit an existing event if you know its secret
|
||||||
def check_secret
|
def check_secret
|
||||||
redirect_to :root, notice: t(:forbidden, scope: [:events, :edit]) \
|
redirect_to :root, alert: t(:forbidden, scope: [:events, :edit]) \
|
||||||
unless params[:secret] == @event.secret
|
unless params[:secret] == @event.secret
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -131,15 +131,4 @@ class EventsController < ApplicationController
|
|||||||
# Send an update mail to moderators
|
# Send an update mail to moderators
|
||||||
ModerationMailer.update(@older_event, @event, nil).deliver
|
ModerationMailer.update(@older_event, @event, nil).deliver
|
||||||
end
|
end
|
||||||
|
|
||||||
def preview
|
|
||||||
@event.valid?
|
|
||||||
render action: :new
|
|
||||||
end
|
|
||||||
|
|
||||||
def preview_update
|
|
||||||
@event.attributes = event_params
|
|
||||||
@event.valid?
|
|
||||||
render action: :edit
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
@ -4,21 +4,21 @@ require 'differ'
|
|||||||
class ModerationsController < ApplicationController
|
class ModerationsController < ApplicationController
|
||||||
before_action :authenticate_user!
|
before_action :authenticate_user!
|
||||||
before_action :set_moderation, :set_mailer_host, only:
|
before_action :set_moderation, :set_mailer_host, only:
|
||||||
[:show, :edit, :update, :validate, :accept, :refuse, :destroy]
|
[:show, :edit, :preview, :update, :validate, :accept, :refuse, :destroy]
|
||||||
|
|
||||||
def index
|
def index
|
||||||
@events = Event.unmoderated
|
@events = Event.unmoderated
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def preview
|
||||||
|
@moderation.attributes = moderation_params
|
||||||
|
@moderation.valid?
|
||||||
|
render action: :edit
|
||||||
|
end
|
||||||
|
|
||||||
# PATCH/PUT /moderations/1
|
# PATCH/PUT /moderations/1
|
||||||
# PATCH/PUT /moderations/1.json
|
# PATCH/PUT /moderations/1.json
|
||||||
def update
|
def update
|
||||||
if params[:visu]
|
|
||||||
@moderation.attributes = moderation_params
|
|
||||||
render action: 'edit'
|
|
||||||
return
|
|
||||||
end
|
|
||||||
|
|
||||||
@older_mod = Event.new @event.attributes
|
@older_mod = Event.new @event.attributes
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @moderation.update(moderation_params) && send_moderation_mails
|
if @moderation.update(moderation_params) && send_moderation_mails
|
||||||
|
@ -2,10 +2,8 @@
|
|||||||
module EventsHelper
|
module EventsHelper
|
||||||
def set_events_meta
|
def set_events_meta
|
||||||
set_meta_tags \
|
set_meta_tags \
|
||||||
description: "#{t 'layouts.application.subtitle'} \
|
description: t('layouts.application.subtitle'),
|
||||||
- #{t '.nb_events', count: @events.size}",
|
keywords: @events.pluck(:tags).join(' ').split.group_by { |i| i }
|
||||||
keywords: @events.pluck(:tags)
|
|
||||||
.join(' ').split.group_by { |i| i }
|
|
||||||
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
.reject { |_k, v| v.size < 2 }.map { |k, _v| k },
|
||||||
DC: {
|
DC: {
|
||||||
title: t('layouts.application.title'),
|
title: t('layouts.application.title'),
|
||||||
|
@ -31,13 +31,14 @@ class Event < ActiveRecord::Base
|
|||||||
end)
|
end)
|
||||||
scope :year, (lambda do |year|
|
scope :year, (lambda do |year|
|
||||||
where '? <= end_time and start_time <= ?',
|
where '? <= end_time and start_time <= ?',
|
||||||
Date.new(year, 1, 1).beginning_of_week, Date.new(year, 12, 31)
|
Date.new(year, 1, 1).beginning_of_week,
|
||||||
.end_of_week
|
Date.new(year, 12, 31).end_of_week
|
||||||
end)
|
end)
|
||||||
scope :month, (lambda do |start_date|
|
scope :month, (lambda do |start_date|
|
||||||
|
start_date ||= Date.today.beginning_of_month
|
||||||
where '? <= end_time and start_time <= ?',
|
where '? <= end_time and start_time <= ?',
|
||||||
start_date.beginning_of_month.beginning_of_week,
|
start_date.beginning_of_week,
|
||||||
start_date.beginning_of_month.next_month.end_of_week
|
start_date.end_of_month.end_of_week
|
||||||
end)
|
end)
|
||||||
scope :region, -> region { where 'region = ? or locality', region }
|
scope :region, -> region { where 'region = ? or locality', region }
|
||||||
scope :tag, -> tag { where 'tags like ?', "%#{tag}%" }
|
scope :tag, -> tag { where 'tags like ?', "%#{tag}%" }
|
||||||
|
@ -5,15 +5,8 @@
|
|||||||
- @event.errors.full_messages.each do |msg|
|
- @event.errors.full_messages.each do |msg|
|
||||||
%p= msg
|
%p= msg
|
||||||
|
|
||||||
- unless @event.id
|
- if @event.persisted?
|
||||||
:markdown
|
- unless @moderation
|
||||||
#{t '.subtitle'}
|
|
||||||
|
|
||||||
#advises
|
|
||||||
:markdown
|
|
||||||
#{t '.advises'}
|
|
||||||
|
|
||||||
- else
|
|
||||||
= hidden_field_tag :secret, params[:secret]
|
= hidden_field_tag :secret, params[:secret]
|
||||||
|
|
||||||
.field.title
|
.field.title
|
||||||
@ -75,5 +68,5 @@
|
|||||||
= f.text_field :tags, size: 70
|
= f.text_field :tags, size: 70
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.submit t('.visualise'), name: :visu
|
= f.submit t('.visualise'), formaction: :preview
|
||||||
= f.submit t('.save')
|
= f.submit t('.save')
|
||||||
|
@ -1,21 +1,18 @@
|
|||||||
%h3
|
%h2
|
||||||
>>>
|
%em.fa.fa-trash-o
|
||||||
=t '.title'
|
=t '.title'
|
||||||
|
|
||||||
.box
|
|
||||||
- if @event.moderated?
|
- if @event.moderated?
|
||||||
%h3=t '.already_moderated'
|
%h3.warning=t '.already_moderated'
|
||||||
|
|
||||||
|
%fieldset
|
||||||
= form_for @event, method: :delete do |f|
|
= form_for @event, method: :delete do |f|
|
||||||
= hidden_field_tag :secret, params[:secret]
|
= hidden_field_tag :secret, params[:secret]
|
||||||
.confirm=t '.confirm'
|
%h2=t '.confirm'
|
||||||
%br/
|
|
||||||
|
|
||||||
= f.submit t('.ok'), name: :yes
|
= f.submit t('.ok'), name: :yes
|
||||||
= link_to t('.ko'), @event, class: :button
|
= link_to t('.ko'), @event, class: :button
|
||||||
|
|
||||||
%h3
|
%fieldset
|
||||||
>>>
|
%legend=Event.model_name.human
|
||||||
=t '.preview'
|
= render file: '/events/show'
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
%h3
|
%h2
|
||||||
>>>
|
%em.fa.fa-pencil
|
||||||
=t '.preview'
|
=t '.title'
|
||||||
|
|
||||||
- if @event.moderated?
|
- if @event.moderated?
|
||||||
.box
|
%h3.warning
|
||||||
%h3=t '.warning'
|
%em.fa.fa-warning
|
||||||
|
=t '.warning'
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
%fieldset
|
||||||
|
%legend=t '.preview'
|
||||||
|
= render file: '/events/show'
|
||||||
|
|
||||||
%h3
|
%fieldset
|
||||||
= link_to t('.moderation'), moderations_path
|
%legend=t '.edit'
|
||||||
>>>
|
= render '/events/form'
|
||||||
=t '.edit'
|
|
||||||
|
|
||||||
.box= render '/events/form'
|
|
||||||
|
@ -1,5 +1,3 @@
|
|||||||
- set_events_meta
|
|
||||||
|
|
||||||
= render '/lugs/search' unless controller.controller_name == 'lugs'
|
= render '/lugs/search' unless controller.controller_name == 'lugs'
|
||||||
|
|
||||||
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
|
-# Seems necessary, for the time being, to ensure calendar is changing days correctly
|
||||||
@ -17,6 +15,7 @@
|
|||||||
|
|
||||||
- if params[:year]
|
- if params[:year]
|
||||||
-# Whole year calendar
|
-# Whole year calendar
|
||||||
|
- @events = @events.year params[:year].to_i
|
||||||
%header.calendar-header.year
|
%header.calendar-header.year
|
||||||
= link_to '<<', year: params[:year].to_i-1, tag: params[:tag], region: params[:region]
|
= link_to '<<', year: params[:year].to_i-1, tag: params[:tag], region: params[:region]
|
||||||
= params[:year]
|
= params[:year]
|
||||||
@ -26,9 +25,9 @@
|
|||||||
- params[:start_date] = "#{params[:year]}-#{i}-01"
|
- params[:start_date] = "#{params[:year]}-#{i}-01"
|
||||||
|
|
||||||
= month_calendar events: @events,
|
= month_calendar events: @events,
|
||||||
title: ->(start_date) { raw link_to I18n.t('date.month_names')[start_date.month]+' '+params[:year], root_url( start_date: start_date), class: 'month_selector' },
|
previous_link: nil, next_link: nil,
|
||||||
previous_link: ->(param, date_range) { },
|
title: ->(start_date) { raw link_to l(start_date, format: :month),
|
||||||
next_link: ->(param, date_range) { } do |date, events|
|
root_url(start_date: start_date), class: 'month_selector' } do |date, events|
|
||||||
.day_number= date.day
|
.day_number= date.day
|
||||||
%ul.events
|
%ul.events
|
||||||
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
|
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
|
||||||
@ -38,10 +37,15 @@
|
|||||||
= event.title
|
= event.title
|
||||||
|
|
||||||
- else
|
- else
|
||||||
|
-# One month calendar
|
||||||
|
- @events = @events.month params[:start_date].try :to_date
|
||||||
= month_calendar events: @events,
|
= month_calendar events: @events,
|
||||||
title: ->(start_date) { raw "#{I18n.t('date.month_names')[start_date.month]} #{link_to start_date.year, root_url(year: start_date.year), class: 'year_selector'}" },
|
title: ->(start_date) { raw "#{I18n.t('date.month_names')[start_date.month]} #{link_to start_date.year,
|
||||||
previous_link: ->(param, date_range) { link_to '<<', { param => date_range.first - 1.day, tag: params[:tag], region: params[:region] } },
|
root_url(year: start_date.year)}" },
|
||||||
next_link: ->(param, date_range) { link_to '>>', { param => date_range.last + 1.day, tag: params[:tag], region: params[:region] } } do |date, events|
|
previous_link: ->(param, date_range) { link_to '<<',
|
||||||
|
{ param => (date_range.first - 1.day).beginning_of_month, tag: params[:tag], region: params[:region] } },
|
||||||
|
next_link: ->(param, date_range) { link_to '>>',
|
||||||
|
{ param => (date_range.last + 1.day).beginning_of_month, tag: params[:tag], region: params[:region] } } do |date, events|
|
||||||
.day_number= date.day
|
.day_number= date.day
|
||||||
%ul.events
|
%ul.events
|
||||||
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
|
- events.select { |e| e.start_time.to_date <= date and date <= e.end_time.to_date }.sort_by { |e| e.city }.each do |event|
|
||||||
@ -66,3 +70,5 @@
|
|||||||
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
|
= image_tag 'priorite-logiciel-libre-je-soutiens-april_2_m.png',
|
||||||
width: '374', height: '48',
|
width: '374', height: '48',
|
||||||
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
|
alt: 'Priorité au Logiciel Libre! Je soutiens l\'April.'
|
||||||
|
|
||||||
|
- set_events_meta
|
||||||
|
@ -2,9 +2,19 @@
|
|||||||
%em.fa.fa-pencil
|
%em.fa.fa-pencil
|
||||||
=title t '.title'
|
=title t '.title'
|
||||||
|
|
||||||
- if @event && params[:visu]
|
- if @event.description
|
||||||
%hr/
|
%fieldset
|
||||||
|
%legend=t '.preview'
|
||||||
= render file: '/events/show'
|
= render file: '/events/show'
|
||||||
%hr/
|
|
||||||
|
|
||||||
|
- else
|
||||||
|
:markdown
|
||||||
|
#{t '.subtitle'}
|
||||||
|
|
||||||
|
#advises
|
||||||
|
:markdown
|
||||||
|
#{t '.advises'}
|
||||||
|
|
||||||
|
%fieldset
|
||||||
|
%legend=t '.edit'
|
||||||
= render 'form'
|
= render 'form'
|
||||||
|
@ -1,17 +1,14 @@
|
|||||||
%h3
|
%h2
|
||||||
= link_to t('.moderation'), moderations_path
|
%em.fa.fa-pencil
|
||||||
>>>
|
=t '.title'
|
||||||
=t '.preview'
|
|
||||||
|
|
||||||
- if @moderation.moderated?
|
- if @moderation.moderated?
|
||||||
.box
|
%h3.warning=t '.warning'
|
||||||
%h3=t '.warning'
|
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
%fieldset
|
||||||
|
%legend=t '.preview'
|
||||||
|
= render file: '/events/show'
|
||||||
|
|
||||||
%h3
|
%fieldset
|
||||||
= link_to t('.moderation'), moderations_path
|
%legend=t '.edit'
|
||||||
>>>
|
= render '/events/form'
|
||||||
=t '.edit'
|
|
||||||
|
|
||||||
.box= render '/events/form'
|
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
%h3
|
%h2
|
||||||
= link_to t('.moderation'), moderations_path
|
%em.fa.fa-thumbs-down
|
||||||
>>>
|
|
||||||
=t '.title'
|
=t '.title'
|
||||||
|
|
||||||
.box
|
%fieldset
|
||||||
%h2=t '.question'
|
|
||||||
|
|
||||||
= form_tag moderation_path(@moderation), method: :delete do |f|
|
= form_tag moderation_path(@moderation), method: :delete do |f|
|
||||||
|
%h3=t '.question'
|
||||||
|
|
||||||
.field.closer(title="#{t '.reason_r_1_long'}")
|
.field.closer(title="#{t '.reason_r_1_long'}")
|
||||||
= radio_button_tag :reason, :r_1, params[:event] == 'reason_r_1'
|
= radio_button_tag :reason, :r_1, params[:event] == 'reason_r_1'
|
||||||
= label_tag :reason_r_1, t('.reason_r_1')
|
= label_tag :reason_r_1, t('.reason_r_1')
|
||||||
@ -24,10 +23,12 @@
|
|||||||
= label_tag :reason_r_4, t('.reason_r_4')
|
= label_tag :reason_r_4, t('.reason_r_4')
|
||||||
|
|
||||||
.field
|
.field
|
||||||
= label_tag :reason_text, t('.reason_text')
|
= label_tag :reason_text, t('.reason')
|
||||||
= text_area_tag :reason_text, nil, cols: 40, rows: 5
|
= text_area_tag :reason_text, nil, cols: 40, rows: 5
|
||||||
|
|
||||||
= submit_tag t '.ok'
|
= submit_tag t '.ok'
|
||||||
= link_to t('.ko'), moderations_url, class: :button
|
= link_to t('.ko'), moderations_url, class: :button
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
%fieldset
|
||||||
|
%legend=Event.model_name.human
|
||||||
|
= render file: '/events/show'
|
||||||
|
@ -1,9 +1,8 @@
|
|||||||
%h3
|
%h2
|
||||||
= link_to t('.moderation'), moderations_path
|
%em.fa.fa-thumbs-up
|
||||||
>>>
|
|
||||||
=t '.title'
|
=t '.title'
|
||||||
|
|
||||||
.box
|
%fieldset
|
||||||
- if @event.locality?
|
- if @event.locality?
|
||||||
%h2.warning=t '.warning'
|
%h2.warning=t '.warning'
|
||||||
%h2=t '.question'
|
%h2=t '.question'
|
||||||
@ -12,4 +11,6 @@
|
|||||||
= f.submit t('.ok'), name: :yes
|
= f.submit t('.ok'), name: :yes
|
||||||
= link_to t('.ko'), moderations_url, class: :button
|
= link_to t('.ko'), moderations_url, class: :button
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
%fieldset
|
||||||
|
%legend=Event.model_name.human
|
||||||
|
= render file: '/events/show'
|
||||||
|
@ -9,7 +9,6 @@
|
|||||||
- if params[:envoiParMail]
|
- if params[:envoiParMail]
|
||||||
= hidden_field_tag :envoiParMail, params[:envoiParMail]
|
= hidden_field_tag :envoiParMail, params[:envoiParMail]
|
||||||
|
|
||||||
%h2=t '.title'
|
|
||||||
%p=t 'title', scope: [:note_mailer, :create]
|
%p=t 'title', scope: [:note_mailer, :create]
|
||||||
%p=t 'body', scope: [:note_mailer, :create], subject: @note.event.title, contents: @note.contents
|
%p=t 'body', scope: [:note_mailer, :create], subject: @note.event.title, contents: @note.contents
|
||||||
|
|
||||||
@ -19,11 +18,11 @@
|
|||||||
|
|
||||||
- if params[:envoiParMail]
|
- if params[:envoiParMail]
|
||||||
:markdown
|
:markdown
|
||||||
#{t 'edit_link', scope: [:note_mailer, :create]}
|
#{t 'edit_link', scope: [:note_mailer, :notify]}
|
||||||
|
|
||||||
#{edit_moderation_url @note.event}
|
#{edit_moderation_url @note.event}
|
||||||
|
|
||||||
#{t 'signature', scope: [:note_mailer, :create]}
|
#{t 'signature', scope: [:note_mailer, :notify]}
|
||||||
|
|
||||||
.actions
|
.actions
|
||||||
= f.submit t('.save')
|
= f.submit t('.save')
|
||||||
|
@ -1,7 +1,14 @@
|
|||||||
%h3
|
%h2
|
||||||
= link_to t('.back'), moderations_path
|
- if params[:envoiParMail]
|
||||||
|
%em.fa.fa-bullhorn
|
||||||
|
- else
|
||||||
|
%em.fa.fa-paperclip
|
||||||
=t '.title'
|
=t '.title'
|
||||||
|
|
||||||
.box= render 'form'
|
%fieldset
|
||||||
|
%legend=t '.title'
|
||||||
|
= render 'form'
|
||||||
|
|
||||||
.box= render file: '/events/show'
|
%fieldset
|
||||||
|
%legend=t '.event'
|
||||||
|
= render file: '/events/show'
|
||||||
|
@ -133,17 +133,22 @@ fr:
|
|||||||
infos: Informations
|
infos: Informations
|
||||||
new:
|
new:
|
||||||
title: Soumettre un événement
|
title: Soumettre un événement
|
||||||
|
preview: Prévisualisation
|
||||||
|
edit: Édition
|
||||||
create:
|
create:
|
||||||
ok: Votre événement a bien été ajouté à la liste des événements en
|
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
|
attente de modération. Il apparaîtra en ligne dès qu'un modérateur
|
||||||
l'aura validé.
|
l'aura validé.
|
||||||
edit:
|
edit:
|
||||||
title: Éditer un événement
|
title: Éditer un événement
|
||||||
preview: Prévisualisation de l'événement
|
|
||||||
warning: Attention, cet événement est déjà modéré. Toute modification
|
warning: Attention, cet événement est déjà modéré. Toute modification
|
||||||
sera immédiatement visible sur le site.
|
sera immédiatement visible sur le site.
|
||||||
forbidden: Vous n'êtes pas authorisé à modifier cet événement
|
forbidden: Vous n'êtes pas authorisé à modifier cet événement
|
||||||
edit: Édition de l'événement
|
preview: Prévisualisation
|
||||||
|
edit: Édition
|
||||||
|
preview:
|
||||||
|
warning: Attention, cet événement est déjà modéré. Toute modification
|
||||||
|
sera immédiatement visible sur le site.
|
||||||
update:
|
update:
|
||||||
ok: Votre événement a été mis à jour
|
ok: Votre événement a été mis à jour
|
||||||
form:
|
form:
|
||||||
@ -211,11 +216,12 @@ Exemple: `%{daylimit}`"
|
|||||||
askInfos: Demander des infos
|
askInfos: Demander des infos
|
||||||
createNote: Ajouter une note
|
createNote: Ajouter une note
|
||||||
edit:
|
edit:
|
||||||
|
title: Éditer un événement
|
||||||
moderation: Modération
|
moderation: Modération
|
||||||
preview: Prévisualisation de l'événement
|
|
||||||
warning: Attention, cet événement est déjà modéré. Toute modification
|
warning: Attention, cet événement est déjà modéré. Toute modification
|
||||||
sera immédiatement visible sur le site.
|
sera immédiatement visible sur le site.
|
||||||
edit: Édition de l'événement
|
preview: Prévisualisation
|
||||||
|
edit: Édition
|
||||||
update:
|
update:
|
||||||
ok: Événement mis à jour
|
ok: Événement mis à jour
|
||||||
validate:
|
validate:
|
||||||
@ -228,6 +234,7 @@ Exemple: `%{daylimit}`"
|
|||||||
ok: Événement accepté
|
ok: Événement accepté
|
||||||
refuse:
|
refuse:
|
||||||
title: Rejet de l'événement
|
title: Rejet de l'événement
|
||||||
|
motif: Motif
|
||||||
question: Quel motif souhaitez-vous associer au rejet de cet événement?
|
question: Quel motif souhaitez-vous associer au rejet de cet événement?
|
||||||
ok: Rejeter
|
ok: Rejeter
|
||||||
ko: Annuler
|
ko: Annuler
|
||||||
@ -262,12 +269,13 @@ Exemple: `%{daylimit}`"
|
|||||||
new:
|
new:
|
||||||
back: Modération
|
back: Modération
|
||||||
title: Ajout d'une note de modération
|
title: Ajout d'une note de modération
|
||||||
|
|
||||||
|
event: Événements à modérer
|
||||||
create:
|
create:
|
||||||
sendByMailWrap: "<p>Demande d'informations complémentaires:</p>
|
sendByMailWrap: "<p>Demande d'informations complémentaires:</p>
|
||||||
<pre>%{contents}</pre>"
|
<pre>%{contents}</pre>"
|
||||||
ok: La note a bien été ajoutée, merci!
|
ok: La note a bien été ajoutée, merci!
|
||||||
form:
|
form:
|
||||||
title: Rédaction du message
|
|
||||||
save: Envoyer
|
save: Envoyer
|
||||||
ok: Enregistrer
|
ok: Enregistrer
|
||||||
ko: Annuler
|
ko: Annuler
|
||||||
|
@ -6,9 +6,12 @@ Rails.application.routes.draw do
|
|||||||
resources :users
|
resources :users
|
||||||
resources :events do
|
resources :events do
|
||||||
get :cancel, on: :member
|
get :cancel, on: :member
|
||||||
|
post :preview, on: :collection, to: 'events#preview_create'
|
||||||
|
patch :preview, on: :member
|
||||||
end
|
end
|
||||||
resources :moderations do
|
resources :moderations do
|
||||||
resources :notes, only: [:new, :create]
|
resources :notes, only: [:new, :create]
|
||||||
|
patch :preview, on: :member
|
||||||
get :validate, :refuse, on: :member
|
get :validate, :refuse, on: :member
|
||||||
put :accept, on: :member
|
put :accept, on: :member
|
||||||
end
|
end
|
||||||
|
@ -21,7 +21,7 @@ class EventsControllerTest < ActionController::TestCase
|
|||||||
|
|
||||||
test 'should preview event' do
|
test 'should preview event' do
|
||||||
assert_no_difference 'Event.count' do
|
assert_no_difference 'Event.count' do
|
||||||
post :create, visu: 'visualise', event: {
|
patch :preview_create, event: {
|
||||||
title: @event.title,
|
title: @event.title,
|
||||||
start_time: @event.start_time,
|
start_time: @event.start_time,
|
||||||
end_time: @event.end_time,
|
end_time: @event.end_time,
|
||||||
|
@ -11,6 +11,13 @@ class ModerationsControllerTest < ActionController::TestCase
|
|||||||
sign_in users(:one)
|
sign_in users(:one)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
test 'should preview event' do
|
||||||
|
patch :preview, id: @moderation, event: {
|
||||||
|
title: 'hello world',
|
||||||
|
related_region: regions(:region_one)
|
||||||
|
}
|
||||||
|
end
|
||||||
|
|
||||||
test 'should edit event' do
|
test 'should edit event' do
|
||||||
put :update, id: @moderation, event: {
|
put :update, id: @moderation, event: {
|
||||||
title: 'hello world',
|
title: 'hello world',
|
||||||
|
Loading…
Reference in New Issue
Block a user