Refactor routes Flask en Blueprints
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
|
||||
<!-- Barre de recherche ISIN -->
|
||||
<div class="bg-gray-900 border border-gray-800 rounded-2xl shadow-2xl w-full max-w-[98%] p-4 mb-4">
|
||||
<form method="GET" action="{{ url_for('main.analyse') }}" class="flex items-center gap-3 flex-wrap">
|
||||
<form method="GET" action="{{ url_for('analyse.analyse') }}" class="flex items-center gap-3 flex-wrap">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<div class="flex-1 min-w-[200px]">
|
||||
<label class="block text-xs font-medium text-gray-400 mb-1">Entrer un ISIN</label>
|
||||
@@ -32,7 +32,7 @@
|
||||
<i class="fa-solid fa-magnifying-glass-chart"></i> Analyser
|
||||
</button>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-5 py-2.5 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-semibold rounded-lg transition duration-200 cursor-pointer self-end"
|
||||
>
|
||||
<i class="fa-solid fa-house"></i> Retour au menu
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<!-- Gauche : Logo -->
|
||||
<div class="flex items-center">
|
||||
<a
|
||||
href="{{ url_for('main.menu') if session.get('user_id') else url_for('main.index') }}"
|
||||
href="{{ url_for('menu.menu') if session.get('user_id') else url_for('auth.index') }}"
|
||||
>
|
||||
<img
|
||||
src="{{ url_for('static', filename='images/GFBlancLogo.png') }}"
|
||||
@@ -66,7 +66,7 @@
|
||||
{% if session.get('user_id') %}
|
||||
<div class="pt-1.5 flex justify-end">
|
||||
<a
|
||||
href="{{ url_for('main.logout') }}"
|
||||
href="{{ url_for('auth.logout') }}"
|
||||
class="no-underline px-2.5 py-1 bg-red-950/60 hover:bg-red-900/80 border border-red-900/60 text-red-300 rounded text-[11px] font-sans transition duration-200"
|
||||
>
|
||||
Se déconnecter
|
||||
|
||||
@@ -34,7 +34,7 @@ content %}
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
|
||||
@@ -40,7 +40,7 @@ content %}
|
||||
<div class="flex items-center gap-4">
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ url_for('main.gestion_comptes') }}"
|
||||
action="{{ url_for('comptes.gestion_comptes') }}"
|
||||
class="m-0"
|
||||
>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
@@ -65,7 +65,7 @@ content %}
|
||||
<!-- Génération automatique des écritures depuis les ordres -->
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ url_for('main.generer_ecritures_ordres') }}"
|
||||
action="{{ url_for('comptes.generer_ecritures_ordres') }}"
|
||||
class="m-0"
|
||||
onsubmit="return confirm('Générer / régénérer les écritures comptables à partir des ordres de cette société ? Les écritures générées existantes seront remplacées.');"
|
||||
>
|
||||
@@ -81,7 +81,7 @@ content %}
|
||||
</form>
|
||||
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
@@ -256,7 +256,7 @@ content %}
|
||||
<form
|
||||
id="form-modal-ecriture"
|
||||
method="POST"
|
||||
action="{{ url_for('main.creer_compte_traitement') }}"
|
||||
action="{{ url_for('comptes.creer_compte_traitement') }}"
|
||||
class="space-y-4"
|
||||
>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
@@ -371,7 +371,7 @@ content %}
|
||||
const title = document.getElementById("modal-title");
|
||||
|
||||
modal.classList.remove("hidden");
|
||||
form.action = "{{ url_for('main.creer_compte_traitement') }}";
|
||||
form.action = "{{ url_for('comptes.creer_compte_traitement') }}";
|
||||
title.innerHTML =
|
||||
'<i class="fa-solid fa-plus-circle text-emerald-500"></i> Nouvelle écriture';
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ endblock %} {% block header_title %}Gestion CSV{% endblock %} {% block content
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
@@ -124,7 +124,7 @@ endblock %} {% block header_title %}Gestion CSV{% endblock %} {% block content
|
||||
>
|
||||
<!-- Formulaire ou lien pour l'Export (réduit) -->
|
||||
<a
|
||||
href="{{ url_for('main.export_actions_csv') }}"
|
||||
href="{{ url_for('historique.export_actions_csv') }}"
|
||||
class="w-full sm:w-1/4 flex items-center justify-center px-4 py-3 bg-blue-600 hover:bg-blue-500 text-white text-sm font-semibold rounded-xl shadow-lg transition duration-200"
|
||||
>
|
||||
<svg
|
||||
@@ -145,7 +145,7 @@ endblock %} {% block header_title %}Gestion CSV{% endblock %} {% block content
|
||||
|
||||
<!-- Formulaire pour l'Import (prend toute la place restante) -->
|
||||
<form
|
||||
action="{{ url_for('main.import_actions_csv') }}"
|
||||
action="{{ url_for('historique.import_actions_csv') }}"
|
||||
method="POST"
|
||||
enctype="multipart/form-data"
|
||||
class="w-full sm:w-3/4 flex items-center gap-2"
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
@@ -44,7 +44,7 @@
|
||||
<!-- 2. Corps : Box d'importation -->
|
||||
<form
|
||||
id="form-import-historique"
|
||||
action="{{ url_for('main.import_historique_csv') }}"
|
||||
action="{{ url_for('historique.import_historique_csv') }}"
|
||||
method="POST"
|
||||
enctype="multipart/form-data"
|
||||
class="space-y-6"
|
||||
|
||||
@@ -41,7 +41,7 @@
|
||||
<!-- Formulaire combiné / Filtre Année + Société -->
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ url_for('main.gestion_ordres') }}"
|
||||
action="{{ url_for('ordres.gestion_ordres') }}"
|
||||
class="flex items-center gap-2 m-0"
|
||||
>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
@@ -80,7 +80,7 @@
|
||||
|
||||
<form
|
||||
method="POST"
|
||||
action="{{ url_for('main.gestion_ordres') }}"
|
||||
action="{{ url_for('ordres.gestion_ordres') }}"
|
||||
class="m-0"
|
||||
>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
@@ -112,7 +112,7 @@
|
||||
</button>
|
||||
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
@@ -304,7 +304,7 @@
|
||||
<form
|
||||
id="form-modal-ordre"
|
||||
method="POST"
|
||||
action="{{ url_for('main.creer_ordre_traitement') }}"
|
||||
action="{{ url_for('ordres.creer_ordre_traitement') }}"
|
||||
class="space-y-4"
|
||||
>
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
@@ -599,7 +599,7 @@
|
||||
const btnValider = document.getElementById("btn-valider");
|
||||
|
||||
modal.classList.remove("hidden");
|
||||
form.action = "{{ url_for('main.creer_ordre_traitement') }}";
|
||||
form.action = "{{ url_for('ordres.creer_ordre_traitement') }}";
|
||||
title.innerHTML =
|
||||
'<i class="fa-solid fa-plus-circle text-emerald-500"></i> Créer un Nouvel Ordre';
|
||||
|
||||
|
||||
@@ -34,7 +34,7 @@ content %}
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
|
||||
@@ -34,7 +34,7 @@ content %}
|
||||
</p>
|
||||
</div>
|
||||
<a
|
||||
href="{{ url_for('main.menu') }}"
|
||||
href="{{ url_for('menu.menu') }}"
|
||||
class="px-4 py-2 bg-gray-800 hover:bg-gray-700 text-gray-200 text-sm font-medium rounded-lg transition duration-200"
|
||||
>
|
||||
Retour au menu
|
||||
|
||||
@@ -17,7 +17,7 @@ block content %}
|
||||
</div>
|
||||
{% endif %} {% endwith %}
|
||||
|
||||
<form method="POST" action="{{ url_for('main.index') }}" class="space-y-4">
|
||||
<form method="POST" action="{{ url_for('auth.index') }}" class="space-y-4">
|
||||
<input type="hidden" name="csrf_token" value="{{ csrf_token() }}" />
|
||||
<div>
|
||||
<label for="login" class="block text-sm font-medium text-gray-300 mb-1"
|
||||
|
||||
@@ -15,7 +15,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
<div class="grid grid-cols-1 md:grid-cols-2 gap-5 mb-8">
|
||||
<!-- btn 1 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_actions') }}"
|
||||
href="{{ url_for('actions.gestion_actions') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
1. Gérer les actions
|
||||
@@ -23,7 +23,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 2 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_ordres') }}"
|
||||
href="{{ url_for('ordres.gestion_ordres') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
2. Ordres
|
||||
@@ -31,7 +31,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 3 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_comptes') }}"
|
||||
href="{{ url_for('comptes.gestion_comptes') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
3. Comptes
|
||||
@@ -39,7 +39,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 4 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_societes') }}"
|
||||
href="{{ url_for('societes.gestion_societes') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
4. Gestion sociétés
|
||||
@@ -47,7 +47,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 5 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_utilisateurs') }}"
|
||||
href="{{ url_for('utilisateurs.gestion_utilisateurs') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
5. Gestion utilisateurs
|
||||
@@ -55,7 +55,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 6 -->
|
||||
<a
|
||||
href="{{ url_for('main.analyse') }}"
|
||||
href="{{ url_for('analyse.analyse') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
6. Stat historique
|
||||
@@ -63,7 +63,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 7 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_import_export_actions_csv') }}"
|
||||
href="{{ url_for('historique.gestion_import_export_actions_csv') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
7. Import/Export Actions CSV
|
||||
@@ -71,7 +71,7 @@ header_title %}Tableau de bord{% endblock %} {% block content %}
|
||||
|
||||
<!-- btn 8 -->
|
||||
<a
|
||||
href="{{ url_for('main.gestion_import_historique_csv') }}"
|
||||
href="{{ url_for('historique.gestion_import_historique_csv') }}"
|
||||
class="py-6 px-6 bg-gray-950 hover:bg-blue-600/30 border-2 border-gray-800 hover:border-blue-500 rounded-xl text-white text-lg font-bold tracking-wide transition-all duration-200 flex items-center justify-center shadow-lg hover:scale-[1.01]"
|
||||
>
|
||||
8. Import historique CSV
|
||||
|
||||
Reference in New Issue
Block a user