1
0
mirror of https://gitlab.com/animath/si/plateforme.git synced 2024-12-24 18:22:24 +00:00

Prepare patterns

This commit is contained in:
Yohann D'ANELLO 2020-04-30 01:43:12 +02:00
parent f08f52c129
commit 683d523da9
3 changed files with 36 additions and 29 deletions

View File

@ -1,4 +1,5 @@
from django.urls import path
from django.views.generic import RedirectView
from .views import CreateUserView, DocumentView
@ -7,4 +8,12 @@ app_name = "member"
urlpatterns = [
path('signup/', CreateUserView.as_view(), name="signup"),
path("file/<str:file>/", DocumentView.as_view(), name="document"),
path("my-account/", RedirectView.as_view(pattern_name="index"), name="my_account"),
path("add-team/", RedirectView.as_view(pattern_name="index"), name="add_team"),
path("join-team/", RedirectView.as_view(pattern_name="index"), name="join_team"),
path("my-team/", RedirectView.as_view(pattern_name="index"), name="my_team"),
path("my-team/update/", RedirectView.as_view(pattern_name="index"), name="update_my_team"),
path("profiles/", RedirectView.as_view(pattern_name="index"), name="all_profiles"),
path("orphaned-profiles/", RedirectView.as_view(pattern_name="index"), name="orphaned_profiles"),
path("organizers/", RedirectView.as_view(pattern_name="index"), name="organizers"),
]

View File

@ -1,4 +1,5 @@
from django.urls import path
from django.views.generic import RedirectView
from .views import TournamentListView, TournamentDetailView, TeamDetailView
@ -6,6 +7,12 @@ app_name = "tournament"
urlpatterns = [
path('list/', TournamentListView.as_view(), name="list"),
path("add/", RedirectView.as_view(pattern_name="index"), name="add"),
path('<int:pk>/', TournamentDetailView.as_view(), name="detail"),
path('team/<int:pk>/', TeamDetailView.as_view(), name="team_detail"),
path("add-organizer/", RedirectView.as_view(pattern_name="index"), name="add_organizer"),
path("solutions/", RedirectView.as_view(pattern_name="index"), name="solutions"),
path("all-solutions/", RedirectView.as_view(pattern_name="index"), name="all_solutions"),
path("syntheses/", RedirectView.as_view(pattern_name="index"), name="syntheses"),
path("all_syntheses/", RedirectView.as_view(pattern_name="index"), name="all_syntheses"),
]

View File

@ -70,96 +70,87 @@
<div id="navbarNavDropdown" class="collapse navbar-collapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item active">
<a href="/" class="nav-link"><i class="fas fa-home"></i> Accueil</a>
<a href="{% url "index" %}" class="nav-link"><i class="fas fa-home"></i> {% trans "Home" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url "tournament:list" %}"><i class="fas fa-calendar"></i> Liste des tournois</a>
<a class="nav-link" href="{% url "tournament:list" %}"><i class="fas fa-calendar"></i> {% trans "Tournament list" %}</a>
{% if user.organizes %}
<ul class="deroule">
{% if user.admin %}
<li class="nav-item active"><a class="nav-link" href="/profils-orphelins"><i
class="fas fa-user"></i> Profils orphelins</a></li>
<li class="nav-item active"><a class="nav-link" href="/profils"><i
class="fas fa-users"></i>
Tous les profils</a></li>
<li class="nav-item active"><a class="nav-link" href="{% url "member:orphaned_profiles" %}"><i class="fas fa-user"></i> {% trans "Orphaned profiles" %}</a></li>
<li class="nav-item active"><a class="nav-link" href="{% url "member:all_profiles" %}"><i class="fas fa-users"></i> {% trans "All profiles" %}</a></li>
{% endif %}
<li class="nav-item active"><a class="nav-link" href="/organisateurs"><i
class="fas fa-user-tie"></i> Organisateurs</a></li>
<li class="nav-item active"><a class="nav-link" href="{% url "member:organizers" %}"><i class="fas fa-user-tie"></i> {% trans "Organizers" %}</a></li>
</ul>
{% endif %}
</li>
{% if user.is_authenticated %}
<li class="nav-item active">
<a class="nav-link" href="/mon-compte"><i class="fas fa-user"></i> Mon compte</a>
<a class="nav-link" href="{% url "member:my_account" %}"><i class="fas fa-user"></i> {% trans "My account" %}</a>
</li>
{% if user.participates %}
{% if user.team is None %}
<li class="nav-item active">
<a class="nav-link" href="/ajouter_equipe"><i class="fas fa-folder-plus"></i> Ajouter
une équipe</a>
<a class="nav-link" href="{% url "member:add_team" %}"><i class="fas fa-folder-plus"></i> {% trans "Add a team" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/rejoindre_equipe"><i class="fas fa-users"></i> Rejoindre une
équipe</a>
<a class="nav-link" href="{% url "member:join_team" %}"><i class="fas fa-users"></i> {% trans "Join a team" %}</a>
</li>
{% else %}
<li class="nav-item active">
<a class="nav-link" href="/mon-equipe"><i class="fas fa-users-cog"></i> Mon équipe</a>
<a class="nav-link" href="{% url "member:my_team" %}"><i class="fas fa-users-cog"></i> {% trans "My team" %}</a>
</li>
{% if user.team.valid %}
<!-- <li class="nav-item active">
<a class="nav-link" href="/paiement">Paiement</a>
</li> -->
<li class="nav-item active">
<a class="nav-link" href="/solutions"><i class="fas fa-lightbulb"></i> Solutions</a>
<a class="nav-link" href="{% url "tournament:solutions" %}"><i class="fas fa-lightbulb"></i> {% trans "Solutions" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/syntheses"><i class="fas fa-feather"></i> Notes de
synthèse</a>
<a class="nav-link" href="{% url "tournament:syntheses" %}"><i class="fas fa-feather"></i> {% trans "Syntheses" %}</a>
</li>
{% endif %}
{% endif %}
{% endif %}
{% if user.admin %}
<li class="nav-item active">
<a class="nav-link" href="/ajouter_tournoi"><i class="fas fa-calendar-plus"></i> Ajouter un
tournoi</a>
<a class="nav-link" href="{% url "tournament:add" %}"><i class="fas fa-calendar-plus"></i> {% trans "Add a tournament" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/ajouter_organisateur"><i class="fas fa-user-plus"></i> Ajouter un
organisateur</a>
<a class="nav-link" href="{% url "tournament:add_organizer" %}"><i class="fas fa-user-plus"></i> {% trans "Add an organizer" %}</a>
</li>
{% endif %}
{% if user.organizes %}
<li class="nav-item active">
<a class="nav-link" href="/solutions_orga"><i class="fas fa-lightbulb"></i> Solutions</a>
<a class="nav-link" href="{% url "tournament:all_solutions" %}"><i class="fas fa-lightbulb"></i> {% trans "Solutions" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="/syntheses_orga"><i class="fas fa-feather"></i> Notes de synthèse</a>
<a class="nav-link" href="{% url "tournament:all_syntheses" %}"><i class="fas fa-feather"></i> {% trans "Syntheses" %}</a>
</li>
{% endif %}
{% endif %}
<li class="nav-item active">
<a class="nav-link" href="https://www.helloasso.com/associations/animath/formulaires/5/widget"><i
class="fas fa-hand-holding-heart"></i> Faire un don</a>
class="fas fa-hand-holding-heart"></i> {% trans "Make a gift" %}</a>
</li>
{% if user.admin %}
<li class="nav-item active">
<a class="nav-link" href="{% url "admin:index" %}"><i class="fas fa-cog"></i> Administration</a>
<a class="nav-link" href="{% url "admin:index" %}"><i class="fas fa-cog"></i> {% trans "Administration" %}</a>
</li>
{% endif %}
</ul>
<ul class="navbar-nav">
{% if not user.is_authenticated %}
<li class="nav-item active">
<a class="nav-link" href="{% url "login" %}"><i class="fas fa-sign-in-alt"></i> Connexion</a>
<a class="nav-link" href="{% url "login" %}"><i class="fas fa-sign-in-alt"></i> {% trans "Log in" %}</a>
</li>
<li class="nav-item active">
<a class="nav-link" href="{% url "member:signup" %}"><i class="fas fa-user-plus"></i> Inscription</a>
<a class="nav-link" href="{% url "member:signup" %}"><i class="fas fa-user-plus"></i> {% trans "Sign up" %}</a>
</li>
{% else %}
<li class="nav-item active">
<a class="nav-link" href="{% url "logout" %}"><i class="fas fa-sign-out-alt"></i> Déconnexion</a>
<a class="nav-link" href="{% url "logout" %}"><i class="fas fa-sign-out-alt"></i> {% trans "Log out" %}</a>
</li>
{% endif %}
</ul>