| 
1 | 1 | <div class="part-snippets">  | 
2 | 2 |   <div class="active-snippets">  | 
3 | 3 |     <h1><%= part.title %></h1>  | 
4 |  | -    <% if part.snippets.any? %>  | 
5 |  | -      <h2><%= t('.active') %></h2>  | 
 | 4 | +    <% if part.snippets.before.any? %>  | 
 | 5 | +      <h2><%= t('.before_body') %></h2>  | 
6 | 6 |       <ul>  | 
7 |  | -        <% part.snippets.each do |snippet| %>  | 
8 |  | -          <li class='clearfix record <%= cycle('on', 'on-hover') %>' >  | 
9 |  | -            <span class='title'>  | 
10 |  | -              <%= snippet.title %>  | 
11 |  | -              <% if ::Refinery::I18n.frontend_locales.many? and  | 
12 |  | -                     (locales = snippet.translations.collect{|t| t.locale}).present? %>  | 
13 |  | -                <span class='preview'>  | 
14 |  | -                  <% locales.each do |locale| %>  | 
15 |  | -                    <%= refinery_icon_tag "flags/#{locale}.png", :size => '16x11' %>  | 
16 |  | -                  <% end %>  | 
17 |  | -                </span>  | 
18 |  | -              <% end %>  | 
19 |  | -            </span>  | 
20 |  | -            <span class='actions'>  | 
21 |  | -              <%= link_to refinery_icon_tag('application_edit.png'), edit_admin_snippet_path(snippet),  | 
22 |  | -                  :title => t('.edit') %>  | 
23 |  | -              <%= link_to refinery_icon_tag('delete.png'), url_for({:controller => 'snippets_page_parts', :action => 'remove', :id => @page.id, :snippet_id => snippet.id, :part_id => part.id}),  | 
24 |  | -                  :title => t('.remove'),  | 
25 |  | -                  :class => 'remove-snippet' %>  | 
26 |  | -            </span>  | 
27 |  | -          </li>  | 
28 |  | -        <% end %>  | 
 | 7 | +        <%= render :partial => '/admin/pages/tabs/snippets_list_item', :collection => part.snippets.before, :as => :snippet, :locals => {:part => part, :before_body => true} %>  | 
 | 8 | +      </ul>  | 
 | 9 | +    <% end %>  | 
 | 10 | +    <% if part.snippets.after.any? %>  | 
 | 11 | +      <h2><%= t('.after_body') %></h2>  | 
 | 12 | +      <ul>  | 
 | 13 | +        <%= render :partial => '/admin/pages/tabs/snippets_list_item', :collection => part.snippets.after, :as => :snippet, :locals => {:part => part, :before_body => false} %>  | 
29 | 14 |       </ul>  | 
30 | 15 |     <% end %>  | 
31 | 16 |   </div>  | 
 | 
39 | 24 |           <li class='clearfix record <%= cycle('on', 'on-hover') %>' >  | 
40 | 25 |             <span class="title"><%= snippet.title %></span>  | 
41 | 26 |             <span class="actions">  | 
42 |  | -              <a class="add_icon add-snippet" href="<%= url_for({:controller => 'snippets_page_parts', :action => 'add', :id => @page.id, :snippet_id => snippet.id, :part_id => part.id}) %>">Add</a>  | 
 | 27 | +              <a class="add_icon add-snippet" href="<%= url_for({:controller => 'snippets_page_parts', :action => 'add', :id => @page.id, :snippet_id => snippet.id, :part_id => part.id}) %>"><%= t('.add_after_body') %></a>  | 
 | 28 | +              <a class="add_icon add-snippet" href="<%= url_for({:controller => 'snippets_page_parts', :action => 'add', :id => @page.id, :snippet_id => snippet.id, :part_id => part.id, :before_body => 'true'}) %>"><%= t('.add_before_body') %></a>  | 
43 | 29 |             </span>  | 
44 | 30 |           </li>  | 
45 | 31 |         <% end %>  | 
 | 
0 commit comments