Skip to content

Commit

Permalink
Add a base.html for embedathon
Browse files Browse the repository at this point in the history
  • Loading branch information
anirudhprabhakaran3 committed Dec 16, 2023
1 parent 2b38413 commit 1921aa8
Show file tree
Hide file tree
Showing 8 changed files with 48 additions and 69 deletions.
5 changes: 3 additions & 2 deletions corpus/templates/embedathon/admin.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
Admin | Embedathon
Admin
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down
24 changes: 24 additions & 0 deletions corpus/templates/embedathon/base.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
{% extends 'base.html' %}

{% block title %}
| Embedathon
{% endblock %}

{% block script %}
<script>
document.addEventListener("DOMContentLoaded", function () {
const theme = "synthwave";
const currTheme = localStorage.getItem("corpusTheme");
const themeButton = document.getElementById("dark-mode-button");
themeButton.remove();
localStorage.setItem("corpusThemeArchive", currTheme);
localStorage.setItem("corpusTheme", theme);
document.documentElement.setAttribute("data-theme", theme);
});

window.addEventListener("beforeunload", function (event) {
const oldTheme = localStorage.getItem("corpusThemeArchive");
localStorage.setItem("corpusTheme", oldTheme);
})
</script>
{% endblock %}
24 changes: 3 additions & 21 deletions corpus/templates/embedathon/home.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
Home | Embedathon
Home
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -203,22 +204,3 @@ <h2>Contact</h2>
<div class="md:basis-1/6"></div>
</div>
{% endblock %}

{% block script %}
<script>
document.addEventListener("DOMContentLoaded", function () {
const theme = "synthwave";
const currTheme = localStorage.getItem("corpusTheme");
const themeButton = document.getElementById("dark-mode-button");
themeButton.remove();
localStorage.setItem("corpusThemeArchive", currTheme);
localStorage.setItem("corpusTheme", theme);
document.documentElement.setAttribute("data-theme", theme);
});

window.addEventListener("beforeunload", function (event) {
const oldTheme = localStorage.getItem("corpusThemeArchive");
localStorage.setItem("corpusTheme", oldTheme);
})
</script>
{% endblock %}
24 changes: 3 additions & 21 deletions corpus/templates/embedathon/index.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
Dashboard | Embedathon
Dashboard
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -156,22 +157,3 @@ <h3>Create a team</h3>
</div>
</div>
{% endblock %}

{% block script %}
<script>
document.addEventListener("DOMContentLoaded", function () {
const theme = "synthwave";
const currTheme = localStorage.getItem("corpusTheme");
const themeButton = document.getElementById("dark-mode-button");
themeButton.remove();
localStorage.setItem("corpusThemeArchive", currTheme);
localStorage.setItem("corpusTheme", theme);
document.documentElement.setAttribute("data-theme", theme);
});

window.addEventListener("beforeunload", function (event) {
const oldTheme = localStorage.getItem("corpusThemeArchive");
localStorage.setItem("corpusTheme", oldTheme);
})
</script>
{% endblock %}
21 changes: 4 additions & 17 deletions corpus/templates/embedathon/register.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
Register | Embedathon
Register
{{ block.title }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -128,6 +129,7 @@ <h1 class="text-center">Register for Embedathon</h1>
{% endblock %}

{% block script %}
{{ block.super }}
<script>
document.addEventListener("DOMContentLoaded", function () {
let nitkChackbox = document.getElementById("{{ form.from_nitk.id_for_label }}");
Expand All @@ -152,20 +154,5 @@ <h1 class="text-center">Register for Embedathon</h1>
toggleIEEE();
ieeeCheckbox.addEventListener("change", toggleIEEE);
})

document.addEventListener("DOMContentLoaded", function () {
const theme = "synthwave";
const currTheme = localStorage.getItem("corpusTheme");
const themeButton = document.getElementById("dark-mode-button");
themeButton.remove();
localStorage.setItem("corpusThemeArchive", currTheme);
localStorage.setItem("corpusTheme", theme);
document.documentElement.setAttribute("data-theme", theme);
});

window.addEventListener("beforeunload", function (event) {
const oldTheme = localStorage.getItem("corpusThemeArchive");
localStorage.setItem("corpusTheme", oldTheme);
})
</script>
{% endblock %}
5 changes: 3 additions & 2 deletions corpus/templates/embedathon/team_management.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
Team Management | Embedathon
Team Management
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down
7 changes: 4 additions & 3 deletions corpus/templates/embedathon/team_page.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
{{ team.team_name }} | Team Management | Embedathon
{{ team.team_name }} | Team Management
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -50,4 +51,4 @@ <h3>Members</h3>
<a href="{% url 'embedathon_admin_teams' %}"
class="btn btn-secondary text-black font-bold no-underline">Back</a>
</div>
{% endblock %}
{% endblock %}
7 changes: 4 additions & 3 deletions corpus/templates/embedathon/user_management.html
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% extends 'base.html' %}
{% extends 'embedathon/base.html' %}

{% block title %}
User Management | Admin | Embedathon
User Management | Admin
{{ block.super }}
{% endblock %}

{% block content %}
Expand Down Expand Up @@ -43,4 +44,4 @@ <h1 class="text-center">User Management</h1>

<a href="{% url 'embedathon_admin' %}" class="btn btn-secondary text-black font-bold no-underline">Back</a>
</div>
{% endblock %}
{% endblock %}

0 comments on commit 1921aa8

Please sign in to comment.