Commit f6630a3d authored by Martin Markech's avatar Martin Markech
Browse files

divide text of news to teaser and whole text

parent 6a6b705d
......@@ -7,7 +7,7 @@ module Refinery
attr_accessor :locale # to hold temporarily
attr_accessible :title, :body, :content, :source, :publish_date, :expiration_date, :position, :image_id
attr_accessible :title, :body, :content, :source, :publish_date, :expiration_date, :position, :image_id, :teaser
class Translation
attr_accessible :locale
end
......
<%= render "/refinery/admin/error_messages",
:object => @item,
:include_object_name => true %>
<%= render "/refinery/admin/error_messages",
:object => @item,
:include_object_name => true %>
<%= render "locale_picker",
:current_locale => Thread.current[:globalize_locale] if defined?(::Refinery::I18n) %>
<%= render "locale_picker",
:current_locale => Thread.current[:globalize_locale] if defined?(::Refinery::I18n) %>
<div class='field'>
<%= f.label :title %>
<%= f.text_field :title, :class => "larger widest" %>
</div>
<div class='field'>
<%= f.label :title %>
<%= f.text_field :title, :class => "larger widest" %>
</div>
<div class='field'>
<%= f.label :publish_date %>
<%= f.datetime_select :publish_date %>
</div>
<div class='field'>
<%= f.label :publish_date %>
<%= f.datetime_select :publish_date %>
</div>
<div class='field'>
<%= f.label :expiration_date %>
<%= f.datetime_select :expiration_date, :start_year => Time.now.year,
:include_blank => true %>
</div>
<div class='field'>
<%= f.label :expiration_date %>
<%= f.datetime_select :expiration_date, :start_year => Time.now.year,
:include_blank => true %>
</div>
<div class='field'>
<%= f.label :image -%>
<%= render '/refinery/admin/image_picker',
:f => f,
:field => :image_id,
:image => @item.image,
:toggle_image_display => false,
:description => t('refinery.news.admin.item')
%>
<div class='field'>
<%= f.label :image -%>
<%= render '/refinery/admin/image_picker',
:f => f,
:field => :image_id,
:image => @item.image,
:toggle_image_display => false,
:description => t('refinery.news.admin.item')
%>
</div>
</div>
<script>
$(document).ready(function(){
page_options.init(
false
, "/refinery/page_parts/new"
, "/refinery/page_parts"
);
});
</script>
<div class='field'>
<%= f.label :body %>
<%= f.text_area :body, :rows => "20", :class => "wymeditor widest" %>
</div>
<div class='field'>
<div id='page-tabs' class='clearfix ui-tabs ui-widget ui-widget-content ui-corner-all'>
<ul id='page_parts'>
<li class='ui-state-default ui-state-active' data-index='0'>
<a href="#page_part_teaser"><%= t('.teaser') %></a>
</li>
<li class='ui-state-default' data-index='1'>
<a href="#page_part_body"><%= t('.body') %></a>
</li>
</ul>
<div id='page_part_editors'>
<div class='page_part' id='page_part_teaser'>
<%= f.text_area :teaser, :rows => "20", :id=> "page_parts_attributes_0_body", :class => "wymeditor widest" %>
</div>
<div class='page_part' id='page_part_body'>
<%= f.text_area :body, :rows => "20", :id=>"page_parts_attributes_1_body", :class => "wymeditor widest" %>
</div>
</div>
</div>
</div>
<%= render "/refinery/admin/form_actions",
:f => f,
:continue_editing => true,
:delete_title => t('admin.news.items.item.delete'),
:delete_confirmation => t('shared.admin.delete.message', :title => @item.title) %>
<%= render "/refinery/admin/form_actions",
:f => f,
:continue_editing => true,
:delete_title => t('admin.news.items.item.delete'),
:delete_confirmation => t('shared.admin.delete.message', :title => @item.title) %>
<div class='wym_skin_refinery page_part'>
<div >
<span class='clearfix label_inline_with_link'></span>
</div>
<div id="news_wym_editation" class='wym_box field ' style="height: 300px;">
<div class='page_part' id='news_part_1'>
<%= hidden_field_tag "news[parts_attributes][1][title]" %>
<%= text_area_tag "news[parts_attributes][1][body]", :rows => 20, :class => 'wymeditor widest' %>
</div>
</div>
</div>
\ No newline at end of file
......@@ -8,6 +8,9 @@ sk:
copy_of: "KÓPIA "
admin:
items:
form:
teaser: Úvodný text
body: Celý text
actions:
create_new: Pridať novinku
reorder: Preusporiadať novinky
......@@ -51,5 +54,6 @@ sk:
expiration_date: Dátum expirácie
source: Zdroj
image: Obrázok
teaser: Teaser
models:
'refinery/news/item': Novinka
class AddTeaserToItems < ActiveRecord::Migration
def change
add_column Refinery::News::Item.table_name, :teaser, :text
end
end
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment