91 lines
3.1 KiB
HTML
91 lines
3.1 KiB
HTML
<nav class="navbar">
|
|
<section>
|
|
<div class="navbar__heading">
|
|
<h2>Tables</h2>
|
|
<form
|
|
action="{{ navigator.get_root_path() -}}
|
|
/w/{{ workspace.id.simple() -}}
|
|
/add-table"
|
|
method="post"
|
|
>
|
|
<!-- FIXME: CSRF -->
|
|
<button type="submit">+</button>
|
|
</form>
|
|
</div>
|
|
<menu class="navbar__menu">
|
|
{%- for rel in relations %}
|
|
<li class="navbar__menu-item
|
|
{%- if current == Some(NavLocation::Rel(rel.oid.to_owned(), None)) -%}
|
|
{# preserve space #} navbar__menu-item--active
|
|
{%- endif -%}
|
|
">
|
|
<collapsible-menu
|
|
class="navbar__collapsible-menu"
|
|
expanded="
|
|
{%- if let Some(NavLocation::Rel(rel_oid, _)) = current -%}
|
|
{%- if rel_oid.to_owned() == rel.oid -%}
|
|
true
|
|
{%- endif -%}
|
|
{%- endif -%}
|
|
"
|
|
>
|
|
<h4 slot="summary" class="navbar__heading navbar__heading--entity">
|
|
{{ rel.name }}
|
|
</h4>
|
|
<menu slot="content" class="navbar__menu">
|
|
<li class="navbar__menu-item">
|
|
<a
|
|
href="{{ navigator.get_root_path() }}/r/{{ rel.oid.0 }}/rbac"
|
|
class="navbar__menu-link"
|
|
>
|
|
Sharing
|
|
</a>
|
|
</li>
|
|
<li class="navbar__menu-item">
|
|
<collapsible-menu class="navbar__collapsible-menu">
|
|
<div slot="summary" class="navbar__heading">
|
|
<h5>Portals</h5>
|
|
<form
|
|
action="{{ navigator.get_root_path() -}}
|
|
/w/{{ workspace.id.simple() -}}
|
|
/r/{{ rel.oid.0 -}}
|
|
/add-portal"
|
|
method="post"
|
|
>
|
|
<!-- FIXME: CSRF -->
|
|
<button type="submit">+</button>
|
|
</form>
|
|
</div>
|
|
<menu slot="content" class="navbar__menu">
|
|
{% for portal in rel.portals %}
|
|
<li class="navbar__menu-item
|
|
">
|
|
<a
|
|
href="
|
|
{{- navigator.get_root_path() -}}
|
|
/w/{{ workspace.id.simple() -}}
|
|
/r/{{ rel.oid.0 -}}
|
|
/p/{{ portal.id.simple() -}}
|
|
"
|
|
class="navbar__menu-link navbar__menu-link--entity
|
|
{%- if current == Some(NavLocation::Rel(rel.oid.to_owned(), Some(RelLocation::Portal(portal.id.to_owned())))) -%}
|
|
{# preserve space #} navbar__menu-link--current
|
|
{%- endif -%}
|
|
"
|
|
>
|
|
{{ portal.name }}
|
|
</a>
|
|
</li>
|
|
{% endfor %}
|
|
</menu>
|
|
</collapsible-menu>
|
|
</li>
|
|
</menu>
|
|
</collapsible-menu>
|
|
</li>
|
|
{% endfor -%}
|
|
</menu>
|
|
</section>
|
|
<script type="module" src="{{ navigator.get_root_path() }}/js_dist/collapsible-menu.webc.mjs"></script>
|
|
</nav>
|
|
|