Skip to content

Commit

Permalink
adding logos of organzations, updating doc, adding flash messages aft…
Browse files Browse the repository at this point in the history
…er deletion of objects
  • Loading branch information
ooemperor committed Nov 25, 2023
1 parent deafa9a commit ca72424
Show file tree
Hide file tree
Showing 10 changed files with 28 additions and 7 deletions.
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/AdminUser.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""

from .Base import BaseHandler
from flask import Request, render_template, redirect, url_for
from flask import Request, render_template, redirect, url_for, flash
import flask


Expand Down Expand Up @@ -177,6 +177,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/admin/{id_}")

# display message that Admin has been deleted on the returned page.
flash("Admin has been deleted")
return redirect(url_for("admins"))

elif self.get_value("action_button") == "Cancel":
Expand Down
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/Exercise.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import flask
from flask import request, render_template, redirect, url_for
from flask import request, render_template, redirect, url_for, flash
from .Base import BaseHandler


Expand Down Expand Up @@ -141,6 +141,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/exercise/{id_}")

# display message that exercise has been deleted on the returned page.
flash("Exercise has been deleted")
return redirect(url_for("exercises"))

elif self.get_value("action_button") == "Cancel":
Expand Down
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/Profile.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import flask
from flask import request, render_template, redirect, url_for
from flask import request, render_template, redirect, url_for, flash
from .Base import BaseHandler


Expand Down Expand Up @@ -141,6 +141,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/profile/{id_}")

# display message that Profile has been deleted on the returned page.
flash("Profile has been deleted")
return redirect(url_for("profiles"))

elif self.get_value("action_button") == "Cancel":
Expand Down
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/Subject.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import flask
from flask import request, render_template, redirect, url_for
from flask import request, render_template, redirect, url_for, flash
from .Base import BaseHandler


Expand Down Expand Up @@ -141,6 +141,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/subject/{id_}")

# display message that Subject has been deleted on the returned page.
flash("Subject has been deleted")
return redirect(url_for("subjects"))

elif self.get_value("action_button") == "Cancel":
Expand Down
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/Task.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""

import flask
from flask import request, render_template, redirect, url_for
from flask import request, render_template, redirect, url_for, flash
from .Base import BaseHandler


Expand Down Expand Up @@ -141,6 +141,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/task/{id_}")

# display message that task has been deleted on the returned page.
flash("Task has been deleted")
return redirect(url_for("tasks"))

elif self.get_value("action_button") == "Cancel":
Expand Down
4 changes: 3 additions & 1 deletion codeGrader/frontend/admin/handlers/User.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
"""
import flask
import json
from flask import request, render_template, redirect, url_for
from flask import request, render_template, redirect, url_for, flash
from .Base import BaseHandler


Expand Down Expand Up @@ -165,6 +165,8 @@ def post(self, id_: int):
if self.get_value("action_button") == "Submit":
response = self.api.delete(f"/user/{id_}")

# display message that user has been deleted on the returned page.
flash("User has been deleted")
return redirect(url_for("users"))

elif self.get_value("action_button") == "Cancel":
Expand Down
Binary file added codeGrader/frontend/admin/static/img/belearn.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added codeGrader/frontend/admin/static/img/ube.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 9 additions & 0 deletions codeGrader/frontend/admin/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,14 @@
<h1 class="header1 core_content">Home</h1>
</div>
<p class="core_content">Welcome to the CodeGrader</p>
<p class="core_content">A project from University of Bern and BeLearn</p>
<div class="core_content">
<img src="{{ url_for('static', filename='img/ube.png') }}" alt="University of Bern" width="300">
<br>
<br>
<img src="{{ url_for('static', filename='img/belearn.png') }}" alt="BeLearn" width="500">
</div>


</div>
{% endblock core %}
2 changes: 1 addition & 1 deletion doc/frontend/AdminFrontendTemplateLinks.drawio

Large diffs are not rendered by default.

0 comments on commit ca72424

Please sign in to comment.