edit.rhtml 1.28 KB
<div style='width: 500px;'>
  <h2><%= _('Editing block') %></h2>

  <% form_tag(:action => 'save', :id => @block.id) do %>

    <%= labelled_form_field(_('Custom title for this block: '), text_field(:block, :title, :maxlength => 20)) %>

    <%= render :partial => partial_for_class(@block.class) %>

    <%= labelled_form_field _('Display this block:'), '' %>
    <div style='margin-left: 10px'>
      <%= radio_button(:block, :display, 'always') %>
      <%= label_tag('block_display_always', _('In all pages')) %>
      <br/>
      <%= radio_button(:block, :display, 'home_page_only') %>
      <%= label_tag('block_display_home_page_only', _('Only in the homepage')) %>
      <br/>
      <%= radio_button(:block, :display, 'except_home_page') %>
      <%= label_tag('block_display_except_home_page', _('In all pages, except in the homepage')) %>
      <br/>
      <%= radio_button(:block, :display, 'never') %>
      <%= label_tag('block_display_never', _("Don't display")) %>
    </div>

    <%= labelled_form_field(_('Show for:'), select(:block, :language, [ [ _('all languages'), 'all']] + environment.locales.map {|key, value| [value, key]} )) %>

    <% button_bar do %>
      <%= submit_button(:save, _('Save')) %>
      <%= colorbox_close_button(_('Cancel')) %>
    <% end %>

  <% end %>
</div>