Skip to content

Commit

Permalink
only show visible problems when creating icons and cards
Browse files Browse the repository at this point in the history
  • Loading branch information
Floppy committed Feb 2, 2024
1 parent de06091 commit e00d4c1
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion app/helpers/models_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ def group(files)
def status_badges(model)
badges = []
badges << content_tag(:span, icon("bi bi-stars", t("general.new")), class: "text-warning align-middle") if model.new?
badges << problem_icon(model.problems_including_files)
badges << problem_icon(model.problems_including_files.visible(current_user.problem_settings))
content_tag :span, safe_join(badges, " "), class: "status-badges"
end

Expand Down
2 changes: 1 addition & 1 deletion app/views/model_files/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
<%= render 'form' %>
<% end %>

<%= render partial: "problem", collection: @file.problems %>
<%= render partial: "problem", collection: @file.problems.visible(current_user.problem_settings) %>

<%= card :secondary, "Actions" do %>
<%= link_to "#{icon('cloud-download', 'Download')} Download".html_safe, library_model_model_file_path(@library, @model, @file, @file.extension.to_sym), {class: "btn btn-secondary"} %>
Expand Down
2 changes: 1 addition & 1 deletion app/views/models/show.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
<% end %>
<% end %>

<%= render partial: "problem", collection: @model.problems %>
<%= render partial: "problem", collection: @model.problems.visible(current_user.problem_settings) %>

<%= card(:secondary, 'Notes') do %>
<p class="card-text"><%= sanitize @model.notes %></p>
Expand Down

0 comments on commit e00d4c1

Please sign in to comment.