Données pour la mise en place des agendas de belgique et suisse

This commit is contained in:
echarp 2014-08-07 22:16:05 +02:00
parent 475a9a26ff
commit b35255d363
8 changed files with 224 additions and 21 deletions

View File

@ -9,7 +9,8 @@ module EventsHelper
.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'),
subject: t('layouts.application.subtitle') subject: t('layouts.application.subtitle'),
publisher: 'april'
} }
end end

View File

@ -21,3 +21,21 @@ production:
username: manu username: manu
password: password:
socket: /var/run/mysqld/mysqld.sock socket: /var/run/mysqld/mysqld.sock
production_be:
adapter: mysql2
encoding: utf8
database: adl_be
pool: 5
username: manu
password:
socket: /var/run/mysqld/mysqld.sock
production_ch:
adapter: mysql2
encoding: utf8
database: adl_ch
pool: 5
username: manu
password:
socket: /var/run/mysqld/mysqld.sock

View File

@ -0,0 +1,90 @@
Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and
# use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
config.action_controller.asset_host = 'http://assets%d.agendadulibre.org'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder
# are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to
# raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.smtp_settings = { openssl_verify_mode: 'none' }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end

View File

@ -0,0 +1,90 @@
Rails.application.configure do
# Settings specified here will take precedence over those in
# config/application.rb.
# Code is not reloaded between requests.
config.cache_classes = true
# Eager load code on boot. This eager loads most of Rails and
# your application in memory, allowing both threaded web servers
# and those relying on copy on write to perform better.
# Rake tasks automatically ignore this option for performance.
config.eager_load = true
# Full error reports are disabled and caching is turned on.
config.consider_all_requests_local = false
config.action_controller.perform_caching = true
# Enable Rack::Cache to put a simple HTTP cache in front of your application
# Add `rack-cache` to your Gemfile before enabling this.
# For large-scale production use, consider using a caching reverse proxy like
# nginx, varnish or squid.
# config.action_dispatch.rack_cache = true
# Disable Rails's static asset server (Apache or nginx will already do this).
config.serve_static_assets = false
# Compress JavaScripts and CSS.
config.assets.js_compressor = :uglifier
# config.assets.css_compressor = :sass
# Do not fallback to assets pipeline if a precompiled asset is missed.
config.assets.compile = false
# Generate digests for assets URLs.
config.assets.digest = true
# Version of your assets, change this if you want to expire all your assets.
config.assets.version = '1.0'
# Specifies the header that your server uses for sending files.
# config.action_dispatch.x_sendfile_header = "X-Sendfile" # for apache
# config.action_dispatch.x_sendfile_header = 'X-Accel-Redirect' # for nginx
# Force all access to the app over SSL, use Strict-Transport-Security, and
# use secure cookies.
# config.force_ssl = true
# Set to :debug to see everything in the log.
config.log_level = :info
# Prepend all log lines with the following tags.
# config.log_tags = [ :subdomain, :uuid ]
# Use a different logger for distributed setups.
# config.logger = ActiveSupport::TaggedLogging.new(SyslogLogger.new)
# Use a different cache store in production.
# config.cache_store = :mem_cache_store
# Enable serving of images, stylesheets, and JavaScripts from an asset server.
# config.action_controller.asset_host = "http://assets.example.com"
config.action_controller.asset_host = 'http://assets%d.agendadulibre.org'
# Precompile additional assets.
# application.js, application.css, and all non-JS/CSS in app/assets folder
# are already added.
# config.assets.precompile += %w( search.js )
# Ignore bad email addresses and do not raise email delivery errors.
# Set this to true and configure the email server for immediate delivery to
# raise delivery errors.
# config.action_mailer.raise_delivery_errors = false
config.action_mailer.smtp_settings = { openssl_verify_mode: 'none' }
# Enable locale fallbacks for I18n (makes lookups for any locale fall back to
# the I18n.default_locale when a translation cannot be found).
config.i18n.fallbacks = true
# Send deprecation notices to registered listeners.
config.active_support.deprecation = :notify
# Disable automatic flushing of the log to improve performance.
# config.autoflush_log = false
# Use default logging formatter so that PID and timestamp are not suppressed.
config.log_formatter = ::Logger::Formatter.new
# Do not dump schema after migrations.
config.active_record.dump_schema_after_migration = false
end

View File

@ -2,4 +2,6 @@
# Add new mime types for use in respond_to blocks: # Add new mime types for use in respond_to blocks:
# Mime::Type.register 'text/richtext', :rtf # Mime::Type.register 'text/richtext', :rtf
# Necessary for the /ical.php redirect to /events.ics
Mime::Type.register 'text/calendar', :ics, [], %w(ical) Mime::Type.register 'text/calendar', :ics, [], %w(ical)

View File

@ -20,3 +20,7 @@ test:
# instead read values from the environment. # instead read values from the environment.
production: production:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %> secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
production_be:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>
production_ch:
secret_key_base: <%= ENV["SECRET_KEY_BASE"] %>

View File

@ -13,6 +13,7 @@
# It's strongly recommended that you check this file into your version control system. # It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema.define(version: 20140403204748) do ActiveRecord::Schema.define(version: 20140403204748) do
create_table "active_admin_comments", force: true do |t| create_table "active_admin_comments", force: true do |t|
t.string "namespace" t.string "namespace"
t.text "body" t.text "body"
@ -24,9 +25,9 @@ ActiveRecord::Schema.define(version: 20140403204748) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id" add_index "active_admin_comments", ["author_type", "author_id"], name: "index_active_admin_comments_on_author_type_and_author_id", using: :btree
add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace" add_index "active_admin_comments", ["namespace"], name: "index_active_admin_comments_on_namespace", using: :btree
add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id" add_index "active_admin_comments", ["resource_type", "resource_id"], name: "index_active_admin_comments_on_resource_type_and_resource_id", using: :btree
create_table "admin_users", force: true do |t| create_table "admin_users", force: true do |t|
t.string "email", default: "", null: false t.string "email", default: "", null: false
@ -43,8 +44,8 @@ ActiveRecord::Schema.define(version: 20140403204748) do
t.datetime "updated_at" t.datetime "updated_at"
end end
add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true add_index "admin_users", ["email"], name: "index_admin_users_on_email", unique: true, using: :btree
add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true add_index "admin_users", ["reset_password_token"], name: "index_admin_users_on_reset_password_token", unique: true, using: :btree
create_table "cities", force: true do |t| create_table "cities", force: true do |t|
t.string "name", default: "", null: false t.string "name", default: "", null: false
@ -56,8 +57,6 @@ ActiveRecord::Schema.define(version: 20140403204748) do
t.float "longitude", limit: 24 t.float "longitude", limit: 24
end end
add_index "cities", ["name"], name: "cities_name"
create_table "events", force: true do |t| create_table "events", force: true do |t|
t.string "title", default: "", null: false t.string "title", default: "", null: false
t.text "description", null: false t.text "description", null: false
@ -78,8 +77,6 @@ ActiveRecord::Schema.define(version: 20140403204748) do
t.string "submitter_mail_id", limit: 32 t.string "submitter_mail_id", limit: 32
end end
add_index "events", ["start_time", "end_time"], name: "events_date"
create_table "lugs", force: true do |t| create_table "lugs", force: true do |t|
t.integer "region", default: 0, null: false t.integer "region", default: 0, null: false
t.integer "department", default: 0, null: false t.integer "department", default: 0, null: false
@ -111,7 +108,8 @@ ActiveRecord::Schema.define(version: 20140403204748) do
t.string "login", default: "", null: false t.string "login", default: "", null: false
t.string "password", default: "", null: false t.string "password", default: "", null: false
t.string "email", default: "", null: false t.string "email", default: "", null: false
t.string "lastname", default: "", null: false
t.string "firstname", default: "", null: false t.string "firstname", default: "", null: false
t.string "lastname", default: "", null: false
end end
end end

View File

@ -10,18 +10,18 @@
# cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }]) # cities = City.create([{ name: 'Chicago' }, { name: 'Copenhagen' }])
# Mayor.create(name: 'Emanuel', city: cities.first) # Mayor.create(name: 'Emanuel', city: cities.first)
City.create name: 'Rennes' # City.create name: 'Rennes'
Region.create name: 'Bretagne' # Region.create name: 'Bretagne'
Region.create name: 'Ma première région' # Region.create name: 'My very first region'
User.create login: 'admin@example.com', email: 'admin@example.com', # User.create login: 'admin@example.com', email: 'admin@example.com',
password: 'password' # password: 'password'
AdminUser.create email: 'admin@example.com', password: 'password' AdminUser.create email: 'admin@example.com', password: 'password'
# rubocop:disable all # rubocop:disable Style/LineLength
# rubocop:disable Metrics/LineLength, Style/StringLiterals
I18n::Backend::ActiveRecord::Translation.create([ I18n::Backend::ActiveRecord::Translation.create([
{ locale: 'fr', key: 'layouts.application.subtitle', { locale: 'fr', key: 'layouts.application.subtitle',
value: 'L\'agenda des événements du Logiciel Libre en France' }, value: 'Les événements du Libre en France' },
{ locale: 'fr', key: 'events.form.subtitle', { locale: 'fr', key: 'events.form.subtitle',
value: "Cette page permet de soumettre un événement dans l'Agenda du Libre. Celui-ci n'apparaîtra pas automatiquement dans l'Agenda, il sera tout d'abord validé par un modérateur. Un courrier électronique vous sera envoyé à l'adresse e-mail de contact donnée ci-dessous lorsque l'événement aura été modéré." }, value: "Cette page permet de soumettre un événement dans l'Agenda du Libre. Celui-ci n'apparaîtra pas automatiquement dans l'Agenda, il sera tout d'abord validé par un modérateur. Un courrier électronique vous sera envoyé à l'adresse e-mail de contact donnée ci-dessous lorsque l'événement aura été modéré." },
@ -48,7 +48,7 @@ Si vous soumettez souvent un événement régulier dans l'Agenda du Libre, vous
" }, " },
{ locale: 'fr', key: 'events.form.title_helper', { locale: 'fr', key: 'events.form.title_helper',
value: "**Décrivez en moins de 5 mots votre événement, sans y indiquer le lieu, la ville ou la date.**" }, value: '**Décrivez en moins de 5 mots votre événement, sans y indiquer le lieu, la ville ou la date.**' },
{ locale: 'fr', key: 'events.form.description_helper', { locale: 'fr', key: 'events.form.description_helper',
value: "**Décrivez de la manière la plus complète possible votre événement.** value: "**Décrivez de la manière la plus complète possible votre événement.**
@ -62,7 +62,7 @@ Si vous soumettez souvent un événement régulier dans l'Agenda du Libre, vous
value: "_Lien **direct** vers une page donnant plus d'informations sur l'événement (lieu précis, horaire précis, programme précis...)_" }, value: "_Lien **direct** vers une page donnant plus d'informations sur l'événement (lieu précis, horaire précis, programme précis...)_" },
{ locale: 'fr', key: 'events.form.contact_helper', { locale: 'fr', key: 'events.form.contact_helper',
value: "*Adresse e-mail de contact. Elle sera affichée de manière peu compréhensible par les spammeurs.*" }, value: '*Adresse e-mail de contact. Elle sera affichée de manière peu compréhensible par les spammeurs.*' },
{ locale: 'fr', key: 'events.form.submitter_helper', { locale: 'fr', key: 'events.form.submitter_helper',
value: "*Adresse e-mail du soumetteur de l'événement. Elle ne sera utilisée que par les modérateurs pour contacter la personne ayant proposé l'événement, pour lui informer de sa validation ou de son rejet. Si cette adresse n'est pas présente, l'adresse de contact sera utilisée*" }, value: "*Adresse e-mail du soumetteur de l'événement. Elle ne sera utilisée que par les modérateurs pour contacter la personne ayant proposé l'événement, pour lui informer de sa validation ou de son rejet. Si cette adresse n'est pas présente, l'adresse de contact sera utilisée*" },