Skip to content

Commit

Permalink
layout template formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
rnixx committed May 23, 2024
1 parent 1ae904a commit c1e3a01
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 29 deletions.
6 changes: 2 additions & 4 deletions js/src/sidebar.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,7 @@ export class Sidebar extends ts.Motion {
}

move(evt) {
// prevent scrollbar from toggling
this.scrollbar.elem.css('pointer-events', 'none');
this.scrollbar.disabled = true;
if (evt.pageX <= 115) {
evt.pageX = 115;
}
Expand All @@ -78,7 +77,6 @@ export class Sidebar extends ts.Motion {
}

up() {
// enable scrollbar toggling again
this.scrollbar.elem.css('pointer-events', 'all');
this.scrollbar.disabled = false;
}
}
4 changes: 2 additions & 2 deletions src/cone/app/browser/static/cone/cone.app.protected.js
Original file line number Diff line number Diff line change
Expand Up @@ -810,15 +810,15 @@ var cone_app_protected = (function (exports, $, ts) {
.addClass('expanded');
}
move(evt) {
this.scrollbar.elem.css('pointer-events', 'none');
this.scrollbar.disabled = true;
if (evt.pageX <= 115) {
evt.pageX = 115;
}
this.sidebar_width = parseInt(evt.pageX);
this.elem.css('width', this.sidebar_width);
}
up() {
this.scrollbar.elem.css('pointer-events', 'all');
this.scrollbar.disabled = false;
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/cone/app/browser/static/cone/cone.app.protected.min.js

Large diffs are not rendered by default.

53 changes: 31 additions & 22 deletions src/cone/app/browser/templates/layout.pt
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
ajax:bind="contextchanged"
tal:define="config context.config">

<div class="${config.columns_fluid and 'container-fluid h-100' or 'container h-100'}">
<div class="${'container-fluid' if config.columns_fluid else 'container'} h-100">

<!-- logo -->
<tal:logo replace="structure tile('logo')" />
Expand All @@ -21,10 +21,10 @@
class="d-flex flex-column flex-shrink-0 p-3 px-0 pb-5">

<div id="sidebar_collapse">
<div class="collapse_btn btn btn-primary">
<i class="bi-chevron-right text-light"></i>
<i class="bi-chevron-left text-light"></i>
</div>
<div class="collapse_btn btn btn-primary">
<i class="bi-chevron-right text-light"></i>
<i class="bi-chevron-left text-light"></i>
</div>
</div>

<div id="sidebar_resize">
Expand All @@ -40,20 +40,23 @@
</tal:tiles>

<!-- example items -->
<!-- <li class="nav-item">
<a href="#" class="nav-link text-light" aria-current="page">
<!--
<li class="nav-item">
<a href="#" class="nav-link text-light" aria-current="page">
<i class="bi-heart me-2"></i>
An Item
</a>
</a>
</li>
<li class="nav-item">
<a href="#" class="nav-link text-light active" aria-current="page">
<a href="#" class="nav-link text-light active" aria-current="page">
<i class="bi-cloud me-2"></i>
Active item
</a>
</li> -->
</a>
</li>
-->
<!-- end example items -->

</ul>
</div>
</div>
Expand All @@ -66,57 +69,63 @@
<!-- header -->
<nav id="header-main"
class="position-relative p-0 navbar navbar-expand-lg navbar-light shadow-sm">

<div id="header-content"
tal:define="css config.mainmenu_fluid
and 'justify-content-end h-100 px-0 flex-row flex-lg-row-reverse container-fluid'"
tal:attributes="class css">

<tal:personaltools
condition="config.personaltools"
replace="structure tile('personaltools')" />
condition="config.personaltools"
replace="structure tile('personaltools')" />

<button class="navbar-toggler border-0 shadow-none h-100"
data-bs-target="#navbar-content"
data-bs-toggle="collapse"
type="button">
<span class="navbar-toggler-icon"></span>
<span class="navbar-toggler-icon"></span>
</button>

<div class="collapse shadow navbar-collapse p-3 p-lg-0" id="navbar-content">
<div id="navbar-content"
class="collapse shadow navbar-collapse p-3 p-lg-0">

<tal:mainmenu
<tal:mainmenu
condition="config.mainmenu"
replace="structure tile('mainmenu')" />

<tal:livesearch
<tal:livesearch
condition="config.livesearch"
replace="structure tile('livesearch')" />

<tal:language replace="structure tile('language')" />
<tal:language replace="structure tile('language')" />

</div>
</div>

</nav>

<!-- pathbar-->
<tal:pathbar condition="config.pathbar" replace="structure tile('pathbar')" />
<tal:pathbar
condition="config.pathbar"
replace="structure tile('pathbar')" />

<!-- content -->
<div id="content"
class="px-3 pb-5 py-2 overflow-auto"
ajax:bind="contextchanged"
ajax:action="content:#content:inner">
<tal:content
replace="structure tile(context.contenttile)" />

<tal:content replace="structure tile(context.contenttile)" />
</div>

</div>
<!-- end content area -->

</div>
</div>

<!-- footer -->
<tal:footer replace="structure tile('footer')" />

</div>

</tal:layout>

0 comments on commit c1e3a01

Please sign in to comment.