aboutsummaryrefslogtreecommitdiffstats
path: root/app/views/admin/blog_posts/index.html.erb
blob: 15fd775c75810db5e73591b731dcfcaa2b920fc7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
<div id='actions'>
  <ul>
    <li>
      <%= render :partial => "/shared/admin/search",
                 :locals => {
                   :url => admin_blog_posts_url
                 } %>
    </li>
    <li>
      <%= link_to t('.create_new'), new_admin_blog_post_url,
                  :class => "add_icon" %>
    </li>
  <% if !searching? and BlogPost.count > 1 %>
    <li>
      <%= link_to t('refinery.reorder', :what => "BlogPost"), admin_blog_posts_url,
                  :id => "reorder_action",
                  :class => "reorder_icon" %>

      <%= link_to t('refinery.reorder_done', :what => "BlogPost"), admin_blog_posts_url,
                  :id => "reorder_action_done",
                  :style => "display: none;",
                  :class => "reorder_icon" %>
    </li>
  <% end %>
  </ul>
</div>
<div id='records'>
  <% if searching? %>
    <h2><%= t('admin.search_results_for', :query => params[:search]) %></h2>
    <% if @blog_posts.any? %>
      <%= render :partial => "blog_posts",
                 :collection => @blog_posts %>
    <% else %>
      <p><%= t('admin.search_no_results') %></p>
    <% end %>
  <% else %>
    <% if @blog_posts.any? %>
      <%= will_paginate @blog_posts,
                        :previous_label => '&laquo;',
                        :next_label => '&raquo;' %>

      <%= render :partial => "sortable_list" %>

      <%= will_paginate @blog_posts,
                        :previous_label => '&laquo;',
                        :next_label => '&raquo;' %>
    <% else %>
      <p>
        <strong>
          <%= t('.no_items_yet') %>
        </strong>
      </p>
    <% end %>
  <% end %>
</div>
<%= render :partial => "/shared/admin/make_sortable",
           :locals => {
             :tree => false
           } if !searching? and BlogPost.count > 1 %>