Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
a30033c0
Commit
a30033c0
authored
Sep 14, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
menu: merge new submenu; no functional changes
parent
1cf50d5c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
88 additions
and
18 deletions
+88
-18
base_menu_system.volt
...sense/mvc/app/views/layout_partials/base_menu_system.volt
+16
-4
default.volt
src/opnsense/mvc/app/views/layouts/default.volt
+20
-2
fbegin.inc
src/www/fbegin.inc
+35
-12
head.inc
src/www/head.inc
+17
-0
No files found.
src/opnsense/mvc/app/views/layout_partials/base_menu_system.volt
View file @
a30033c0
...
@@ -7,13 +7,25 @@
...
@@ -7,13 +7,25 @@
<a href="#{{ topMenuItem.Id }}" class="list-group-item {% if topMenuItem.Selected %} active-menu-title {% endif %}" data-toggle="collapse" data-parent="#mainmenu"><span class="{{ topMenuItem.CssClass }} __iconspacer"></span>{{ topMenuItem.VisibleName }} </a>
<a href="#{{ topMenuItem.Id }}" class="list-group-item {% if topMenuItem.Selected %} active-menu-title {% endif %}" data-toggle="collapse" data-parent="#mainmenu"><span class="{{ topMenuItem.CssClass }} __iconspacer"></span>{{ topMenuItem.VisibleName }} </a>
<div class="collapse {% if topMenuItem.Selected %} active-menu in {% endif %}" id="{{ topMenuItem.Id }}">
<div class="collapse {% if topMenuItem.Selected %} active-menu in {% endif %}" id="{{ topMenuItem.Id }}">
{% for subMenuItem in topMenuItem.Children %}
{% for subMenuItem in topMenuItem.Children %}
{% if subMenuItem.IsExternal == "Y" %}
{% if subMenuItem.Url == '' %}
<a href="{{ subMenuItem.Url }}" target="_new" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}</a>
{# next level items, submenu is a container #}
<a href="#{{ topMenuItem.Id }}_{{ subMenuItem.Id }}" class="list-group-item {% if subMenuItem.Selected %} active-menu-title {% endif %}" data-toggle="collapse" data-parent="#{{ topMenuItem.Id }}">{{ subMenuItem.VisibleName }} <span class="{{ subMenuItem.CssClass }} __iconspacer pull-right"></span></a>
<div class="collapse {% if subMenuItem.Selected %} active-menu in {% endif %}" id="{{ topMenuItem.Id }}_{{ subMenuItem.Id }}">
{% for subsubMenuItem in subMenuItem.Children %}
{% if subsubMenuItem.IsExternal == "Y" %}
<a href="{{ subsubMenuItem.Url }}" target="_new" class="list-group-item menu-level-3-item {% if subsubMenuItem.Selected %} active {% endif %}">{{ subsubMenuItem.VisibleName }}</a>
{% elseif acl.isPageAccessible(session.get('Username'),subsubMenuItem.Url) %}
<a href="{{ subsubMenuItem.Url }}" class="list-group-item menu-level-3-item {% if subsubMenuItem.Selected %} active {% endif %}">{{ subsubMenuItem.VisibleName }}</a>
{% endif %}
{% endfor %}
</div>
{% elseif subMenuItem.IsExternal == "Y" %}
<a href="{{ subMenuItem.Url }}" target="_new" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}<span class="{{ subMenuItem.CssClass }} __iconspacer pull-right"></span></a>
{% elseif acl.isPageAccessible(session.get('Username'),subMenuItem.Url) %}
{% elseif acl.isPageAccessible(session.get('Username'),subMenuItem.Url) %}
<a href="{{ subMenuItem.Url }}" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}</a>
<a href="{{ subMenuItem.Url }}" class="list-group-item {% if subMenuItem.Selected %} active {% endif %}">{{ subMenuItem.VisibleName }}<
span class="{{ subMenuItem.CssClass }} __iconspacer pull-right"></span><
/a>
{% endif %}
{% endif %}
{% endfor %}
{% endfor %}
</div>
</div>
{% endfor %}
{% endfor %}
</div>
</div>
</div>
</div>
...
...
src/opnsense/mvc/app/views/layouts/default.volt
View file @
a30033c0
...
@@ -18,6 +18,15 @@
...
@@ -18,6 +18,15 @@
<!-- include (theme) style -->
<!-- include (theme) style -->
<link
href=
"/ui/themes/{{ui_theme|default('opnsense')}}/build/css/main.css"
media=
"screen, projection"
rel=
"stylesheet"
>
<link
href=
"/ui/themes/{{ui_theme|default('opnsense')}}/build/css/main.css"
media=
"screen, projection"
rel=
"stylesheet"
>
<!-- TODO: move to theme style -->
<style>
.menu-level-3-item
{
font-size
:
90%
;
padding-left
:
54px
!important
;
}
</style>
<!-- Favicon -->
<!-- Favicon -->
<link
href=
"/ui/themes/{{ui_theme|default('opnsense')}}/build/images/favicon.png"
rel=
"shortcut icon"
>
<link
href=
"/ui/themes/{{ui_theme|default('opnsense')}}/build/images/favicon.png"
rel=
"shortcut icon"
>
...
@@ -44,9 +53,18 @@
...
@@ -44,9 +53,18 @@
});
});
// hide empty menu items
// hide empty menu items
$
(
'
#mainmenu > div > .collapse
'
).
each
(
function
(){
$
(
'
#mainmenu > div > .collapse
'
).
each
(
function
()
{
// cleanup empty second level menu containers
$
(
this
).
find
(
"
div.collapse
"
).
each
(
function
()
{
if
(
$
(
this
).
children
().
length
==
0
)
{
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
$
(
this
).
remove
();
}
});
// cleanup empty first level menu items
if
(
$
(
this
).
children
().
length
==
0
)
{
if
(
$
(
this
).
children
().
length
==
0
)
{
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
}
}
});
});
...
...
src/www/fbegin.inc
View file @
a30033c0
...
@@ -163,18 +163,41 @@ if($need_alert_display == true) {
...
@@ -163,18 +163,41 @@ if($need_alert_display == true) {
<nav
class=
"page-side-nav"
role=
"navigation"
>
<nav
class=
"page-side-nav"
role=
"navigation"
>
<div
id=
"mainmenu"
class=
"panel"
style=
"border:0px"
>
<div
id=
"mainmenu"
class=
"panel"
style=
"border:0px"
>
<div
class=
"panel list-group"
style=
"border:0px"
>
<div
class=
"panel list-group"
style=
"border:0px"
>
<?php
foreach
(
$menuSystem
as
$topMenuItem
)
:
?>
<?php
<a
href=
"#
<?php
echo
$topMenuItem
->
Id
;
?>
"
class=
"list-group-item
<?php
if
(
$topMenuItem
->
Selected
)
echo
'active-menu-title'
;
?>
"
data-toggle=
"collapse"
data-parent=
"#mainmenu"
><span
class=
"
<?php
echo
$topMenuItem
->
CssClass
;
?>
__iconspacer"
></span>
<?php
echo
$topMenuItem
->
VisibleName
;
?>
</a>
foreach
(
$menuSystem
as
$topMenuItem
)
:
?>
<div
class=
"collapse
<?php
if
(
$topMenuItem
->
Selected
)
echo
'active-menu in'
;
?>
"
id=
"
<?php
echo
$topMenuItem
->
Id
;
?>
"
>
<a
href=
"#
<?=
$topMenuItem
->
Id
;
?>
"
class=
"list-group-item
<?=
$topMenuItem
->
Selected
?
'active-menu-title'
:
""
;
?>
"
data-toggle=
"collapse"
data-parent=
"#mainmenu"
><span
class=
"
<?=
$topMenuItem
->
CssClass
;
?>
__iconspacer"
></span>
<?=
$topMenuItem
->
VisibleName
;
?>
</a>
<?php
foreach
(
$topMenuItem
->
Children
as
$subMenuItem
)
:
?>
<div
class=
"collapse
<?=
$topMenuItem
->
Selected
?
'active-menu in'
:
""
;
?>
"
id=
"
<?=
$topMenuItem
->
Id
;
?>
"
>
<?php
if
(
$subMenuItem
->
IsExternal
==
"Y"
)
:?>
<?php
<
a
href
=
"<?php echo
$subMenuItem->Url
;?>"
target
=
"_new"
class
="
list
-
group
-
item
<?
php
if
(
$subMenuItem
->
Selected
)
echo
"active"
;
?>
">
<?php
echo
$subMenuItem
->
VisibleName
?>
</a>
foreach
(
$topMenuItem
->
Children
as
$subMenuItem
)
:
?>
<?php
elseif
(
$aclObj
->
isPageAccessible
(
$_SESSION
[
'Username'
],
$subMenuItem
->
Url
))
:?>
<?php
<
a
href
=
"<?php echo
$subMenuItem->Url
;?>"
class
="
list
-
group
-
item
<?
php
if
(
$subMenuItem
->
Selected
)
echo
"active"
;
?>
">
<?php
echo
$subMenuItem
->
VisibleName
;
?>
</a>
if
(
$subMenuItem
->
Url
==
''
)
:?>
<?php
endif
;
?>
<
a
href
=
"#<?=
$topMenuItem->Id
;?>_<?=
$subMenuItem->Id
;?>"
class
="
list
-
group
-
item
<?=
$subMenuItem
->
Selected
?
"active-menu-title"
:
""
;
?>
" data-toggle="collapse" data-parent="#
<?=
$topMenuItem
->
Id
;
?>
">
<?=
$subMenuItem
->
VisibleName
;
?>
<span
class=
"
<?=
$subMenuItem
->
CssClass
;
?>
__iconspacer pull-right"
></span></a>
<?php
endforeach
;
?>
<div
class=
"collapse
<?=
$subMenuItem
->
Selected
?
"active-menu in"
:
""
;
?>
"
id=
"
<?=
$topMenuItem
->
Id
;
?>
_
<?=
$subMenuItem
->
Id
;
?>
"
>
</div>
<?php
<?php
endforeach
;
?>
foreach
(
$subMenuItem
->
Children
as
$subsubMenuItem
)
:?>
<?
php
if
(
$subsubMenuItem
->
IsExternal
==
"Y"
)
:?>
<
a
href
=
"<?=
$subsubMenuItem->Url
;?>"
target
=
"_new"
class
="
list
-
group
-
item
menu
-
level
-
3
-
item
<?=
$subsubMenuItem
->
Selected
?
"active"
:
""
;
?>
">
<?=
$subsubMenuItem
->
VisibleName
;
?>
</a>
<?php
elseif
(
$aclObj
->
isPageAccessible
(
$_SESSION
[
'Username'
],
$subsubMenuItem
->
Url
))
:?>
<
a
href
=
"<?=
$subsubMenuItem->Url
;?>"
class
="
list
-
group
-
item
menu
-
level
-
3
-
item
<?=
$subsubMenuItem
->
Selected
?
"active"
:
""
;
?>
">
<?=
$subsubMenuItem
->
VisibleName
;
?>
</a>
<?php
endif
;
endforeach
;
?>
</div>
<?php
elseif
(
$subMenuItem
->
IsExternal
==
"Y"
)
:?>
<
a
href
=
"<?=
$subMenuItem->Url
;?>"
target
=
"_new"
class
="
list
-
group
-
item
<?=
$subMenuItem
->
Selected
?
"active"
:
""
;
?>
">
<?=
$subMenuItem
->
VisibleName
?>
<span
class=
"
<?=
$subMenuItem
->
CssClass
;
?>
__iconspacer pull-right"
></span></a>
<?php
elseif
(
$aclObj
->
isPageAccessible
(
$_SESSION
[
'Username'
],
$subMenuItem
->
Url
))
:?>
<
a
href
=
"<?=
$subMenuItem->Url
;?>"
class
="
list
-
group
-
item
<?=
$subMenuItem
->
Selected
?
"active"
:
""
;
?>
">
<?=
$subMenuItem
->
VisibleName
;
?>
<span
class=
"
<?=
$subMenuItem
->
CssClass
;
?>
__iconspacer pull-right"
></span></a>
<?php
endif
;
?>
<?php
endforeach
;
?>
</div>
<?php
endforeach
;
?>
</div>
</div>
</div>
</div>
</nav>
</nav>
...
...
src/www/head.inc
View file @
a30033c0
...
@@ -38,6 +38,14 @@ $pagetitle = gentitle( $pgtitle );
...
@@ -38,6 +38,14 @@ $pagetitle = gentitle( $pgtitle );
<!-- include (theme) style -->
<!-- include (theme) style -->
<link
href=
"/ui/themes/
<?=
$g
[
'theme'
];
?>
/build/css/main.css"
media=
"screen, projection"
rel=
"stylesheet"
>
<link
href=
"/ui/themes/
<?=
$g
[
'theme'
];
?>
/build/css/main.css"
media=
"screen, projection"
rel=
"stylesheet"
>
<!-- TODO: move to theme style -->
<style>
.menu-level-3-item
{
font-size
:
90%
;
padding-left
:
54px
!important
;
}
</style>
<!-- Favicon -->
<!-- Favicon -->
<link
href=
"/ui/themes/
<?=
$g
[
'theme'
];
?>
/build/images/favicon.png"
rel=
"shortcut icon"
>
<link
href=
"/ui/themes/
<?=
$g
[
'theme'
];
?>
/build/images/favicon.png"
rel=
"shortcut icon"
>
...
@@ -100,6 +108,15 @@ $pagetitle = gentitle( $pgtitle );
...
@@ -100,6 +108,15 @@ $pagetitle = gentitle( $pgtitle );
$
(
"
input
"
).
attr
(
"
autocomplete
"
,
"
off
"
);
$
(
"
input
"
).
attr
(
"
autocomplete
"
,
"
off
"
);
// hide empty menu items
// hide empty menu items
$
(
'
#mainmenu > div > .collapse
'
).
each
(
function
(){
$
(
'
#mainmenu > div > .collapse
'
).
each
(
function
(){
// cleanup empty second level menu containers
$
(
this
).
find
(
"
div.collapse
"
).
each
(
function
(){
if
(
$
(
this
).
children
().
length
==
0
)
{
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
$
(
this
).
remove
();
}
});
// cleanup empty first level menu items
if
(
$
(
this
).
children
().
length
==
0
)
{
if
(
$
(
this
).
children
().
length
==
0
)
{
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
$
(
"
#mainmenu
"
).
find
(
'
[href="#
'
+
$
(
this
).
attr
(
'
id
'
)
+
'
"]
'
).
remove
();
}
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment