diff --git a/app/routes.py b/app/routes.py index a227d50..00a9c8e 100644 --- a/app/routes.py +++ b/app/routes.py @@ -25,11 +25,8 @@ def to_json_array(collection): @app.route("/") def index(): - # get all elections that have this status. pending - status = Status.query.get(1) - elections = Election.query.with_parent( - status).all() # all elections in the system - return render_template("index.html", title="Home Page", elections=elections) + + return render_template("index.html", title="Home Page") @app.route("/login-complete") @@ -58,11 +55,15 @@ def login_complete(): return redirect(url_for('dashboard')) -@app.route("/dashboard") +@app.route("/home") @login_required def dashboard(): - elections = current_user.elections.all() # all user elections - return render_template("dashboard.html", title="User Dashboard", elections=elections) + # get all elections that have this status. pending + status = Status.query.get(1) + elections = Election.query.with_parent( + status).all() # all elections in the system + user_elections = current_user.elections.all() # all user elections + return render_template("dashboard.html", title="User Home", elections=elections, user_elections=user_elections) @app.route("/elections/new", methods=['GET', 'POST']) diff --git a/app/static/css/styles.css b/app/static/css/styles.css new file mode 100644 index 0000000..e2ab167 --- /dev/null +++ b/app/static/css/styles.css @@ -0,0 +1,9 @@ +body { + /* color: grey; */ + background-color: #e1e1e1; +} + +header { + background-color: #5792cf !important; + color: white; +} diff --git a/app/templates/dashboard.html b/app/templates/dashboard.html index 9c45421..1ff6d45 100644 --- a/app/templates/dashboard.html +++ b/app/templates/dashboard.html @@ -2,20 +2,41 @@ {% block content %}
| - Id + Name + | ++ Status | ++ Actions + | + + {% for election in user_elections %} + {% include "partials/election_record.html" %} + {% endfor %} +
|---|
| Name | @@ -23,13 +44,12 @@- Actions + Action | {% for election in elections %} {% include "partials/election_record.html" %} {% endfor %}
|---|
+ Yarnnsss +
-| - Id - | -- Name - | -- Status - | -- Action - | - - {% for election in elections %} - {% include "partials/election_record.html" %} - {% endfor %} -
|---|