-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: run formatter on html files, create pagination component
- Loading branch information
Showing
36 changed files
with
3,119 additions
and
2,276 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,3 +6,6 @@ rpusers.json | |
test.py | ||
static/servers.json | ||
config.json.save | ||
venv/ | ||
node_modules/ | ||
.vscode/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
overrides: [ | ||
{ | ||
files: ["*.html"], | ||
options: { | ||
parser: "jinja-template" | ||
}, | ||
}, | ||
], | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"devDependencies": { | ||
"prettier": "^2.8.1", | ||
"prettier-plugin-jinja-template": "^0.0.4" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,48 @@ | ||
{% extends "base.html" %} | ||
{% block content %} | ||
<h2 class="section-title">Badges</h2> | ||
<p class="section-lead">Modify or edit profile badges!</p> | ||
<div class="card"> | ||
<div class="card-header"> | ||
Badges | ||
</div> | ||
<h2 class="section-title">Badges</h2> | ||
<p class="section-lead">Modify or edit profile badges!</p> | ||
<div class="card"> | ||
<div class="card-header">Badges</div> | ||
<div class="card-body"> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th scope="col">ID</th> | ||
<th scope="col">Name</th> | ||
<th scope="col">Icon</th> | ||
<th scope="col">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for badge in badges %} | ||
<tr> | ||
<td>{{ badge["Id"] }}</td> | ||
<td>{{ badge["Name"] }}</td> | ||
<td><i class="fa {{ badge['Icon'] }} fa-2x"></i></td> | ||
<td> | ||
<div class="buttons"> | ||
<a href="/actions/deletebadge/{{ badge['Id'] }}" class="btn btn-danger">Delete</a> | ||
<a href="/badge/edit/{{ badge['Id'] }}" class="btn btn-primary">Edit</a> | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
<table class="table table-striped"> | ||
<thead> | ||
<tr> | ||
<th scope="col">ID</th> | ||
<th scope="col">Name</th> | ||
<th scope="col">Icon</th> | ||
<th scope="col">Actions</th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
{% for badge in badges %} | ||
<tr> | ||
<td>{{ badge["Id"] }}</td> | ||
<td>{{ badge["Name"] }}</td> | ||
<td><i class="fa {{ badge['Icon'] }} fa-2x"></i></td> | ||
<td> | ||
<div class="buttons"> | ||
<a | ||
href="/actions/deletebadge/{{ badge['Id'] }}" | ||
class="btn btn-danger" | ||
>Delete</a | ||
> | ||
<a | ||
href="/badge/edit/{{ badge['Id'] }}" | ||
class="btn btn-primary" | ||
>Edit</a | ||
> | ||
</div> | ||
</td> | ||
</tr> | ||
{% endfor %} | ||
</tbody> | ||
</table> | ||
</div> | ||
<div class="card-footer"> | ||
<div class="buttons"> | ||
<a href="/actions/createbadge" class="btn btn-success">Create Badge</a> | ||
</div> | ||
<div class="buttons"> | ||
<a href="/actions/createbadge" class="btn btn-success">Create Badge</a> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
{% endblock %} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,36 @@ | ||
{% extends "base.html" %} | ||
{% import "components/pagination.html" as pagination %} | ||
{% block content %} | ||
|
||
<h2 class="section-title">Ban Logs</h2> | ||
<p class="section-lead">View detailed ban reasons for the entire server!</p> | ||
|
||
{% for log in ban_logs %} | ||
|
||
<div class= "card"> | ||
<div class="card-header"> | ||
<img alt="image" src="https://a.ussr.pl/{{ log["from_id"] }}" class="rounded-circle mr-1" style="width:100%; max-width:30px; max-height:30px;"> | ||
<h4>{{ log["from_name"] }}</h4> to | ||
<img alt="image" src="https://a.ussr.pl/{{ log["to_id"] }}" class="rounded-circle mr-1" style="width:100%; max-width:30px; max-height:30px;margin-left: 10px;"> | ||
<h4>{{ log["to_name"] }}</h4> for {{ log["summary"] }} | ||
</div> | ||
<div class="card-body"> | ||
<h2 class="section-title">Ban Logs</h2> | ||
<p class="section-lead">View detailed ban reasons for the entire server!</p> | ||
|
||
{{ pagination.pagination('/ban-logs', page, pages) }} | ||
{% for log in ban_logs %} | ||
<div class="card"> | ||
<div class="card-header"> | ||
<img | ||
alt="image" | ||
src="https://a.ussr.pl/{{ log["from_id"] }}" | ||
class="rounded-circle mr-1" | ||
style="width:100%; max-width:30px; max-height:30px;" | ||
/> | ||
<h4>{{ log["from_name"] }}</h4> | ||
to | ||
<img | ||
alt="image" | ||
src="https://a.ussr.pl/{{ log["to_id"] }}" | ||
class="rounded-circle mr-1" | ||
style="width:100%; max-width:30px; max-height:30px;margin-left: 10px;" | ||
/> | ||
<h4>{{ log["to_name"] }}</h4> | ||
for {{ log["summary"] }} | ||
</div> | ||
<div class="card-body"> | ||
{{ log["detail"] }} | ||
</div> | ||
<div class="card-footer">Banned {{ log["expity_timeago"] }}</div> | ||
</div> | ||
<div class="card-footer"> | ||
Banned {{ log["expity_timeago"] }} | ||
</div> | ||
</div> | ||
|
||
{% endfor %} | ||
|
||
<ul class="pagination"> | ||
<li class="page-item" id="page-before"> | ||
<a class="page-link" href="/users/{{ page-1 }}" aria-label="Previous"> | ||
<span aria-hidden="true">«</span> | ||
<span class="sr-only">Previous</span> | ||
</a> | ||
</li> | ||
<span id="page-items"></span> | ||
<li class="page-item" id="page-after"> | ||
<a class="page-link" href="/users/{{ page+1 }}" aria-label="Next"> | ||
<span aria-hidden="true">»</span> | ||
<span class="sr-only">Next</span> | ||
</a> | ||
</li> | ||
</ul> | ||
<script> | ||
// cap = 10 | ||
const pageItems = document.querySelector("#page-items"); | ||
const pageLen = {{ pages }} + 1; | ||
const page = {{ page }}; | ||
const plen = Math.max(page-5, 1); | ||
|
||
for (let i = plen; i < Math.min(plen+(5*2), pageLen); i++) { | ||
pageItems.innerHTML += ` | ||
<li class="page-item ${i == page ? "active" : ""}"> | ||
<a class="page-link" href="/users/${i}">${i}</a> | ||
</li> | ||
`; | ||
} | ||
|
||
if (page <= 1) document.getElementById("page-before").classList.add("disabled"); | ||
if (page >= pageLen-1) document.getElementById("page-after").classList.add("disabled"); | ||
</script> | ||
|
||
{% endfor %} | ||
{{ pagination.pagination('/ban-logs', page, pages) }} | ||
{{ pagination.paginationJs('/ban-logs', page, pages) }} | ||
{% endblock %} |
Oops, something went wrong.