seminar2_old/app/views/admin/seminars/_node.html.erb

56 lines
4.1 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<div class="navbar">
<div class="navbar-inner">
<span class="brand"><i class="<%= node.root? ? 'icons-house' : 'icons-list-2' %>"></i></span>
<% unless node.root? %>
<% if node.page_type == "page" %>
<% name, icon_name = get_item_module_infos(node) %>
<span title="<%= name %>" class="item-type page tip"><i class="<%= icon_name %>"></i></span>
<% else %>
<span title="<%= t(:link) %>" class="item-type link tip"><i class="icon-link"></i></span>
<% end %>
<% end %>
<div class="item-title">
<%= content_tag(:em, node.url, class: "muted") if node.class.to_s.eql?('Link') %>
<% link_url = nil %>
<% if node.page_type.eql?('page') %>
<% if @prefix_url.present? %>
<% link_url = "#{@prefix_url}#{node.url}" %>
<% else %>
<% link_url = (node.url == "/" ? "/?locale=#{I18n.locale}" : ("/" + I18n.locale.to_s + node.url)) %>
<% end %>
<% else %>
<em class="muted"><%= node.external_url %></em>
<% link_url = node.external_url %>
<% end %>
<%= link_to node.name, link_url %>
<div class="item-menu">
<%= link_to content_tag(:i, nil, class: "icon-eye-open"), (link_url.split('/').last.include?("?") ? "#{link_url}&editmode=on" : "#{link_url}?editmode=on" ), class: "view-page open-slide tip", title: t("structure.view"), data: {title: node.name} if node.page_type.eql?('page') %>
<%#= link_to content_tag(:i, nil, class: "icons-mobile"), (node.root? ? "/?editmode=on&mobile=1" : "/" + I18n.locale.to_s + node.url + "?editmode=on&mobile=1"), class: "view-page open-slide tip mobile-view-btn", title: "Edit Mobile Page", data: {title: "Edit Mobile Page"} if node.page_type.eql?("page") && current_site.mobile_on && node.enabled_for_mobile %>
<% unless name.eql? "sitemap" %>
<%= link_to content_tag(:i, nil, class: "icon-edit"), edit_page_path(node.id,:type => node.page_type), class: "open-slide tip page edit", title: t("structure.edit_#{node.page_type}"), data: {title: t("structure.edit_#{node.page_type}")} if node.class.to_s.downcase.eql?("page") %>
<%= link_to content_tag(:i, nil, class: "icons-link"), new_page_path(:parent_page => node.id.to_s,:type => "link"), class: "open-slide tip link", title: t("structure.add_link"), data: {title: t("structure.add_link"), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') && level < 3 %>
<%= link_to content_tag(:i, nil, class: "icons-newspaper"), new_page_path(:parent_page => node.id.to_s,:type => "page"), class: "open-slide tip page", title: t("structure.add_page"), data: {title: t("structure.add_page"), id: 'new', parent: node.id.to_s} if node.class.to_s.eql?('Page') && level < 3 %>
<%= link_to content_tag(:i, nil, class: "icons-retweet"), "/pages/#{node.id}/import_widgets",:method => :post, :remote => true, "data-confirm" => "This will override your current widgets and widget settings. Do you wish to continue?.", class: "import-widgets tip", title: t("structure.import_widgets"), data: {title: t("structure.import_widgets")} if level > 1 && node.page_type != "link" %>
<%= link_to content_tag(:i, nil, class: "icon-trash"), page_path(node.id),:method => :delete,:remote => true, "data-confirm" => "Are you sure ?", class: "delete tip", title: t("structure.delete"), data: {title: t("structure.delete")} unless node.root? %>
<% end %>
</div>
</div>
<div class="item-info pull-right">
<% if node.access_level != "none" && !node.access_level.nil? %>
<span class="icon-logged-in"><i class="icons-user"></i> </span> |
<% end %>
<% I18n.available_locales.each do |valid_locale| %>
<% if node.enabled_for.include?(valid_locale.to_s) %>
<span class="label label-warning">
<% if node.menu_enabled_for.include?(valid_locale.to_s) %>
<i class="icons-untitled" style="vertical-align: middle; margin-bottom: 2px;"></i>
<% end %>
<%= t(valid_locale.to_s) %>
</span>
<% end %>
<% end %>
<span class="badge <%= 'badge-inverse' if node.root? %>"></span>
</div>
</div>
</div>