refactor comments, select language
CI / scan_ruby (push) Successful in 18s
CI / scan_js (push) Successful in 12s
CI / lint (push) Failing after 19s
CI / test (push) Failing after 36s

This commit is contained in:
2026-01-30 10:37:56 +01:00
parent 8ce7f1b913
commit 46e4f808e7
9 changed files with 82 additions and 75 deletions
+2 -35
View File
@@ -33,41 +33,8 @@
</div>
<% end %>
<div class="space-y-4">
<div>
<%= 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" } %>
</div>
</div>
<div class="border-t border-gray-200 pt-6">
<h3 class="text-lg font-semibold text-gray-900 mb-4">Translations (at least one required)</h3>
<div class="grid grid-cols-1 md:grid-cols-2 gap-4">
<% %w[fi en sv no ru de].each do |lang_code| %>
<div>
<%= 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" %>
</div>
<% end %>
</div>
</div>
<div>
<%= 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..." %>
<div class="space-y-6">
<%= render 'entries/form_fields', f: f, category_prompt: false %>
</div>
<div class="flex flex-col sm:flex-row gap-4 pt-4">