merrycms 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (75) hide show
  1. data/README +15 -0
  2. data/app/controllers/admin/base_controller.rb +11 -0
  3. data/app/controllers/admin/categories_controller.rb +63 -0
  4. data/app/controllers/admin/pages_controller.rb +73 -0
  5. data/app/controllers/admin/translations_controller.rb +55 -0
  6. data/app/controllers/admin/users_controller.rb +53 -0
  7. data/app/helpers/admin/categories_helper.rb +32 -0
  8. data/app/helpers/admin/pages_helper.rb +24 -0
  9. data/app/helpers/admin/translations_helper.rb +25 -0
  10. data/app/helpers/admin/users_helper.rb +10 -0
  11. data/app/models/category.rb +11 -0
  12. data/app/models/page.rb +66 -0
  13. data/app/models/role.rb +6 -0
  14. data/app/models/translation.rb +48 -0
  15. data/app/models/user.rb +42 -0
  16. data/app/views/admin/_nav.html.erb +10 -0
  17. data/app/views/admin/categories/_form.erb +24 -0
  18. data/app/views/admin/categories/edit.html.erb +3 -0
  19. data/app/views/admin/categories/index.html.erb +22 -0
  20. data/app/views/admin/categories/new.html.erb +3 -0
  21. data/app/views/admin/categories/sort.html.erb +29 -0
  22. data/app/views/admin/pages/_form.html.erb +25 -0
  23. data/app/views/admin/pages/_search.erb +15 -0
  24. data/app/views/admin/pages/edit.html.erb +3 -0
  25. data/app/views/admin/pages/index.html.erb +32 -0
  26. data/app/views/admin/pages/new.html.erb +3 -0
  27. data/app/views/admin/translations/_filter.html.erb +8 -0
  28. data/app/views/admin/translations/destroy.js +4 -0
  29. data/app/views/admin/translations/index.html.erb +40 -0
  30. data/app/views/admin/translations/new.html.erb +49 -0
  31. data/app/views/admin/users/_form.html.erb +33 -0
  32. data/app/views/admin/users/edit.html.erb +3 -0
  33. data/app/views/admin/users/index.html.erb +18 -0
  34. data/app/views/admin/users/new.html.erb +3 -0
  35. data/app/views/devise/confirmations/new.html.erb +10 -0
  36. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  37. data/app/views/devise/mailer/reset_password_instructions.html.erb +8 -0
  38. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  39. data/app/views/devise/passwords/edit.html.erb +15 -0
  40. data/app/views/devise/passwords/new.html.erb +16 -0
  41. data/app/views/devise/registrations/edit.html.erb +24 -0
  42. data/app/views/devise/registrations/new.html.erb +31 -0
  43. data/app/views/devise/sessions/new.html.erb +24 -0
  44. data/app/views/devise/shared/_links.erb +19 -0
  45. data/app/views/devise/unlocks/new.html.erb +11 -0
  46. data/app/views/layouts/admin.html.erb +22 -0
  47. data/app/views/layouts/login.html.erb +17 -0
  48. data/app/views/shared/_error_messages.html.erb +9 -0
  49. data/app/views/shared/_flashbox.html.erb +5 -0
  50. data/app/views/shared/_toplinks.html.erb +8 -0
  51. data/config/locales/en/admin/missing.yml +4 -0
  52. data/config/locales/fr/admin/admin.fr.yml +9 -0
  53. data/config/locales/fr/admin/category.fr.yml +22 -0
  54. data/config/locales/fr/admin/devise.fr.yml +129 -0
  55. data/config/locales/fr/admin/merrycms.fr.yml +6 -0
  56. data/config/locales/fr/admin/missing.yml +5 -0
  57. data/config/locales/fr/admin/pages.fr.yml +51 -0
  58. data/config/locales/fr/admin/pagination.fr.yml +6 -0
  59. data/config/locales/fr/admin/toplinks.fr.yml +9 -0
  60. data/config/locales/fr/admin/translations.fr.yml +46 -0
  61. data/config/locales/fr/admin/users.fr.yml +14 -0
  62. data/lib/generators/merrycms/install_generator.rb +78 -0
  63. data/lib/generators/merrycms/templates/create_pages_and_categories_migration.rb +36 -0
  64. data/lib/generators/merrycms/templates/create_roles_migration.rb +14 -0
  65. data/lib/generators/merrycms/templates/create_translations_migration.rb +17 -0
  66. data/lib/generators/merrycms/templates/devise_create_users_migration.rb +26 -0
  67. data/lib/generators/merrycms/templates/devise_initializer.rb +142 -0
  68. data/lib/generators/merrycms/templates/locale_initializer.rb +10 -0
  69. data/lib/generators/merrycms/templates/roles_users_migration.rb +13 -0
  70. data/lib/generators/merrycms/views_generator.rb +11 -0
  71. data/lib/merrycms/engine.rb +38 -0
  72. data/lib/merrycms/rails/routes.rb +35 -0
  73. data/lib/merrycms/railties/merrycms_tasks.rake +72 -0
  74. data/lib/merrycms.rb +1 -0
  75. metadata +270 -0
@@ -0,0 +1,129 @@
1
+ fr:
2
+ activerecord:
3
+ models:
4
+ user: Utilisateur
5
+ attributes:
6
+ user:
7
+ email: Email
8
+
9
+ errors:
10
+ models:
11
+ user:
12
+ attributes:
13
+ email:
14
+ blank: "Vous oubliez votre email"
15
+ taken: "Cet email est déjà pris"
16
+ password:
17
+ blank: "Vous oubliez le mot de passe"
18
+ too_short: "Le mot de passe est trop court"
19
+ confirmation: "La confirmation ne correspond pas au mot de passe"
20
+
21
+ errors:
22
+ messages:
23
+ not_found: "n'a pas été trouvé(e)"
24
+ already_confirmed: "a déjà été confirmé(e)"
25
+ not_locked: "n'était pas verrouillé(e)"
26
+
27
+ devise:
28
+ failure:
29
+ unauthenticated: "Vous devez vous connecter ou vous inscrire pour continuer."
30
+ unconfirmed: "Vous devez confirmer votre compte pour continuer."
31
+ locked: "Votre compte est verrouillé."
32
+ invalid: "Courriel ou mot de passe incorrect."
33
+ invalid_token: "Jeton d'authentification incorrect."
34
+ timeout: "Votre séance est expirée, veuillez vous reconnecter pour continuer."
35
+ inactive: "Votre compte n'est pas encore activé."
36
+
37
+ passwords:
38
+ send_instructions: "Vous allez recevoir un courriel avec des instructions pour changer votre mot de passe."
39
+ updated: "Votre mot de passe a été changé. Vous êtes maintenant connecté."
40
+ confirmations:
41
+ send_instructions: "Vous allez recevoir un courriel avec des instructions pour confirmer votre compte."
42
+ confirmed: "Votre compte a été confirmé. Vous êtes maintenant connecté."
43
+ registrations:
44
+ user:
45
+ signed_up: "Votre inscription est enregistrée. Si elle est activé, un courriel de confirmation vous a été envoyé."
46
+ updated: "Votre mise à jour a été prise en compte."
47
+ destroyed: "Bye! Votre compte est annulé. Nous souhaitons vous revoir bientôt."
48
+ unlocks:
49
+ send_instructions: "Vous allez recevoir un courriel avec des instructions pour déverrouiller votre compte."
50
+ unlocked: "Votre compte est déverrouillé. Vous êtes maintenant connecté."
51
+ mailer:
52
+ confirmation_instructions: "Instructions de confirmation"
53
+ reset_password_instructions: "Instructions pour changer le mot de passe"
54
+ unlock_instructions: "Instructions pour déverrouiller le compte"
55
+
56
+ ##########################################################################################################
57
+ # For generated views: By "rails generate devise_views".
58
+ # Assuming to use I18n "Lazy" lookup, except for the ones under "common" namespace.
59
+ # e.g. Under views/devise/confirmations/new.html.erb,
60
+ # <h2>Resend confirmation instructions</h2>
61
+ # is changed to
62
+ # <h2><%= t(".resend_confirmation_instructions") %></h2>
63
+ # locally.
64
+ ##########################################################################################################
65
+ sessions:
66
+ user:
67
+ signed_in: "Vous êtes connecté."
68
+ signed_out: "Vous êtes déconnecté."
69
+ new:
70
+ title: "Se connecter"
71
+ sign_in: "Se connecter"
72
+ password: Mot de passe
73
+ remember_me: Se souvenir de moi
74
+ shared:
75
+ links:
76
+ didnt_receive_confirmation_instructions?: "Vous n'avez pas reçu de courriel de confirmation?"
77
+ didnt_receive_unlock_instructions?: "Vous n'avez pas reçu de courriel de déverrouillage de votre compte?"
78
+ forgot_your_password?: "Mot de passe oublié?"
79
+ sign_in: "Se connecter"
80
+ sign_up: "Créer un compte"
81
+ confirmations:
82
+ new:
83
+ resend_confirmation_instructions: "Renvoyer le courriel de confirmation"
84
+ mailer:
85
+ confirmation_instructions:
86
+ welcome: "Bienvenu(e)"
87
+ you_can_confirm_your_account_through_the_link_below: "Vous pouvez confirmer votre compte via le lien ci-dessous"
88
+ confirm_my_account: "Confirmer mon compte"
89
+ reset_password_instructions:
90
+ # For "Someone has requested a link to change your password, and you can do this through the link below."
91
+ reset_password_instruction: "Quelqu'un a demandé un lien pour changer votre mot de passe. Vous pouvez le faire via le lien ci-dessous."
92
+ change_my_password: "Changer mon mot de passe"
93
+ # For "If you didn't request this, please ignore this email."
94
+ wrong_request_instruction: "Si vous n'avez pas demandé ce changement, ignorez ce message."
95
+ # For "Your password won't change until you access the link above and create a new one."
96
+ unchange_password_message: "Votre mot de passe ne sera pas changé tant vous n'aurez pas accédé au lien ci-dessus pour en créer un nouveau."
97
+ unlock_instructions:
98
+ # For "Your account has been locked due to an excessive amount of unsuccessful sign in attempts."
99
+ locked_account_message: "Votre compte est verrouillé car vous avez échoué lors de votre identification trop de fois."
100
+ # For "Click the link below to unlock your account"
101
+ unlock_account_instruction: "Cliquez sur le lien ci-dessous pour déverrouiller votre compte"
102
+ unlock_my_account: "Déverrouiller mon compte"
103
+ passwords:
104
+ edit:
105
+ change_your_password: "Changez votre mot de passe"
106
+ change_my_password: "Changer mon mot de passe"
107
+ new:
108
+ title: Mot de passe oublié ?
109
+ send_me_reset_password_instructions: "Envoyez-moi un courriel pour changer mon mot de passe"
110
+ registrations:
111
+ new:
112
+ title: "Créer un compte"
113
+ password: Mot de passe
114
+ password_confirmation: Confirmation du mot de passe
115
+ sign_up: Créer compte
116
+ edit:
117
+ edit: "Modifier"
118
+ # For "leave blank if you don't want to change it"
119
+ password_instruction: "Ne pas remplir si vous ne voulez pas le changer"
120
+ # For "we need your current password to confirm your changes"
121
+ current_password_instruction: "Vous devez remplir votre mot de passe en cours pour confirmer vos changement"
122
+ update: "Mettre à jour"
123
+ cancel_my_account: "Annuler mon compte"
124
+ unhappy?: "Pas content(e)?"
125
+ are_you_sure?: "Êtes-vous sûr?"
126
+ back: "Retour"
127
+ unlocks:
128
+ new:
129
+ resend_unlock_instructions: "Renvoyez le mail pour déverrouiller mon compte"
@@ -0,0 +1,6 @@
1
+ fr:
2
+ site_title: Site
3
+ cancel: Annuler
4
+ home: Accueil
5
+ access_denied: Accès interdit
6
+
@@ -0,0 +1,5 @@
1
+ fr:
2
+ i18n:
3
+ plural:
4
+ keys: [:zero, :one, :other]
5
+
@@ -0,0 +1,51 @@
1
+ fr:
2
+ activerecord:
3
+ models:
4
+ page: Page
5
+ attributes:
6
+ page:
7
+ title: Titre
8
+ link: Lien
9
+ errors:
10
+ models:
11
+ page:
12
+ attributes:
13
+ title:
14
+ blank: Vous oubliez le titre
15
+
16
+ pages:
17
+
18
+ title: Titre
19
+ submit: Envoyer
20
+
21
+ category: Catégorie
22
+ delete: Supprimer cette page
23
+
24
+ search:
25
+ title: Rechercher
26
+ page_title: Par titre
27
+ submit: Rechercher
28
+
29
+
30
+ state: Etat
31
+ states:
32
+ draft: brouillon
33
+ published: publié
34
+ archived: archivé
35
+
36
+ events:
37
+ publish: publier
38
+ unpublish: dépublier
39
+ archive: archiver
40
+ unarchive: désarchiver
41
+
42
+
43
+ index:
44
+ title: Pages
45
+ new_page: Nouvelle page
46
+ new:
47
+ title: Nouvelle page
48
+ edit:
49
+ title: Modifier la page
50
+ form:
51
+ submit: Sauver
@@ -0,0 +1,6 @@
1
+ fr:
2
+ views:
3
+ pagination:
4
+ previous: "&lt; Précédent"
5
+ next: "Suivant &gt;"
6
+ truncate: "..."
@@ -0,0 +1,9 @@
1
+ fr:
2
+ shared:
3
+ toplinks:
4
+ sign_in: "Se connecter"
5
+ sign_up: "Créer un compte"
6
+ signed_in_as: "Connecté en tant que %{user}"
7
+ sign_out: "Se deconnecter"
8
+ or: "ou"
9
+ site: "Accueil"
@@ -0,0 +1,46 @@
1
+ fr:
2
+ admin:
3
+ nav:
4
+ translations: Traductions
5
+
6
+ translations:
7
+ locales:
8
+ fr: Français
9
+ en: Anglais
10
+ de: Allemand
11
+ es: Espagnol
12
+ version:
13
+ fr: Française
14
+ en: Anglaise
15
+ de: Allemande
16
+ es: Espagnole
17
+
18
+ key: Elément à traduire
19
+ submit: Envoyer
20
+ delete: supprimer
21
+
22
+ filter: Filtrer
23
+
24
+ available_locales: Languages disponibles
25
+
26
+ pending: Traductions en attentes
27
+ all: Toutes les traductions
28
+
29
+ no_pending: Pas de traduction en attente
30
+ no_translation: Pas de traduction
31
+
32
+ you_are_editing: Vous modifier la version
33
+
34
+ index:
35
+ title: Traductions
36
+
37
+ new:
38
+ title: Modification des traductions
39
+
40
+ dump:
41
+ link: Appliquer les changements
42
+ confirm: Vous êtes sur le point d'enregistrer toutes les traductions. Cette opération n'est pas reversible. Voulez vous continuer ?
43
+
44
+ notice:
45
+ translation_added: Traductions ajoutées
46
+ dumped: Traductions enregistrées
@@ -0,0 +1,14 @@
1
+ fr:
2
+ users:
3
+ password: Mot de passe
4
+ password_confirmation: Confirmation du mot de passe
5
+
6
+ index:
7
+ title: Utilisateurs
8
+ roles: Roles
9
+ new:
10
+ title: Ajouter un utilisateur
11
+ edit:
12
+ title: Modifier l'utilisateur
13
+
14
+
@@ -0,0 +1,78 @@
1
+ require 'rails/generators'
2
+ require 'rails/generators/migration'
3
+
4
+ module Merrycms
5
+ class InstallGenerator < Rails::Generators::Base
6
+ include Rails::Generators::Migration
7
+
8
+ def self.source_root
9
+ @source_root ||= File.join(File.dirname(__FILE__), 'templates')
10
+ end
11
+
12
+ def self.next_migration_number(dirname)
13
+ if ActiveRecord::Base.timestamped_migrations
14
+ Time.now.utc.strftime("%Y%m%d%H%M%S")
15
+ else
16
+ "%.3d" % (current_migration_number(dirname) + 1)
17
+ end
18
+ end
19
+
20
+ # Authentication (Devise)
21
+ def copy_devise_initializer
22
+ copy_file 'devise_initializer.rb', 'config/initializers/devise.rb'
23
+ end
24
+
25
+ def add_devise_routes
26
+ route 'devise_for :users'
27
+ end
28
+
29
+ def add_merrycms_routes
30
+ route 'merrycms_routes'
31
+ end
32
+
33
+ def copy_locales
34
+ directory "../../../../config/locales/fr/admin", "config/locales/fr/admin"
35
+ end
36
+
37
+ def create_migration_files
38
+ migration_template 'devise_create_users_migration.rb', 'db/migrate/devise_create_users.rb'
39
+ sleep 1
40
+ migration_template 'create_roles_migration.rb', 'db/migrate/create_roles.rb'
41
+ sleep 1
42
+ migration_template 'roles_users_migration.rb', 'db/migrate/roles_users.rb'
43
+ sleep 1
44
+ migration_template 'create_pages_and_categories_migration.rb', 'db/migrate/create_pages_and_categories.rb'
45
+ sleep 1
46
+ migration_template 'create_translations_migration.rb', 'db/migrate/create_translations.rb'
47
+ sleep 1
48
+ end
49
+
50
+ def copy_stylesheets
51
+ copy_file '../../../../public/stylesheets/reset.css', 'public/stylesheets/reset.css'
52
+ copy_file '../../../../public/stylesheets/font.css', 'public/stylesheets/font.css'
53
+ copy_file '../../../../public/stylesheets/form.css', 'public/stylesheets/form.css'
54
+ copy_file '../../../../public/stylesheets/login.css', 'public/stylesheets/login.css'
55
+ copy_file '../../../../public/stylesheets/admin.css', 'public/stylesheets/admin.css'
56
+ end
57
+
58
+ def copy_javascripts
59
+ copy_file '../../../../public/javascripts/form.js', 'public/javascripts/form.js'
60
+ copy_file '../../../../public/javascripts/admin.js', 'public/javascripts/admin.js'
61
+ copy_file '../../../../public/javascripts/autoresize.jquery.min.js', 'public/javascripts/autoresize.jquery.min.js'
62
+ end
63
+
64
+ def copy_images
65
+ directory '../../../../public/images/merrycms', 'public/images/merrycms'
66
+ end
67
+
68
+ def copy_locale_initializer
69
+ copy_file 'locale_initializer.rb', 'config/initializers/locale.rb'
70
+ end
71
+
72
+ # pages and categories
73
+ def generate_slugs_table
74
+ invoke 'friendly_id'
75
+ end
76
+
77
+ end
78
+ end
@@ -0,0 +1,36 @@
1
+ class CreatePagesAndCategories < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :pages do |t|
4
+ t.string :title
5
+ t.text :content
6
+ t.text :content_html
7
+ t.string :link
8
+ t.string :state
9
+ t.datetime :published_at
10
+ t.datetime :archived_at
11
+ t.integer :category_id
12
+ t.timestamps
13
+ end
14
+
15
+ create_table :categories do |t|
16
+ t.string :name
17
+
18
+ # nested_sey
19
+ t.integer :parent_id
20
+ t.integer :lft
21
+ t.integer :rgt
22
+ t.integer :depth
23
+
24
+ # acts_as_list
25
+ t.integer :position
26
+
27
+ t.string :link
28
+ t.timestamps
29
+ end
30
+ end
31
+
32
+ def self.down
33
+ drop_table :pages
34
+ drop_table :categories
35
+ end
36
+ end
@@ -0,0 +1,14 @@
1
+ class CreateRoles < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :roles do |t|
4
+ t.string :name, :limit => 40
5
+ t.string :authorizable_type, :limit => 40
6
+ t.integer :authorizable_id
7
+ t.timestamps
8
+ end
9
+ end
10
+
11
+ def self.down
12
+ drop_table :roles
13
+ end
14
+ end
@@ -0,0 +1,17 @@
1
+ class CreateTranslations < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :translations do |t|
4
+ t.string :locale
5
+ t.string :key
6
+ t.text :value
7
+ t.text :interpolations
8
+ t.boolean :is_proc, :default => false
9
+
10
+ t.timestamps
11
+ end
12
+ end
13
+
14
+ def self.down
15
+ drop_table :translations
16
+ end
17
+ end
@@ -0,0 +1,26 @@
1
+ class DeviseCreateUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table(:users) do |t|
4
+ t.database_authenticatable :null => false
5
+ t.recoverable
6
+ t.rememberable
7
+ t.trackable
8
+
9
+ # t.confirmable
10
+ # t.lockable :lock_strategy => :failed_attempts, :unlock_strategy => :both
11
+ # t.token_authenticatable
12
+
13
+
14
+ t.timestamps
15
+ end
16
+
17
+ add_index :users, :email, :unique => true
18
+ add_index :users, :reset_password_token, :unique => true
19
+ # add_index :users, :confirmation_token, :unique => true
20
+ # add_index :users, :unlock_token, :unique => true
21
+ end
22
+
23
+ def self.down
24
+ drop_table :users
25
+ end
26
+ end
@@ -0,0 +1,142 @@
1
+ # Use this hook to configure devise mailer, warden hooks and so forth. The first
2
+ # four configuration values can also be set straight in your models.
3
+ Devise.setup do |config|
4
+ # ==> Mailer Configuration
5
+ # Configure the e-mail address which will be shown in DeviseMailer.
6
+ config.mailer_sender = "please-change-me@config-initializers-devise.com"
7
+
8
+ # Configure the class responsible to send e-mails.
9
+ # config.mailer = "Devise::Mailer"
10
+
11
+ # ==> ORM configuration
12
+ # Load and configure the ORM. Supports :active_record (default) and
13
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
14
+ # available as additional gems.
15
+ require 'devise/orm/active_record'
16
+
17
+ # ==> Configuration for any authentication mechanism
18
+ # Configure which keys are used when authenticating an user. By default is
19
+ # just :email. You can configure it to use [:username, :subdomain], so for
20
+ # authenticating an user, both parameters are required. Remember that those
21
+ # parameters are used only when authenticating and not when retrieving from
22
+ # session. If you need permissions, you should implement that in a before filter.
23
+ # config.authentication_keys = [ :email ]
24
+
25
+ # Tell if authentication through request.params is enabled. True by default.
26
+ # config.params_authenticatable = true
27
+
28
+ # Tell if authentication through HTTP Basic Auth is enabled. False by default.
29
+ # config.http_authenticatable = false
30
+
31
+ # Set this to true to use Basic Auth for AJAX requests. True by default.
32
+ # config.http_authenticatable_on_xhr = true
33
+
34
+ # The realm used in Http Basic Authentication
35
+ # config.http_authentication_realm = "Application"
36
+
37
+ # ==> Configuration for :database_authenticatable
38
+ # For bcrypt, this is the cost for hashing the password and defaults to 10. If
39
+ # using other encryptors, it sets how many times you want the password re-encrypted.
40
+ config.stretches = 10
41
+
42
+ # Define which will be the encryption algorithm. Devise also supports encryptors
43
+ # from others authentication tools as :clearance_sha1, :authlogic_sha512 (then
44
+ # you should set stretches above to 20 for default behavior) and :restful_authentication_sha1
45
+ # (then you should set stretches to 10, and copy REST_AUTH_SITE_KEY to pepper)
46
+ config.encryptor = :bcrypt
47
+
48
+ # Setup a pepper to generate the encrypted password.
49
+ config.pepper = "3d077cf1ba0311ee6f809b7c3382ebf29a2e5ad488b9c5b3feff450ba61943a4a0ecf710bd1211b908b5e9e3a911793aca5160c8d853df0ecd6142775133fa55"
50
+
51
+ # ==> Configuration for :confirmable
52
+ # The time you want to give your user to confirm his account. During this time
53
+ # he will be able to access your application without confirming. Default is nil.
54
+ # When confirm_within is zero, the user won't be able to sign in without confirming.
55
+ # You can use this to let your user access some features of your application
56
+ # without confirming the account, but blocking it after a certain period
57
+ # (ie 2 days).
58
+ # config.confirm_within = 2.days
59
+
60
+ # ==> Configuration for :rememberable
61
+ # The time the user will be remembered without asking for credentials again.
62
+ # config.remember_for = 2.weeks
63
+
64
+ # If true, a valid remember token can be re-used between multiple browsers.
65
+ # config.remember_across_browsers = true
66
+
67
+ # If true, extends the user's remember period when remembered via cookie.
68
+ # config.extend_remember_period = false
69
+
70
+ # ==> Configuration for :validatable
71
+ # Range for password length
72
+ # config.password_length = 6..20
73
+
74
+ # Regex to use to validate the email address
75
+ # config.email_regexp = /^([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})$/i
76
+
77
+ # ==> Configuration for :timeoutable
78
+ # The time you want to timeout the user session without activity. After this
79
+ # time the user will be asked for credentials again.
80
+ # config.timeout_in = 10.minutes
81
+
82
+ # ==> Configuration for :lockable
83
+ # Defines which strategy will be used to lock an account.
84
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
85
+ # :none = No lock strategy. You should handle locking by yourself.
86
+ # config.lock_strategy = :failed_attempts
87
+
88
+ # Defines which strategy will be used to unlock an account.
89
+ # :email = Sends an unlock link to the user email
90
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
91
+ # :both = Enables both strategies
92
+ # :none = No unlock strategy. You should handle unlocking by yourself.
93
+ # config.unlock_strategy = :both
94
+
95
+ # Number of authentication tries before locking an account if lock_strategy
96
+ # is failed attempts.
97
+ # config.maximum_attempts = 20
98
+
99
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
100
+ # config.unlock_in = 1.hour
101
+
102
+ # ==> Configuration for :token_authenticatable
103
+ # Defines name of the authentication token params key
104
+ # config.token_authentication_key = :auth_token
105
+
106
+ # ==> Scopes configuration
107
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
108
+ # "users/sessions/new". It's turned off by default because it's slower if you
109
+ # are using only default views.
110
+ # config.scoped_views = true
111
+
112
+ # Configure the default scope given to Warden. By default it's the first
113
+ # devise role declared in your routes.
114
+ # config.default_scope = :user
115
+
116
+ # Configure sign_out behavior.
117
+ # By default sign_out is scoped (i.e. /users/sign_out affects only :user scope).
118
+ # In case of sign_out_all_scopes set to true any logout action will sign out all active scopes.
119
+ # config.sign_out_all_scopes = false
120
+
121
+ # ==> Navigation configuration
122
+ # Lists the formats that should be treated as navigational. Formats like
123
+ # :html, should redirect to the sign in page when the user does not have
124
+ # access, but formats like :xml or :json, should return 401.
125
+ # If you have any extra navigational formats, like :iphone or :mobile, you
126
+ # should add them to the navigational formats lists. Default is [:html]
127
+ # config.navigational_formats = [:html, :iphone]
128
+
129
+ # ==> Warden configuration
130
+ # If you want to use other strategies, that are not (yet) supported by Devise,
131
+ # you can configure them inside the config.warden block. The example below
132
+ # allows you to setup OAuth, using http://github.com/roman/warden_oauth
133
+ #
134
+ # config.warden do |manager|
135
+ # manager.oauth(:twitter) do |twitter|
136
+ # twitter.consumer_secret = <YOUR CONSUMER SECRET>
137
+ # twitter.consumer_key = <YOUR CONSUMER KEY>
138
+ # twitter.options :site => 'http://twitter.com'
139
+ # end
140
+ # manager.default_strategies(:scope => :user).unshift :twitter_oauth
141
+ # end
142
+ end
@@ -0,0 +1,10 @@
1
+ #I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Memoize)
2
+ I18n::Backend::ActiveRecord.send(:include, I18n::Backend::Flatten)
3
+ I18n::Backend::Simple.send(:include, I18n::Backend::Memoize)
4
+ I18n::Backend::Simple.send(:include, I18n::Backend::Pluralization)
5
+
6
+ I18n::Backend::ActiveRecord.send(:include, I18n::Backend::ActiveRecord::Missing)
7
+
8
+ I18n.backend = I18n::Backend::Chain.new(I18n::Backend::Simple.new, I18n::Backend::ActiveRecord.new)
9
+
10
+ I18n.available_locales = ['fr']
@@ -0,0 +1,13 @@
1
+ class RolesUsers < ActiveRecord::Migration
2
+ def self.up
3
+ create_table :roles_users, :id => false, :force => true do |t|
4
+ t.references :user
5
+ t.references :role
6
+ t.timestamps
7
+ end
8
+ end
9
+
10
+ def self.down
11
+ drop_table :roles_users
12
+ end
13
+ end
@@ -0,0 +1,11 @@
1
+
2
+
3
+ module Merrycms
4
+ class ViewsGenerator < Rails::Generators::Base
5
+
6
+ def copy_views
7
+ puts "TODO ..."
8
+ end
9
+
10
+ end
11
+ end
@@ -0,0 +1,38 @@
1
+ require 'merrycms'
2
+ require 'rails'
3
+ require 'devise'
4
+ require 'acl9'
5
+ require 'transitions'
6
+ require 'active_record/transitions'
7
+ require 'RedCloth'
8
+ require 'friendly_id'
9
+ require 'nested_set'
10
+ require 'i18n/active_record'
11
+ require 'merrycms/rails/routes'
12
+ require 'kaminari'
13
+ require 'meta_search'
14
+
15
+ module Merrycms
16
+ class Engine < Rails::Engine
17
+
18
+ # I18n config
19
+ #config.i18n.load_path += Dir[Rails.root.join('config', 'locales', '*', '*.{rb,yml}').to_s]
20
+ config.i18n.load_path += Dir[File.join(File.dirname(__FILE__), '../../config/locales/*/admin/*.{rb,yml}')]
21
+ config.i18n.default_locale = :fr
22
+
23
+ # JavaScript files you want as :defaults (application.js is always included).
24
+ config.action_view.javascript_expansions[:defaults] = %w(jquery jquery-ui.min rails)
25
+
26
+ config.to_prepare {
27
+ Devise::SessionsController.layout "login"
28
+ Devise::PasswordsController.layout "login"
29
+ Devise::UnlocksController.layout "login"
30
+ Devise::RegistrationsController.layout "login"
31
+ }
32
+
33
+ rake_tasks do
34
+ load "merrycms/railties/merrycms_tasks.rake"
35
+ end
36
+
37
+ end
38
+ end