refactor comments, select language
This commit is contained in:
@@ -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">
|
||||
|
||||
Reference in New Issue
Block a user