Skip to content

Commit

Permalink
pushing the close nav button in admin frontend into base template, ad…
Browse files Browse the repository at this point in the history
…ding support for flashing messaging via base template.
  • Loading branch information
ooemperor committed Nov 23, 2023
1 parent 40a3bba commit 2d2a3bc
Show file tree
Hide file tree
Showing 22 changed files with 27 additions and 20 deletions.
2 changes: 1 addition & 1 deletion codeGrader/frontend/admin/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
@author: mkaiser
@version: 1.0
"""
from flask import Flask, request, render_template, url_for, redirect
from flask import Flask, request, render_template, url_for, redirect, flash
from flask_login import LoginManager, login_user, login_required, logout_user
from codeGrader.frontend.config import config
from codeGrader.frontend.admin import templates
Expand Down
6 changes: 6 additions & 0 deletions codeGrader/frontend/admin/static/css/styling.css
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ body {
.main {
margin-left: 250px;
transition: margin-left 500ms;
position:relative;
}

.light-mode {
Expand Down Expand Up @@ -210,3 +211,8 @@ body {
}

/* Table Styling end*/

.flash {
background-color: red;
padding: 10px;
}
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addAdminUser.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

{% block core %}
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Admin User</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addExercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Exercise</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addProfile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Profile</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addSubject.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Subject</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addTask.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Task</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/addUser.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Add User</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/adminUser.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

{% block core %}
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Admin User {{ username }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/adminUsers.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Administrators</h1>
</div>
Expand Down
20 changes: 20 additions & 0 deletions codeGrader/frontend/admin/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
function openNav() {
document.getElementById("mySidenav").style.width = "250px";
document.getElementById("main").style.marginLeft = "250px";
document.getElementById("flash").style.marginLeft = "250px";
document.getElementById("main-menu-button").style.visibility = "hidden";

}
Expand All @@ -23,6 +24,7 @@
function closeNav() {
document.getElementById("mySidenav").style.width = "0";
document.getElementById("main").style.marginLeft = "0";
document.getElementById("flash").style.marginLeft = "0";
document.getElementById("main-menu-button").style.visibility = "visible";
}
</script>
Expand Down Expand Up @@ -51,8 +53,26 @@
</div>

</div>
<div id="btn_sidenav_close">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
</div>
{% with msgs = get_flashed_messages() %}
{% if msgs %}
<div id="flash" class="main flash">
{% if msgs %}
<ul class="list">
{% for msg in msgs %}
<li class="item">{{ msg }}</li>
{% endfor %}
</ul>
{% endif %}
</div>
{% endif %}
{% endwith %}

{% block core %}
{% endblock %}

</body>

</html>
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/exercise.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Exercise {{ name }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/exercises.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Exercise</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/home.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Home</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Profile {{ name }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/profiles.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Profile</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/subject.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Subject {{ name }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/subjects.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Subject</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/task.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Task {{ name }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/tasks.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Tasks</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/user.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">User {{ username }}</h1>
</div>
Expand Down
1 change: 0 additions & 1 deletion codeGrader/frontend/admin/templates/users.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
{% block core %}
<!-- Add all page content inside this div if you want the side nav to push page content to the right (not used if you only want the sidenav to sit on top of the page -->
<div id="main" class="main">
<span id="main-menu-button" class="btn-menu" onclick="openNav()">&equiv;</span>
<div>
<h1 class="header1 core_content">Users</h1>
</div>
Expand Down

0 comments on commit 2d2a3bc

Please sign in to comment.