clean style, log in/out

This commit is contained in:
2026-01-23 03:08:25 +01:00
parent 3ed9455bbb
commit da96d357a5
3 changed files with 25 additions and 30 deletions
+5 -1
View File
@@ -11,7 +11,11 @@
<div class="flex items-center gap-3"> <div class="flex items-center gap-3">
<%= link_to "Download XLSX", download_entries_path(format: :xlsx), <%= link_to "Download XLSX", download_entries_path(format: :xlsx),
class: "text-xs font-bold text-indigo-700 px-3 py-2 rounded-md border border-indigo-200 bg-indigo-50 hover:bg-indigo-100 transition" %> class: "text-xs font-bold text-indigo-700 px-3 py-2 rounded-md border border-indigo-200 bg-indigo-50 hover:bg-indigo-100 transition" %>
<%= link_to "Sign In", "#", class: "bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition" %> <% if admin? %>
<%= link_to "Admin", admin_root_path, class: "bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition" %>
<% else %>
<%= link_to "Sign In", login_path, class: "bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition" %>
<% end %>
</div> </div>
</div> </div>
</div> </div>
+16 -25
View File
@@ -10,22 +10,22 @@
<script src="https://cdn.tailwindcss.com"></script> <script src="https://cdn.tailwindcss.com"></script>
</head> </head>
<body class="bg-gray-100 text-gray-900 font-sans antialiased"> <body class="bg-slate-50 text-gray-900 font-sans antialiased">
<div class="min-h-screen flex flex-col"> <div class="min-h-screen flex flex-col">
<!-- Header --> <!-- Header -->
<header class="bg-blue-600 text-white shadow-md"> <header class="bg-white border-b border-slate-200">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8"> <div class="max-w-7xl mx-auto px-4">
<div class="flex items-center justify-between h-16"> <div class="h-16 flex items-center justify-between">
<div class="flex items-center"> <div class="flex items-center gap-2">
<h1 class="text-2xl font-bold"> <span class="text-xl font-bold tracking-tight text-indigo-600">Sanasto</span>
<%= link_to "Sanasto Admin", admin_root_path, class: "hover:text-blue-100" %> <span class="text-xl font-light text-slate-400">Admin</span>
</h1>
</div> </div>
<nav class="flex space-x-4"> <nav class="flex items-center gap-3">
<%= link_to "Dashboard", admin_dashboard_path, class: "px-3 py-2 rounded-md text-sm font-medium hover:bg-blue-700" %> <%= link_to "Dashboard", admin_dashboard_path, class: "text-sm font-medium text-slate-600 hover:text-indigo-600 transition" %>
<%= link_to "Users", admin_users_path, class: "px-3 py-2 rounded-md text-sm font-medium hover:bg-blue-700" %> <%= link_to "Users", admin_users_path, class: "text-sm font-medium text-slate-600 hover:text-indigo-600 transition" %>
<%= link_to "Invitations", admin_invitations_path, class: "px-3 py-2 rounded-md text-sm font-medium hover:bg-blue-700" %> <%= link_to "Invitations", admin_invitations_path, class: "text-sm font-medium text-slate-600 hover:text-indigo-600 transition" %>
<%= link_to "Back to Site", root_path, class: "px-3 py-2 rounded-md text-sm font-medium hover:bg-blue-700" %> <%= link_to "Back to Site", root_path, class: "text-sm font-medium text-slate-600 hover:text-indigo-600 transition" %>
<%= button_to "Log Out", logout_path, method: :delete, class: "bg-indigo-600 text-white px-4 py-2 rounded-lg text-sm font-semibold hover:bg-indigo-700 transition" %>
</nav> </nav>
</div> </div>
</div> </div>
@@ -33,9 +33,9 @@
<!-- Flash messages --> <!-- Flash messages -->
<% if flash.any? %> <% if flash.any? %>
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 mt-4"> <div class="max-w-7xl mx-auto px-4 mt-4">
<% flash.each do |type, message| %> <% flash.each do |type, message| %>
<div class="<%= type == 'notice' ? 'bg-green-100 border-green-400 text-green-700' : 'bg-red-100 border-red-400 text-red-700' %> px-4 py-3 rounded relative mb-4" role="alert"> <div class="<%= type == 'notice' ? 'bg-green-50 border border-green-200 text-green-700' : 'bg-red-50 border border-red-200 text-red-700' %> px-4 py-3 rounded-lg mb-4" role="alert">
<span class="block sm:inline"><%= message %></span> <span class="block sm:inline"><%= message %></span>
</div> </div>
<% end %> <% end %>
@@ -43,18 +43,9 @@
<% end %> <% end %>
<!-- Main content --> <!-- Main content -->
<main class="flex-1 max-w-7xl w-full mx-auto px-4 sm:px-6 lg:px-8 py-8"> <main class="flex-1 max-w-7xl w-full mx-auto px-4 py-8">
<%= yield %> <%= yield %>
</main> </main>
<!-- Footer -->
<footer class="bg-white border-t border-gray-200 mt-auto">
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-4">
<p class="text-center text-sm text-gray-600">
Sanasto Wiki Admin Dashboard &copy; <%= Time.current.year %>
</p>
</div>
</footer>
</div> </div>
</body> </body>
</html> </html>
+4 -4
View File
@@ -16,10 +16,10 @@ Rails.application.routes.draw do
get "setup", to: "setup#show" get "setup", to: "setup#show"
post "setup", to: "setup#create" post "setup", to: "setup#create"
# Authentication routes (placeholder for future implementation) # Authentication routes
# get "login", to: "sessions#new", as: :login get "login", to: "sessions#new", as: :login
# post "login", to: "sessions#create" post "login", to: "sessions#create"
# delete "logout", to: "sessions#destroy", as: :logout delete "logout", to: "sessions#destroy", as: :logout
# Admin namespace # Admin namespace
namespace :admin do namespace :admin do