diff --git a/app/assets/stylesheets/application.scss b/app/assets/stylesheets/application.scss index 152f59810..c840a574d 100644 --- a/app/assets/stylesheets/application.scss +++ b/app/assets/stylesheets/application.scss @@ -31,6 +31,7 @@ @import "my_modules/results/*"; @import "my_modules/*"; @import "protocols/*"; +@import "dashboard/*"; @import "repository/*"; @import "repository_columns/*"; @import "settings/*"; diff --git a/app/assets/stylesheets/dashboard/calendar.scss b/app/assets/stylesheets/dashboard/calendar.scss new file mode 100644 index 000000000..99bc774ed --- /dev/null +++ b/app/assets/stylesheets/dashboard/calendar.scss @@ -0,0 +1,11 @@ +.dashboard-container .calendar-widget { + grid-column: 10 / span 3; + grid-row: 1 / span 6; +} + +@media (max-width: 1000px) { + .dashboard-container .calendar-widget { + grid-column: 1 / span 6; + grid-row: 5 / span 4; + } +} diff --git a/app/assets/stylesheets/dashboard/current_tasks.scss b/app/assets/stylesheets/dashboard/current_tasks.scss new file mode 100644 index 000000000..eec174014 --- /dev/null +++ b/app/assets/stylesheets/dashboard/current_tasks.scss @@ -0,0 +1,11 @@ +.dashboard-container .current-tasks-widget { + grid-column: 1 / span 9; + grid-row: 1 / span 6; +} + +@media (max-width: 1000px) { + .dashboard-container .current-tasks-widget { + grid-column: 1 / span 12; + grid-row: 1 / span 4; + } +} diff --git a/app/assets/stylesheets/dashboard/quick_start.scss b/app/assets/stylesheets/dashboard/quick_start.scss new file mode 100644 index 000000000..f65e95d00 --- /dev/null +++ b/app/assets/stylesheets/dashboard/quick_start.scss @@ -0,0 +1,11 @@ +.dashboard-container .quick-start-widget { + grid-column: 1 / span 3; + grid-row: 7 / span 6; +} + +@media (max-width: 1000px) { + .dashboard-container .quick-start-widget { + grid-column: 7 / span 6; + grid-row: 5 / span 4; + } +} diff --git a/app/assets/stylesheets/dashboard/recent_work.scss b/app/assets/stylesheets/dashboard/recent_work.scss new file mode 100644 index 000000000..4344b3ee5 --- /dev/null +++ b/app/assets/stylesheets/dashboard/recent_work.scss @@ -0,0 +1,17 @@ +.dashboard-container .recent-work-widget { + grid-column: 4 / span 6; + grid-row: 7 / span 6; +} + +@media (max-width: 1300px) { + .dashboard-container .recent-work-widget { + grid-column: 4 / span 9; + } +} + +@media (max-width: 1000px) { + .dashboard-container .recent-work-widget { + grid-column: 1 / span 12; + grid-row: 9 / span 4; + } +} diff --git a/app/assets/stylesheets/dashboard/show.scss b/app/assets/stylesheets/dashboard/show.scss new file mode 100644 index 000000000..a8b04836d --- /dev/null +++ b/app/assets/stylesheets/dashboard/show.scss @@ -0,0 +1,24 @@ + +.dashboard-container { + --dashboard-widgets-gap: 30px; + display: grid; + grid-column-gap: var(--dashboard-widgets-gap); + grid-row-gap: var(--dashboard-widgets-gap); + grid-template-columns: repeat(12, 1fr); + grid-template-rows: repeat(12, 1fr); + min-height: calc(100vh - 51px); + padding: var(--dashboard-widgets-gap) calc(var(--dashboard-widgets-gap) - 15px); + width: 100%; + + .basic-widget { + border-radius: $border-radius-modal; + box-shadow: $flyout-shadow; + position: relative; + } +} + +@media (max-width: 1300px) { + .dashboard-container { + --dashboard-widgets-gap: 16px; + } +} diff --git a/app/controllers/dashboards_controller.rb b/app/controllers/dashboards_controller.rb new file mode 100644 index 000000000..2e4880fad --- /dev/null +++ b/app/controllers/dashboards_controller.rb @@ -0,0 +1,5 @@ +# frozen_string_literal: true + +class DashboardsController < ApplicationController + def show; end +end diff --git a/app/helpers/left_menu_bar_helper.rb b/app/helpers/left_menu_bar_helper.rb index 536ef7391..afcdd7bee 100644 --- a/app/helpers/left_menu_bar_helper.rb +++ b/app/helpers/left_menu_bar_helper.rb @@ -1,4 +1,9 @@ module LeftMenuBarHelper + + def dashboard_are_selected? + controller_name == 'dashboards' + end + def projects_are_selected? controller_name.in? %w(projects experiments my_modules) end diff --git a/app/views/dashboards/_calendar.html.erb b/app/views/dashboards/_calendar.html.erb new file mode 100644 index 000000000..5c13117a0 --- /dev/null +++ b/app/views/dashboards/_calendar.html.erb @@ -0,0 +1,2 @@ +
+
diff --git a/app/views/dashboards/_current_tasks.html.erb b/app/views/dashboards/_current_tasks.html.erb new file mode 100644 index 000000000..00b11fcae --- /dev/null +++ b/app/views/dashboards/_current_tasks.html.erb @@ -0,0 +1,2 @@ +
+
diff --git a/app/views/dashboards/_quick_start.html.erb b/app/views/dashboards/_quick_start.html.erb new file mode 100644 index 000000000..82792b540 --- /dev/null +++ b/app/views/dashboards/_quick_start.html.erb @@ -0,0 +1,2 @@ +
+
diff --git a/app/views/dashboards/_recent_work.html.erb b/app/views/dashboards/_recent_work.html.erb new file mode 100644 index 000000000..0a3a1ed48 --- /dev/null +++ b/app/views/dashboards/_recent_work.html.erb @@ -0,0 +1,2 @@ +
+
diff --git a/app/views/dashboards/show.html.erb b/app/views/dashboards/show.html.erb new file mode 100644 index 000000000..a4632c1d2 --- /dev/null +++ b/app/views/dashboards/show.html.erb @@ -0,0 +1,8 @@ +<% provide :head_title, t('nav.label.dashboard') %> + +
+ <%= render "calendar" %> + <%= render "current_tasks" %> + <%= render "recent_work" %> + <%= render "quick_start" %> +
diff --git a/app/views/shared/_left_menu_bar.html.erb b/app/views/shared/_left_menu_bar.html.erb index 40131aaed..be3920ee4 100644 --- a/app/views/shared/_left_menu_bar.html.erb +++ b/app/views/shared/_left_menu_bar.html.erb @@ -2,6 +2,12 @@