locomotive_cms 0.0.4 → 1.0.0.beta
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +15 -13
- data/README.textile +5 -4
- data/app/controllers/admin/api_contents_controller.rb +10 -1
- data/app/controllers/admin/base_controller.rb +2 -2
- data/app/controllers/admin/cross_domain_sessions_controller.rb +7 -4
- data/app/controllers/admin/current_sites_controller.rb +2 -0
- data/app/controllers/admin/imports_controller.rb +13 -19
- data/app/controllers/admin/installation_controller.rb +79 -0
- data/app/controllers/admin/pages_controller.rb +1 -1
- data/app/controllers/admin/passwords_controller.rb +2 -2
- data/app/controllers/admin/sessions_controller.rb +2 -2
- data/app/controllers/admin/sites_controller.rb +2 -0
- data/app/controllers/admin/theme_assets_controller.rb +1 -1
- data/app/controllers/application_controller.rb +1 -1
- data/app/helpers/admin/assets_helper.rb +0 -6
- data/app/helpers/admin/{login_helper.rb → box_helper.rb} +7 -3
- data/app/helpers/admin/custom_fields_helper.rb +2 -2
- data/app/models/asset_collection.rb +15 -3
- data/app/models/content_instance.rb +19 -0
- data/app/models/content_type.rb +21 -3
- data/app/models/extensions/page/tree.rb +63 -7
- data/app/models/page.rb +2 -0
- data/app/models/site.rb +15 -3
- data/app/uploaders/asset_uploader.rb +1 -1
- data/app/uploaders/theme_asset_uploader.rb +12 -1
- data/app/uploaders/theme_uploader.rb +19 -0
- data/app/views/admin/asset_collections/edit.html.haml +2 -2
- data/app/views/admin/asset_collections/new.html.haml +1 -1
- data/app/views/admin/assets/_form.html.haml +2 -2
- data/app/views/admin/content_types/_form.html.haml +2 -2
- data/app/views/admin/content_types/new.html.haml +1 -1
- data/app/views/admin/contents/_form.html.haml +2 -2
- data/app/views/admin/contents/index.html.haml +1 -1
- data/app/views/admin/cross_domain_sessions/new.html.haml +1 -1
- data/app/views/admin/current_sites/_form.html.haml +3 -3
- data/app/views/admin/current_sites/edit.html.haml +1 -1
- data/app/views/admin/errors/no_page.html.haml +1 -0
- data/app/views/admin/errors/no_site.html.haml +1 -0
- data/app/views/admin/imports/new.html.haml +11 -0
- data/app/views/admin/imports/show.html.haml +1 -1
- data/app/views/admin/installation/step_1.html.haml +24 -0
- data/app/views/admin/installation/step_2.html.haml +26 -0
- data/app/views/admin/installation/step_3.html.haml +23 -0
- data/app/views/{layouts/admin → admin/layouts}/application.html.haml +0 -0
- data/app/views/admin/layouts/box.html.haml +21 -0
- data/app/views/admin/layouts/error.html.haml +1 -0
- data/app/views/admin/my_accounts/edit.html.haml +1 -1
- data/app/views/admin/pages/_form.html.haml +2 -3
- data/app/views/admin/pages/_page.html.haml +4 -2
- data/app/views/admin/pages/index.html.haml +1 -1
- data/app/views/admin/passwords/edit.html.haml +2 -2
- data/app/views/admin/passwords/new.html.haml +2 -2
- data/app/views/admin/sessions/new.html.haml +2 -2
- data/app/views/admin/shared/_head.html.haml +4 -5
- data/app/views/admin/shared/menu/_contents.html.haml +1 -1
- data/app/views/admin/sites/_form.html.haml +3 -3
- data/app/views/admin/snippets/_form.html.haml +2 -2
- data/app/views/admin/theme_assets/_form.html.haml +2 -2
- data/app/views/admin/theme_assets/index.html.haml +1 -1
- data/config/application.rb +1 -3
- data/config/assets.yml +96 -0
- data/config/environments/development.rb +1 -6
- data/config/environments/production.rb +1 -1
- data/config/environments/test.rb +1 -5
- data/config/initializers/carrierwave.rb +17 -0
- data/config/initializers/locomotive.rb +14 -0
- data/config/locales/admin_ui_en.yml +33 -1
- data/config/locales/admin_ui_fr.yml +34 -1
- data/config/locales/default_en.yml +1 -0
- data/config/locales/default_fr.yml +1 -0
- data/config/locales/flash.en.yml +1 -0
- data/config/locales/flash.fr.yml +1 -0
- data/config/mongoid.yml +13 -5
- data/config/routes.rb +6 -1
- data/lib/generators/locomotive/install/install_generator.rb +18 -10
- data/lib/generators/locomotive/install/templates/README +23 -13
- data/lib/generators/locomotive/install/templates/locomotive.rb +15 -1
- data/lib/locomotive/carrierwave.rb +1 -0
- data/lib/locomotive/configuration.rb +3 -1
- data/lib/locomotive/custom_fields.rb +0 -1
- data/lib/locomotive/delayed_job.rb +1 -2
- data/lib/locomotive/engine.rb +24 -7
- data/lib/locomotive/heroku.rb +1 -0
- data/lib/locomotive/httparty/webservice.rb +12 -1
- data/lib/locomotive/import.rb +2 -0
- data/lib/locomotive/import/asset_collections.rb +40 -8
- data/lib/locomotive/import/assets.rb +20 -12
- data/lib/locomotive/import/base.rb +46 -0
- data/lib/locomotive/import/content_types.rb +51 -15
- data/lib/locomotive/import/job.rb +106 -11
- data/lib/locomotive/import/logger.rb +13 -0
- data/lib/locomotive/import/pages.rb +79 -26
- data/lib/locomotive/import/site.rb +3 -5
- data/lib/locomotive/import/snippets.rb +6 -8
- data/lib/locomotive/inherited_resources.rb +1 -0
- data/lib/locomotive/liquid/drops/asset_collections.rb +4 -4
- data/lib/locomotive/liquid/drops/contents.rb +21 -16
- data/lib/locomotive/liquid/drops/page.rb +4 -0
- data/lib/locomotive/liquid/filters/html.rb +15 -29
- data/lib/locomotive/liquid/tags/consume.rb +1 -1
- data/lib/locomotive/liquid/tags/nav.rb +48 -17
- data/lib/locomotive/liquid/tags/paginate.rb +3 -3
- data/lib/locomotive/middlewares/fonts.rb +3 -11
- data/lib/locomotive/misc_form_builder.rb +2 -7
- data/lib/locomotive/railties/tasks.rake +16 -0
- data/lib/locomotive/regexps.rb +1 -1
- data/lib/locomotive/render.rb +9 -3
- data/lib/locomotive/routing/site_dispatcher.rb +10 -6
- data/lib/locomotive/version.rb +1 -1
- data/public/images/admin/box/buttons/right_bg.png +0 -0
- data/public/javascripts/admin/aloha/VERSION.txt +1 -1
- data/public/javascripts/admin/aloha/aloha-nodeps.js +140 -101
- data/public/javascripts/admin/aloha/aloha.js +193 -105
- data/public/javascripts/admin/aloha/css/aloha.css +65 -4
- data/public/javascripts/admin/aloha/deps/prettyPhoto/resources/css/prettyPhoto.css +2 -2
- data/public/javascripts/admin/aloha/i18n/de.dict +2 -0
- data/public/javascripts/admin/aloha/i18n/en.dict +2 -0
- data/public/javascripts/admin/aloha/i18n/pl.dict +5 -0
- data/public/javascripts/admin/aloha/images/base.png +0 -0
- data/public/javascripts/admin/aloha/images/base_big.png +0 -0
- data/public/javascripts/admin/aloha/images/base_multi.png +0 -0
- data/public/javascripts/admin/aloha/images/fade_in.png +0 -0
- data/public/javascripts/admin/aloha/images/fade_out.png +0 -0
- data/public/javascripts/admin/aloha/images/gentics_logo.png +0 -0
- data/public/javascripts/admin/aloha/images/grabhandle.png +0 -0
- data/public/javascripts/admin/aloha/images/maximize.png +0 -0
- data/public/javascripts/admin/aloha/images/pin.png +0 -0
- data/public/javascripts/admin/aloha/images/removeformat.png +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.css +86 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/examples/triSports.html +44 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/de.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/en.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/i18n/fr.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/plugin.js +1 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/product.js +1 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/2xu-wetsuit.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/asics-noosa.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/fivefingers-kso.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/kuota-kueen-k.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/mizuno-wave-musha2.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product.css +69 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/product_button.gif +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/simplon-mrt.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trek-fuel-ex.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/trisports.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.plugins.Product/resources/zoggs-predator.jpg +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/i18n/de.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/i18n/en.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/i18n/fi.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/i18n/fr.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/i18n/it.dict +0 -0
- data/public/javascripts/admin/aloha/plugins/{com.example.aloha.DummySave → com.example.aloha.plugins.Save}/plugin.js +0 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.css +48 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/examples/AlohaAbbr.html +69 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/de.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/i18n/en.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Abbr/plugin.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/i18n/pl.dict +30 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Format/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.HighlightEditables/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/LinkList.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/delicious.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/i18n/pl.dict +4 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/css/LinkChecker.css +14 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.css +49 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/examples/AlohaLinkChecker.html +82 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/i18n/en.dict +27 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/plugin.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.LinkChecker/proxy.php +235 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.List/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/plugin.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Paste/wordpastehandler.js +7 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/de.dict +1 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/i18n/en.dict +1 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.TOC/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/de.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/en.dict +2 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/i18n/pl.dict +12 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/plugin.js +1 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/table.css +28 -110
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_green.png +0 -0
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Table/resources/wai_red.png +0 -0
- data/public/javascripts/admin/asset_collections.js +11 -7
- data/public/javascripts/admin/contents.js +3 -1
- data/public/javascripts/admin/site.js +9 -3
- data/public/javascripts/admin/snippets.js +1 -1
- data/public/javascripts/admin/utils.js +5 -3
- data/public/stylesheets/admin/application.css +1 -1
- data/public/stylesheets/admin/box.css +5 -5
- data/public/stylesheets/admin/buttons.css +0 -5
- data/public/stylesheets/admin/formtastic_changes.css +5 -12
- data/public/stylesheets/admin/inline_editor.css +22 -5
- data/public/stylesheets/admin/installation.css +50 -0
- data/public/stylesheets/admin/layout.css +9 -4
- data/public/stylesheets/admin/safari.css +15 -0
- metadata +188 -131
- data/app/controllers/home_controller.rb +0 -7
- data/app/views/admin/snippets/index.html.haml +0 -15
- data/app/views/home/show.html.haml +0 -4
- data/app/views/layouts/admin/box.html.haml +0 -19
- data/app/views/layouts/application.html.haml +0 -7
- data/lib/generators/locomotive/copy_assets/copy_assets_generator.rb +0 -14
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/de.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/en.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/eo.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fi.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/fr.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/i18n/it.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/com.example.aloha.DummyDC/plugin.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/de.dict +0 -20
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/en.dict +0 -20
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/eo.dict +0 -16
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fi.dict +0 -20
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/fr.dict +0 -16
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/i18n/it.dict +0 -20
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.GCN/plugin.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/css/jquery.autocomplete.css +0 -48
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/deps/jquery.autocomplete.js +0 -1
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressource.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourcedummy.js +0 -7
- data/public/javascripts/admin/aloha/plugins/com.gentics.aloha.plugins.Link/ressourceregistry.js +0 -7
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Loader/plugin.js +0 -1
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/en.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fi.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/i18n/fr.dict +0 -2
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/person.css +0 -3
- data/public/javascripts/admin/aloha/plugins/eu.iksproject.plugins.Person/plugin.js +0 -1
- data/public/javascripts/admin/aloha/plugins/simpletable/plugin.js.deactivated +0 -2330
@@ -174,7 +174,7 @@ fr:
|
|
174
174
|
help: "Vous avez le choix de soit uploader n'importe quel fichier ou bien soit de copier/coller du code css ou javascript."
|
175
175
|
edit:
|
176
176
|
title: "Edition %{file}"
|
177
|
-
help: "
|
177
|
+
help: "L'url du fichier est <a href='%{url}'>%{url}</a>"
|
178
178
|
form:
|
179
179
|
choose_file: Choisir fichier
|
180
180
|
choose_plain_text: Passer en mode texte
|
@@ -219,6 +219,7 @@ fr:
|
|
219
219
|
new_item: nouvel élément
|
220
220
|
form:
|
221
221
|
order_by:
|
222
|
+
created_at: 'Par date création'
|
222
223
|
updated_at: 'Par date de mise à jour'
|
223
224
|
position_in_list: Manuellement
|
224
225
|
|
@@ -265,6 +266,34 @@ fr:
|
|
265
266
|
success: "Votre site a été mis à jour avec succès."
|
266
267
|
failure: "L'import n'a pas fonctionné."
|
267
268
|
|
269
|
+
installation:
|
270
|
+
common:
|
271
|
+
title: Première installation de Locomotive
|
272
|
+
next: Suivant
|
273
|
+
step_1:
|
274
|
+
title: "Étape 1/3"
|
275
|
+
explanations: "Voici la première étape de l'installation de Locomotive. Veuillez lire attentivement ce qui est écrit ci-dessous."
|
276
|
+
database:
|
277
|
+
label: "Nom base de données: <em>%{name}</em>"
|
278
|
+
notes: "Les paramètres de la connection à MongoDB se trouvent dans le fichier <b>config/mongoid.yml</b> de votre application."
|
279
|
+
default_domain:
|
280
|
+
label: "Nom du domaine par défaut: <em>%{name}</em>"
|
281
|
+
notes:
|
282
|
+
"Locomotive est une plate-forme multi-sites. Chaque instance de site a une entrée par défaut appelée aussi sous-domaine et qui est aussi fonction du nom de domaine par défaut. Evidemment, vous êtes libres d'associer d'autres noms de domaines, sortes d'alias.
|
283
|
+
<br/>La valeur du nom de domaine par défaut se trouve dans le fichier <b>config/initializers/locomotive.rb</b>."
|
284
|
+
step_2:
|
285
|
+
title: "Étape 2/3 — Créer un compte"
|
286
|
+
name: Nom du compte
|
287
|
+
email: E-mail
|
288
|
+
password: Mot de passe
|
289
|
+
password_confirmation: Confirmation mot de passe
|
290
|
+
done: "Vous avez déjà ajouté un compte:<br/><strong>%{name}</strong>, <em>%{email}</em>"
|
291
|
+
next: Créer compte
|
292
|
+
step_3:
|
293
|
+
title: "Étape 3/3 — Créer premier site"
|
294
|
+
explanations: "C'est la dernière étape de l'installation. Vous pouvez uploader un theme sous forme d'un fichier zip. Nous avons quelques themes disponibles <a href=\"http://www.locomotivecms.com/support/themes\">ici</a>."
|
295
|
+
next: Créer site
|
296
|
+
|
268
297
|
formtastic:
|
269
298
|
titles:
|
270
299
|
information: Informations générales
|
@@ -297,6 +326,8 @@ fr:
|
|
297
326
|
import:
|
298
327
|
new:
|
299
328
|
source: Fichier
|
329
|
+
samples: Copier contenu
|
330
|
+
reset: Remettre à zéro
|
300
331
|
|
301
332
|
hints:
|
302
333
|
page:
|
@@ -319,3 +350,5 @@ fr:
|
|
319
350
|
hint: "Texte affiché dans le formulaire de l'élément juste en dessous du champ."
|
320
351
|
import:
|
321
352
|
source: "Un fichier zip contenant database.yml, les fichiers du thème et les templates de page"
|
353
|
+
samples: "Si activé, les contenus et les média seront aussi copiés lors de l'import"
|
354
|
+
reset: "Si activé, toutes les données de votre site seront détruites avant l'import du nouveau site"
|
@@ -13,6 +13,7 @@ en:
|
|
13
13
|
array_too_short: "is too small (minimum element number is %{count})"
|
14
14
|
liquid_syntax: "Liquid Syntax error, please check the syntax"
|
15
15
|
liquid_extend: "The page extends a template which does not exist"
|
16
|
+
invalid_theme_file: "can't be blank or isn't a zip file"
|
16
17
|
|
17
18
|
attributes:
|
18
19
|
defaults:
|
@@ -34,6 +34,7 @@ fr:
|
|
34
34
|
array_too_short: "est trop petit (le nombre minimum d'éléments est %{count})"
|
35
35
|
liquid_syntax: "Erreur de syntaxe dans les sections de page, veuillez vérifier la syntaxe"
|
36
36
|
liquid_extend: "La page étend le contenu d'une page qui n'existe pas"
|
37
|
+
invalid_theme_file: "doit être rempli ou n'est pas un fichier zip"
|
37
38
|
|
38
39
|
attributes:
|
39
40
|
defaults:
|
data/config/locales/flash.en.yml
CHANGED
data/config/locales/flash.fr.yml
CHANGED
data/config/mongoid.yml
CHANGED
@@ -17,8 +17,16 @@ test:
|
|
17
17
|
# set these environment variables on your prod server
|
18
18
|
production:
|
19
19
|
<<: *defaults
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
20
|
+
database: locomotive_prod
|
21
|
+
|
22
|
+
# other settings for production
|
23
|
+
|
24
|
+
# host: <%= ENV['MONGOID_HOST'] %>
|
25
|
+
# port: <%= ENV['MONGOID_PORT'] %>
|
26
|
+
# username: <%= ENV['MONGOID_USERNAME'] %>
|
27
|
+
# password: <%= ENV['MONGOID_PASSWORD'] %>
|
28
|
+
# database: <%= ENV['MONGOID_DATABASE'] %>
|
29
|
+
|
30
|
+
# heroku
|
31
|
+
# uri: <%= ENV['MONGOHQ_URL'] %>
|
32
|
+
|
data/config/routes.rb
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
Rails.application.routes.draw do
|
3
3
|
|
4
4
|
constraints(Locomotive::Routing::DefaultConstraint) do
|
5
|
-
root :to => '
|
5
|
+
root :to => 'admin/sessions#new'
|
6
6
|
end
|
7
7
|
|
8
8
|
# admin authentication
|
@@ -52,6 +52,11 @@ Rails.application.routes.draw do
|
|
52
52
|
resources :cross_domain_sessions, :only => [:new, :create]
|
53
53
|
|
54
54
|
resource :import, :only => [:new, :show, :create]
|
55
|
+
|
56
|
+
# installation guide
|
57
|
+
match '/installation' => 'installation#show', :defaults => { :step => 1 }, :as => :installation
|
58
|
+
match '/installation/:step' => 'installation#show', :as => :installation_step
|
59
|
+
|
55
60
|
end
|
56
61
|
|
57
62
|
# sitemap
|
@@ -1,21 +1,29 @@
|
|
1
1
|
module Locomotive
|
2
2
|
class InstallGenerator < Rails::Generators::Base
|
3
3
|
|
4
|
-
|
5
|
-
|
4
|
+
source_root File.expand_path('../../../../../', __FILE__)
|
5
|
+
|
6
|
+
def copy_mongoid_config
|
7
|
+
copy_file 'config/mongoid.yml', 'config/mongoid.yml'
|
8
|
+
end
|
9
|
+
|
10
|
+
def copy_assets
|
11
|
+
directory 'public', 'public', :recursive => true
|
12
|
+
copy_file 'config/assets.yml', 'config/assets.yml'
|
6
13
|
end
|
7
14
|
|
8
|
-
def
|
15
|
+
def copy_initializers
|
16
|
+
copy_file 'config/initializers/carrierwave.rb', 'config/initializers/carrierwave.rb'
|
17
|
+
|
18
|
+
@source_paths = nil # reset it for the find_in_source_paths method
|
19
|
+
|
20
|
+
Locomotive::InstallGenerator.source_root(File.expand_path('../templates', __FILE__))
|
21
|
+
|
9
22
|
template 'locomotive.rb', 'config/initializers/locomotive.rb'
|
10
23
|
end
|
11
24
|
|
12
|
-
def
|
13
|
-
|
14
|
-
# Uncomment the following lines if you want to create the first website / account
|
15
|
-
#account = Account.create! :name => 'Admin', :email => 'admin@example.com', :password => 'locomotive', :password_confirmation => 'locomotive'
|
16
|
-
#site = Site.new :name => 'Locomotive test website', :subdomain => 'test'
|
17
|
-
#site.memberships.build :account => account, :admin => true
|
18
|
-
#site.save!}
|
25
|
+
def remove_index_html
|
26
|
+
remove_file 'public/index.html'
|
19
27
|
end
|
20
28
|
|
21
29
|
def show_readme
|
@@ -1,17 +1,27 @@
|
|
1
1
|
===============================================================================
|
2
2
|
|
3
|
-
Locomotive
|
4
|
-
|
5
|
-
1.
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
3
|
+
The Locomotive Engine has been correctly installed in your Rails application.
|
4
|
+
|
5
|
+
1. Edit the main config files:
|
6
|
+
|
7
|
+
- config/initializers/locomotive.rb
|
8
|
+
- config/initializers/carrierwave.rb
|
9
|
+
- config/mongoid.yml
|
10
|
+
|
11
|
+
2. Launch the server
|
12
|
+
|
13
|
+
> unicorn_rails
|
14
|
+
|
15
|
+
3. Open your browser
|
16
|
+
|
17
|
+
> open localhost:8080
|
18
|
+
|
19
|
+
4. Follow the installation wizzard steps
|
20
|
+
|
21
|
+
5. Enjoy !
|
22
|
+
|
23
|
+
Note: If you want to use DelayedJob, be sure to launch it:
|
24
|
+
|
25
|
+
> rake jobs:work
|
16
26
|
|
17
27
|
===============================================================================
|
@@ -2,7 +2,13 @@ Locomotive.configure do |config|
|
|
2
2
|
# if not defined, locomotive will use example.com as main domain name. Remove prefix www from your domain name.
|
3
3
|
# Ex:
|
4
4
|
# config.default_domain = Rails.env.production? ? 'mydomain.com' : 'example.com'
|
5
|
-
|
5
|
+
#
|
6
|
+
# If you use locomotive for a single site in Heroku, use "heroku.com" as default domain name.
|
7
|
+
# Your heroku app name (<app_name>.heroku.name) will be used as the sub domain name in Locomotive
|
8
|
+
# during the installation wizzard.
|
9
|
+
# Ex:
|
10
|
+
# config.default_domain = Rails.env.production? ? 'heroku.com' : 'example.com'
|
11
|
+
config.default_domain = 'example.com'
|
6
12
|
|
7
13
|
# configure how many items we display in sub menu in the "Contents" section.
|
8
14
|
config.lastest_items_nb = 5
|
@@ -23,4 +29,12 @@ Locomotive.configure do |config|
|
|
23
29
|
# Ex:
|
24
30
|
# config.heroku = { :name => '<my heroku app name>', :login => 'john@doe.net', :password => 'easy' }
|
25
31
|
config.heroku = false
|
32
|
+
|
33
|
+
# Locomotive uses the DelayedJob gem for the theme import module.
|
34
|
+
# In case you want to deploy to Heroku, you will have to pay for an extra dyno.
|
35
|
+
# If you do not mind about importing theme without DelayedJob, disable it.
|
36
|
+
config.delayed_job = false
|
37
|
+
|
38
|
+
# default locale (for now, only en and fr are supported)
|
39
|
+
config.default_locale = :en
|
26
40
|
end
|
data/lib/locomotive/engine.rb
CHANGED
@@ -1,20 +1,37 @@
|
|
1
|
-
puts "...Locomotive engine
|
1
|
+
puts "...loading Locomotive engine"
|
2
2
|
|
3
|
-
require '
|
4
|
-
require 'liquid'
|
3
|
+
require 'rails'
|
5
4
|
require 'devise'
|
6
|
-
require 'carrierwave'
|
7
|
-
require 'formtastic'
|
8
5
|
require 'mongoid'
|
9
6
|
require 'mongoid_acts_as_tree'
|
7
|
+
require 'will_paginate'
|
8
|
+
require 'haml'
|
9
|
+
require 'liquid'
|
10
|
+
require 'formtastic'
|
11
|
+
require 'inherited_resources'
|
12
|
+
require 'carrierwave'
|
13
|
+
require 'custom_fields'
|
14
|
+
require 'mimetype_fu'
|
15
|
+
require 'actionmailer_with_request'
|
16
|
+
require 'heroku'
|
10
17
|
require 'httparty'
|
11
18
|
require 'redcloth'
|
12
|
-
require '
|
19
|
+
require 'delayed_job_mongoid'
|
13
20
|
require 'zip/zipfilesystem'
|
14
|
-
require '
|
21
|
+
require 'jammit-s3'
|
22
|
+
|
23
|
+
$:.unshift File.dirname(__FILE__)
|
15
24
|
|
16
25
|
module Locomotive
|
17
26
|
class Engine < Rails::Engine
|
18
27
|
|
28
|
+
rake_tasks do
|
29
|
+
load "railties/tasks.rake"
|
30
|
+
end
|
31
|
+
|
32
|
+
initializer "serving fonts" do |app|
|
33
|
+
app.middleware.insert_after Rack::Lock, '::Locomotive::Middlewares::Fonts', :path => %r{^/fonts}
|
34
|
+
end
|
35
|
+
|
19
36
|
end
|
20
37
|
end
|
data/lib/locomotive/heroku.rb
CHANGED
@@ -17,7 +17,18 @@ module Locomotive
|
|
17
17
|
|
18
18
|
# puts "[WebService] consuming #{path}, #{options.inspect}"
|
19
19
|
|
20
|
-
self.get(path, options)
|
20
|
+
response = self.get(path, options)
|
21
|
+
|
22
|
+
if response.code == 200
|
23
|
+
if response.respond_to?(:underscore_keys)
|
24
|
+
response.underscore_keys
|
25
|
+
else
|
26
|
+
response.collect(&:underscore_keys)
|
27
|
+
end
|
28
|
+
else
|
29
|
+
nil
|
30
|
+
end
|
31
|
+
|
21
32
|
end
|
22
33
|
|
23
34
|
end
|
data/lib/locomotive/import.rb
CHANGED
@@ -1,30 +1,34 @@
|
|
1
1
|
module Locomotive
|
2
2
|
module Import
|
3
|
-
|
4
|
-
|
5
|
-
def self.process(context)
|
6
|
-
site, database = context[:site], context[:database]
|
3
|
+
class AssetCollections < Base
|
7
4
|
|
5
|
+
def process
|
8
6
|
asset_collections = database['site']['asset_collections']
|
9
7
|
|
10
8
|
return if asset_collections.nil?
|
11
9
|
|
12
10
|
asset_collections.each do |name, attributes|
|
13
|
-
|
11
|
+
self.log "slug = #{attributes['slug']}"
|
14
12
|
|
15
13
|
asset_collection = site.asset_collections.where(:slug => attributes['slug']).first
|
16
14
|
|
17
|
-
asset_collection ||= self.build_asset_collection(
|
15
|
+
asset_collection ||= self.build_asset_collection(attributes.merge(:name => name))
|
18
16
|
|
19
17
|
self.add_or_update_fields(asset_collection, attributes['fields'])
|
20
18
|
|
19
|
+
if options[:samples] && attributes['assets']
|
20
|
+
self.insert_samples(asset_collection, attributes['assets'])
|
21
|
+
end
|
22
|
+
|
21
23
|
asset_collection.save!
|
22
24
|
|
23
25
|
site.reload
|
24
26
|
end
|
25
27
|
end
|
26
28
|
|
27
|
-
|
29
|
+
protected
|
30
|
+
|
31
|
+
def build_asset_collection(data)
|
28
32
|
attributes = { :internal => false }.merge(data)
|
29
33
|
|
30
34
|
attributes.delete_if { |name, value| %w{fields assets}.include?(name) }
|
@@ -32,7 +36,7 @@ module Locomotive
|
|
32
36
|
site.asset_collections.build(attributes)
|
33
37
|
end
|
34
38
|
|
35
|
-
def
|
39
|
+
def add_or_update_fields(asset_collection, fields)
|
36
40
|
fields.each_with_index do |data, position|
|
37
41
|
name, data = data.keys.first, data.values.first
|
38
42
|
|
@@ -48,6 +52,34 @@ module Locomotive
|
|
48
52
|
end
|
49
53
|
end
|
50
54
|
|
55
|
+
def insert_samples(asset_collection, assets)
|
56
|
+
assets.each_with_index do |data, position|
|
57
|
+
value, attributes = data.is_a?(Array) ? [data.first, data.last] : [data.keys.first, data.values.first]
|
58
|
+
|
59
|
+
url = attributes.delete('url')
|
60
|
+
|
61
|
+
# build with default attributes
|
62
|
+
asset = asset_collection.assets.build(:name => value, :position => position, :source => self.open_sample_asset(url))
|
63
|
+
|
64
|
+
attributes.each do |name, value|
|
65
|
+
field = asset_collection.asset_custom_fields.detect { |f| f._alias == name }
|
66
|
+
|
67
|
+
value = (case field.kind.downcase
|
68
|
+
when 'file' then self.open_sample_asset(value)
|
69
|
+
when 'boolean' then Boolean.set(value)
|
70
|
+
else
|
71
|
+
value
|
72
|
+
end)
|
73
|
+
|
74
|
+
asset.send("#{name}=", value)
|
75
|
+
end
|
76
|
+
|
77
|
+
asset.save
|
78
|
+
|
79
|
+
self.log "insert asset '#{asset.name}'"
|
80
|
+
end
|
81
|
+
end
|
82
|
+
|
51
83
|
end
|
52
84
|
end
|
53
85
|
end
|