Skip to content

Commit

Permalink
Make use of partial strict locals
Browse files Browse the repository at this point in the history
  • Loading branch information
Earlopain committed Oct 5, 2023
1 parent b39420e commit 42aa471
Show file tree
Hide file tree
Showing 14 changed files with 14 additions and 2 deletions.
1 change: 1 addition & 0 deletions app/views/application/_footer.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: () %>
<footer>
<%= Config.app_name %>
– Rendered in <%= (Time.current.to_f - @start_time).round(3) %> seconds
Expand Down
1 change: 1 addition & 0 deletions app/views/application/_navbar.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: () %>
<header id="top">
<nav id="nav">
<%= link_to "", root_path, class: "logo" %>
Expand Down
1 change: 1 addition & 0 deletions app/views/artist_urls/_list.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: (artist_urls:) -%>
<div class="url-list">
<% artist_urls.each do |artist_url| %>
<%= render "artists/artist_link", artist_url: artist_url %>
Expand Down
1 change: 1 addition & 0 deletions app/views/artists/_artist_link.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: (artist_url:) -%>
<div class="artist-link">
<%= site_icon artist_url %>
<%= link_to artist_url.unescaped_url_identifier, artist_path(artist_url.artist, search: { artist_url_id: [artist_url.id] }), class: "site-icon-text" %>
Expand Down
1 change: 1 addition & 0 deletions app/views/artists/_secondary_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: () %>
<%= subnav_link_to "Listing", artists_path %>
<%= subnav_link_to "New", new_artist_path %>
<% unless @artist&.id %>
Expand Down
1 change: 1 addition & 0 deletions app/views/config/_secondary_links.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<%# locals: () %>
<%= subnav_link_to "Listing", config_index_path %>
1 change: 1 addition & 0 deletions app/views/log_events/_secondary_links.html.erb
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<%# locals: () %>
<%= subnav_link_to "Listing", log_events_path %>
1 change: 1 addition & 0 deletions app/views/submission_files/_e6_post_stats.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: (submission_file:) -%>
<% submission_file.e6_posts.sort_by(&:similarity_score).reverse_each do |entry| %>
<div>
<%= link_to_external "##{entry.post_id}", "https://e621.net/posts/#{entry.post_id}", title: "Score: #{entry.score}" %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submission_files/_list_with_search.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<%# TODO: Figure out how remove the folder prefix %>
<%# locals: (path:, artist_urls:, submission_files:) -%>
<%= render "submission_files/search", path: path, artist_urls: artist_urls %>

<% submission_files.each do |file| %>
Expand Down
1 change: 1 addition & 0 deletions app/views/submission_files/_multiselect.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: () %>
<%= toggleable("multiselect", "Enter select mode", "Leave select mode", visible_on_load: false) do %>
<li><%= fake_link("Hide selected", id: "hide-selected") %> (<span class="selected-count">0</span>)</li>
<li><%= fake_link("Backlog selected", id: "backlock-selected") %> (<span class="selected-count">0</span>)</li>
Expand Down
2 changes: 1 addition & 1 deletion app/views/submission_files/_sample.html.erb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<% similarity ||= nil %>
<%# locals: (submission_file:, similarity: nil) -%>
<%= tag.div class: "submission-sample", data: { id: submission_file.id } do %>
<% if submission_file.sample_generated? %>
<div class="file-container">
Expand Down
1 change: 1 addition & 0 deletions app/views/submission_files/_search.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: (path:, artist_urls:) -%>
<%= hideable_search(path) do |f| %>
<%= f.input :artist_url_id, label: "URLs", collection: artist_urls, input_html: { multiple: true } if artist_urls.any? %>
<%= f.input :upload_status, label: "Status", collection: [
Expand Down
1 change: 1 addition & 0 deletions app/views/submission_files/_secondary_links.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: () %>
<%= subnav_link_to "Backlog", backlog_submission_files_path %>
<%= subnav_link_to "Hidden", hidden_submission_files_path %>
<% if instance_variable_defined?(:@search_params) %>
Expand Down
1 change: 1 addition & 0 deletions app/views/submission_files/_stats.html.erb
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<%# locals: (submission_file:, similarity:) %>
<% artist_submission = submission_file.artist_submission %>
<% artist_url = submission_file.artist_url %>
<div class="submission-stats">
Expand Down

0 comments on commit 42aa471

Please sign in to comment.