<% content_for :title, "Edit Entry" %>
<%= render "shared/header", show_request_button: false, show_browse_button: true %>

Edit Entry

<% if @entry.verified? %>
Verified
<% else %> Unverified <% end %>

Update the translations and details for this entry.

<%= form_with model: @entry, class: "space-y-6" do |f| %> <% if @entry.errors.any? %>

Please fix the following errors:

    <% @entry.errors.full_messages.each do |message| %>
  • <%= message %>
  • <% end %>
<% end %>
<%= f.label :category, "Category", class: "block text-sm font-semibold text-gray-700 mb-2" %> <%= f.select :category, Entry.categories.keys.map { |key| [key.tr("_", " ").capitalize, key] }, {}, { class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" } %>

Translations (at least one required)

<% %w[fi en sv no ru de].each do |lang_code| %>
<%= f.label lang_code.to_sym, case lang_code when 'fi' then '🇫🇮 Finnish' when 'en' then '🇬🇧 English' when 'sv' then '🇸🇪 Swedish' when 'no' then '🇳🇴 Norwegian' when 'ru' then '🇷🇺 Russian' when 'de' then '🇩🇪 German' end, class: "block text-sm font-medium text-gray-700 mb-2" %> <%= f.text_field lang_code.to_sym, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition" %>
<% end %>
<%= f.label :notes, "Additional Notes (optional)", class: "block text-sm font-semibold text-gray-700 mb-2" %> <%= f.text_area :notes, rows: 4, class: "w-full px-4 py-3 border border-gray-300 rounded-lg focus:ring-2 focus:ring-indigo-500 focus:border-transparent transition", placeholder: "Any additional context or information about this entry..." %>
<%= f.submit "Save Changes", class: "flex-1 bg-indigo-600 hover:bg-indigo-700 text-white font-semibold py-3 px-6 rounded-lg transition shadow-md hover:shadow-lg" %> <%= link_to "Cancel", entry_path(@entry), class: "flex-1 text-center bg-gray-100 hover:bg-gray-200 text-gray-800 font-semibold py-3 px-6 rounded-lg transition" %>
<% end %>
<%= link_to "← Back to entry", entry_path(@entry), class: "text-indigo-600 hover:text-indigo-800 font-semibold" %> • <%= link_to "Back to search", entries_path, class: "text-indigo-600 hover:text-indigo-800 font-semibold" %>