From cd8371b80497443800012caedd913a02db404339 Mon Sep 17 00:00:00 2001 From: jorg-vr Date: Tue, 12 Mar 2024 09:40:59 +0100 Subject: [PATCH 01/13] Rename options to options --- app/views/activity_read_states/index.html.erb | 2 +- app/views/annotations/question_index.html.erb | 8 ++++---- app/views/courses/index.html.erb | 2 +- app/views/courses/scoresheet.html.erb | 2 +- app/views/layouts/_searchbar.html.erb | 6 +++--- app/views/series/scoresheet.html.erb | 2 +- app/views/submissions/index.html.erb | 11 +++++++---- 7 files changed, 18 insertions(+), 15 deletions(-) diff --git a/app/views/activity_read_states/index.html.erb b/app/views/activity_read_states/index.html.erb index c7004be0fe..d82a8c2672 100644 --- a/app/views/activity_read_states/index.html.erb +++ b/app/views/activity_read_states/index.html.erb @@ -34,7 +34,7 @@ <% end %>
- <%= render partial: 'layouts/searchbar', locals: {actions: [], course_labels: @course_labels, refresh_element: "#refresh_element"} %> + <%= render partial: 'layouts/searchbar', locals: {course_labels: @course_labels, refresh_element: "#refresh_element"} %>
<%= render partial: 'read_states_table', locals: { read_states: @read_states, activity: @activity, course: @course, user: @user} %>
diff --git a/app/views/annotations/question_index.html.erb b/app/views/annotations/question_index.html.erb index cd2b08c4aa..ebbb8ed75a 100644 --- a/app/views/annotations/question_index.html.erb +++ b/app/views/annotations/question_index.html.erb @@ -21,12 +21,12 @@
- <% actions = [] %> + <% options = [] %> <% if current_user&.a_course_admin? %> - <% actions << { text: t('questions.index.watch'), search: { refresh: true }, click: 'window.dodona.toggleIndexReload()' } %> - <% actions << { text: t('questions.index.everything'), search: { everything: true } } if @unfiltered %> + <% options << { text: t('questions.index.watch'), search: { refresh: true } } %> + <% options << { text: t('questions.index.everything'), search: { everything: true } } if @unfiltered %> <% end %> - <%= render partial: 'layouts/searchbar', locals: { actions: actions, refresh_element: "#question-container", courses: @courses, question_states: Question.question_states.keys } %> + <%= render partial: 'layouts/searchbar', locals: { options: options, refresh_element: "#question-container", courses: @courses, question_states: Question.question_states.keys } %>
<%= render partial: 'questions_table_with_pagination', locals: { questions: @questions } %>
diff --git a/app/views/courses/index.html.erb b/app/views/courses/index.html.erb index 9732465383..8274feadf6 100644 --- a/app/views/courses/index.html.erb +++ b/app/views/courses/index.html.erb @@ -25,7 +25,7 @@ labels << { name: t('courses.index.my_courses'), id: 'my' } if @show_my_courses %> - <%= render partial: 'layouts/searchbar', locals: {institutions: Institution.all, eager: true, no_dropdown_for: ["institutions"], actions: [{search: {can_register: true}, type: 'can-register', text: "#{t(".only_show_can_register")}"}] } %> + <%= render partial: 'layouts/searchbar', locals: {institutions: Institution.all, eager: true, no_dropdown_for: ["institutions"], options: [{search: {can_register: true}, text: "#{t(".only_show_can_register")}"}] } %>
diff --git a/app/views/courses/scoresheet.html.erb b/app/views/courses/scoresheet.html.erb index 5b4de9681c..cae9dd738a 100644 --- a/app/views/courses/scoresheet.html.erb +++ b/app/views/courses/scoresheet.html.erb @@ -26,7 +26,7 @@ <% end %> <%= render partial: 'layouts/searchbar', locals: { - actions: [ + options: [ { text: t('.at_least_one_started'), search: { at_least_one_started: true } } ], course_labels: @course_labels, diff --git a/app/views/layouts/_searchbar.html.erb b/app/views/layouts/_searchbar.html.erb index 5a16f25173..0770400388 100644 --- a/app/views/layouts/_searchbar.html.erb +++ b/app/views/layouts/_searchbar.html.erb @@ -9,11 +9,11 @@ "> - <% if local_assigns[:actions]&.any? %> - - <% end %> + <% if local_assigns[:actions]&.any? %> + + <% end %>