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

add redirect to day page on mobile

Klaus Zandersdb10c8738f7b
diff --git a/modules/costs/app/controllers/my/time_tracking_controller.rb b/modules/costs/app/controllers/my/time_tracking_controller.rb
index 54248c0c85f..dc8d4697d53 100644
--- a/modules/costs/app/controllers/my/time_tracking_controller.rb
+++ b/modules/costs/app/controllers/my/time_tracking_controller.rb
@@ -51,8 +51,11 @@ module My
helper_method :current_day, :today?, :this_week?, :this_month?, :time_entries_json
def calendar
- # TODO: on mobile, we should show the day view
- redirect_to action: :week
+ if browser.device.mobile?
+ redirect_to action: :day
+ else
+ redirect_to action: :week
+ end
end
def day
diff --git a/modules/costs/app/views/my/time_tracking/day.html.erb b/modules/costs/app/views/my/time_tracking/day.html.erb
index f3c7c50cfd3..bb66833433c 100644
--- a/modules/costs/app/views/my/time_tracking/day.html.erb
+++ b/modules/costs/app/views/my/time_tracking/day.html.erb
@@ -3,7 +3,7 @@
header.with_title { I18n.t(:label_today) }
header.with_breadcrumbs(
[
- { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_week_path },
+ { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_path },
I18n.t(:label_today)
]
)
diff --git a/modules/costs/app/views/my/time_tracking/month.html.erb b/modules/costs/app/views/my/time_tracking/month.html.erb
index d1e4bda3bac..09c750b46fd 100644
--- a/modules/costs/app/views/my/time_tracking/month.html.erb
+++ b/modules/costs/app/views/my/time_tracking/month.html.erb
@@ -3,7 +3,7 @@
header.with_title { I18n.t(:label_this_month) }
header.with_breadcrumbs(
[
- { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_week_path },
+ { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_path },
I18n.t(:label_this_month)
]
)
diff --git a/modules/costs/app/views/my/time_tracking/week.html.erb b/modules/costs/app/views/my/time_tracking/week.html.erb
index ce5662e0afc..3ed0044c3dd 100644
--- a/modules/costs/app/views/my/time_tracking/week.html.erb
+++ b/modules/costs/app/views/my/time_tracking/week.html.erb
@@ -3,7 +3,7 @@
header.with_title(variant: :large) { I18n.t(:label_this_week) }
header.with_breadcrumbs(
[
- { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_week_path },
+ { text: I18n.t(:label_my_time_tracking), href: my_time_tracking_path },
I18n.t(:label_this_week)
]
)