Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Fix footer for past recurring meetings

Oliver Günther0989c8534f6a
diff --git a/modules/meeting/app/components/recurring_meetings/footer_component.rb b/modules/meeting/app/components/recurring_meetings/footer_component.rb
index 2a40f7e3a8c..1b2a0a0d514 100644
--- a/modules/meeting/app/components/recurring_meetings/footer_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/footer_component.rb
@@ -1,4 +1,5 @@
# frozen_string_literal: true
+
#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) the OpenProject GmbH
@@ -39,7 +40,7 @@ module RecurringMeetings
@meeting = meeting
@project = project
@current_count = count
- @direction = direction
+ @direction = direction.to_sym
@max_count = max_count
end
@@ -48,16 +49,20 @@ module RecurringMeetings
end
def label
- # If it never ends, don't try to count it
- return endless_label if @meeting.end_after_never?
+ if @direction == :past || [email protected]_after_never?
+ countable_label
+ else
+ # If it never ends, don't try to count it
+ endless_label
+ end
+ end
+ def countable_label
count = @max_count - @current_count
- label_suffix = count == 1 ? "_singular" : ""
-
- if @direction == "past"
- I18n.t("label_recurring_meeting_more_past#{label_suffix}", count:)
+ if @direction == :past
+ I18n.t("label_recurring_meeting_more_past", count:)
else
- I18n.t("label_recurring_meeting_more#{label_suffix}", count:, schedule: @meeting.full_schedule_in_words)
+ I18n.t("label_recurring_meeting_more", count:, schedule: @meeting.full_schedule_in_words)
end
end
diff --git a/modules/meeting/app/components/recurring_meetings/table_component.rb b/modules/meeting/app/components/recurring_meetings/table_component.rb
index 219b6f5c682..05ec85654e7 100644
--- a/modules/meeting/app/components/recurring_meetings/table_component.rb
+++ b/modules/meeting/app/components/recurring_meetings/table_component.rb
@@ -39,7 +39,6 @@ module RecurringMeetings
end
def has_footer?
- return false unless recurring_meeting && rows.any? { |r| r.id.nil? }
return true if options[:max_count].nil?
options[:max_count] - count > 0
diff --git a/modules/meeting/config/locales/en.yml b/modules/meeting/config/locales/en.yml
index c6adaa50775..5dacc06b1c8 100644
--- a/modules/meeting/config/locales/en.yml
+++ b/modules/meeting/config/locales/en.yml
@@ -150,11 +150,13 @@ en:
label_recurring_meeting_restore: "Restore this occurrence"
label_recurring_meeting_schedule: "Schedule"
label_recurring_meeting_next_occurrence: "Next occurrence"
- label_recurring_meeting_more: "There are %{count} more scheduled meetings (%{schedule})."
label_recurring_meeting_no_end_date: "There are more scheduled meetings (%{schedule})."
- label_recurring_meeting_more_singular: "There is %{count} more scheduled meeting (%{schedule})."
- label_recurring_meeting_more_past: "There are %{count} more past meetings."
- label_recurring_meeting_more_past_singular: "There is %{count} more past meeting."
+ label_recurring_meeting_more:
+ one: "There is one more scheduled meeting (%{schedule})."
+ other: "There are %{count} more scheduled meetings (%{schedule})."
+ label_recurring_meeting_more_past:
+ one: "There is one more past meeting."
+ other: "There are %{count} more past meetings."
label_recurring_meeting_show_more: "Show more"
label_recurring_meeting_series_create: "Create meeting series"
label_recurring_meeting_series_edit: "Edit meeting series"