%= error_messages_for 'blog' %>
<%= _('My Blog') %>
<%= render :file => 'shared/tiny_mce' %>
<%= required f.text_field(:name, :size => '64', :maxlength => 150, :onchange => "updateUrlField(this, 'article_slug')") %>
<%= render :partial => 'general_fields' %>
<%= hidden_field_tag 'old_article_slug', @article.slug %>
<%= labelled_form_field( _('Address'),
content_tag('code',
url_for(@article.url).gsub(/#{@article.slug}$/, '') +
text_field(:article, :slug, :onchange => "warn_value_change()", :size => 25)
) +
content_tag('div',
content_tag('strong', _('WARNING!')) + ' ' +
_("You are about to change the address, and this will break external links to this blog or to posts inside it. Do you really want to change?") +
content_tag('div',
button_to_function(:ok, _("Yes"), "confirm_change()") + ' ' +
button_to_function(:cancel, _('No'), 'no_change()')
),
:id => 'slug-change-confirmation',
:class => 'change-confirmation',
:style => 'display: none;'
)
)
%>
<%= labelled_form_field(_('Description:'), text_area(:article, :body, :rows => 10, :class => 'mceEditor')) %>
<%= f.fields_for :image_builder, @article.image do |i| %>
<%= file_field_or_thumbnail(_('Cover image:'), @article.image, i)%>
<%= _("Max size: %s (.jpg, .gif, .png)")% Image.max_size.to_humanreadable %>
<% end %>
<%= labelled_form_field(_('How to display posts:'), f.select(:visualization_format, [
[ _('Full post'), 'full'],
[ _('First paragraph'), 'short'],
[ _('First paragraph, with post picture'), 'short+pic'],
[ _("Title, Image, Lead"), 'compact']
])) %>
<%= labelled_form_field(_('Posts per page:'), f.select(:posts_per_page, Blog.posts_per_page_options)) %>
<%= labelled_check_box(_("List only translated posts"), 'article[display_posts_in_current_language]', '1', @article.display_posts_in_current_language?) %>
<%= f.fields_for 'feed', @article.feed do |feed| %>
<%= labelled_form_field(_('Limit of posts in RSS Feed'), feed.select(:limit, [5, 10, 20, 50])) %>
<%= labelled_form_field(_('Include in RSS Feed only posts from language:'), feed.select(:language, [[_('All'), nil ]] + environment.locales.map { |k,v| [v, k]})) %>
<% end %>
<%= f.fields_for 'external_feed_builder', @article.external_feed do |efeed| %>
<% enabled = @article.external_feed && @article.external_feed.enabled %>
<% only_once = @article.external_feed ? @article.external_feed.only_once : true %>
<%= labelled_check_box(_('Fetch posts from an external feed'), 'article[external_feed_builder][enabled]', 'true', enabled, {:onchange => "jQuery('#external-feed-options').toggle()"}) %>
<%= efeed.hidden_field(:id) %>
<%= labelled_form_field( _('Feed address'), efeed.text_field(:address) ) %>
<%= labelled_radio_button( _('Fetch posts only once'), 'article[external_feed_builder][only_once]', 'true', only_once) %>
<%= labelled_radio_button( _('Fetch posts periodically'), 'article[external_feed_builder][only_once]', 'false', !only_once) %>
<%= _('Feeds are updated in batches periodically. Please note that your posts will not be fetched immediately.') %>
<% end %>