From 54f9c042a71fbe289b9e797c5d99d32f90d194d9 Mon Sep 17 00:00:00 2001
From: Mischa The Evil
Date: Tue, 17 Aug 2021 11:49:32 +0200
Subject: [PATCH] Move sidebar content on versions index view (roadmap) into a
separate partial.
---
app/views/versions/_sidebar.html.erb | 53 +++++++++++++++++++++++++++
app/views/versions/index.html.erb | 54 +---------------------------
2 files changed, 54 insertions(+), 53 deletions(-)
create mode 100644 app/views/versions/_sidebar.html.erb
diff --git a/app/views/versions/_sidebar.html.erb b/app/views/versions/_sidebar.html.erb
new file mode 100644
index 000000000..abfe9c67c
--- /dev/null
+++ b/app/views/versions/_sidebar.html.erb
@@ -0,0 +1,53 @@
+<%= form_tag({}, :method => :get) do %>
+<%= l(:label_roadmap) %>
+
+<% @trackers.each do |tracker| %>
+
+
+ <%= check_box_tag("tracker_ids[]", tracker.id,
+ (@selected_tracker_ids.include? tracker.id.to_s),
+ :id => nil) %>
+ <%= tracker.name %>
+
+
+<% end %>
+
+
+
+
+
+ <%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %>
+
+
+ <% if @project.descendants.active.any? %>
+
+ <%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
+
+ <%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%>
+
+
+ <% end %>
+
+<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
+<% end %>
+
+<%= l(:label_version_plural) %>
+
+<% @versions.each do |version| %>
+
+ <%= link_to(format_version_name(version), "##{version_anchor(version)}") %>
+
+<% end %>
+
+<% if @completed_versions.present? %>
+
+ <%= link_to_function l(:label_completed_versions),
+ '$("#toggle-completed-versions").toggleClass("icon-collapsed icon-expended"); $("#completed-versions").toggle()',
+ :id => 'toggle-completed-versions', :class => 'icon icon-collapsed collapsible' %>
+
+ <% @completed_versions.each do |version| %>
+ <%= link_to_version version %>
+ <% end %>
+
+
+<% end %>
\ No newline at end of file
diff --git a/app/views/versions/index.html.erb b/app/views/versions/index.html.erb
index 61fbe05ab..382133e93 100644
--- a/app/views/versions/index.html.erb
+++ b/app/views/versions/index.html.erb
@@ -50,59 +50,7 @@
<% end %>
<% content_for :sidebar do %>
-<%= form_tag({}, :method => :get) do %>
-<%= l(:label_roadmap) %>
-
-<% @trackers.each do |tracker| %>
-
-
- <%= check_box_tag("tracker_ids[]", tracker.id,
- (@selected_tracker_ids.include? tracker.id.to_s),
- :id => nil) %>
- <%= tracker.name %>
-
-
-<% end %>
-
-
-
-
-
- <%= check_box_tag "completed", 1, params[:completed] %> <%= l(:label_show_completed_versions) %>
-
-
- <% if @project.descendants.active.any? %>
-
- <%= hidden_field_tag 'with_subprojects', 0, :id => nil %>
-
- <%= check_box_tag 'with_subprojects', 1, @with_subprojects %> <%=l(:label_subproject_plural)%>
-
-
- <% end %>
-
-<%= submit_tag l(:button_apply), :class => 'button-small', :name => nil %>
-<% end %>
-
-<%= l(:label_version_plural) %>
-
-<% @versions.each do |version| %>
-
- <%= link_to(format_version_name(version), "##{version_anchor(version)}") %>
-
-<% end %>
-
-<% if @completed_versions.present? %>
-
- <%= link_to_function l(:label_completed_versions),
- '$("#toggle-completed-versions").toggleClass("icon-collapsed icon-expended"); $("#completed-versions").toggle()',
- :id => 'toggle-completed-versions', :class => 'icon icon-collapsed collapsible' %>
-
- <% @completed_versions.each do |version| %>
- <%= link_to_version version %>
- <% end %>
-
-
-<% end %>
+ <%= render :partial => 'versions/sidebar' %>
<% end %>
<% html_title(l(:label_roadmap)) %>
--
2.26.0.windows.1