change new external route

This commit is contained in:
Donovan Daniels 2024-10-21 19:43:38 -05:00
parent f92c7370d8
commit 73ec849903
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
3 changed files with 7 additions and 7 deletions

View File

@ -323,9 +323,9 @@ class APIImage < ApplicationRecord
description: <<~DESC, description: <<~DESC,
ID: `#{md5}` ID: `#{md5}`
Category: `#{category}` Category: `#{category}`
Artists: `#{artists.join(', ') || '[NONE]'}` Artists: `#{artists.join(', ').presence || '[NONE]'}`
Sources: Sources:
#{sources.map { |s| "* #{s}" }.join("\n") || '[NONE]'}} #{sources.map { |s| "* #{s}" }.join("\n").presence || '[NONE]'}
Upload Type: #{original_url.present? ? "[url](#{original_url})" : 'file'} Upload Type: #{original_url.present? ? "[url](#{original_url})" : 'file'}
Uploaded By: <@#{creator.id}> (`#{creator.name}`) Uploaded By: <@#{creator.id}> (`#{creator.name}`)
Created At: <t:#{created_at.to_i}> Created At: <t:#{created_at.to_i}>
@ -342,9 +342,9 @@ class APIImage < ApplicationRecord
description: <<~DESC, description: <<~DESC,
ID: `#{md5}` ID: `#{md5}`
Category: `#{category}` Category: `#{category}`
Artists: `#{artists.join(', ') || '[NONE]'}}` Artists: `#{artists.join(', ').presence || '[NONE]'}}`
Sources: Sources:
#{sources.map { |s| "* #{s}" }.join("\n") || '[NONE]'}} #{sources.map { |s| "* #{s}" }.join("\n").presence || '[NONE]'}}
Upload Type: #{original_url.present? ? "[url](#{original_url})" : 'file'} Upload Type: #{original_url.present? ? "[url](#{original_url})" : 'file'}
Uploaded By: <@#{creator.id}> (`#{creator.name}`) Uploaded By: <@#{creator.id}> (`#{creator.name}`)
Reason: #{deletion_reason || 'None Provided'} Reason: #{deletion_reason || 'None Provided'}

View File

@ -8,9 +8,9 @@
<div class="w-100"> <div class="w-100">
<div style="width: 40%; margin-left: 30%;"> <div style="width: 40%; margin-left: 30%;">
<%= simple_form_for(:api_image, url: create_external_yiff_rest_api_v2_manage_images_path, method: :post) do |f| %> <%= simple_form_for(:api_image, url: create_external_yiff_rest_api_v2_manage_images_path, method: :post) do |f| %>
<%= f.input(:site, label: "Site", as: :select, selected: params.dig(:api_image, :site), collection: ExternalAPIImage::SITES.map { |s| [s.name, s.value] }) %> <%= f.input(:site, label: "Site", as: :select, selected: params.dig(:api_image, :site), collection: ExternalAPIImage::SITES.map { |s| [s.name, s.value] }, include_blank: true) %>
<%= f.input(:external_id, input_html: { value: params.dig(:api_image, :external_id) }) %> <%= f.input(:external_id, input_html: { value: params.dig(:api_image, :external_id) }) %>
<%= f.input(:category, as: :select, selected: params.dig(:api_image, :category), collection: @categories.map { |cat| [cat.name, cat.db] }) %> <%= f.input(:category, as: :select, selected: params.dig(:api_image, :category), collection: @categories.map { |cat| [cat.name, cat.db] }, include_blank: true) %>
<%= f.button(:submit, "Upload Image", name: nil) %> <%= f.button(:submit, "Upload Image", name: nil) %>
<% end %> <% end %>
</div> </div>

View File

@ -63,7 +63,7 @@ module YiffRestRoutes
get(:iqdb) get(:iqdb)
match("/iqdb/query", via: %i[get post], action: :query_iqdb) match("/iqdb/query", via: %i[get post], action: :query_iqdb)
post(:external, action: :create_external, as: "create_external") post(:external, action: :create_external, as: "create_external")
get("/new/external", action: :new_external) get("/external/new", action: :new_external)
end end
end end
end end