diff --git a/shop/templates/shop/partials/navigation_base.html b/shop/templates/shop/partials/navigation_base.html
index f5dc311..351b98f 100644
--- a/shop/templates/shop/partials/navigation_base.html
+++ b/shop/templates/shop/partials/navigation_base.html
@@ -9,4 +9,8 @@
Se connecter
{% endif %}
La boutique
+ {% if user.is_authenticated and user.is_staff %}
+ Tableau de bord boutique
+ Préparer commandes
+ {% endif %}
diff --git a/tournaments/templates/admin/tournaments/dashboard.html b/tournaments/templates/admin/tournaments/dashboard.html
index 3986625..b6f6fb1 100644
--- a/tournaments/templates/admin/tournaments/dashboard.html
+++ b/tournaments/templates/admin/tournaments/dashboard.html
@@ -181,7 +181,12 @@
-
Recently Registered Users
+
diff --git a/tournaments/templates/tournaments/navigation_base.html b/tournaments/templates/tournaments/navigation_base.html
index b1ef0ea..91c9752 100644
--- a/tournaments/templates/tournaments/navigation_base.html
+++ b/tournaments/templates/tournaments/navigation_base.html
@@ -10,5 +10,9 @@
Se connecter
{% endif %}
La boutique
- Ajouter vos tournois
+ {% if user.is_authenticated and user.is_staff %}
+ Tableau de bord
+ {% else %}
+ Ajouter vos tournois
+ {% endif %}
diff --git a/tournaments/templates/tournaments/navigation_tournament.html b/tournaments/templates/tournaments/navigation_tournament.html
index 7f74a36..4af9993 100644
--- a/tournaments/templates/tournaments/navigation_tournament.html
+++ b/tournaments/templates/tournaments/navigation_tournament.html
@@ -37,4 +37,35 @@
{% else %}
Se connecter
{% endif %}
+
+
+ {% if user.is_superuser %}
+
+ {% endif %}
diff --git a/tournaments/urls.py b/tournaments/urls.py
index 5ea47c7..3d14290 100644
--- a/tournaments/urls.py
+++ b/tournaments/urls.py
@@ -80,4 +80,6 @@ urlpatterns = [
path('tournaments//confirm/', views.confirm_tournament_registration, name='confirm_tournament_registration'),
path('stripe-onboarding-complete/', views.stripe_onboarding_complete, name='stripe-onboarding-complete'),
path('stripe-refresh-account-link/', views.stripe_refresh_account_link, name='stripe-refresh-account-link'),
+ path('tournaments//toggle-private/', views.toggle_tournament_private, name='toggle_tournament_private'),
+
]
diff --git a/tournaments/views.py b/tournaments/views.py
index 4d606a6..6d98079 100644
--- a/tournaments/views.py
+++ b/tournaments/views.py
@@ -1659,6 +1659,48 @@ def stripe_onboarding_complete(request):
def stripe_refresh_account_link(request):
return render(request, 'stripe/refresh_account_link.html')
+def toggle_tournament_private(request, tournament_id):
+ """Toggle tournament privacy status (for superusers only)"""
+
+ # Check if user is superuser
+ if not request.user.is_superuser:
+ if request.headers.get('Content-Type') == 'application/json':
+ return JsonResponse({'error': 'Accès non autorisé'}, status=403)
+ messages.error(request, 'Accès non autorisé')
+ return redirect('tournament-info', tournament_id=tournament_id)
+
+ # Only allow POST requests
+ if request.method != 'POST':
+ if request.headers.get('Content-Type') == 'application/json':
+ return JsonResponse({'error': 'Méthode non autorisée'}, status=405)
+ messages.error(request, 'Méthode non autorisée')
+ return redirect('tournament-info', tournament_id=tournament_id)
+
+ try:
+ tournament = get_object_or_404(Tournament, pk=tournament_id)
+
+ # Toggle the private status
+ tournament.is_private = not tournament.is_private
+ tournament.save()
+
+ # Check if this is an AJAX request
+ if request.headers.get('Content-Type') == 'application/json':
+ return JsonResponse({
+ 'success': True,
+ 'is_private': tournament.is_private,
+ 'message': f'Tournoi défini comme {"privé" if tournament.is_private else "public"}'
+ })
+ else:
+ # Regular form submission - add success message and redirect
+ status = "privé" if tournament.is_private else "public"
+ messages.success(request, f'Tournoi défini comme {status}')
+ return redirect('tournament-info', tournament_id=tournament_id)
+
+ except Exception as e:
+ if request.headers.get('Content-Type') == 'application/json':
+ return JsonResponse({'error': f'Erreur: {str(e)}'}, status=500)
+ messages.error(request, f'Erreur: {str(e)}')
+ return redirect('tournament-info', tournament_id=tournament_id)
class UserListExportView(LoginRequiredMixin, View):
def get(self, request, *args, **kwargs):