mirror of
https://github.com/Freika/dawarich.git
synced 2026-01-11 17:51:39 -05:00
Update link to Immich search on the trip page
This commit is contained in:
parent
c689051472
commit
b712332277
2 changed files with 11 additions and 1 deletions
|
|
@ -110,4 +110,14 @@ module ApplicationHelper
|
|||
def human_date(date)
|
||||
date.strftime('%e %B %Y')
|
||||
end
|
||||
|
||||
def immich_search_url(base_url, start_date, end_date)
|
||||
query = {
|
||||
takenAfter: "#{start_date.to_date}T00:00:00.000Z",
|
||||
takenBefore: "#{end_date.to_date}T23:59:59.999Z"
|
||||
}
|
||||
|
||||
encoded_query = URI.encode_www_form_component(query.to_json)
|
||||
"#{base_url}/search?query=#{encoded_query}"
|
||||
end
|
||||
end
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@
|
|||
<% end %>
|
||||
|
||||
<div class="text-center mt-6">
|
||||
<%= link_to "More photos on Immich", "#", class: "btn btn-primary" %>
|
||||
<%= link_to "More photos on Immich", immich_search_url(current_user.settings['immich_url'], @trip.started_at, @trip.ended_at), class: "btn btn-primary", target: '_blank' %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue