Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added app/assets/images/receipt_status_upload.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added app/assets/images/receipt_status_uploaded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 7 additions & 1 deletion app/controllers/hcb_codes_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,13 @@ def receipt_status
@secret = params[:s]
@hcb_code = HcbCode.find_signed(@secret, purpose: :receipt_status)

raise Pundit::NotAuthorizedError if @hcb_code.nil?
if @hcb_code.nil?
raise Pundit::NotAuthorizedError
end

file_name = @hcb_code.missing_receipt? ? "receipt_status_upload.png" : "receipt_status_uploaded.png"

send_file Rails.root.join("app", "assets", "images", file_name), type: "image/png", disposition: "inline"
end

def toggle_tag
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<% if hcb_code.receipt_required? %>

<%= link_to upload_url do %>
<img style="display: block; margin-top: 10px;" src="<%= receipt_status_hcb_codes_url(format: :svg, s: @cpt.local_hcb_code.signed_id(purpose: :receipt_status)) %>" alt="Click to upload your receipt">
<img style="display: block; margin-top: 10px;" src="<%= receipt_status_hcb_codes_url(format: :png, s: @cpt.local_hcb_code.signed_id(purpose: :receipt_status)) %>" alt="Click to upload your receipt">
<% end %>
<p><em>This link can be used by anyone for two weeks to upload a receipt for this charge.</em></p>

Expand Down
11 changes: 0 additions & 11 deletions app/views/hcb_codes/receipt_status.svg.erb

This file was deleted.