Skip to content
Snippets Groups Projects
Commit 5c39608b authored by Nigel Kukard's avatar Nigel Kukard
Browse files

Added dynamic viewport sized if there are menus

parent c5eaa934
No related branches found
No related tags found
No related merge requests found
...@@ -330,6 +330,9 @@ sub httpCreateResponse ...@@ -330,6 +330,9 @@ sub httpCreateResponse
# Set header # Set header
$headers->content_type("text/html"); $headers->content_type("text/html");
# Bootstrap stuff
my $mainCols = 12;
# Check if we have a menu structure, if we do, display the sidebar # Check if we have a menu structure, if we do, display the sidebar
my $styleStr = ""; my $styleStr = "";
my $menuStr = ""; my $menuStr = "";
...@@ -343,12 +346,13 @@ sub httpCreateResponse ...@@ -343,12 +346,13 @@ sub httpCreateResponse
# Check if menu exists # Check if menu exists
if (my $menu = $options->{'menu'}) { if (my $menu = $options->{'menu'}) {
$menuStr =<<EOF; $menuStr =<<EOF;
<ul class="nav nav-pills nav-stacked"> <div class="col-md-2">
<ul class="nav nav-pills nav-stacked">
EOF EOF
# Loop with sub menu sections # Loop with sub menu sections
foreach my $section (keys %{$menu}) { foreach my $section (keys %{$menu}) {
$menuStr .=<<EOF; $menuStr .=<<EOF;
<li class="nav-header">$section</li> <li class="nav-header">$section</li>
EOF EOF
# Loop with menu items # Loop with menu items
foreach my $item (keys %{$menu->{$section}}) { foreach my $item (keys %{$menu->{$section}}) {
...@@ -358,13 +362,17 @@ EOF ...@@ -358,13 +362,17 @@ EOF
# Build sections # Build sections
$menuStr .=<<EOF; $menuStr .=<<EOF;
<li><a href="$link">$item</a></li> <li><a href="$link">$item</a></li>
EOF EOF
} }
} }
$menuStr .=<<EOF; $menuStr .=<<EOF;
</ul> </ul>
</div>
EOF EOF
# Reduce number of main cols to make way for menu
$mainCols = 10;
} }
# Check if we have a list of javascript assets # Check if we have a list of javascript assets
...@@ -400,11 +408,6 @@ EOF ...@@ -400,11 +408,6 @@ EOF
body { body {
padding-top: 50px; padding-top: 50px;
} }
.main-area {
padding-top: 15px;
padding-bottom: 15px;
}
$styleStr $styleStr
</style> </style>
<!-- End Assets --> <!-- End Assets -->
...@@ -423,7 +426,7 @@ $styleStr ...@@ -423,7 +426,7 @@ $styleStr
</div> </div>
<div class="collapse navbar-collapse"> <div class="collapse navbar-collapse">
<ul class="nav navbar-nav"> <ul class="nav navbar-nav">
<li class="active"><a href="#">Home</a></li> <li class="active"><a href="/">Home</a></li>
<li><a href="/limits">Limits</a></li> <li><a href="/limits">Limits</a></li>
<li><a href="/configmanager">ConfigManager</a></li> <li><a href="/configmanager">ConfigManager</a></li>
</ul> </ul>
...@@ -431,20 +434,20 @@ $styleStr ...@@ -431,20 +434,20 @@ $styleStr
</div> </div>
</div> </div>
<div class="main-area container"> <div style="padding: 15px 15px">
<div class="col-md-2"> <div class="row">
$menuStr $menuStr
</div> <div class="col-md-$mainCols">
<div class="col-md-10">
$content $content
</div> </div>
</div> </div>
<hr> </div>
<div style="padding: 0 15px">
<hr />
<footer> <footer>
<p class="muted">v$globals->{'version'} - Copyright &copy; 2013, <a href="http://www.allworldit.com">AllWorldIT</a></p> <p class="muted">v$globals->{'version'} - Copyright &copy; 2013, <a href="http://www.allworldit.com">AllWorldIT</a></p>
</footer> </footer>
</div> </div>
</body> </body>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment