commit b9a4e5ac1188a3cdf8ce7ad64b3babcffd60c3ab
parent 49a256ab7c12af63aab4014564ac5c0fe176d86f
Author: Brennen T. Mazur <brennen@madis.cool>
Date: Wed, 15 Mar 2023 14:50:19 -0600
Merge branch 'auth' of git.brennen.work:stc into auth
Diffstat:
8 files changed, 126 insertions(+), 0 deletions(-)
diff --git a/app/routes.py b/app/routes.py
@@ -419,6 +419,49 @@ def knowlegebase():
return render_template('knowlegebase/index.html',ORGNAME=OrganizationName)
+# Report Routes
+# Agreement Routes
+@app.route('/admin/reports/agreement')
+@login_required
+def agreement_report():
+ return render_template ('admin/reports/agreement_report.html', ORGNAME=OrganizationName)
+
+@app.route('/admin/reports/agreements/<agreement>')
+@login_required
+def project_report():
+ return render_template ('admin/reports/project.html')
+
+# Payperiod Routes
+@app.route('/admin/reports/pay-period')
+@login_required
+def pay_period_report():
+ pay = mongo.db.time_collection.find()
+ user = mongo.db.user_colelction.find()
+ return render_template ('admin/reports/pay_period_report.html', user=user, pay=pay, ORGNAME=OrganizationName)
+
+# @app.route("/dev/fleetdata")
+# @login_required
+# def fleetdatalist():
+# allfleetdata = mongo.db.fleet_collection.find()
+# return render_template('dev/fleetdata.html', allfleetdata=allfleetdata)
+
+@app.route('/admin/reports/employee/<username>')
+@login_required
+def employee_report():
+ return render_template ('admin/reports/employee_report.html', ORGNAME=OrganizationName)
+
+# Vehicle Routes
+@app.route('/admin/reports/vehicles')
+@login_required
+def vehicle_report():
+ return render_template ('admin/reports/vehicle_report.html', ORGNAME=OrganizationName)
+
+@app.route('/admin/reports/vehicles/<vehicle>')
+@login_required
+def vehicle_indepth():
+ return render_template ('admin/reports/vehicle_report.html', ORGNAME=OrganizationName)
+# Report Routes End
+
#====================================#
############# ##############
#### DEVELOPMENT ROUTES ####
diff --git a/app/templates/admin/employee_report/widget.html b/app/templates/admin/employee_report/widget.html
@@ -0,0 +1,12 @@
+<section class="agreements">
+ <h3>Employee Overlook</h3>
+ <div class="progress">First Middle Last
+ <div class="total-progress">Username</div>
+ <div class="progress-bar">email</div>
+ <div class="progress-bar">Phone Number</div>
+ <div class="progress-bar">Branch</div>
+ <div class="progress-bar">Address</div>
+ <div class="progress-bar">Birthday</div>
+ <div class="progress-bar">Role</div>
+ </div>
+</section>
diff --git a/app/templates/admin/pay_period_report/widget.html b/app/templates/admin/pay_period_report/widget.html
@@ -0,0 +1,15 @@
+<section class="agreements">
+ <h3>Pay-period Overlook</h3>
+ <!-- Hourly -->
+ <a href="/admin/reports/employee/<username>" onClick="alert('route to /admin/reports/employee/<username>')"><div class="progress">{{ user.fname }} {{ user.mname }}. {{ user.lname }}
+ <div class="total-progress">Amount Due: totalmoney</div> <!-- Multiply hours by pay-value -->
+ <div class="progress-bar">Total Time: 40 hours, 15 minutes</div>
+ <div class="progress-bar">Pay Rate: ${{ user.pay_value }}</div>
+ </div></a>
+ <!-- Salaried -->
+ <a href="/admin/reports/employee/<username>" onClick="alert('route to /admin/reports/employee/<username>')"><div class="progress">Brennen Mazur
+ <div class="total-progress">Amount Due: totalmoney</div> <!-- Divide pay-value by 24 -->
+ <div class="progress-bar">Total Time: 35 hours, 16 minutes</div>
+ <div class="progress-bar">Pay Rate: $65,000</div>
+ </div></a>
+</section>
diff --git a/app/templates/admin/reports/agreement_report.html b/app/templates/admin/reports/agreement_report.html
diff --git a/app/templates/admin/reports/employee_report.html b/app/templates/admin/reports/employee_report.html
@@ -0,0 +1,14 @@
+{% extends 'base.html' %}
+
+{% block title %}Employee Reports{% endblock %}
+
+{% block content %}
+ <section class="admin-grid">
+ <!-- returned values from admin check is array of permissive ACCESS else return 'missing permissions response' -->
+ {%- for x in ['reports','employee_report','roles','users'] %}
+ {% include 'admin/'~x~'/widget.html' %}
+ {%- else-%}
+ {{ 'You do not have permission to access this page' }}
+ {%- endfor %}
+ </section>
+{% endblock %}
diff --git a/app/templates/admin/reports/pay_period_report.html b/app/templates/admin/reports/pay_period_report.html
@@ -0,0 +1,14 @@
+{% extends 'base.html' %}
+
+{% block title %}Payment Reports{% endblock %}
+
+{% block content %}
+ <section class="admin-grid">
+ <!-- returned values from admin check is array of permissive ACCESS else return 'missing permissions response' -->
+ {%- for x in ['reports','pay_period_report','roles','users'] %}
+ {% include 'admin/'~x~'/widget.html' %}
+ {%- else-%}
+ {{ 'You do not have permission to access this page' }}
+ {%- endfor %}
+ </section>
+{% endblock %}
diff --git a/app/templates/admin/reports/vehicle_report.html b/app/templates/admin/reports/vehicle_report.html
@@ -0,0 +1,14 @@
+{% extends 'base.html' %}
+
+{% block title %}Vehicle Reports{% endblock %}
+
+{% block content %}
+ <section class="admin-grid">
+ <!-- returned values from admin check is array of permissive ACCESS else return 'missing permissions response' -->
+ {%- for x in ['reports','employee_report','roles','users'] %}
+ {% include 'admin/'~x~'/widget.html' %}
+ {%- else-%}
+ {{ 'You do not have permission to access this page' }}
+ {%- endfor %}
+ </section>
+{% endblock %}
diff --git a/app/templates/admin/vehicle_report/widget.html b/app/templates/admin/vehicle_report/widget.html
@@ -0,0 +1,14 @@
+<section class="agreements">
+ <h3>Vehicle Overlook</h3>
+ <a href="/admin/agreement" onClick="alert('route to /admin/agreement<id>')"><div class="progress">Agreement Bid
+ <div class="total-progress" style="width:51.71%;">10342/20000</div>
+ <div class="progress-bar" style="width:5.7%;">Project1:342/6000</div>
+ <div class="progress-bar" style="width:85.71%;">Project2:6000/7000</div>
+ <div class="progress-bar" style="width:57.14%;">Project3:4000/7000</div>
+ </div></a>
+ <a href="/admin/agreement" onClick="alert('route to /admin/agreement<id>')"><div class="progress">Agreement Bid 2
+ <div class="total-progress" style="width:30%;">10000/30000</div>
+ <div class="progress-bar" style="width:28.94%;">Project1:4342/15000</div>
+ <div class="progress-bar" style="width:37.72%;">Project3:5658/15000</div>
+ </div></a>
+</section>