diff --git a/app/views/entries/index.html.erb b/app/views/entries/index.html.erb index 052219e..bf829e4 100644 --- a/app/views/entries/index.html.erb +++ b/app/views/entries/index.html.erb @@ -11,7 +11,11 @@
<%= 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" %> - <%= 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 %>
diff --git a/app/views/layouts/admin.html.erb b/app/views/layouts/admin.html.erb index 7b504dd..a326e50 100644 --- a/app/views/layouts/admin.html.erb +++ b/app/views/layouts/admin.html.erb @@ -10,22 +10,22 @@ - +
-
-
-
-
-

- <%= link_to "Sanasto Admin", admin_root_path, class: "hover:text-blue-100" %> -

+
+
+
+
+ Sanasto + Admin
-
@@ -33,9 +33,9 @@ <% if flash.any? %> -
+
<% flash.each do |type, message| %> - diff --git a/config/routes.rb b/config/routes.rb index a74e826..b06735f 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -16,10 +16,10 @@ Rails.application.routes.draw do get "setup", to: "setup#show" post "setup", to: "setup#create" - # Authentication routes (placeholder for future implementation) - # get "login", to: "sessions#new", as: :login - # post "login", to: "sessions#create" - # delete "logout", to: "sessions#destroy", as: :logout + # Authentication routes + get "login", to: "sessions#new", as: :login + post "login", to: "sessions#create" + delete "logout", to: "sessions#destroy", as: :logout # Admin namespace namespace :admin do