From 45bbd56a51c6793af576198a2e9137cfcb88f30b Mon Sep 17 00:00:00 2001 From: Philip Arndt Date: Fri, 6 May 2011 00:28:14 +1200 Subject: Added form fields for SEO and translations. --- app/models/blog_post.rb | 3 ++- app/views/admin/blog/posts/_form.html.erb | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) (limited to 'app') diff --git a/app/models/blog_post.rb b/app/models/blog_post.rb index f95f81a..b738018 100644 --- a/app/models/blog_post.rb +++ b/app/models/blog_post.rb @@ -1,8 +1,9 @@ require 'acts-as-taggable-on' +require 'seo_meta' class BlogPost < ActiveRecord::Base - is_seo_meta if self.respond_to?(:is_seo_meta) + is_seo_meta default_scope :order => 'published_at DESC' #.first & .last will be reversed -- consider a with_exclusive_scope on these? diff --git a/app/views/admin/blog/posts/_form.html.erb b/app/views/admin/blog/posts/_form.html.erb index 3c0a351..9d0e0bd 100644 --- a/app/views/admin/blog/posts/_form.html.erb +++ b/app/views/admin/blog/posts/_form.html.erb @@ -46,10 +46,32 @@ <% end %> -

<%= t('admin.blog.posts.form.published_at') %>

+

<%= t('.published_at') %>

<%= f.datetime_select :published_at %>
+

<%= t('.seo') %>

+
+ + <%= f.label :browser_title, t('.seo_override_title') %> + <%= refinery_help_tag t('.seo_override_title_help')%> + + <%= f.text_field :browser_title, :class => 'widest' %> +
+
+ + <%= f.label :meta_keywords, t('.meta_keywords_title') %> + <%= refinery_help_tag t('.meta_keywords_help') %> + + <%= f.text_field :meta_keywords, :class => 'widest' %> +
+
+ + <%= f.label :meta_description, t('.meta_description_title') %> + <%= refinery_help_tag t('.meta_description_help') %> + + <%= f.text_area :meta_description, :class => 'widest', :rows => 7 %> +
<%= render :partial => "/shared/admin/form_actions", -- cgit v1.2.3