fix error

This commit is contained in:
邱博亞 2022-10-01 15:16:05 +08:00
parent 0615de7a2a
commit 09a1772f46
3 changed files with 6 additions and 4 deletions

View File

@ -6,9 +6,11 @@ class SiteMenuWidgetsController < ApplicationController
item["obj"] = page item["obj"] = page
if page.child_page.size > 0 if page.child_page.size > 0
item["page_name"] = page.name item["page_name"] = page.name
item['dropdown'] = 'dropdown-menu'
item["children"] = create_json(page.sorted_published_child_pages) item["children"] = create_json(page.sorted_published_child_pages)
else else
item["page_name"] = page.name item["page_name"] = page.name
item['dropdown'] = ''
item["children"] = [] item["children"] = []
end end
if page.page_type == "link" if page.page_type == "link"

View File

@ -5,10 +5,10 @@
<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 {{active_class}}"> <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 dropdown-menu" data-list="children" data-level="1"> <ul class="sitemenu-list level-2 {{dropdown}}" data-list="children" data-level="1">
<li class="sitemenu-item level-2" style="position: relative;"> <li class="sitemenu-item level-2" style="position: relative;">
<a class="sitemenu-link level-2" href="{{url}}" target="{{target}}">{{page_name}}</a> <a class="sitemenu-link level-2" href="{{url}}" target="{{target}}">{{page_name}}</a>
<ul class="sitemenu-list level-2 dropdown-menu" data-list="children" data-level="2"> <ul class="sitemenu-list level-2 {{dropdown}}" data-list="children" data-level="2">
<li class="sitemenu-item level-3" style="position: relative;"> <li class="sitemenu-item level-3" style="position: relative;">
<a class="sitemenu-link level-3" href="{{url}}" target="{{target}}">{{page_name}}</a> <a class="sitemenu-link level-3" href="{{url}}" target="{{target}}">{{page_name}}</a>
</li> </li>

View File

@ -5,10 +5,10 @@
<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 {{active_class}}"> <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 dropdown-menu" data-list="children" data-level="1"> <ul class="sitemenu-list level-2 {{dropdown}}" data-list="children" data-level="1">
<li class="sitemenu-item level-2" style="position: relative;"> <li class="sitemenu-item level-2" style="position: relative;">
<a class="sitemenu-link level-2" href="{{url}}" target="{{target}}">{{page_name}}</a> <a class="sitemenu-link level-2" href="{{url}}" target="{{target}}">{{page_name}}</a>
<ul class="sitemenu-list level-2 dropdown-menu" data-list="children" data-level="2"> <ul class="sitemenu-list level-2 {{dropdown}}" data-list="children" data-level="2">
<li class="sitemenu-item level-3" style="position: relative;"> <li class="sitemenu-item level-3" style="position: relative;">
<a class="sitemenu-link level-3" href="{{url}}" target="{{target}}">{{page_name}}</a> <a class="sitemenu-link level-3" href="{{url}}" target="{{target}}">{{page_name}}</a>
</li> </li>