diff --git a/app/models/foi_attachment.rb b/app/models/foi_attachment.rb index f0c726d373..de9e701969 100644 --- a/app/models/foi_attachment.rb +++ b/app/models/foi_attachment.rb @@ -49,6 +49,7 @@ class FoiAttachment < ApplicationRecord before_destroy :delete_cached_file! scope :binary, -> { where.not(content_type: AlaveteliTextMasker::TextMask) } + scope :substantive, -> { reject(&:main_body_part?) } delegate :expire, :log_event, to: :info_request delegate :metadata, to: :file_blob diff --git a/app/views/admin_request/_some_attachments.html.erb b/app/views/admin_request/_some_attachments.html.erb new file mode 100644 index 0000000000..14f60b9b86 --- /dev/null +++ b/app/views/admin_request/_some_attachments.html.erb @@ -0,0 +1,27 @@ +
+ <% foi_attachments = fetch_foi_attachments(@info_request) %> + <% if foi_attachments.any? %> + + + + + + + + + + + <% foi_attachments.each do |attachment| %> + + + + + + + <% end %> + +
AttachmentContent TypeHexdigestDisplay Size
<%= both_links attachment %><%= attachment.content_type %><%= attachment.hexdigest %><%= attachment.display_size %>
+ <% else %> +

None yet.

+ <% end %> +
diff --git a/app/views/admin_request/show.html.erb b/app/views/admin_request/show.html.erb index 4946874df6..85270f7f46 100644 --- a/app/views/admin_request/show.html.erb +++ b/app/views/admin_request/show.html.erb @@ -372,6 +372,16 @@
+

Attachments

+ +
+

Excludes main body part attachments.

+
+ +<%= render partial: 'admin_incoming_message/foi_attachments', + locals: { foi_attachments: @info_request.foi_attachments.substantive } %> +
+

Annotations

<%= render partial: 'admin_request/some_annotations' ,