From 4d2950048328797e3dfc59e957a356bd0e92f6ec Mon Sep 17 00:00:00 2001 From: did Date: Tue, 21 Jun 2011 14:53:21 -0700 Subject: [PATCH] new version of custom_fields + allow users to change the permalink of the custom model instances --- Gemfile | 2 +- Gemfile.lock | 4 ++-- app/views/admin/contents/_form.html.haml | 7 ++++--- config/locales/formtastic.en.yml | 4 ++++ config/locales/formtastic.fr.yml | 4 ++++ doc/TODO | 3 ++- locomotive_cms.gemspec | 2 +- 7 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Gemfile b/Gemfile index 89a67bb0..fd65e34c 100644 --- a/Gemfile +++ b/Gemfile @@ -25,7 +25,7 @@ gem 'locomotive_carrierwave', '0.5.4.beta2' gem 'dragonfly', '~> 0.9.1' gem 'rack-cache', :require => 'rack/cache' -gem 'custom_fields', '1.0.0.beta.17' +gem 'custom_fields', '1.0.0.beta.19' gem 'fog', '0.8.2' gem 'mimetype-fu' gem 'actionmailer-with-request', :require => 'actionmailer_with_request' diff --git a/Gemfile.lock b/Gemfile.lock index 61c715af..8cfc20ce 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -86,7 +86,7 @@ GEM cucumber-rails (0.3.2) cucumber (>= 0.8.0) culerity (0.2.15) - custom_fields (1.0.0.beta.17) + custom_fields (1.0.0.beta.19) activesupport (>= 3.0.7) mongoid (= 2.0.2) daemons (1.1.4) @@ -283,7 +283,7 @@ DEPENDENCIES capybara cucumber (= 0.8.5) cucumber-rails - custom_fields (= 1.0.0.beta.17) + custom_fields (= 1.0.0.beta.19) database_cleaner delayed_job (= 2.1.4) delayed_job_mongoid (= 1.0.2) diff --git a/app/views/admin/contents/_form.html.haml b/app/views/admin/contents/_form.html.haml index 745b8129..17e2de64 100644 --- a/app/views/admin/contents/_form.html.haml +++ b/app/views/admin/contents/_form.html.haml @@ -2,9 +2,10 @@ = include_javascripts :edit_custom_fields, :contents = include_stylesheets :fancybox -= f.foldable_inputs :name => :meta do += render 'admin/custom_fields/custom_form', :form => f, :title => :attributes, :parent => @content_type += f.foldable_inputs :name => :advanced_options do + + = f.input :_slug = f.input :meta_keywords = f.input :meta_description - -= render 'admin/custom_fields/custom_form', :form => f, :title => :attributes, :parent => @content_type \ No newline at end of file diff --git a/config/locales/formtastic.en.yml b/config/locales/formtastic.en.yml index 8dafb198..b916087d 100644 --- a/config/locales/formtastic.en.yml +++ b/config/locales/formtastic.en.yml @@ -40,6 +40,8 @@ en: content_type: raw_item_template: Item template api_accounts: Notified Accounts + content_instance: + _slug: Permalink account: edit: password: New password @@ -74,6 +76,8 @@ en: field: _alias: "Property available in liquid templates" hint: "Text displayed in the model form just below the field" + content_instance: + _slug: "Property used to generate the url of a page working as a template for this content type (ex: \"template_page/{{ your_object._permalink }})\"." import: source: "A zipfile containing a database.yml along with assets and templates" samples: "If enabled, the import process will also copy contents and assets" diff --git a/config/locales/formtastic.fr.yml b/config/locales/formtastic.fr.yml index c57acd0c..d6ea2c08 100644 --- a/config/locales/formtastic.fr.yml +++ b/config/locales/formtastic.fr.yml @@ -42,6 +42,8 @@ fr: content_type: raw_item_template: Template d'affichage api_accounts: Comptes à notifier + content_instance: + _slug: Permalink account: edit: password: Nouveau mot de passe @@ -76,6 +78,8 @@ fr: field: _alias: "Champ utilisable dans les templates liquid" hint: "Texte affiché dans le formulaire de l'élément juste en dessous du champ." + content_instance: + _slug: "Propriété utilisée pour générer l'url d'une page faisant office de template pour ce modèle (ex: \"template_de_la_page/{{ votre_object._permalink }})\"." import: source: "Un fichier zip contenant database.yml, les fichiers du thème et les templates de page" samples: "Si activé, les contenus et les média seront aussi copiés lors de l'import" diff --git a/doc/TODO b/doc/TODO index 61240b17..ba8f8aba 100644 --- a/doc/TODO +++ b/doc/TODO @@ -17,9 +17,10 @@ x remove asset_collections x pick up a theme_asset x pull request locomedia x refactor slugify method (use parameterize + create a module) +x contents permalink (UI) +- BUG: has_one / has_many. Delete an author - bushido changes in the master - SEO: support and support/ should be 2 different pages. Remove trailing slash -- BUG: has_many. Delete an author - edit sidebar (inline editor). Unable to reset it BACKLOG: diff --git a/locomotive_cms.gemspec b/locomotive_cms.gemspec index 946a4d23..b6484af2 100644 --- a/locomotive_cms.gemspec +++ b/locomotive_cms.gemspec @@ -40,7 +40,7 @@ Gem::Specification.new do |s| s.add_dependency "dragonfly", "~> 0.9.1" s.add_dependency "rack-cache" - s.add_dependency "custom_fields", "1.0.0.beta.17" + s.add_dependency "custom_fields", "1.0.0.beta.19" s.add_dependency "fog", "0.8.2" s.add_dependency "mimetype-fu" s.add_dependency "actionmailer-with-request"