fix some error
This commit is contained in:
parent
5c1e50eba7
commit
17f67c0f01
|
@ -7,24 +7,18 @@ class SiteMenuWidgetsController < ApplicationController
|
||||||
if page.child_page.size > 0
|
if page.child_page.size > 0
|
||||||
item["page_name"] = page.name
|
item["page_name"] = page.name
|
||||||
item["children"] = create_json(page.sorted_published_child_pages)
|
item["children"] = create_json(page.sorted_published_child_pages)
|
||||||
if page.page_type == "page" or page.page_type == "link"
|
|
||||||
item["url"] = (page.page_type == "link") ? "/#{locale.to_s}" + page.external_url : "/#{locale.to_s}" + page.url
|
|
||||||
item["target"] = "_self"
|
|
||||||
else
|
|
||||||
item["url"] = "/#{locale.to_s}" + page.url
|
|
||||||
item["target"] = "_blank"
|
|
||||||
end
|
|
||||||
else
|
else
|
||||||
item["page_name"] = page.name
|
item["page_name"] = page.name
|
||||||
item["children"] = []
|
item["children"] = []
|
||||||
if page.page_type == "page"
|
|
||||||
item["url"] = "/#{locale.to_s}" + page.url
|
|
||||||
item["target"] = "_self"
|
|
||||||
else
|
|
||||||
item["url"] = page.external_url
|
|
||||||
item["target"] = (is_internal_url?(page.external_url) ? "_self" : "_blank") rescue "_blank"
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
if page.page_type == "link"
|
||||||
|
item["url"] = page.external_url
|
||||||
|
item["target"] = (is_internal_url?(page.external_url) ? "_self" : "_blank") rescue "_blank"
|
||||||
|
else
|
||||||
|
item["url"] = "/#{locale.to_s}" + page.url
|
||||||
|
item["target"] = "_self"
|
||||||
|
end
|
||||||
|
item['active_class'] = (@page_id==page.id ? 'active' : '')
|
||||||
items << item
|
items << item
|
||||||
end
|
end
|
||||||
items
|
items
|
||||||
|
@ -55,7 +49,7 @@ class SiteMenuWidgetsController < ApplicationController
|
||||||
subpart = OrbitHelper.get_current_widget
|
subpart = OrbitHelper.get_current_widget
|
||||||
params = OrbitHelper.params
|
params = OrbitHelper.params
|
||||||
page = Page.where(:page_id => params[:page_id]).first
|
page = Page.where(:page_id => params[:page_id]).first
|
||||||
@page_id = page.id
|
@page_id = page.id rescie nil
|
||||||
@expand_layer = false
|
@expand_layer = false
|
||||||
@expand_next_layer = false
|
@expand_next_layer = false
|
||||||
@expand_current_layer = false
|
@expand_current_layer = false
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<a id="accesskey_sitemenu" accesskey="S" href="/<%= "#{locale.to_s}" %>/accesskey" title="Sitemenu">:::</a>
|
<a id="accesskey_sitemenu" accesskey="S" href="/<%= "#{locale.to_s}" %>/accesskey" title="Sitemenu">:::</a>
|
||||||
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
||||||
<ul data-list="pages" class="sitemenu-list level-1 list-unstyled" data-level="0">
|
<ul data-list="pages" class="sitemenu-list level-1 list-unstyled" data-level="0">
|
||||||
<li class="sitemenu-item level-1">
|
<li class="sitemenu-item level-1 {{active_class}}">
|
||||||
<a class="sitemenu-link level-1" href="{{url}}" target="{{target}}">{{page_name}}</a>
|
<a class="sitemenu-link level-1" href="{{url}}" target="{{target}}">{{page_name}}</a>
|
||||||
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
||||||
<li class="sitemenu-item level-2" style="position: relative;">
|
<li class="sitemenu-item level-2" style="position: relative;">
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
<a id="accesskey_sitemenu" accesskey="S" href="/<%= "#{locale.to_s}" %>/accesskey" title="Sitemenu">:::</a>
|
<a id="accesskey_sitemenu" accesskey="S" href="/<%= "#{locale.to_s}" %>/accesskey" title="Sitemenu">:::</a>
|
||||||
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
||||||
<ul data-list="pages" class="sitemenu-list level-1 list-unstyled" data-level="0">
|
<ul data-list="pages" class="sitemenu-list level-1 list-unstyled" data-level="0">
|
||||||
<li class="sitemenu-item level-1">
|
<li class="sitemenu-item level-1 {{active_class}}">
|
||||||
<a class="sitemenu-link level-1" href="{{url}}" target="{{target}}">{{page_name}}</a>
|
<a class="sitemenu-link level-1" href="{{url}}" target="{{target}}">{{page_name}}</a>
|
||||||
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
||||||
<li class="sitemenu-item level-2" style="position: relative;">
|
<li class="sitemenu-item level-2" style="position: relative;">
|
||||||
|
|
Loading…
Reference in New Issue