Files
nairobi/app/components/documents/fields_component.html.erb
Javi Martín 8116e75aee Simplify showing/hiding attached file name
Note we have to render the `<p>` tag in one line because at the time of
writing browsers don't consider elements with whitespace inside as empty
[1].

[1] https://developer.mozilla.org/en-US/docs/Web/CSS/:empty
2021-07-13 16:58:13 +02:00

30 lines
896 B
Plaintext

<div id="<%= dom_id(document) %>" class="document direct-upload document-fields nested-fields">
<%= f.hidden_field :id %>
<%= f.hidden_field :user_id, value: current_user.id %>
<%= f.hidden_field :cached_attachment %>
<div class="small-12 column title">
<%= f.text_field :title, placeholder: t("documents.form.title_placeholder") %>
</div>
<div class="small-12 column attachment-actions">
<div class="small-9 column action-add attachment-errors document-attachment">
<%= render_attachment %>
</div>
<div class="small-3 column action-remove text-right">
<%= render_destroy_document_link %>
</div>
</div>
<div class="small-6 column">
<p class="file-name"><%= document_attachment_file_name %></p>
</div>
<div class="small-12 column">
<div class="progress-bar-placeholder"><div class="loading-bar"></div></div>
</div>
<hr>
</div>