Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
DeyanVNikolov committed Feb 15, 2024
2 parents 3788a3e + 1f31a6a commit d66331a
Show file tree
Hide file tree
Showing 48 changed files with 4,949 additions and 9,628 deletions.
Binary file modified req.txt
Binary file not shown.
4 changes: 3 additions & 1 deletion website/adventora/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@
TURNSTILE_SECRET = os.getenv("TURNSTILE_SECRET")

INSTALLED_APPS = [
'management',
'jazzmin',
'django.contrib.admin',
'django.contrib.auth',
Expand All @@ -66,7 +67,8 @@
'multiselectfield',
'ckeditor',
'corsheaders',
'django.contrib.gis',
'sri',
'fontawesomefree',
]

SOCIAL_AUTH_PIPELINE = (
Expand Down
214 changes: 111 additions & 103 deletions website/adventora/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
<html lang="en">
{% load static %}
{% load i18n %}
{% load sri %}
<head>
<meta charset="UTF-8">
<link rel="icon" href="/static/img/logo/adv-redplane-transparent.png"/>
Expand Down Expand Up @@ -29,6 +30,9 @@
<script type="text/javascript" src="https://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js"></script>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bulma-carousel.min.css">
{% sri_static 'fontawesomefree/css/fontawesome.css' %}
{% sri_static 'fontawesomefree/css/brands.css' %}
{% sri_static 'fontawesomefree/css/solid.css' %}
<style>
/* Custom styling for the footer */
.footer {
Expand Down Expand Up @@ -106,128 +110,63 @@
<body>


<nav id="navbar-main" class="navbar is-fixed-top">
<nav class="navbar is-mobile navbar-center" role="navigation" aria-label="main navigation">


<div class="navbar-brand">
<a class="navbar-item is-hidden-desktop jb-aside-mobile-toggle" id="showondashboard" style="display: none">
<span class="icon"><i class="mdi mdi-forwardburger mdi-24px"></i></span>
<a class="navbar-item" href="/">
<img src="/static/img/logo/adv-redplane-transparent.png" style="height: 100%;">
</a>
<script>
let show = {% block show %}false;{% endblock %}

if (show) {
document.getElementById("showondashboard").style.display = "block";
}
</script>
<a role="button" class="navbar-burger navbur-span" aria-label="menu" aria-expanded="false" data-target="navbarBasicExample" style="color: black !important;">
<span aria-hidden="true" class="navbur-span"></span>
<span aria-hidden="true" class="navbur-span"></span>
<span aria-hidden="true" class="navbur-span"></span>
</a>
</div>

<div class="navbar-item has-control">
<a href="/" style="color: #000000">Adventora.net</a>
<img onclick="window.open('/', '_self');" style="cursor: pointer" src="{% static 'img/logo/adv-redplane-transparent.png' %}" alt="Adventora Logo">
</div>
<div class="navbar-item has-control">
<a class="navbar-item" href="{% url 'home' %}">
<span class="mdi mdi-home-account icon"></span>
<span>{% trans "Homepage" %}</span>
<div id="navbarBasicExample" class="navbar-menu">
<div class="navbar-start">
<a class="navbar-item" href="/">
{% trans "Home" %}
</a>
<a class="navbar-item" href="/hotels">
<span class="mdi mdi-bed icon"></span>
<span>{% trans "Hotels" %}</span>
{% trans "Hotels" %}
</a>


</div>
</div>
<div class="navbar-brand is-right">
<a class="navbar-item is-hidden-desktop jb-navbar-menu-toggle" data-target="navbar-menu">
<span class="icon"><i class="mdi mdi-dots-vertical"></i></span>
</a>
</div>
<div class="navbar-menu fadeIn animated faster" id="navbar-menu">
<div class="navbar-end">

{% if request.user.role == "hotel_manager" %}
<div class="navbar-item has-dropdown has-dropdown-with-icons has-divider is-hoverable">
<a class="navbar-link is-arrowless">
<span class="mdi mdi-office-building-cog icon"></span>
<span>{% trans "Hotel" %}</span>
<i class="mdi mdi-chevron-down"></i>
</a>
<div class="navbar-dropdown">
<a href="{% url 'dashboard' %}" class="navbar-item">
<span class="icon"><i class="mdi mdi-account"></i></span>
<span>{% trans "Dashboard" %}</span>
</a>
</div>
</div>
{% endif %}
<div class="navbar-item has-dropdown has-dropdown-with-icons has-divider has-user-avatar is-hoverable">
{% if request.user.is_authenticated %}
<a class="navbar-link is-arrowless">
<div class="is-user-avatar">
<img src="{% static 'img/blank.png' %}" alt="John Doe">
</div>
<div class="is-user-name"><span>{{ request.user.first_name }} {{ request.user.last_name }}</span></div>
<span class="icon"><i class="mdi mdi-chevron-down"></i></span>
</a>

<div class="navbar-dropdown">
<a href="{% url 'edit-profile' %}" class="navbar-item">
<span class="icon"><i class="mdi mdi-account"></i></span>
<span>{% trans "Profile" %}</span>
</a>
{% if request.user.is_staff == True %}
<hr class="navbar-divider">
<a href="/admin" class="navbar-item" style="background-color: #ffff52;">
<span class="icon"><i class="mdi mdi-account"></i></span>
<span>{% trans "Admin" %}</span>
</a>
{% endif %}
<hr class="navbar-divider">
<a class="navbar-item" href="{% url 'logout' %}">
<span class="icon"><i class="mdi mdi-logout"></i></span>
<span>{% trans "Log out" %}</span>
</a>
</div>
{% endif %}
</div>
{% if request.user.is_authenticated %}
<a title="{% trans "Log out" %}" class="navbar-item is-desktop-icon-only" href="{% url 'logout' %}">
<span class="icon"><i class="mdi mdi-logout"></i></span>
<span>{% trans "Log out" %}</span>
</a>
{% else %}
<a href="{% url 'sign-in' %}" class="navbar-item">
<span class="mdi mdi-login icon"></span>
<span>{% trans "Login" %}</span>
</a>
<a class="navbar-item" href="{% url 'sign-up' %}">
<span class="mdi mdi-account-plus icon"></span>
<span>{% trans "Sign up" %}</span>
</a>
{% endif %}
<div class="navbar-item has-dropdown is-hoverable lang-dropdown">


<div class="navbar-end">
<div class="navbar-item has-dropdown is-hoverable">
{% get_current_language as LANGUAGE_CODE %}
{% get_available_languages as LANGUAGES %}
{% get_language_info_list for LANGUAGES as languages %}
<a class="navbar-link is-arrowless" id="current-language-indicator">
<img src="https://flagcdn.com/w40/{% if LANGUAGE_CODE == "sv" %}se{% elif LANGUAGE_CODE == "sr" %}rs{% elif LANGUAGE_CODE == "uk" %}ua{% elif LANGUAGE_CODE == "en" %}gb{% elif LANGUAGE_CODE == "el" %}gr{% else %}{{ LANGUAGE_CODE | lower }}{% endif %}.png"
alt="" class="image" style="border-radius: 25px; border: 1px solid black; margin: auto">
{% get_language_info for LANGUAGE_CODE as current_lang %}
<style>
{# distance from button right#}
.language-button::after {
right: 0px !important;


}
</style>
<a class="navbar-link language-button" id="languagebutton">
<img src="https://flagcdn.com/w40/{% if current_lang.code == "sv" %}se{% elif current_lang.code == "sr" %}rs{% elif current_lang.code == "uk" %}ua{% elif current_lang.code == "en" %}gb{% elif current_lang.code == "el" %}gr{% else %}{{ current_lang.code | lower }}{% endif %}.png"
alt="" class="image" style="border-radius: 25px; border: 1px solid black; width: 30px;">&nbsp;{{ current_lang.name_local | capfirst }}
</a>
<script>
function loadinglanguageongoing() {

let element = document.getElementById("current-language-indicator");
element.innerHTML = '<progress class="progress is-success" style="width: 40px" max="100">30%</progress>';
}
</script>
<div class="navbar-dropdown is-boxed is-right language-selector-div" style="min-width: 130px !important; max-height: 50vh`; overflow:auto">


<div class="navbar-dropdown is-boxed" style="pointer-events: none; display: none;">
{% for language in languages %}
<a class="navbar-item" id="{{ language.code }}-CHANGER" onclick="loadinglanguageongoing('{{ language.code }}')" hx-post="{% url 'set_language' %}" hx-include="this"
<a class="navbar-item" style="color: #2f2f2f !important;" id="{{ language.code }}-CHANGER" onclick="loadinglanguageongoing('{{ language.code }}')"
hx-post="{% url 'set_language' %}" hx-include="this"
hx-swap="none">
<input type="hidden" name="csrfmiddlewaretoken" value="{{ csrf_token }}">
<input type="hidden" name="language" value="{{ language.code }}">
<img src="https://flagcdn.com/w40/{% if language.code == "sv" %}se{% elif language.code == "sr" %}rs{% elif language.code == "uk" %}ua{% elif language.code == "en" %}gb{% elif language.code == "el" %}gr{% else %}{{ language.code | lower }}{% endif %}.png"
alt="" class="image" style="border-radius: 25px; border: 1px solid black; width: 30px;">
<span>&nbsp;{{ language.name_local | capfirst }}</span>
<span style="color: #2f2f2f !important;">&nbsp;{{ language.name_local | capfirst }}</span>

</a>
{% endfor %}
Expand All @@ -238,8 +177,77 @@
</script>
</div>
</div>
<style>
.language-button::after {
transform: rotate(135deg) !important;
}

.language-button.rotate::after {
transform: rotate(-45deg) !important;
}
</style>
<script>
// when clicking on the dropdown, if closed, add is-active, change .navbar-dropdown to display block, and change opacity to 1, position to relative, and transform to translateY(0)
// if open, remove is-active, change .navbar-dropdown to display none, and change opacity to 0, position to absolute, and transform to translateY(-5px)


let dropdown = document.querySelector('.navbar-dropdown');
let dropdownContent = document.querySelector('.navbar-dropdown.is-boxed');
let dropdownButton = document.querySelector('.language-button');
let after = document.querySelector('.language-button:after');

dropdownButton.addEventListener('click', function () {
if (dropdown.classList.contains('is-active')) {
dropdown.classList.remove('is-active');
dropdownContent.style.display = 'none';
dropdownContent.style.opacity = '0';
dropdownContent.style.transform = 'translateY(-5px)';
dropdownContent.style.pointerEvents = 'none';

dropdownButton.classList.remove('rotate');
} else {
dropdown.classList.add('is-active');
dropdownContent.style.display = 'block';
dropdownContent.style.opacity = '1';
dropdownContent.style.transform = 'translateY(0)';
dropdownContent.style.pointerEvents = 'all';
dropdownButton.classList.add('rotate');
}
});
</script>
<div class="navbar-item">
<div class="buttons">

{% if not user.is_authenticated %}
<a class="button" href="/authentication/sign-up" style="border-radius: 100px">
<i class="fa-solid fa-user-plus" style="color: #2f2f2f"></i>
</a>
<a class="button" href="/authentication/sign-in" style="border-radius: 100px">
<i class="fa-solid fa-right-to-bracket" style="color: #2f2f2f"></i>
</a>
{% else %}
<a class="button" href="/hotel/dashboard" style="border-radius: 100px">
{% trans "Dashboard" %}
</a>
{% if user.is_superuser == True and user.is_staff == True %}
<a class="button" href="/admin" style="border-radius: 100px; background-color: #ffdf00">
<i class="fa-solid fa-hammer" style="color: #2f2f2f"></i>
</a>
{% endif %}
<a class="button" href="/authentication/edit-profile" style="border-radius: 100px">
<i class="fa-solid fa-id-card" style="color: #2f2f2f"></i>
</a>
<a class="button" href="/authentication/logout" style="border-radius: 100px">
<i class="fa-solid fa-right-from-bracket" style="color: #2f2f2f"></i>
</a>

{% endif %}
</div>
</div>
</div>
</div>


</nav>

<br><br><br>
Expand Down
Binary file removed website/locale/bg/LC_MESSAGES/django.mo
Binary file not shown.
Loading

0 comments on commit d66331a

Please sign in to comment.