Skip to content

Self-hosted project management for devs and their clients: tickets, time tracking, docs and meetings, with an AI assistant that cites its sources. AGPL-3.0.

1.7 KB
Raw Blame
<%# Shared by the operator backend AND the in-app per-org persona forms: the
    per-language Label + Prompt-Fragment inputs. Extracted so the supported
    language set and the labels/prompt_fragments field shape live in ONE place
    (they must stay in sync with PromptPersona#localized and the controllers'
    permit lists). Styling differs between the two hosts (admin brutalist vs
    in-app editorial), so the CSS classes are passed in rather than hard-coded. %>
<%# locals: (persona:, input_class:, label_class:, hint_class:) -%>
<% Lalabase::Languages::SUPPORTED.each do |lang| %>
  <div class="mb-5">
    <label for="prompt_persona_labels_<%= lang %>" class="<%= label_class %>">
      <%= t('views.prompt_personas.locale_fields.label_label', language: lang.upcase) %>
    </label>
    <%= text_field_tag "prompt_persona[labels][#{lang}]", persona.labels&.dig(lang),
                       id: "prompt_persona_labels_#{lang}", class: input_class, autocomplete: "off",
                       placeholder: t('views.prompt_personas.locale_fields.label_placeholder') %>

    <label for="prompt_persona_prompt_fragments_<%= lang %>" class="<%= label_class %> mt-3">
      <%= t('views.prompt_personas.locale_fields.fragment_label', language: lang.upcase) %>
    </label>
    <%= text_area_tag "prompt_persona[prompt_fragments][#{lang}]", persona.prompt_fragments&.dig(lang),
                      id: "prompt_persona_prompt_fragments_#{lang}", rows: 4, class: input_class,
                      placeholder: t('views.prompt_personas.locale_fields.fragment_placeholder') %>
    <p class="<%= hint_class %>"><%= t('views.prompt_personas.locale_fields.fragment_hint') %></p>
  </div>
<% end %>