Skip to content

Commit

Permalink
Minor UI improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Edouard Bourque committed Apr 20, 2024
1 parent b58c54e commit 4d9aa0c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
22 changes: 12 additions & 10 deletions clashstats/clanranking/templates/clanranking.html
Original file line number Diff line number Diff line change
Expand Up @@ -44,28 +44,30 @@ <h1 class='fw-bold text-warning'>Clan ranking</h1>
{% else %}
<p class='text-muted'>Updated {{ lastUpdatedMin }} minutes ago</p>
{% endif %}
<div class='d-flex justify-content-end'>
<div class="btn-group mb-4 justify-content-center mx-3" role="group" aria-label="Basic example">
<button type="button" class="btn btn-primary pe-none">{{ clan.name }}</button>
<a id='refreshButton' href="/clanrefresh/{{ clan.tag|slice:"1:" }}" class="btn btn-outline-primary" role="button"><i class="bi bi-arrow-clockwise" style='-webkit-text-stroke: 1px;'></i></a>
<div class='position-relative'>
<div class="btn-group mb-4 d-inline-block" role="group" aria-label="Clan Name">
<button type="button" class="btn btn-warning pe-none">{{ clan.name }}</button>
</div>
<div>
<button type="button" class="btn btn-outline-primary mb-4" data-bs-toggle="modal" data-bs-target="#weeklyRanking">
Historical ranking
<div style="position: absolute; right: 0; top: 50%; transform: translateY(-50%);">
<button type="button" class="btn btn-primary mb-4 mx-2" data-bs-toggle="modal" data-bs-target="#weeklyRanking">
<i class="ti ti-history"></i>
</button>
<a id='refreshButton' href="/clanrefresh/{{ clan.tag|slice:"1:" }}" class="btn btn-primary mb-4" role="button">
<i class="ti ti-refresh"></i>
</a>
</div>
</div>
<!-- Modal -->
<div class="modal fade" id="weeklyRanking" tabindex="-1" aria-labelledby="weeklyRankingLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<h1 class="modal-title fs-5" id="weeklyRankingLabel">Weekly ranking</h1>
<h1 class="modal-title fs-5" id="weeklyRankingLabel">Historical ranking</h1>
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
</div>
<div class="modal-body">
<div>
<form id="dateForm" class='d-flex justify-content-between align-items-end'>
<form id="dateForm" class='d-flex justify-content-around align-items-end'>
<div class="mb-3">
<label for="startDateInput" class="form-label">Start date</label>
<input type="date" class="form-control" id="startDate" name="start_date" min="2024-03-28" max={{today}}>
Expand All @@ -75,7 +77,7 @@ <h1 class="modal-title fs-5" id="weeklyRankingLabel">Weekly ranking</h1>
<input type="date" class="form-control" id="endDate" name="end_date" min="2024-03-28" max={{today}}>
</div>
<div class='mb-3'>
<button type="submit" class="btn btn-primary">Submit</button>
<button type="submit" class="btn btn-primary"><i class="ti ti-search"></i></button>
</div>
</form>
<div class='container-fluid'>
Expand Down
6 changes: 3 additions & 3 deletions clashstats/clanranking/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ def clanranking(request, clantag):
.all(),
"battles": Battles.objects.all(),
"lastUpdatedMin": round((tn - tu).total_seconds() / 60),
"today": datetime.strftime(timezone.now(), "%Y-%m-%d"),
"today": datetime.strftime(datetime.now(), "%Y-%m-%d"),
}

default_start_date = timezone.now() - timedelta(days=7)
default_end_date = timezone.now()
default_start_date = datetime.now() - timedelta(days=7)
default_end_date = datetime.now()

start_date = default_start_date
end_date = default_end_date
Expand Down
Binary file modified clashstats/db.sqlite3
Binary file not shown.

0 comments on commit 4d9aa0c

Please sign in to comment.