From 048cd2dd7ae15d936efc5d45e3dcd16ece23908e Mon Sep 17 00:00:00 2001 From: Andy Allan Date: Wed, 17 Dec 2025 17:01:09 +0000 Subject: [PATCH] Refactor turbo-frame element to avoid multiline conditionals inside html attribute While the original is perfectly valid erb, it's hard to read and hard for erblint to parse. This refactor moves the multi-line conditional logic outside of the turbo-frame `src` html attribute. --- app/views/browse/_relation.html.erb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/browse/_relation.html.erb b/app/views/browse/_relation.html.erb index 8eb93eb4c..405493de1 100644 --- a/app/views/browse/_relation.html.erb +++ b/app/views/browse/_relation.html.erb @@ -24,14 +24,14 @@
> <%= t ".members_count", :count => relation.relation_members.count %> <% if relation.relation_members.count >= 10 %> - - <% path_params = [relation.relation_id, relation.version] %> - <% path_params << { :show_redactions => params[:show_redactions] } if params[:show_redactions] %> - src="<%= old_relation_members_path(*path_params) %>"> - <% else %> - src="<%= relation_members_path(relation) %>"> - <% end %> + <% if relation.is_a?(OldRelation) %> + <% path_params = [relation.relation_id, relation.version] %> + <% path_params << { :show_redactions => params[:show_redactions] } if params[:show_redactions] %> + <% src_path = old_relation_members_path(*path_params) %> + <% else %> + <% src_path = relation_members_path(relation) %> + <% end %> +
<%= t("browse.start_rjs.loading") %> -- 2.39.5