technicall you can make groups (it does nothing)
This commit is contained in:
@@ -233,3 +233,18 @@ def delete_ifiles():
|
|||||||
os.remove(os.path.join(current_app.config["ICON_UPLOAD_FOLDER"], icon))
|
os.remove(os.path.join(current_app.config["ICON_UPLOAD_FOLDER"], icon))
|
||||||
|
|
||||||
return redirect(url_for("manage.assets"))
|
return redirect(url_for("manage.assets"))
|
||||||
|
|
||||||
|
@bp.route("/groups", methods=('GET', 'POST'))
|
||||||
|
@login_required
|
||||||
|
def groups():
|
||||||
|
db = get_db()
|
||||||
|
|
||||||
|
if request.method == "POST":
|
||||||
|
name = request.form['name']
|
||||||
|
desc = request.form['desc']
|
||||||
|
db.execute("INSERT INTO groups (group_name, group_description) VALUES (?, ?)",(name, desc))
|
||||||
|
db.commit()
|
||||||
|
|
||||||
|
|
||||||
|
groups = db.execute("SELECT * FROM groups").fetchall()
|
||||||
|
return render_template("manage/groups.html", groups=groups)
|
||||||
@@ -14,6 +14,7 @@
|
|||||||
{% if g.user %}
|
{% if g.user %}
|
||||||
<div class="heading">Manage</div>
|
<div class="heading">Manage</div>
|
||||||
<div class="navitem">> <a href="{{ url_for('manage.new') }}">Add New Member</a></div>
|
<div class="navitem">> <a href="{{ url_for('manage.new') }}">Add New Member</a></div>
|
||||||
|
<div class="navitem">> <a href="{{ url_for('manage.groups') }}">Member groups</a></div>
|
||||||
<div class="navitem">> <a href="{{ url_for('manage.assets') }}">Site Assets</a></div>
|
<div class="navitem">> <a href="{{ url_for('manage.assets') }}">Site Assets</a></div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
|
|||||||
24
myriad/templates/manage/groups.html
Normal file
24
myriad/templates/manage/groups.html
Normal file
@@ -0,0 +1,24 @@
|
|||||||
|
{% extends 'base.html' %}
|
||||||
|
|
||||||
|
{% block header %}
|
||||||
|
<div class="title">{% block title %}Manage groups{% endblock %}</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block content %}
|
||||||
|
|
||||||
|
<div class="heading">Create new group</div>
|
||||||
|
<form method="post">
|
||||||
|
<label for="name">Name</label>
|
||||||
|
<input name="name" id="name" required><br>
|
||||||
|
<label for="desc">Description</label>
|
||||||
|
<textarea name="desc" id="desc"></textarea><br>
|
||||||
|
<input type="submit" value="Submit">
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="heading big">Groups</div>
|
||||||
|
{% for group in groups %}
|
||||||
|
<div class="heading">{{group[1]}}</div>
|
||||||
|
<div class="maintext">{{group[2]}}</div>
|
||||||
|
{% endfor %}
|
||||||
|
|
||||||
|
{% endblock %}
|
||||||
Reference in New Issue
Block a user