stc

a simple time card webapp
git clone _git@git.brennen.work:stc.git
Log | Files | Refs | README

base.html (3203B)


      1 <!DOCTYPE html>
      2 <html>
      3 <head>
      4 	<meta charset="UTF-8">
      5 	{% if title %}
      6 	<title>{% block title %} {% endblock %} - {{ ORGNAME }}</title>
      7 	{% else %}
      8 	<title>{{ ORGNAME }}</title>
      9 	{% endif %}
     10 	<link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
     11 	<meta name="viewport" content="width=device-width,initial-scale=1" />
     12 </head>
     13 <body onload="startTime()">
     14 <!-- BEGIN NAVIGATION BAR -->
     15 	<header>
     16 		<!-- BEGIN logo -->
     17 		<a id="logo" href="{{ url_for('dashboard') }}"><img src="{{ url_for('static', filename='imgs/logo.svg') }}" /></a>
     18 		<!-- END logo -->
     19 		<!-- BEGIN navigation/navi logic -->
     20 		{% if current_user.is_authenticated %}
     21 			<!-- if userHasPermission(current_user.role) [admin] | if route is admin [dashboard] else [empty space]-->{% if adminNav == True %}
     22 			<a href="{{ url_for('admin') }}"><div id="navi">Admin</div></a>
     23 			{% else %}
     24 			<a href="{{ url_for('dashboard') }}"><div id="navi">Dashboard</div></a>
     25 			{% endif %}
     26 		{% else %} 
     27 			<div id="navi"></div>
     28 		{% endif %}
     29 		<!-- END navigation/navi logic -->
     30 		<!-- BEGIN login/logout logic -->
     31 		{% if current_user.is_anonymous == True %}
     32 			<a href="{{ url_for('login') }}"><div id="logout">Login</div></a>
     33 		{% else %} 
     34 			<a href="{{ url_for('logout') }}"><div id="logout">Logout</div></a>
     35 		{% endif %}
     36 		<!-- END login/logout logic -->
     37 	</header>
     38 <!-- END NAVIGATION BAR -->
     39 <!-- BEGIN DOCUMENTATION BUTTON -->
     40 		<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>
     41 <!-- END DOCUMENTATION BUTTON -->
     42 	<section class="appview">
     43 		{% block content %} {% endblock %}
     44 	</section>
     45 
     46 	<footer>
     47 		Engineered with &#10084; for {{ ORGNAME }} with Sawtooth Systems
     48 	</footer>
     49 {% if current_user.is_authenticated %}
     50 <script>
     51 function startTime() {
     52 	const today = new Date();
     53 	let h = today.getHours();
     54 	let m = today.getMinutes();
     55 	let s = today.getSeconds();
     56 	m = checkTime(m);
     57 	s = checkTime(s);
     58 	document.getElementById('clock').innerHTML =  h + ":" + m + ":" + s;
     59 	setTimeout(startTime, 1000);
     60 }
     61 
     62 function checkTime(i) {
     63 	if (i < 10) {i = "0" + i};  // add zero in front of numbers < 10
     64 	return i;
     65  }
     66 </script>
     67 {% endif %}
     68 </body>
     69 </html>
     70