improve navigation
This commit is contained in:
parent
36bf32dd30
commit
9818df10f7
7 changed files with 70 additions and 53 deletions
|
|
@ -45,7 +45,7 @@ pub(super) fn new_router() -> Router<App> {
|
||||||
post(update_name_handler::post),
|
post(update_name_handler::post),
|
||||||
)
|
)
|
||||||
.route(
|
.route(
|
||||||
"/{workspace_id}/add-service-credential",
|
"/{workspace_id}/service-credentials/add-service-credential",
|
||||||
post(add_service_credential_handler::post),
|
post(add_service_credential_handler::post),
|
||||||
)
|
)
|
||||||
.route("/{workspace_id}/add-table", post(add_table_handler::post))
|
.route("/{workspace_id}/add-table", post(add_table_handler::post))
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
{% extends "base.html" %}
|
|
||||||
|
|
||||||
{% block main %}
|
|
||||||
<table>
|
|
||||||
<tbody>
|
|
||||||
{% for base in bases %}
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
<a href="{{ settings.root_path }}/d/{{ base.id.simple() }}/config">
|
|
||||||
{{ base.name }}
|
|
||||||
</a>
|
|
||||||
</td>
|
|
||||||
</tr>
|
|
||||||
{% endfor %}
|
|
||||||
</tbody>
|
|
||||||
</table>
|
|
||||||
{% endblock %}
|
|
||||||
|
|
@ -1,7 +1,12 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block main %}
|
{% block head_extras %}
|
||||||
<link rel="stylesheet" href="{{ settings.root_path }}/css_dist/viewer.css">
|
<link rel="stylesheet" href="{{ settings.root_path }}/css_dist/viewer.css">
|
||||||
|
<script type="module" src="{{ settings.root_path }}/js_dist/table-viewer.webc.mjs"></script>
|
||||||
|
<script type="module" src="{{ settings.root_path }}/js_dist/filter-menu.webc.mjs"></script>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block main %}
|
||||||
<div class="page-grid">
|
<div class="page-grid">
|
||||||
<div class="page-grid__toolbar">
|
<div class="page-grid__toolbar">
|
||||||
<div class="page-grid__toolbar-utilities">
|
<div class="page-grid__toolbar-utilities">
|
||||||
|
|
@ -24,6 +29,4 @@
|
||||||
<table-viewer columns="{{ columns | json }}"></table-viewer>
|
<table-viewer columns="{{ columns | json }}"></table-viewer>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
<script type="module" src="{{ settings.root_path }}/js_dist/table-viewer.webc.mjs"></script>
|
|
||||||
<script type="module" src="{{ settings.root_path }}/js_dist/filter-menu.webc.mjs"></script>
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@
|
||||||
method="post"
|
method="post"
|
||||||
>
|
>
|
||||||
<!-- FIXME: CSRF -->
|
<!-- FIXME: CSRF -->
|
||||||
<button aria-label="Add table" class="button--secondary button--small" type="submit">
|
<button class="button--secondary button--small" type="submit">
|
||||||
<i class="ti ti-database-plus"></i>
|
<i class="ti ti-database-plus"><div class="sr-only">Add table</div></i>
|
||||||
</button>
|
</button>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,23 +1,52 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block main %}
|
{% block head_extras %}
|
||||||
<main>
|
{% endblock %}
|
||||||
<h1>Workspaces</h1>
|
|
||||||
<form method="post" action="add">
|
{% block main %}
|
||||||
<button class="button--primary" type="submit">+</button>
|
<div class="page-grid">
|
||||||
</form>
|
<div class="page-grid__toolbar">
|
||||||
<ul>
|
{% include "toolbar_user.html" %}
|
||||||
{% for workspace_perm in workspace_perms %}
|
</div>
|
||||||
<li>
|
<main class="page-grid__main">
|
||||||
<a href="{{ navigator.workspace_page().workspace_id(*workspace_perm.workspace_id).build()?.get_path() }}">
|
<nav class="workspace-nav" style="position: relative; margin: 0 auto; max-width: 540px;">
|
||||||
{% if workspace_perm.workspace_display_name.is_empty() %}
|
<section class="workspace-nav__section">
|
||||||
[Untitled Workspace]
|
<div class="workspace-nav__heading">
|
||||||
{% else %}
|
<h1>My Workspaces</h1>
|
||||||
{{ workspace_perm.workspace_display_name }}
|
<form method="post" action="add">
|
||||||
{% endif %}
|
<button class="button--secondary button--small" type="submit">
|
||||||
</a>
|
<i class="ti ti-plus"><div class="sr-only">Add workspace</div></i>
|
||||||
</li>
|
</button>
|
||||||
{% endfor %}
|
</form>
|
||||||
</ul>
|
</div>
|
||||||
</main>
|
<menu class="workspace-nav__menu">
|
||||||
|
{% for workspace_perm in workspace_perms %}
|
||||||
|
<li class="workspace-nav__menu-item">
|
||||||
|
<div class="workspace-nav__menu-leaf">
|
||||||
|
<a href="
|
||||||
|
{{- navigator
|
||||||
|
.workspace_page()
|
||||||
|
.workspace_id(*workspace_perm.workspace_id)
|
||||||
|
.build()?
|
||||||
|
.get_path() -}}
|
||||||
|
" class="workspace-nav__menu-link">
|
||||||
|
{% if workspace_perm.workspace_display_name.is_empty() %}
|
||||||
|
[Untitled Workspace]
|
||||||
|
{% else %}
|
||||||
|
{{ workspace_perm.workspace_display_name }}
|
||||||
|
{% endif %}
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
{% endfor %}
|
||||||
|
</menu>
|
||||||
|
</section>
|
||||||
|
<section class="workspace-nav__section">
|
||||||
|
<div class="workspace-nav__heading">
|
||||||
|
<h1>Shared With Me</h1>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</nav>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,16 @@
|
||||||
{% extends "base.html" %}
|
{% extends "base.html" %}
|
||||||
|
|
||||||
{% block main %}
|
{% block main %}
|
||||||
<main style="position: relative; margin: 0 auto; max-width: 32rem;">
|
<div class="page-grid">
|
||||||
<h1>{{ workspace.display_name }}</h1>
|
<div class="page-grid__toolbar">
|
||||||
{{ workspace_nav | safe }}
|
{% include "toolbar_user.html" %}
|
||||||
</main>
|
</div>
|
||||||
|
<div class="page-grid__sidebar">
|
||||||
|
<div style="padding: 1rem;">
|
||||||
|
{{ workspace_nav | safe }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<main class="page-grid__main">
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
|
||||||
|
|
@ -78,9 +78,3 @@ $background-current-item: #0001;
|
||||||
text-decoration: none;
|
text-decoration: none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.base-switcher {
|
|
||||||
@include globals.reset-button;
|
|
||||||
font-family: globals.$font-family-data;
|
|
||||||
padding: 1rem;
|
|
||||||
}
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue