orbit-4-2/app/views/admin/items/_node.html.erb

42 lines
2.8 KiB
Plaintext
Raw Normal View History

<div class="navbar">
<div class="navbar-inner">
<span class="brand"><i class="<%= node.root? ? 'icons-house' : 'icons-list-2' %>"></i></span>
<% if node.class.to_s.eql?('Page') %>
<% unless node.root? %>
<% name, icon_name = get_item_module_infos(node) %>
<span title="<%= name %>" class="item-type page tip"><i class="<%= icon_name %>"></i></span>
<% end %>
<% else %>
<span title="<%= t(:link) %>" class="item-type link tip"><i class="icon-link"></i></span>
<% end %>
<div class="item-title">
<%= content_tag(:em, node.url, class: "muted") if node.class.to_s.eql?('Link') %>
<% if node.class.to_s.eql?('Page') %>
<%= link_to node.title, "/" + node.path %>
<% else %>
<%= link_to node.title, node.url %>
<% end %>
<div class="item-menu">
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "view-page open-slide tip", title: t(:view), data: {title: node.title} if node.class.to_s.eql?('Page') %>
<% if node.class.to_s.downcase.eql?("page") %>
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#page", class: "open-slide tip page edit", title: t('editing.page'), data: {title: t('editing.page'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations)} %>
<% elsif node.class.to_s.downcase.eql?("link") %>
<%= link_to content_tag(:i, nil, class: "icon-edit"), "#link", class: "open-slide tip link edit", title: t('editing.link'), data: {title: t('editing.link'), id: node.id.to_s, parent: node.parent_id.to_s, form: {name: node.name}.merge(node.title_translations).merge(node.urls)} %>
<% end %>
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), "#page", class: "open-slide tip page", title: t(:add_page), data: {title: t(:add_page), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') %>
<%= link_to content_tag(:i, nil, class: "icon-link"), "#link", class: "open-slide tip link", title: t(:add_link), data: {title: t(:add_link), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') %>
<%= link_to content_tag(:i, nil, class: "icon-trash"), nil, rel: eval("admin_#{node.class.to_s.downcase}_path(node)"), class: "delete tip", title: t(:delete_), data: {title: t(:delete_)} unless node.root? %>
</div>
</div>
<div class="item-info pull-right">
<% @site_in_use_locales.each do |valid_locale| %>
<% if node.enabled_for && node.enabled_for.include?(valid_locale) %>
<span class="label label-warning"><%= I18nVariable.from_locale(valid_locale) %></span>
<% end %>
<% end %>
<span class="badge <%= 'badge-inverse' if node.root? %>"></span>
</div>
</div>
</div>