commit b09211b1c3677659c12cbc3394e43b25487e908d
parent 1f61560f2e0503dfaf76a3b6cc19a22ceee34cef
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Tue, 21 Feb 2023 13:02:15 -0700
navigation structure overhaul
Diffstat:
9 files changed, 33 insertions(+), 23 deletions(-)
diff --git a/app/static/css/main.css b/app/static/css/main.css
@@ -20,7 +20,7 @@
html,body {margin:0;padding:0;background-color:var(--rootbg);}
.appview {margin:0;padding:0;}
-
+/* min-height: 100vh;
a,a.visited,a.hover {
text-decoration:none;
color:#000;
@@ -73,7 +73,7 @@ header {
/********** LOGIN PAGE **********/
.login-grid {
display: grid;
- grid-template-rows: repeat(3, 30vh);
+ grid-template-rows: 1fr 2fr 1fr;/*repeat(3, 1fr);*/
grid-template-columns: repeat(3, 1fr);
}
@@ -81,11 +81,11 @@ header {
display: grid;
align-items: center;
justify-items: center;
- grid-row-start: 2;
- grid-row-end: 3;
+ grid-row-start: 1;
+ grid-row-end: 2;
grid-column-start: 2;
grid-column-end: 3;
- padding-top:4rem;
+ padding-top:5rem;
padding-bottom:4rem;
box-shadow: 0px 0px .1em .1em var(--accent);/* probably shouldn't have box-shadow for clean ui at intermediate page sizes (between laptop and phone off ratio) */
}
diff --git a/app/templates/admin/layout.html b/app/templates/admin/layout.html
@@ -2,8 +2,6 @@
{% block title %}Management{% endblock %}
-{% block navigation %}<a href="/dashboard"><div id="dashboard">Dashboard</div></a>{% endblock %}
-
{% block content %}
<section class="admin-grid">
<!--functioncall checking role for admin. while loop return permissioned 'widgets' -->
diff --git a/app/templates/admin/roles/index.html b/app/templates/admin/roles/index.html
@@ -2,8 +2,6 @@
{% block title %}Employees/Crew/Roles{% endblock %}
-{% block navigation %}<a id="navi" href="/admin"><div id="back"><Back</div></a>{% endblock %}
-
{% block content %}
<table> <tr><th>Name</th><th>Role</th><th>Active Employee</th></tr>
<tr>
diff --git a/app/templates/admin/roles/updateroles.html b/app/templates/admin/roles/updateroles.html
@@ -2,8 +2,6 @@
{% block title %}Current Activeated Users{% endblock %}
-{% block navigation %}<a id="navi" href="/admin"><div id="back"><Back</div></a>{% endblock %}
-
{% block content %}
<table>
diff --git a/app/templates/base.html b/app/templates/base.html
@@ -10,12 +10,34 @@
<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
</head>
<body onload="startTime()">
- <header> <!-- logo , if userHasPermission(current_user.role) [admin] | if route is admin [dashboard] else [empty space], if current_user.is_anonymous [login] else [logout] -->
+<!-- BEGIN NAVIGATION BAR -->
+ <header>
+ <!-- BEGIN logo -->
<div id="logo"><a href="{{ url_for('dashboard') }}"><img src="{{ url_for('static', filename='imgs/logo.svg') }}" /></a></div>
- {% block navigation %}{% endblock %} <!-- remove from here and template pgs after nav logic above finished -->
+ <!-- END logo -->
+ <!-- BEGIN navigation/navi logic -->
+ {% if current_user.is_authenticated %}
+ <!-- if userHasPermission(current_user.role) [admin] | if route is admin [dashboard] else [empty space]-->{% if current_user.role == "admin" %}<!-- Need to check for page location -->
+ <a href="{{ url_for('admin') }}"><div id="navi">Admin</div></a>
+ {% else %}
+ <a href="{{ url_for('dashboard') }}"><div id="navi">Dashboard</div></a>
+ {% endif %}
+ {% else %}
+ <div id="navi"></div>
+ {% endif %}
+ <!-- END navigation/navi logic -->
+ <!-- BEGIN login/logout logic -->
+ {% if current_user.is_anonymous %}
+ <a href="{{ url_for('login') }}"><div id="logout">Login</div></a>
+ {% else %}
+ <a href="{{ url_for('logout') }}"><div id="logout">Logout</div></a>
+ {% endif %}
+ <!-- END login/logout logic -->
</header>
+<!-- END NAVIGATION BAR -->
+<!-- BEGIN DOCUMENTATION BUTTON -->
<div id="doc"><a href="/docs"><svg fill="var(--accent)" height="2rem" width="2rem" version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" viewBox="0 0 29.536 29.536" xml:space="preserve"><g stroke-linecap="round" stroke-linejoin="round"/><path d="M14.768,0C6.611,0,0,6.609,0,14.768c0,8.155,6.611,14.767,14.768,14.767s14.768-6.612,14.768-14.767 C29.535,6.609,22.924,0,14.768,0z M14.768,27.126c-6.828,0-12.361-5.532-12.361-12.359c0-6.828,5.533-12.362,12.361-12.362 c6.826,0,12.359,5.535,12.359,12.362C27.127,21.594,21.594,27.126,14.768,27.126z"/> <path d="M14.385,19.337c-1.338,0-2.289,0.951-2.289,2.34c0,1.336,0.926,2.339,2.289,2.339c1.414,0,2.314-1.003,2.314-2.339 C16.672,20.288,15.771,19.337,14.385,19.337z"/> <path d="M14.742,6.092c-1.824,0-3.34,0.513-4.293,1.053l0.875,2.804c0.668-0.462,1.697-0.772,2.545-0.772 c1.285,0.027,1.879,0.644,1.879,1.543c0,0.85-0.67,1.697-1.494,2.701c-1.156,1.364-1.594,2.701-1.516,4.012l0.025,0.669h3.42 v-0.463c-0.025-1.158,0.387-2.162,1.311-3.215c0.979-1.08,2.211-2.366,2.211-4.321C19.705,7.968,18.139,6.092,14.742,6.092z"/></svg></a></div>
-
+<!-- END DOCUMENTATION BUTTON -->
<section class="appview">
{% block content %} {% endblock %}
<!-- functioncall for checking role IF logged in route /dashboard else LOGIN(templates/index.html) -->
diff --git a/app/templates/dashboard/layout.html b/app/templates/dashboard/layout.html
@@ -2,8 +2,6 @@
{% block title %}Dashboard{% endblock %}
-{% block navigation %}<div id="navi"><a href="{{ url_for('admin') }}">Admin</a></div><a href="{{ url_for('logout') }}"><div id="logout">Logout</div></a>{% endblock %}
-
{% block content %}
<section class="base-grid">
<!-- TODO: function call for permissive ACCESS, returns array of strings -->
diff --git a/app/templates/dashboard/punchclock/index.html b/app/templates/dashboard/punchclock/index.html
@@ -2,8 +2,6 @@
{% block title %}Hours{% endblock %}
-{% block navigation %}<a href="/dashboard"><div id="back">< Back</div></a>{% endblock %}
-
{% block content %}
<section class="hours-grid">
<h3>{{ current_user.fname }} {{ current_user.lname }}</h3><!-- IF logged in user has permission allow this username section to be a dropdown for modifying user time sheets. -->
diff --git a/app/templates/index.html b/app/templates/index.html
@@ -2,8 +2,6 @@
{% block title %} Resource Management System {% endblock %}
-{% block navigation %}<div id="nav" href="{{ url_for('logout') }}"></div><div id="logout"></div>{% endblock %}
-
{% block content %}
<section class="singlepage">
<h2>Welcome to YEP!</h2><h6>Call to action! Motto or Mission Statement</h6>
diff --git a/app/templates/login.html b/app/templates/login.html
@@ -2,10 +2,9 @@
{% block title %}Login{% endblock %}
-{% block navigation %}<div id="nav" href="#"></div><div id="logout"></div>{% endblock %}
-
{% block content %}
- <form action="" method="post" novalidate>
+<section class="login-grid">
+ <form class="login" action="" method="post" novalidate>
{{ form.hidden_tag() }}
{% for error in form.errors %}
<span style="color:red;">[{{ error }}]</span>
@@ -20,6 +19,7 @@
</p>
<p>{{ form.login() }}</p>
</form>
+</section>
<!-- old version before structure change -->
<!-- <section class="login-grid">
<form class="login">