Profile Settings
<%= form_with model: @user, url: user_path(@user), method: :patch, class: "space-y-4" do |f| %>
<% if @user.errors.any? %>
<% @user.errors.full_messages.each do |message| %>
<%= message %>
<% end %>
<% end %>
<%= f.label :username, class: "block text-sm font-medium text-gray-700" %>
<%= f.text_field :username, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" %>
<%= f.label :email, class: "block text-sm font-medium text-gray-700" %>
<%= f.email_field :email, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" %>
<%= f.label :bio, class: "block text-sm font-medium text-gray-700" %>
<%= f.text_area :bio, rows: 4, class: "mt-1 block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500" %>
<%= f.check_box :profile_public, class: "rounded border-gray-300 text-indigo-600 focus:ring-indigo-500" %>
<%= f.label :profile_public, "Make my profile public", class: "ml-2 text-sm text-gray-700" %>
<%= f.label :theme, "Theme", class: "block text-sm font-medium text-gray-700 mb-2" %>
<% {
"light" => { name: "Light", colors: "bg-white border-gray-300", icon: "โ๏ธ" },
"dark" => { name: "Dark", colors: "bg-gray-900 text-white border-gray-600", icon: "๐" },
"midnight" => { name: "Midnight", colors: "bg-blue-950 text-blue-100 border-blue-800", icon: "๐" },
"retro" => { name: "Retro", colors: "bg-amber-950 text-amber-100 border-amber-700", icon: "๐น๏ธ" },
"ocean" => { name: "Ocean", colors: "bg-cyan-950 text-cyan-100 border-cyan-700", icon: "๐" }
}.each do |value, theme_info| %>
<%= f.radio_button :theme, value, class: "peer sr-only" %>
<%= theme_info[:icon] %>
<%= theme_info[:name] %>
<% end %>
Choose your preferred theme for TurboVault
<%= f.check_box :igdb_sync_enabled, class: "rounded border-gray-300 text-indigo-600 focus:ring-indigo-500 mt-1" %>
<%= f.label :igdb_sync_enabled, "Enable IGDB game matching", class: "text-sm font-medium text-gray-700" %>
Enabled by default. Automatically match your games with IGDB for cover art, genres, and metadata.
Sync runs every 30 minutes for unmatched games. You can review matches before they're linked.
<%= f.submit "Update Profile", class: "px-6 py-2 bg-indigo-600 text-white rounded-md hover:bg-indigo-700" %>
<% end %>
API Tokens
<%= link_to "Manage API Tokens", settings_api_tokens_path, class: "text-indigo-600 hover:text-indigo-800" %>
<% if @api_tokens.any? %>
<% @api_tokens.first(3).each do |token| %>
<%= token.name || "Unnamed Token" %>
Created <%= time_ago_in_words(token.created_at) %> ago
<% if token.last_used_at %>
ยท Last used <%= time_ago_in_words(token.last_used_at) %> ago
<% end %>
<% end %>
<% if @api_tokens.count > 3 %>
<%= link_to "View all #{@api_tokens.count} tokens", settings_api_tokens_path, class: "text-indigo-600 hover:text-indigo-800" %>
<% end %>
<% else %>
No API tokens yet. Create one to access the API.
<% end %>