develop #3

Merged
kbe merged 227 commits from develop into main 2025-09-16 14:35:23 +00:00
8 changed files with 165 additions and 4462 deletions
Showing only changes of commit 91e6425c1e - Show all commits

View File

@@ -211,6 +211,8 @@ GEM
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.9-arm-linux-musl) nokogiri (1.18.9-arm-linux-musl)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.9-x86_64-darwin)
racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-gnu) nokogiri (1.18.9-x86_64-linux-gnu)
racc (~> 1.4) racc (~> 1.4)
nokogiri (1.18.9-x86_64-linux-musl) nokogiri (1.18.9-x86_64-linux-musl)
@@ -360,6 +362,7 @@ GEM
sqlite3 (2.7.3-aarch64-linux-musl) sqlite3 (2.7.3-aarch64-linux-musl)
sqlite3 (2.7.3-arm-linux-gnu) sqlite3 (2.7.3-arm-linux-gnu)
sqlite3 (2.7.3-arm-linux-musl) sqlite3 (2.7.3-arm-linux-musl)
sqlite3 (2.7.3-x86_64-darwin)
sqlite3 (2.7.3-x86_64-linux-gnu) sqlite3 (2.7.3-x86_64-linux-gnu)
sqlite3 (2.7.3-x86_64-linux-musl) sqlite3 (2.7.3-x86_64-linux-musl)
sshkit (1.24.0) sshkit (1.24.0)
@@ -376,6 +379,7 @@ GEM
thor (1.4.0) thor (1.4.0)
thruster (0.1.15) thruster (0.1.15)
thruster (0.1.15-aarch64-linux) thruster (0.1.15-aarch64-linux)
thruster (0.1.15-x86_64-darwin)
thruster (0.1.15-x86_64-linux) thruster (0.1.15-x86_64-linux)
timeout (0.4.3) timeout (0.4.3)
ttfunk (1.8.0) ttfunk (1.8.0)
@@ -412,6 +416,7 @@ PLATFORMS
aarch64-linux-musl aarch64-linux-musl
arm-linux-gnu arm-linux-gnu
arm-linux-musl arm-linux-musl
x86_64-darwin-24
x86_64-linux-gnu x86_64-linux-gnu
x86_64-linux-musl x86_64-linux-musl

View File

@@ -47,7 +47,7 @@ class Auth::RegistrationsController < Devise::RegistrationsController
# If you have extra params to permit, append them to the sanitizer. # If you have extra params to permit, append them to the sanitizer.
def configure_account_update_params def configure_account_update_params
devise_parameter_sanitizer.permit(:account_update, keys: [ :last_name, :first_name ]) devise_parameter_sanitizer.permit(:account_update, keys: [ :last_name, :first_name, :is_professionnal ])
end end
# The path used after sign up. # The path used after sign up.

View File

@@ -0,0 +1,26 @@
class SettingsController < ApplicationController
before_action :authenticate_user!
before_action :set_user
def show
# Show settings page
end
def update
if @user.update(user_params)
redirect_to settings_path, notice: "Vos informations ont été mises à jour avec succès."
else
render :show, status: :unprocessable_entity
end
end
private
def set_user
@user = current_user
end
def user_params
params.require(:user).permit(:first_name, :last_name, :is_professionnal)
end
end

View File

@@ -150,8 +150,8 @@ class Event < ApplicationRecord
http.use_ssl = true http.use_ssl = true
request = Net::HTTP::Get.new(uri) request = Net::HTTP::Get.new(uri)
request['User-Agent'] = 'AperoNight Event Platform/1.0 (https://aperonight.com)' request["User-Agent"] = "AperoNight Event Platform/1.0 (https://aperonight.com)"
request['Accept'] = 'application/json' request["Accept"] = "application/json"
response = http.request(request) response = http.request(request)

View File

@@ -58,9 +58,14 @@
<i data-lucide="calendar" class="w-4 h-4 mr-3"></i> <i data-lucide="calendar" class="w-4 h-4 mr-3"></i>
Réservations Réservations
<% end %> <% end %>
<%= link_to settings_path,
class: "flex items-center px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 transition-colors duration-200" do %>
<i data-lucide="user" class="w-4 h-4 mr-3"></i>
Profil
<% end %>
<%= link_to edit_user_registration_path, <%= link_to edit_user_registration_path,
class: "flex items-center px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 transition-colors duration-200" do %> class: "flex items-center px-4 py-3 text-sm text-gray-700 hover:bg-gray-50 transition-colors duration-200" do %>
<i data-lucide="settings" class="w-4 h-4 mr-3"></i> <i data-lucide="key" class="w-4 h-4 mr-3"></i>
Sécurité Sécurité
<% end %> <% end %>
<div class="border-t border-gray-100"> <div class="border-t border-gray-100">
@@ -149,9 +154,14 @@
<i data-lucide="calendar" class="w-4 h-4 mr-3"></i> <i data-lucide="calendar" class="w-4 h-4 mr-3"></i>
Réservations Réservations
<% end %> <% end %>
<%= link_to settings_path,
class: "flex items-center px-3 py-2 rounded-lg text-base font-medium text-gray-700 hover:text-brand-primary hover:bg-gray-50" do %>
<i data-lucide="user" class="w-4 h-4 mr-3"></i>
Profil
<% end %>
<%= link_to edit_user_registration_path, <%= link_to edit_user_registration_path,
class: "flex items-center px-3 py-2 rounded-lg text-base font-medium text-gray-700 hover:text-brand-primary hover:bg-gray-50" do %> class: "flex items-center px-3 py-2 rounded-lg text-base font-medium text-gray-700 hover:text-brand-primary hover:bg-gray-50" do %>
<i data-lucide="settings" class="w-4 h-4 mr-3"></i> <i data-lucide="key" class="w-4 h-4 mr-3"></i>
Sécurité Sécurité
<% end %> <% end %>
<%= link_to destroy_user_session_path, <%= link_to destroy_user_session_path,

View File

@@ -0,0 +1,115 @@
<div class="min-h-screen bg-gray-50 py-12 px-4 sm:px-6 lg:px-8">
<div class="max-w-2xl mx-auto space-y-8">
<!-- Header -->
<div class="text-center">
<%= link_to "/" do %>
<div class="inline-flex items-center justify-center w-16 h-16 bg-gradient-to-br from-purple-600 to-blue-600 rounded-2xl mb-6 mx-auto">
<i data-lucide="calendar" class="w-8 h-8 text-white"></i>
</div>
<% end %>
<h2 class="text-3xl font-bold text-gray-900">Paramètres du profil</h2>
<p class="mt-2 text-gray-600">
Gérez vos informations personnelles et préférences
</p>
</div>
<!-- Profile Form -->
<div class="bg-white py-8 px-6 shadow-xl rounded-2xl">
<h3 class="text-xl font-semibold text-gray-900 mb-6">Informations personnelles</h3>
<%= form_with model: @user, url: settings_path, method: :patch, local: true, html: { class: "space-y-6" } do |f| %>
<% if @user.errors.any? %>
<div class="bg-red-50 border border-red-200 rounded-lg p-4">
<div class="flex">
<i data-lucide="alert-circle" class="w-5 h-5 text-red-400 mt-0.5 mr-3"></i>
<div>
<h3 class="text-sm font-medium text-red-800">Erreurs :</h3>
<ul class="mt-2 text-sm text-red-700 list-disc list-inside">
<% @user.errors.full_messages.each do |message| %>
<li><%= message %></li>
<% end %>
</ul>
</div>
</div>
</div>
<% end %>
<div class="grid grid-cols-1 md:grid-cols-2 gap-6">
<div>
<%= f.label :first_name, "Prénom", class: "block text-sm font-semibold text-gray-700 mb-2" %>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="user" class="w-5 h-5 text-gray-400"></i>
</div>
<%= f.text_field :first_name,
class: "block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-xl shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition-colors",
placeholder: "Votre prénom" %>
</div>
</div>
<div>
<%= f.label :last_name, "Nom de famille", class: "block text-sm font-semibold text-gray-700 mb-2" %>
<div class="relative">
<div class="absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none">
<i data-lucide="user" class="w-5 h-5 text-gray-400"></i>
</div>
<%= f.text_field :last_name,
class: "block w-full pl-10 pr-3 py-3 border border-gray-300 rounded-xl shadow-sm placeholder-gray-400 focus:outline-none focus:ring-2 focus:ring-purple-500 focus:border-purple-500 transition-colors",
placeholder: "Votre nom de famille" %>
</div>
</div>
</div>
<!-- Professional Account Toggle -->
<div class="border-t pt-6">
<h4 class="text-lg font-medium text-gray-900 mb-4">Type de compte</h4>
<div class="bg-gray-50 p-4 rounded-xl">
<div class="flex items-start space-x-3">
<%= f.check_box :is_professionnal,
class: "mt-1 h-5 w-5 text-purple-600 border-gray-300 rounded focus:ring-purple-500" %>
<div class="flex-1">
<%= f.label :is_professionnal, "Compte professionnel",
class: "block text-sm font-medium text-gray-900 cursor-pointer" %>
<p class="mt-1 text-sm text-gray-600">
Les comptes professionnels peuvent créer et gérer des événements.
Cette option vous permet d'accéder aux fonctionnalités de promotion d'événements.
</p>
</div>
</div>
</div>
</div>
<div class="pt-4">
<%= f.button type: "submit", class: "group relative w-full flex justify-center items-center py-3 px-4 border border-transparent text-sm font-semibold rounded-xl text-white bg-gray-900 hover:bg-gray-800 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-gray-500 transition-all duration-200 shadow-lg hover:shadow-xl transform hover:-translate-y-0.5" do %>
<i data-lucide="save" class="w-4 h-4 mr-2"></i>
Enregistrer les modifications
<% end %>
</div>
<% end %>
</div>
<!-- Navigation Links -->
<div class="bg-white py-6 px-6 shadow-xl rounded-2xl">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Gestion du compte</h3>
<div class="space-y-3">
<%= link_to edit_user_registration_path,
class: "flex items-center p-3 text-gray-700 hover:bg-gray-50 rounded-lg transition-colors" do %>
<i data-lucide="key" class="w-5 h-5 mr-3 text-gray-400"></i>
<div>
<div class="font-medium">Sécurité du compte</div>
<div class="text-sm text-gray-500">Modifier l'email et le mot de passe</div>
</div>
<i data-lucide="chevron-right" class="w-5 h-5 ml-auto text-gray-400"></i>
<% end %>
</div>
</div>
<!-- Back Link -->
<div class="text-center">
<%= link_to :back, class: "inline-flex items-center text-purple-600 hover:text-purple-500 transition-colors" do %>
<i data-lucide="arrow-left" class="w-4 h-4 mr-2"></i>
Retour
<% end %>
</div>
</div>
</div>

View File

@@ -39,6 +39,10 @@ Rails.application.routes.draw do
# === Pages === # === Pages ===
get "dashboard", to: "pages#dashboard", as: "dashboard" get "dashboard", to: "pages#dashboard", as: "dashboard"
# === Settings ===
get "settings", to: "settings#show", as: "settings"
patch "settings", to: "settings#update"
# === Events === # === Events ===
get "events", to: "events#index", as: "events" get "events", to: "events#index", as: "events"
get "events/:slug.:id", to: "events#show", as: "event" get "events/:slug.:id", to: "events#show", as: "event"

4457
package-lock.json generated

File diff suppressed because it is too large Load Diff