Skip to content

Commit

Permalink
Fix linking to config pages for disabled scrapers
Browse files Browse the repository at this point in the history
Also makes navigating to these a 404 instead of erroring out.
See 84ee8dc#comments
  • Loading branch information
Earlopain committed Oct 13, 2023
1 parent 40b407d commit 47231d8
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/controllers/config_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ def index

def show
@definition = Sites.from_enum(params[:id])
raise ActiveRecord::RecordNotFound unless @definition
end

def modify
Expand Down
2 changes: 1 addition & 1 deletion app/views/stats/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<% entry = @counts[definition.site_type] || {} %>
<% next unless definition.scraper? || entry["file_count"] %>
<tr>
<td><%= link_to_if(definition.site_type != "manual", definition.display_name, config_path(definition.site_type)) %></td>
<td><%= link_to_if(definition.scraper?, definition.display_name, config_path(definition.site_type)) %></td>
<td><%= link_to(entry["artist_count"] || 0, artists_path(search: { site_type: definition.site_type })) %></td>
<td><%= link_to(entry["url_count"] || 0, artist_urls_path(search: { site_type: definition.site_type })) %></td>
<td><%= link_to(entry["submission_count"] || 0, submission_files_path(search: { site_type: definition.site_type })) %></td>
Expand Down

0 comments on commit 47231d8

Please sign in to comment.