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
|
||||
item["page_name"] = page.name
|
||||
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
|
||||
item["page_name"] = page.name
|
||||
item["children"] = []
|
||||
if page.page_type == "page"
|
||||
item["url"] = "/#{locale.to_s}" + page.url
|
||||
item["target"] = "_self"
|
||||
else
|
||||
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
|
||||
end
|
||||
item['active_class'] = (@page_id==page.id ? 'active' : '')
|
||||
items << item
|
||||
end
|
||||
items
|
||||
|
@ -55,7 +49,7 @@ class SiteMenuWidgetsController < ApplicationController
|
|||
subpart = OrbitHelper.get_current_widget
|
||||
params = OrbitHelper.params
|
||||
page = Page.where(:page_id => params[:page_id]).first
|
||||
@page_id = page.id
|
||||
@page_id = page.id rescie nil
|
||||
@expand_layer = false
|
||||
@expand_next_layer = false
|
||||
@expand_current_layer = false
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<a id="accesskey_sitemenu" accesskey="S" href="/<%= "#{locale.to_s}" %>/accesskey" title="Sitemenu">:::</a>
|
||||
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
||||
<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>
|
||||
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
||||
<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>
|
||||
<h3 class="sitemenu-title">{{widget_title}}</h3>
|
||||
<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>
|
||||
<ul class="sitemenu-list level-2" data-list="children" data-level="1">
|
||||
<li class="sitemenu-item level-2" style="position: relative;">
|
||||
|
|
Loading…
Reference in New Issue