group privacy implemented
This commit is contained in:
@@ -267,7 +267,8 @@ def group_edit(gid):
|
|||||||
if request.method == "POST":
|
if request.method == "POST":
|
||||||
name = request.form["name"]
|
name = request.form["name"]
|
||||||
desc = request.form["desc"]
|
desc = request.form["desc"]
|
||||||
db.execute("UPDATE groups SET group_name=(?), group_description=(?) WHERE id=(?)",(name, desc, gid))
|
privacy = request.form["privacy"]
|
||||||
|
db.execute("UPDATE groups SET group_name=(?), group_description=(?), public=(?) WHERE id=(?)",(name, desc, privacy, gid))
|
||||||
db.commit()
|
db.commit()
|
||||||
|
|
||||||
return redirect(url_for("manage.groups"))
|
return redirect(url_for("manage.groups"))
|
||||||
@@ -4,6 +4,8 @@
|
|||||||
{% block content %}
|
{% block content %}
|
||||||
|
|
||||||
{% for group in groups %}
|
{% for group in groups %}
|
||||||
|
{% if not g.user and group[3]==0 %}
|
||||||
|
{% else %}
|
||||||
<div class="heading big">{{group[1]}}</div>
|
<div class="heading big">{{group[1]}}</div>
|
||||||
<div class="maintext">
|
<div class="maintext">
|
||||||
{{group[2]}}<br><br>
|
{{group[2]}}<br><br>
|
||||||
@@ -13,6 +15,7 @@
|
|||||||
{% endfor %}
|
{% endfor %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
</div>
|
</div>
|
||||||
|
{% endif %}
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
@@ -22,8 +22,13 @@
|
|||||||
<input name="name" id="name" value="{{group[1]}}" required><br>
|
<input name="name" id="name" value="{{group[1]}}" required><br>
|
||||||
<label for="desc">Description</label>
|
<label for="desc">Description</label>
|
||||||
<textarea name="desc" id="desc">{{group[2]}}</textarea><br>
|
<textarea name="desc" id="desc">{{group[2]}}</textarea><br>
|
||||||
|
<input type="radio" id="public" name="privacy" value=1 {% if group[3]==1 %}checked{% endif %}>
|
||||||
|
<label for="public">Public</label><br>
|
||||||
|
<input type="radio" id="private" name="privacy" value=0 {% if group[3]==0 %}checked{% endif %}>
|
||||||
|
<label for="private">Private</label><br>
|
||||||
<input type="submit" value="Submit">
|
<input type="submit" value="Submit">
|
||||||
</form>
|
</form>
|
||||||
|
<a class="danger">Delete group</a> - WARNING: this action is permanent and irreversible. this will not delete any members contained within the group.
|
||||||
<hr>
|
<hr>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user