diff --git a/servicePoints/templates/index.html b/servicePoints/templates/index.html index f0c4ffcff6a81a517155f4ba8bf067427aeb574b..f6311cd4d23ff107a10a3af7de6323a779ca8c02 100644 --- a/servicePoints/templates/index.html +++ b/servicePoints/templates/index.html @@ -50,9 +50,14 @@ Username: {{username}} <div class="dropdown"> <button onclick="myFunction()" class="dropbtn">Settings</button> + <div id="myDropdown" class="dropdown-content"> <a href="/accounts/profile/">Profile</a> + {% if leader == 1 %} + <a href="/accounts/manageOrg/">Manage Org</a> + {% endif %} <a href="/accounts/logout/">Logout</a> + </div> </div> diff --git a/servicePoints/templates/manageOrg.html b/servicePoints/templates/manageOrg.html new file mode 100644 index 0000000000000000000000000000000000000000..ecbcf5dc857daa821ab9ff1a82dd9b7287cbce1b --- /dev/null +++ b/servicePoints/templates/manageOrg.html @@ -0,0 +1,13 @@ +<!DOCTYPE html> +<html> + <head> + <link rel="stylesheet" type="text/css" href="/css/style.css"> + <title>ServicePoints</title> + </head> + + <body> + <p> + {{org}} + </p> + </body> +</html> diff --git a/servicePoints/views/__pycache__/accounts.cpython-36.pyc b/servicePoints/views/__pycache__/accounts.cpython-36.pyc index 9f728b0a7d16dbe1209a926485c7d9974f50d743..cb131b8bf79f711104bf893a45155d5bdf30fd1c 100644 Binary files a/servicePoints/views/__pycache__/accounts.cpython-36.pyc and b/servicePoints/views/__pycache__/accounts.cpython-36.pyc differ diff --git a/servicePoints/views/accounts.py b/servicePoints/views/accounts.py index 15a067e9f2dd232cc8b9fea3aa05b7112026a9a3..3e0dba8f95b44e2eb5589e6d511993ff52bcefcf 100644 --- a/servicePoints/views/accounts.py +++ b/servicePoints/views/accounts.py @@ -483,6 +483,20 @@ def confirmSubmission(): context = {"leader": results["fullname"]} return render_template('confirmSubmission.html', **context) +@servicePoints.app.route('/accounts/manageOrg/', methods=['GET', 'POST']) +def manageOrg(): + if 'username' in flask.session: + username = flask.session["username"] + if flask.request.method == 'POST': + return flask.redirect(flask.url_for('login')) + cursor = servicePoints.model.get_db() + leaderCur = cursor.execute('SELECT orgName FROM orgs WHERE ' + 'username =:who', + {"who": username}) + results = leaderCur.fetchone() + context = {'org': results["orgName"]} + return render_template('manageOrg.html', **context) + return flask.redirect(flask.url_for('login')) def sha256sum(filename):