request from Bernd (Designhunger) #45

This commit is contained in:
did 2011-03-05 00:41:44 +01:00
parent a2ea522964
commit 110c7a0fc9
5 changed files with 8 additions and 4 deletions

View File

@ -28,6 +28,7 @@ class Page
index [[:fullpath, Mongo::ASCENDING], [:site_id, Mongo::ASCENDING]]
## callbacks ##
after_initialize :set_default_raw_template
before_validation :normalize_slug
before_save { |p| p.fullpath = p.fullpath(true) }
before_destroy :do_not_remove_index_and_404_pages
@ -102,4 +103,8 @@ class Page
self.slug.slugify!(:without_extension => true) if self.slug.present?
end
def set_default_raw_template
self.raw_template ||= I18n.t('attributes.defaults.pages.other.body')
end
end

View File

@ -44,6 +44,5 @@
%button{ :class => 'button light add', :type => 'button' }
%span!= t('admin.buttons.new_item')
%script{ :type => 'text/javascript', :name => 'data' }
!= collection_to_js(ordered_custom_fields, :template => field_klass.new(:label => t('.default_label'), :_alias => '', :kind => 'string').to_hash)

View File

@ -46,7 +46,7 @@ de:
title: "Seite nicht gefunden"
body: "Inhalt der 404 Seite"
other:
body: "Inhalte kommen hier rein"
body: "{% extends 'parent' %}"
mongoid:
attributes:

View File

@ -25,7 +25,7 @@ en:
title: "Page not found"
body: "Content of the 404 page"
other:
body: "Content goes here"
body: "{% extends 'parent' %}"
pagination:
previous: "« Previous"

View File

@ -50,7 +50,7 @@ pt-BR:
title: "Página não encontrada"
body: "Conteúdo da página de erro 404"
other:
body: "Conteúdo vai aqui"
body: "{% extends 'parent' %}"
mongoid:
attributes: