Fix upload link in iqdb action

This commit is contained in:
Donovan Daniels 2024-10-13 02:45:34 -05:00
parent 7a7d8c0dcc
commit e2b84fa079
Signed by: Donovan_DMC
GPG Key ID: 907D29CBFD6157BA
2 changed files with 4 additions and 3 deletions

View File

@ -58,6 +58,7 @@ module YiffRest
end end
def iqdb def iqdb
@sp = {}
end end
def query_iqdb def query_iqdb

View File

@ -9,13 +9,13 @@
<div class="collapse navbar-collapse" id="navbarSupportedContent"> <div class="collapse navbar-collapse" id="navbarSupportedContent">
<ul class="navbar-nav me-auto mb-2 mb-lg-0"> <ul class="navbar-nav me-auto mb-2 mb-lg-0">
<li class="nav-item"> <li class="nav-item">
<%= link_to "Home", yiff_rest_api_v2_manage_index_path, class: "nav-link#{if_active(' active', path: yiff_rest_api_v2_manage_index_path)}" %> <%= link_to("Home", yiff_rest_api_v2_manage_index_path, class: "nav-link#{if_active(' active', path: yiff_rest_api_v2_manage_index_path)}") %>
</li> </li>
<% if params[:controller] == "yiff_rest/api_v2/manage" %> <% if params[:controller] == "yiff_rest/api_v2/manage" %>
<% elsif params[:controller] == "yiff_rest/api_v2/images" %> <% elsif params[:controller] == "yiff_rest/api_v2/images" %>
<% if %w[index iqdb query_iqdb].include?(params[:action]) %> <% if %w[index iqdb query_iqdb].include?(params[:action]) %>
<li class="nav-item"> <li class="nav-item">
<%= link_to "Upload Image", new_yiff_rest_api_v2_manage_image_path(api_image: ({ category: @sp[:category] } if @sp[:category])), class: "nav-link#{if_active(' active', path: new_yiff_rest_api_v2_manage_image_path(manage_id: params[:id]))}" %> <%= link_to("Upload Image", new_yiff_rest_api_v2_manage_image_path(api_image: ({ category: @sp[:category] } if @sp[:category])), class: "nav-link#{if_active(' active', path: new_yiff_rest_api_v2_manage_image_path(manage_id: params[:id]))}") %>
</li> </li>
<% else %> <% else %>
<% category = params.dig(:api_image, :category) if params[:action] == "new" %> <% category = params.dig(:api_image, :category) if params[:action] == "new" %>
@ -23,7 +23,7 @@
<% category = @image.category if params[:action] == "edit" %> <% category = @image.category if params[:action] == "edit" %>
<% if category %> <% if category %>
<li class="nav-item"> <li class="nav-item">
<%= link_to "Back To Category", yiff_rest_api_v2_manage_images_path(search: { category: category }), class: "nav-link" %> <%= link_to("Back To Category", yiff_rest_api_v2_manage_images_path(search: { category: category }), class: "nav-link") %>
</li> </li>
<% end %> <% end %>
<% end %> <% end %>