Skip to content

Commit

Permalink
Remove use of turbo_method since we dont have it enabled
Browse files Browse the repository at this point in the history
  • Loading branch information
epugh committed Jan 22, 2025
1 parent 5a1184a commit 09fe5d2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 4 deletions.
4 changes: 4 additions & 0 deletions app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ def bootstrap_class_for flash_type
}[flash_type.to_sym] || flash_type.to_s
end

def button_to_if condition, name, options = {}, html_options = {}
button_to(name, options, html_options) if condition
end

# rubocop:disable Metrics/MethodLength
# rubocop:disable Lint/EmptyBlock
def flash_messages _opts = {}
Expand Down
18 changes: 14 additions & 4 deletions app/views/books/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -220,8 +220,8 @@ This book consists of <%= @book.query_doc_pairs.count %> query document pairs an
<thead>
<tr>
<th scope="col">Judge</th>
<th scope="col">Marked Unrateable</th>
<th scope="col">Marked Judge Later</th>
<th scope="col" colspan="2">Marked Unrateable</th>
<th scope="col" colspan="2">Marked Judge Later</th>
<th scope="col">Total</th>
</tr>
</thead>
Expand All @@ -242,12 +242,22 @@ This book consists of <%= @book.query_doc_pairs.count %> query document pairs an
</th>
<td>
<% if row[:judge] %>
<%=row[:unrateable] %> <%= link_to_if(row[:judge] && row[:unrateable] > 0, "reset", reset_unrateable_book_path(@book,row[:judge].id), data: { turbo_method: :delete, turbo_confirm: "Are you sure?" }){ '' } %>
<%=row[:unrateable] %>
<% end %>
</td>
<td>
<% if row[:judge] %>
<%=row[:judge_later] %> <%= link_to_if(row[:judge] && row[:judge_later] > 0, "reset", reset_judge_later_book_path(@book,row[:judge].id), data: { turbo_method: :delete, turbo_confirm: "Are you sure?" }){ '' } %>
<%= button_to_if row[:judge] && row[:unrateable] > 0, 'reset', reset_unrateable_book_path(@book,row[:judge].id), method: :delete, class: 'btn btn-sm btn-light' %>
<% end %>
</td>
<td>
<% if row[:judge] %>
<%=row[:judge_later] %>
<% end %>
</td>
<td>
<% if row[:judge] %>
<%= button_to_if row[:judge] && row[:judge_later] > 0, "reset", reset_judge_later_book_path(@book,row[:judge].id), method: :delete, class: 'btn btn-sm btn-light' %>
<% end %>
</td>
<td><%=row[:judgements] %></td>
Expand Down

0 comments on commit 09fe5d2

Please sign in to comment.