Traductions et look global en place

This commit is contained in:
echarp 2013-11-24 16:11:44 +01:00
parent f419876b35
commit a0cd381d43
13 changed files with 342 additions and 42 deletions

View File

@ -2,3 +2,6 @@
* *
@include transition-duration(0.5s) @include transition-duration(0.5s)
[class^="fa-"], [class*=" fa-"]
font-family: FontAwesome, Arial, Helvetica, sans-serif !important

View File

@ -2,4 +2,6 @@ class ApplicationController < ActionController::Base
# Prevent CSRF attacks by raising an exception. # Prevent CSRF attacks by raising an exception.
# For APIs, you may want to use :null_session instead. # For APIs, you may want to use :null_session instead.
protect_from_forgery with: :exception protect_from_forgery with: :exception
before_action :authenticate_admin_user!
end end

View File

@ -0,0 +1,3 @@
#flash_messages
- flash.each do |key, value|
.flash(class="#{key}")= value

View File

@ -1,14 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>AgendaDuLibreRails</title>
<%= stylesheet_link_tag "application", media: "all", "data-turbolinks-track" => true %>
<%= javascript_include_tag "application", "data-turbolinks-track" => true %>
<%= csrf_meta_tags %>
</head>
<body>
<%= yield %>
</body>
</html>

View File

@ -0,0 +1,49 @@
!!! 5
/[if IE]
%html(lang="#{I18n.locale}")
%head
%title AgendaDuLibreRails
%meta(http-equiv='Content-Type' content='text/html; charset=utf-8')
%meta(name='description' content='Parlement, a mix between direct and representative democracy, in the shape of a website. A mailing list, forum, chat. Democratic mailing list and forum')
%meta(name='author' content='Emmanuel Charpentier')
%meta(name='robots' content='index, follow')
%meta(name='keywords' content='collaborative writing, democracy, direct democracy, representative democracy, forum, mailing list, chat, Ruby on Rails, PostgreSQL')
%meta(name='dcterms.title' content='Parlement' lang='en')
%meta(name='dcterms.title' content='Parlement' lang='fr')
%meta(name='dcterms.subject' content='Parlement, democratic mailing list and forum')
-#%link(rel='shortcut icon' href='/assets/favicon.ico')
%link(rel='icon' type='image/png' href='/assets/world.png')
= auto_discovery_link_tag :atom, { format: :atom }
= stylesheet_link_tag 'application', media: "all", "data-turbolinks-track" => true
= javascript_include_tag 'application', "data-turbolinks-track" => true
/[if lt IE 9]
%script(src='http://html5shiv.googlecode.com/svn/trunk/html5.js')
= csrf_meta_tags
// = javascript_include_tag 'html5'
// = javascript_include_tag 'PIE'
// /https://github.com/aFarkas/iepp/wiki
%body(class = "#{controller.controller_name}")
= render 'layouts/flash', flash: flash if flash.present?
%header.top
%h1= link_to 'Agenda du libre', root_url
- if admin_user_signed_in?
- else
= link_to t('.login'), new_user_session_path, class: :login
= yield
%footer.bottom
%nav
= link_to User.model_name.human.capitalize.pluralize, users_url
= link_to 'Forge', 'http://rubyforge.org/projects/parlement'
= link_to 'AGPL', 'http://www.gnu.org/licenses/agpl.html'
= link_to 'fr', '/fr', class: 'fr'
%span.version=t :version, version: 1.99

View File

@ -1,25 +1,25 @@
%h1 Listing users %h1= User.model_name.human.pluralize
%table %table.index_table
%tr %tr
%th Login %th= User.human_attribute_name :login
%th Email %th= User.human_attribute_name :email
%th Lastname %th= User.human_attribute_name :lastname
%th Firstname %th= User.human_attribute_name :firstname
%th
%th
%th %th
- @users.each do |user| - @users.each do |user|
%tr %tr(class="#{cycle('odd', 'even')}")
%td= user.login %td= user.login
%td= user.email %td= user.email
%td= user.lastname %td= user.lastname
%td= user.firstname %td= user.firstname
%td= link_to 'Show', user %td
%td= link_to 'Edit', edit_user_path(user) = link_to t('show'), user, class: 'view_link'
%td= link_to 'Destroy', user, :method => :delete, :data => { :confirm => 'Are you sure?' } = link_to t('edit'), edit_user_path(user), class: 'edit_link'
= link_to t('destroy'), user, method: :delete,
data: { confirm: 'Are you sure?' }, class: 'delete_link'
%br %br/
= link_to 'New User', new_user_path = link_to 'New User', new_user_path

View File

@ -24,7 +24,7 @@ development:
test: test:
adapter: mysql2 adapter: mysql2
encoding: utf8 encoding: utf8
database: agenda-du-libre-rails_test database: adl_test
pool: 5 pool: 5
username: manu username: manu
password: password:

View File

@ -20,4 +20,23 @@
# available at http://guides.rubyonrails.org/i18n.html. # available at http://guides.rubyonrails.org/i18n.html.
en: en:
hello: "Hello world" show: Show
edit: Edit
destroy: Destroy
attributes:
created_at: Created at
updated_at: Updated at
created: Created %{date} ago
updated: Updated %{date} ago
activerecord:
models:
user: Contributor
attributes:
user:
login: Id
email: Email
password: Password
lastname: Name
firstname: First name

View File

@ -1,3 +1,25 @@
fr: fr:
hello: "Bonjour le monde" show: Voir
edit: Éditer
destroy: Supprimer
attributes:
created_at: Créé le
updated_at: Modifié le
created: Créé il y a %{date}
updated: Mis à jour il y a %{date}
activerecord:
models:
user: Contributeur
attributes:
user:
login: Identifiant
email: Email
password: Mot de passe
lastname: Nom
firstname: Prénom
layouts:
application:
login: Authentication

View File

@ -3,6 +3,8 @@ AgendaDuLibreRails::Application.routes.draw do
ActiveAdmin.routes(self) ActiveAdmin.routes(self)
resources :users resources :users
root to: 'users#index'
# The priority is based upon order of creation: first created -> highest priority. # The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes". # See how all your routes lay out with "rake routes".

215
db/structure.sql Normal file
View File

@ -0,0 +1,215 @@
-- MySQL dump 10.13 Distrib 5.5.33, for debian-linux-gnu (x86_64)
--
-- Host: localhost Database: adl_fr
-- ------------------------------------------------------
-- Server version 5.5.33-1
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `active_admin_comments`
--
DROP TABLE IF EXISTS `active_admin_comments`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `active_admin_comments` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`namespace` varchar(255) DEFAULT NULL,
`body` text,
`resource_id` varchar(255) NOT NULL,
`resource_type` varchar(255) NOT NULL,
`author_id` int(11) DEFAULT NULL,
`author_type` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `index_active_admin_comments_on_namespace` (`namespace`),
KEY `index_active_admin_comments_on_author_type_and_author_id` (`author_type`,`author_id`),
KEY `index_active_admin_comments_on_resource_type_and_resource_id` (`resource_type`,`resource_id`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `admin_users`
--
DROP TABLE IF EXISTS `admin_users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `admin_users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`email` varchar(255) NOT NULL DEFAULT '',
`encrypted_password` varchar(255) NOT NULL DEFAULT '',
`reset_password_token` varchar(255) DEFAULT NULL,
`reset_password_sent_at` datetime DEFAULT NULL,
`remember_created_at` datetime DEFAULT NULL,
`sign_in_count` int(11) NOT NULL DEFAULT '0',
`current_sign_in_at` datetime DEFAULT NULL,
`last_sign_in_at` datetime DEFAULT NULL,
`current_sign_in_ip` varchar(255) DEFAULT NULL,
`last_sign_in_ip` varchar(255) DEFAULT NULL,
`created_at` datetime DEFAULT NULL,
`updated_at` datetime DEFAULT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `index_admin_users_on_email` (`email`),
UNIQUE KEY `index_admin_users_on_reset_password_token` (`reset_password_token`)
) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `cities`
--
DROP TABLE IF EXISTS `cities`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `cities` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
`majname` varchar(255) NOT NULL DEFAULT '',
`postalcode` int(11) DEFAULT NULL,
`inseecode` int(11) DEFAULT NULL,
`regioncode` int(11) DEFAULT NULL,
`latitude` float DEFAULT NULL,
`longitude` float DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `cities_name` (`name`)
) ENGINE=MyISAM AUTO_INCREMENT=51637 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `events`
--
DROP TABLE IF EXISTS `events`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `events` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`title` varchar(255) NOT NULL DEFAULT '',
`description` text NOT NULL,
`start_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`end_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`city` varchar(255) NOT NULL DEFAULT '',
`region` int(11) NOT NULL DEFAULT '0',
`locality` int(11) NOT NULL DEFAULT '0',
`url` varchar(255) NOT NULL DEFAULT '',
`contact` varchar(255) NOT NULL DEFAULT '',
`submitter` varchar(255) NOT NULL DEFAULT '',
`moderated` int(11) NOT NULL DEFAULT '0',
`tags` varchar(255) NOT NULL DEFAULT '',
`secret` varchar(255) NOT NULL DEFAULT '',
`decision_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`submission_time` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`moderator_mail_id` varchar(32) DEFAULT NULL,
`submitter_mail_id` varchar(32) DEFAULT NULL,
PRIMARY KEY (`id`),
KEY `events_date` (`start_time`,`end_time`)
) ENGINE=MyISAM AUTO_INCREMENT=8113 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `lugs`
--
DROP TABLE IF EXISTS `lugs`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `lugs` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`region` int(11) NOT NULL DEFAULT '0',
`department` int(11) NOT NULL DEFAULT '0',
`name` varchar(255) NOT NULL DEFAULT '',
`url` varchar(255) NOT NULL DEFAULT '',
`city` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=3444 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `notes`
--
DROP TABLE IF EXISTS `notes`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `notes` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`contents` text NOT NULL,
`date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
`event_id` int(11) DEFAULT NULL,
`author_id` int(11) DEFAULT NULL,
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=662 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `regions`
--
DROP TABLE IF EXISTS `regions`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `regions` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=28 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `schema_migrations`
--
DROP TABLE IF EXISTS `schema_migrations`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `schema_migrations` (
`version` varchar(255) NOT NULL,
UNIQUE KEY `unique_schema_migrations` (`version`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Table structure for table `users`
--
DROP TABLE IF EXISTS `users`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `users` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`login` varchar(255) NOT NULL DEFAULT '',
`password` varchar(255) NOT NULL DEFAULT '',
`email` varchar(255) NOT NULL DEFAULT '',
`lastname` varchar(255) NOT NULL DEFAULT '',
`firstname` varchar(255) NOT NULL DEFAULT '',
PRIMARY KEY (`id`)
) ENGINE=MyISAM AUTO_INCREMENT=12 DEFAULT CHARSET=utf8;
/*!40101 SET character_set_client = @saved_cs_client */;
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2013-11-24 15:40:00
INSERT INTO schema_migrations (version) VALUES ('0');
INSERT INTO schema_migrations (version) VALUES ('20131114103118');
INSERT INTO schema_migrations (version) VALUES ('20131114103121');

View File

@ -3,9 +3,8 @@
# This model initially had no columns defined. If you add columns to the # This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately # model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below # below each fixture, per the syntax in the comments below
#
one: {} one:
# column: value email: one@example.com
# two:
two: {} email: two@example.com
# column: value

View File

@ -3,9 +3,9 @@
# This model initially had no columns defined. If you add columns to the # This model initially had no columns defined. If you add columns to the
# model remove the '{}' from the fixture names and add the columns immediately # model remove the '{}' from the fixture names and add the columns immediately
# below each fixture, per the syntax in the comments below # below each fixture, per the syntax in the comments below
#
one: {} one:
# column: value email: one@example.com
#
two: {} two:
# column: value email: two@example.com