Skip to content

1.4 #26

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

1.4 #26

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion webapp/app/views/register.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,6 @@ def login():
if request.method == "POST":
data = request.form.to_dict()

#responsare = get_token(data)
pigapi = api()
code,responsare = pigapi.get_token(payload=data)

Expand Down
45 changes: 28 additions & 17 deletions webapp/app/views/static/assets/css/navbar.css
Original file line number Diff line number Diff line change
Expand Up @@ -138,49 +138,60 @@ a {
height: 100vh;
}

@media screen and (min-width: 768px) {
@media screen and (min-width: 701px) {
body {
margin: calc(var(--header-height) + 1rem) 0 0 0;
padding-left: calc(var(--nav-width) + 2rem);
}
}

@media screen and (min-width: 768px) {
.header {
height: calc(var(--header-height) + 1rem);
padding: 0 2rem 0 calc(var(--nav-width) + 2rem);
}
}

@media screen and (min-width: 768px) {
.header_img {
width: 40px;
height: 40px;
}
}

@media screen and (min-width: 768px) {
.header_img img {
width: 45px;
}
}

@media screen and (min-width: 768px) {
.l-navbar {
left: 0;
padding: 1rem 1rem 0 0;
}
}

@media screen and (min-width: 768px) {
.show-nav {
width: calc(var(--nav-width) + 156px);
}
.body-pd {
padding-left: calc(var(--nav-width) + 188px);
}
}
@media screen and (max-width: 700px) {
body {
margin: calc(var(--header-height) + 1rem) 0 0 0;
padding-left: calc(var(--nav-width) + 2rem);
}

@media screen and (min-width: 768px) {
.header {
height: calc(var(--header-height) + 0.5rem);
padding: 0 2rem 0 calc(var(--nav-width) + 2rem);
}
.header_img {
width: 40px;
height: 40px;
}
.header_img img {
width: 45px;
}
.l-navbar {
left: 0;
padding: 1rem 1rem 0 0;
}
.show-nav {
width: calc(var(--nav-width) + 110px);
}
.body-pd {
padding-left: calc(var(--nav-width) + 188px);
padding-left: calc(var(--nav-width) + 120px);
}
}

Expand Down
4 changes: 2 additions & 2 deletions webapp/app/views/static/assets/js/footer.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@

document.addEventListener("DOMContentLoaded", function() {
const currentVersion = "v1.3"
const currentVersion = "v1.4"
const owner = 'k3nd0x'
const repo = 'piglet'
const p_version = document.getElementById('version')
Expand All @@ -9,7 +9,7 @@ document.addEventListener("DOMContentLoaded", function() {
.then(data => {
const latestVersion = data.tag_name; // Assumes the version is stored in the tag_name field
if (currentVersion !== latestVersion) {
p_version.textContent = `New Version available at Github '${latestVersion}'`;
p_version.textContent = `Piglet - Version ${currentVersion} - Newer version available at Github '${latestVersion}'`;
} else {
p_version.textContent = `Piglet - Version ${currentVersion}`;
}
Expand Down
14 changes: 12 additions & 2 deletions webapp/app/views/static/assets/js/lightswitch.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,15 @@
const body = document.body;
let header = null;
let table = null;
let icon = null;
try {
header = document.getElementById('header');
table = document.getElementsByClassName('table-piglet')
icon = document.getElementById('switch-icon')
} catch (error) {
header = null;
table = null;
icon = null;
}
const html = document.documentElement;

Expand All @@ -22,12 +25,16 @@
for (var i = 0; i < table.length; i++) {
table[i].classList.add('table-dark')
}
icon.classList.remove('bx-moon')
icon.classList.add('bx-sun')
} else if ( theme === "dark") {
for (var i = 0; i < table.length; i++) {
table[i].classList.remove('table-dark')
}
localStorage.setItem("theme", 'light')
html.removeAttribute('data-bs-theme')
icon.classList.remove('bx-sun')
icon.classList.add('bx-moon')
}
}
try {
Expand All @@ -38,19 +45,22 @@
const theme = localStorage.getItem("theme") || "light"
if ( theme == "dark"){
body.classList.toggle("dark")

if (header !== null ) {
header.classList.toggle("dark")
}
html.setAttribute('data-bs-theme', 'dark')
for (var i = 0; i < table.length; i++) {
table[i].classList.add('table-dark')
}
icon.classList.remove('bx-moon')
icon.classList.add('bx-sun')

} else {
for (var i = 0; i < table.length; i++) {
table[i].classList.remove('table-dark')
}
html.removeAttribute('data-bs-theme')

icon.classList.remove('bx-sun')
icon.classList.add('bx-moon')
}
});
4 changes: 2 additions & 2 deletions webapp/app/views/templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@
<i class="bx bx-chevron-left" id="chevron-icon"></i>
</div>
<div class="col-2">
<a id="light-switch" class="header_toggle" title="Switch light" href="#" style="margin-right: 15px;">
<i class="bx bx-moon nav_icon"></i>
<a id="light-switch" class="header_toggle" title="Toggle darkmode" href="#" style="margin-right: 15px;">
<i id="switch-icon" class="bx nav_icon"></i>
</a>

<a title="Show notifications" class="header_toggle" href="#" id="notiRead" aria-expanded="false" data-bs-toggle="dropdown" name="{{ notilist }}" onclick="notiRead();">
Expand Down
Loading