/
_page.html.erb
52 lines (48 loc) · 2.37 KB
/
_page.html.erb
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
<li class='clearfix record icons' id="<%= dom_id(page) -%>">
<div class='clearfix'>
<% if page.children.present? %>
<span class="icon toggle <%= 'expanded' if Refinery::Pages.auto_expand_admin_tree %>" title="<%= t('expand_collapse', :scope => 'refinery.admin.pages') %>"></span>
<% else %>
<span class="icon"></span>
<% end %>
<span class='title <%= 'toggle' if page.children.present? %>'>
<%= page_title_with_translations page %>
<%= page_meta_information page %>
</span>
<% if Refinery.i18n_enabled? and Refinery::I18n.frontend_locales.many? %>
<span class='locales'>
<% page.translations.each do |translation| %>
<%= link_to refinery_icon_tag("flags/#{translation.locale}.png", :size => '16x11'),
refinery.edit_admin_page_path(page.nested_url, :switch_locale => translation.locale),
:class => 'locale' if translation.title.present? %>
<% end %>
</span>
<% end %>
<span class='actions'>
<%= link_to refinery_icon_tag('application_go.png'),
page.url,
:target => "_blank",
:title => t('.view_live_html') %>
<%= link_to refinery_icon_tag('page_add.png'),
refinery.new_admin_page_path(:parent_id => page.id),
:title => t('new', :scope => 'refinery.admin.pages') %>
<%= link_to refinery_icon_tag('application_edit.png'),
refinery.edit_admin_page_path(page.uncached_nested_url),
:title => t('edit', :scope => 'refinery.admin.pages') %>
<%= link_to refinery_icon_tag('delete.png'),
refinery.admin_page_path(page.uncached_nested_url),
:class => "cancel confirm-delete",
:title => t('delete', :scope => 'refinery.admin.pages'),
:data => {
:confirm => t('message',
:scope => 'refinery.admin.delete',
:title => page_title_with_translations(page)
)
},
:method => :delete if page.deletable? %>
</span>
</div>
<ul class='nested' data-ajax-content="<%= refinery.admin_children_pages_path(page.uncached_nested_url) %>">
<%= render(:partial => 'page', :collection => page.children) if Refinery::Pages.auto_expand_admin_tree %>
</ul>
</li>