aboutsummaryrefslogblamecommitdiffstats
path: root/app/views/admin/blog/posts/_form.html.erb
blob: da3f132a976894d290594650f4e53ee163a4ab95 (plain) (tree)
1
2
3
4
5
6
7
8
9
10
11
12











                                                                        













                                                                      







                                                                       




                                       
        


                                                      
                                          


                                                              
                          






                                               













                                                                               
<% form_for [:admin, @blog_post] do |f| -%>
  <%= f.error_messages %>

  <div class='field'>
    <%= f.label :title -%>
    <%= f.text_field :title, :class => 'larger widest' -%>
  </div>

  <div class='field'>
    <%= f.label :body -%>
    <%= f.text_area :body, :rows => 20, :class => 'wymeditor widest' -%>
  </div>
  <div id='more_options_field'>
    <p>
      <%= link_to t('.advanced_options'), "#",
                  :id => 'toggle_advanced_options',
                  :title => t('.toggle_advanced_options') %>
    </p>
    <span id='draft_field'>
      <%= f.check_box :draft %>
      <%= f.label :draft, t('.save_as_draft'), :class => "stripped" %>
    </span>
  </div>
  <div id='more_options' style="display:none;">
    <div class="hemisquare">
      <h3><%= t('admin.blog.submenu.categories.title') %></h3>
      <ul class='blog_categories'>
        <% f.fields_for :categories do |c| %>
          <% @blog_categories.each do |category| %>
            <li>
               <%= c.check_box :id, :value => category.id %>
               <%= c.label :id, category.title, :class => 'stripped' %>
            </li>
          <% end %>
        <% end %>
      </ul>
    </div>
    <div class='hemisquare right_side'>
    </div>
  </div>
  <%= render :partial => "/shared/admin/form_actions",
              :locals => {
                :f => f,
                :continue_editing => true,
                :delete_title => t('admin.blogs.blogs.delete')
              } %>
<% end -%>
<% content_for :head do %>
  <style type='text/css'>
    ul.blog_categories, ul.blog_categories li {
      list-style: none;
      margin: 0px;
      padding: 0px;
    }
  </style>
  <script type='text/javascript'>
    $(document).ready(function(){
      $('#toggle_advanced_options').click(function(e){
        e.preventDefault();

        $('#more_options').animate({opacity: 'toggle', height: 'toggle'}, 250);

        $('html,body').animate({
          scrollTop: $('#toggle_advanced_options').parent().offset().top
        }, 250);
      });
    });
  </script>
<% end %>