Files
godot-showreel-voting/templates/macros.html
Iñigo b031a52d6a Flask remake (#23)
* initial backend setup

* copied db setup

* added login

* added autoincrement to ids

* update db again

* added script to populate with test data

* added functionality to fetch videos

* added vote functionality

* added logic to update video info

* added history

* updated readme

* Update thank you page

* fixed small bugs

* small improvements

* added admin view, UI fix

* fix vote buttons style

* added pagination

* added command to load sample data from csv

* Autoplay videos

* Adding before you vote page

* added yt video id extractor

* improve visibility for the history page votes

* added logic for before you vote disclaimer

* Remind people to set videos to unlisted and allowed for embed

* Update home.html

* Update home.html

* Add progress bar to total

* Small adjustments

* fix home {% if user %}

* Update macros.html

* limit vote views to users with specific roles

* added endpoint to delete votes

* added confirmation to the delete vote action

* Update non-fund members CTA

* allow voting to specific fund members

* added result csv endpoint

* updated auth

* revert adding 'vote_allowed' column, merged it into is_staff

* added `is_fund_member` attribute to table and updated code

* refactored code

* update style for voting page

* updated readme

* Add static files

* remove options from dropdown for users that can't vote

* added keyboard shortcuts to vote buttons

* added azerty support for shortcuts

* update skip to S key

* remove placeholder

---------

Co-authored-by: Emi <2206700+coppolaemilio@users.noreply.github.com>
2025-10-02 12:07:03 +02:00

65 lines
2.2 KiB
HTML

{% macro nav(user) %}
<div class="nav-gap"></div>
<nav>
<div class="wrapper">
<a href="/">
<img class="logo" src="/static/images/nav-logo.svg" alt="Godot Showreel Voting">
</a>
<!-- search bar -->
<div style="height: 58px;"></div>
<!-- navigation links -->
<div class="navigation-links">
{% if user %}
<div class="dropdown">
<a href="#" class="dd-button-view" onclick="document.getElementById('dropdown-menu').classList.toggle('show'); event.preventDefault();">
<img src="https://www.gravatar.com/avatar/{{ user.gravatar_hash }}?d=retro" alt="User" title="{{ user.usernamename }}" class="user-icon gravatar">
</a>
<div id="dropdown-menu" class="dropdown-content">
<a href="/about">About</a>
{% if user.can_vote() %}
<a href="/vote">Vote</a>
<a href="/history">History</a>
{% endif %}
{% if user.is_superuser %}
<a href="/admin">Administration</a>
{% endif %}
<hr>
<a href="{{ url_for('oidc.logout') }}">Logout</a>
</div>
</div>
{% else %}
<a class="desktop" href="/about">About</a>
<div class="dropdown">
<a href="{{ url_for('oidc.login') }}" class="dd-button-view logged-out">
<p class="desktop">Login</p>
<img src="https://store-beta.godotengine.org/static/images/user.svg" alt="User" class="user-icon">
</a>
</div>
{% endif %}
<script>
// Close the dropdown if the user clicks outside of it
window.onclick = function(event) {
if (!event.target.closest('.dd-button-view')) {
var dropdowns = document.getElementsByClassName("dropdown-content");
for (var i = 0; i < dropdowns.length; i++) {
var openDropdown = dropdowns[i];
if (openDropdown.classList.contains('show')) {
openDropdown.classList.remove('show');
}
}
}
}
</script>
</div>
</div>
</nav>
{% endmacro %}
{% macro footer() %}
<footer>
<p>If you found any issue or if you have a suggestion, please create an issue in our <a href="https://github.com/godotengine/godot-showreel-voting/issues">issue tracker</a>.</p>
<br>
<p>&copy; 2025 - Godot Showreel Voting by <a href="https://godot.foundation">Godot Foundation</a></p>
</footer>
{% endmacro %}