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.6 KB
Raw Blame
<%# locals: (form:) %>
<%# The file first (S4 of doc/dokumentansicht_plan.md, the designer's 43a): a
    dashed zone that is a LABEL around the real file input, so a click opens
    the picker without a line of script and the input stays the field the form
    submits (multipart; @rails/activestorage is not started in this app, so a
    direct_upload flag would be dead). upload_zone_controller, on the form,
    adds drag and drop, the chosen file's name, the title suggestion and the
    button's off state. No formats and no limit are named: the model enforces
    neither (DocumentVersion validates presence alone), and a line that named
    some would be a promise the server does not keep. %>
<% uz = 'views.organisations.documents.upload_zone' %>
<label class="flex cursor-pointer flex-col items-center justify-center gap-1 rounded-lg border-2 border-dashed border-cream-300 bg-surface-raised px-4 py-6 text-center text-sm text-cream-700 transition-colors hover:border-cream-500 focus-within:border-ink"
       data-upload-zone-target="zone"
       data-action="dragover->upload-zone#over dragleave->upload-zone#leave drop->upload-zone#drop">
  <i class="bi bi-file-earmark-arrow-up text-xl text-cream-500" aria-hidden="true"></i>
  <span class="font-medium text-cream-900"><%= t("#{uz}.prompt") %></span>
  <span class="text-cream-600" data-upload-zone-target="name"><%= t("#{uz}.none_chosen") %></span>
  <%= form.file_field :document_version_file, multiple: false, required: true, class: 'sr-only',
        data: { upload_zone_target: 'input', action: 'change->upload-zone#changed' } %>
</label>