add staff page
This commit is contained in:
parent
7d00fdf62f
commit
c21e8b36b7
10
app.py
10
app.py
@ -1,3 +1,4 @@
|
|||||||
|
import csv
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
@ -11,3 +12,12 @@ def index():
|
|||||||
@app.route("/about")
|
@app.route("/about")
|
||||||
def about():
|
def about():
|
||||||
return render_template("about.html")
|
return render_template("about.html")
|
||||||
|
|
||||||
|
|
||||||
|
@app.route("/staff")
|
||||||
|
def staff():
|
||||||
|
# thanks to http://www.figmentfly.com/bb/badguys3.html for names
|
||||||
|
with open("data/employees.csv") as f:
|
||||||
|
employees = list(csv.DictReader(f))
|
||||||
|
|
||||||
|
return render_template("staff.html", employees=employees)
|
||||||
|
46
data/employees.csv
Normal file
46
data/employees.csv
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
first,last,position,status,children,hired
|
||||||
|
John,Barnett,Scheduling,Married,1,3/6/1963
|
||||||
|
John,Bigbooté,Executive Vice President,Single,0,10/31/1938
|
||||||
|
John,Camp,Human Resources,Single,0,6/12/1985
|
||||||
|
John,Careful Walker,Accounting,Single,0,4/30/1990
|
||||||
|
John,Chief Crier,"VP, Public Relations",Married,2,4/2/1980
|
||||||
|
John,Cooper,Storage Acquisition,Single,0,8/15/1984
|
||||||
|
John,Coyote,Medical Research,Married,6,1/1/1970
|
||||||
|
John,Edwards,Public Relations,Divorced,2,8/15/1984
|
||||||
|
John,Fat Eating,Craft Services,Single,0,8/15/1984
|
||||||
|
John,Fish,Marine R&D,Divorced,12,10/31/1938
|
||||||
|
John,Fledgling,Human Resources,Married,2,7/4/1976
|
||||||
|
John,Gomez,"VP, Sales",Married,1,8/15/1984
|
||||||
|
John,Grim,Actuary,Married,1.8,9/9/1970
|
||||||
|
John,Guardian,Optical Systems Engineer,Single,0,6/9/1980
|
||||||
|
John,Icicle Boy,Refrigeration R&D,Single,0,2/6/1939
|
||||||
|
John,Jones,Government Relations,Married,3,8/15/1984
|
||||||
|
John,Joseph,Government Relations,Married,2,10/31/1938
|
||||||
|
John,Kim Chi,Craft Services,Married,2,7/24/1990
|
||||||
|
John,Lee,Accounting,Single,0,12/14/1988
|
||||||
|
John,Littlejohn,Staff Parlementarian,Divorced,0,10/31/1938
|
||||||
|
John,Many Jars,Storage Acquisition Lead,Married,3,1/8/1960
|
||||||
|
John,Milton,Chief Counsel,Single,2,6/6/1966
|
||||||
|
John,Mud Head,Apian Research Lead,Married,7,1/2/1956
|
||||||
|
John,Nephew,Temporal Paradox Resolution,Widowed,0,1/20/1474
|
||||||
|
John,Nolan,Custodian,Married,2,10/31/1938
|
||||||
|
John,O'Connor,Temporal Paradox Resolution,Widowed,1,5/15/2022
|
||||||
|
John,Omar,Imports & Exports,Single,0,9/9/1963
|
||||||
|
John,Parrot,Computer Design Specialist,Married,1,10/1/1970
|
||||||
|
John,Rajeesh,Human Resources,Divorced,1,6/12/1982
|
||||||
|
John,Ready to Fly,Aerial R&D,Married,1,7/4/1976
|
||||||
|
John,Repeat Dance,Sales,Married,3,6/8/1949
|
||||||
|
John,Roberts,Counsel,Married,0,4/1/1962
|
||||||
|
John,Scott,Administration,Single,1,10/31/1938
|
||||||
|
John,Shaw,Administration,Single,0,8/15/1984
|
||||||
|
John,Small Berries,Orbital Ergonomitrics Team Leader,Married,3,10/17/1948
|
||||||
|
John,Starbird,Orbital Ergonomitrics,Married,2,10/18/1948
|
||||||
|
John,Take Cover,Security Administrator,Divorced,0,2/15/2019
|
||||||
|
John,Thorny Stick,Sales,Married,0,8/15/1984
|
||||||
|
John,Turk,System Administrator,Engaged,0,11/3/1986
|
||||||
|
John,Two Horns,Paralegal,Married,0,8/15/1984
|
||||||
|
John,Web,IT Support,Married,1,6/8/1949
|
||||||
|
John,Whorfin,CEO / Lord,Single,0,10/31/1938
|
||||||
|
John,Wood,Sales,Married,1,8/12/1948
|
||||||
|
John,Wright,Orbital Mechanics Supervisor,Married,2,10/4/1985
|
||||||
|
John,Ya Ya,Computer Design Specialist,Married,0,10/31/1938
|
|
@ -7,6 +7,7 @@
|
|||||||
<header>
|
<header>
|
||||||
<a href="#" class="logo">YPS</a>
|
<a href="#" class="logo">YPS</a>
|
||||||
<a href="/" class="button">Home</a>
|
<a href="/" class="button">Home</a>
|
||||||
|
<a href="/staff" class="button">Staff</a>
|
||||||
<a href="/about" class="button">About</a>
|
<a href="/about" class="button">About</a>
|
||||||
</header>
|
</header>
|
||||||
{% block base %}
|
{% block base %}
|
||||||
|
31
templates/staff.html
Normal file
31
templates/staff.html
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
{% extends "base.html" %}
|
||||||
|
|
||||||
|
{% block base %}
|
||||||
|
<div class="card fluid">
|
||||||
|
<h1 class="section">Yoyodyne Propulsion Systems <small>The future begins tomorrow</small></h1>
|
||||||
|
<div class="section">
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>First Name</th>
|
||||||
|
<th>Last Name</th>
|
||||||
|
<th>Position Name</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Hired</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
{% for e in employees %}
|
||||||
|
<tr>
|
||||||
|
<td>{{ e.first }}</td>
|
||||||
|
<td>{{ e.last }}</td>
|
||||||
|
<td>{{ e.position }}</td>
|
||||||
|
<td>{{ e.status }}, {{ e.children }} children</td>
|
||||||
|
<td>{{ e.hired }}</td>
|
||||||
|
</tr>
|
||||||
|
{% endfor %}
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
Loading…
Reference in New Issue
Block a user