Move documents partials to components
This way it'll be easier to change them. Note that there were two `.document-link` elements which aren't part of a `.documents` element. We're renaming the HTML class of the link in investments because it didn't contain links to download documents and are slightly duplicating the CSS in the poll answer documents in order to keep the `word-wrap` property.
This commit is contained in:
@@ -45,13 +45,13 @@
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_attached_documents) %>
|
||||
<%= render "documents/documents", documents: investment.documents %>
|
||||
<%= render Documents::DocumentsComponent.new(investment.documents) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "shared/tags", taggable: investment %>
|
||||
|
||||
<% if investment.external_url.present? %>
|
||||
<div class="document-link">
|
||||
<div class="investment-external-link">
|
||||
<%= sanitize_and_auto_link investment.external_url %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
</div>
|
||||
|
||||
<div class="small-12 medium-4 column">
|
||||
<%= render "documents/documents", documents: dashboard_action.documents %>
|
||||
<%= render Documents::DocumentsComponent.new(dashboard_action.documents) %>
|
||||
|
||||
<% if dashboard_action.links.any? %>
|
||||
<div class="margin-top">
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
<li id="<%= dom_id(document) %>">
|
||||
<%= link_to t("documents.buttons.download_document"),
|
||||
document.attachment,
|
||||
target: "_blank",
|
||||
rel: "nofollow",
|
||||
class: "button hollow medium float-right" %>
|
||||
|
||||
<strong><%= document.title %></strong>
|
||||
<br>
|
||||
<small>
|
||||
<%= document.humanized_content_type %> |
|
||||
<%= number_to_human_size(document.attachment_file_size, precision: 2) %>
|
||||
</small>
|
||||
|
||||
<% if can?(:destroy, document) %>
|
||||
<br>
|
||||
<%= link_to t("documents.buttons.destroy_document"),
|
||||
document,
|
||||
method: :delete,
|
||||
data: { confirm: t("documents.actions.destroy.confirm") },
|
||||
class: "delete" %>
|
||||
<% end %>
|
||||
</li>
|
||||
@@ -1,9 +0,0 @@
|
||||
<% if documents.any? %>
|
||||
<div id="documents" class="documents">
|
||||
<h2><%= t("documents.title") %> <span>(<%= documents.count %>)</span></h2>
|
||||
|
||||
<ul class="no-bullet document-link">
|
||||
<%= render partial: "documents/document", collection: documents %>
|
||||
</ul>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -87,7 +87,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_attached_documents) %>
|
||||
<%= render "documents/documents", documents: @proposal.documents %>
|
||||
<%= render Documents::DocumentsComponent.new(@proposal.documents) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "shared/tags", taggable: @proposal %>
|
||||
|
||||
@@ -67,7 +67,7 @@
|
||||
<% end %>
|
||||
|
||||
<% if feature?(:allow_attached_documents) %>
|
||||
<%= render "documents/documents", documents: @proposal.documents %>
|
||||
<%= render Documents::DocumentsComponent.new(@proposal.documents) %>
|
||||
<% end %>
|
||||
|
||||
<%= render "shared/tags", taggable: @proposal %>
|
||||
|
||||
Reference in New Issue
Block a user