commit 8113f0ec0451f38211e67ef24a8c0b8153096f43
parent ae84517eeab98c658b43868647d5d526d0e6424c
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Fri, 9 Dec 2022 14:59:01 -0700
added README.planfor and created changehours page structure
Diffstat:
8 files changed, 72 insertions(+), 5 deletions(-)
diff --git a/.README.planfor.swp b/.README.planfor.swp
Binary files differ.
diff --git a/README.planfor b/README.planfor
@@ -0,0 +1,8 @@
+#Plan for getting appropriate modules
+
+on successfull auth -> base.html calls getModules(),
+ getModules() retrieves permissions[] value from db.users
+ returns string of {% block $module %}{% endblock %} for each value in permission
+
+ This implies you have db.users.$user.permission[val1,val2,...]
+ /admin.html should have 'preset' permissions per role and allow toggling individual level
diff --git a/app.py b/app.py
@@ -19,6 +19,10 @@ def dashboard():
def crewlist():
return render_template ('crewlist.html')
+@app.route("/changehours")#modify to take userid ex. /changehours<userid>
+def changeHours():#userid goes into call to db to get user[] -> then returns formatted table (punchclock/index.html
+ return render_template ('punchclock/index.html')
+
@app.route("/fleet")
def fleet():
return render_template('fleet.html')
@@ -33,4 +37,4 @@ def fleet():
# return render_template('login.html')
if __name__ == '__main__':
- app.run(debug=True)
-\ No newline at end of file
+ app.run(debug=True)
diff --git a/templates/style.css b/static/css/main.css
diff --git a/templates/admin/index.html b/templates/admin/index.html
diff --git a/templates/admin/roles.html b/templates/admin/roles.html
diff --git a/templates/base.html b/templates/base.html
@@ -3,14 +3,26 @@
<head>
<meta charset="UTF-8">
<title>{% block title %} {% endblock %} - {% block orgname %} {% endblock %}</title>
- <link rel="stylesheet" href="/style.css"
+ <link rel="stylesheet" href="{{ url_for('static', filename='css/main.css') }}">
</head>
<body>
<section class="appview">
- {% block content %} {% endblock %}
+ <!-- functioncall for checking role -->
+ <!-- while/for loop adding blocks for permissive widgets -->
+ <!-- this is calling extended block {% block content %} {% endblock %} -->
+
+ <!-- temporary call all blocks for general 'wireframing' -->
+ <!-- start temp widget blocks -->
+ {% block punchclock %} {% endblock %}
+ {% block punchedin %} {% endblock %}
+ {% block fleet %} {% endblock %}
+ <!-- end temp widget blocks -->
+ <!-- start temp full page blocks -->
+ {% block hours %} {% endblock %}
+ <!-- end temp full page blocks -->
</section>
<nav>
- {% block navigation %} {% endblock %}
+ <!-- functioncall for inserting <a> for permissive pages -->
</nav>
</body>
</html>
diff --git a/templates/punchclock/index.html b/templates/punchclock/index.html
@@ -0,0 +1,44 @@
+{% extends 'base.html' %}
+
+{% block hours %}
+ <div class="hours-grid">
+ <h3>username</h3><!-- abstract to 'welcome' function -->
+ <div><!-- abstract to payPeriod() -->
+ <h6>$payperiod range</h6>
+ <button>Request Changes</button>
+ </div>
+ <table><!-- replace w/ function getUserHours(username) -->
+ <tr>
+ <th>Day</th>
+ <th>Project</th>
+ <th>Start</th>
+ <th>Finish</th>
+ <th>Purdium</th>
+ <th>Add Project</th>
+ <th>Remove Time</th>
+ </tr>
+ <tr>
+ <th>Wednesday Jan 3rd</th>
+ <th>Project #1(dropdown)</th>
+ <th><input type="text" value="12:12"/></th>
+ <th><input type="text" value="1:11"/></th>
+ <th><input type="checkbox"></input></th>
+ <th><button>+</button></th>
+ <th><button>-</button></th>
+ </tr>
+ <tr>
+ <th>Wednesday Jan 2rd</th>
+ <th>Project #2(dropdown)</th>
+ <th><input type="text" value="12:12"/></th>
+ <th><input type="text" value="1:11"/></th>
+ <th><input type="checkbox"></input></th>
+ <th><button>+</button></th>
+ <th><button>-</button></th>
+ </tr>
+ <tr><!-- getUserHours(username) if note present returns following tr -->
+ <th></th><!-- date space -->
+ <th>note:<input type="text" value="reason for requested change"/></th>
+ </tr>
+ </table>
+ </div>
+{% endblock %}