From 66ef5e9e250d8ae770c8080430372793939e8e0a Mon Sep 17 00:00:00 2001
From: Mikkel <4072916+Mikk3@users.noreply.github.com>
Date: Thu, 2 Jun 2022 11:30:04 +0200
Subject: [PATCH] Design ting
---
aula/Group/routes.py | 2 +-
aula/templates/group_show.html | 46 +++++++++++++++++++++++++--------
aula/templates/thread_show.html | 5 ++++
aula/templates/threads.html | 1 +
4 files changed, 42 insertions(+), 12 deletions(-)
diff --git a/aula/Group/routes.py b/aula/Group/routes.py
index 7646b2f..ed9394e 100644
--- a/aula/Group/routes.py
+++ b/aula/Group/routes.py
@@ -47,7 +47,7 @@ def join(group_id):
current_user.join_group(group_id)
flash(f'Du er nu tilmeldt {group.name} gruppen', 'success')
- return redirect(f"/groups")
+ return redirect(f"/groups/{group_id}")
@Group.route("/groups/leave/", methods=['GET'])
def leave(group_id):
diff --git a/aula/templates/group_show.html b/aula/templates/group_show.html
index 1878c05..9537fac 100644
--- a/aula/templates/group_show.html
+++ b/aula/templates/group_show.html
@@ -1,6 +1,7 @@
{% extends "layout.html" %}
{% block content %}
- {{ group.name }}
+ {{ group.name }}
+
{% if posts|length == 0 %}
Gruppen har ingen opslag endnu
@@ -17,6 +18,8 @@
{% endfor %}
+
+ {% if current_user.is_member_of_group(group.group_id) %}
Skriv opslag
@@ -31,20 +34,41 @@
+ {% endif %}
{% endblock content %}
{% block sidebar %}
+ {% if current_user.is_member_of_group(group.group_id) %}
Gruppe tråde
- {% if threads|length == 0 %}
- Gruppen har ingen tråde endnu
+ {% if threads|length == 0 %}
+ Gruppen har ingen tråde endnu
+ {% endif %}
+ {% for thread in threads %}
+ {{ thread.title }}
+ {% endfor %}
+
+
+
+ {% else %}
+
+ Tilmeld dig gruppe for at se gruppe tråde og skrive opslag
+ Tilmeld
+
{% endif %}
- {% for thread in threads %}
- {{ thread.title }}
- {% endfor %}
+
+ {% if current_user.is_member_of_group(group.group_id) %}
+
-
+ {% if group.mandatory %}
+ Obligatorisk gruppe
+ {% else %}
+ Forlad gruppen
+ {% endif %}
+
+ {% endif %}
+
{% endblock sidebar %}
diff --git a/aula/templates/thread_show.html b/aula/templates/thread_show.html
index 33058c4..0fc42b5 100644
--- a/aula/templates/thread_show.html
+++ b/aula/templates/thread_show.html
@@ -30,3 +30,8 @@
{% endblock content %}
+
+{% block sidebar %}
+{{thread.group.name}}
+
+{% endblock sidebar %}
diff --git a/aula/templates/threads.html b/aula/templates/threads.html
index ccc6415..8716f89 100644
--- a/aula/templates/threads.html
+++ b/aula/templates/threads.html
@@ -5,6 +5,7 @@
{% for thread in threads %}
{% endfor %}
{% endblock content %}