Skip to content

Commit abcf634

Browse files
authored
feat(Dashboard): Redesigns sidebar with category labels (#290)
* feat(dashboard): Adds category labels to sidebar * refactor: Changes config to settings, adds localization * refactor: Adds localization to sidebar * refactor: Adds localization to page titles * refactor: Adds "Overview" category for event-wide pages * refactor: Adds missing localizers
1 parent c6d33a9 commit abcf634

File tree

12 files changed

+111
-50
lines changed

12 files changed

+111
-50
lines changed

app/views/layouts/manage/application.html.haml

Lines changed: 62 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -25,76 +25,98 @@
2525
.row
2626
%nav.col-md-2.d-none.d-md-block.bg-light.sidebar
2727
.sidebar-sticky
28-
%ul.nav.flex-column
28+
%h6.sidebar-heading.d-flex.justify-content-between.align-items-center.px-3.mt-4.mb-1.text-muted
29+
%span
30+
= t(:overview, scope: 'layouts.manage.navigation')
31+
%ul.nav.flex-column.mb-2
2932
%li.nav-item
3033
= active_link_to manage_root_path, class: "nav-link", active_children: false do
3134
.fa.fa-area-chart.fa-fw.icon-space-r-half
32-
Dashboard
35+
= t(:title, scope: 'pages.manage.dashboard')
3336
%li.nav-item
3437
= active_link_to manage_questionnaires_path, class: "nav-link" do
3538
.fa.fa-inbox.fa-fw.icon-space-r-half
36-
Questionnaires
37-
%li.nav-item
38-
= active_link_to manage_checkins_path, class: "nav-link" do
39-
.fa.fa-drivers-license-o.fa-fw.icon-space-r-half
40-
Check-in
41-
- if current_user.admin?
42-
%li.nav-item
43-
= active_link_to manage_users_path, class: "nav-link" do
44-
.fa.fa-users.fa-fw.icon-space-r-half
45-
= t(:title, scope: 'pages.manage.users')
39+
= t(:title, scope: 'pages.manage.questionnaires')
4640
%li.nav-item
4741
= active_link_to manage_messages_path, class: "nav-link" do
4842
.fa.fa-bullhorn.fa-fw.icon-space-r-half
49-
Messages
50-
%li.nav-item
51-
= active_link_to manage_bus_lists_path, class: "nav-link" do
52-
.fa.fa-bus.fa-fw.icon-space-r-half
53-
Bus Lists
54-
%li.nav-item
55-
= active_link_to manage_schools_path, class: "nav-link" do
56-
.fa.fa-home.fa-fw.icon-space-r-half
57-
Schools
58-
%li.nav-item
59-
= active_link_to manage_stats_path, class: "nav-link" do
60-
.fa.fa-table.fa-fw.icon-space-r-half
61-
Stats
62-
%li.nav-item
63-
= active_link_to manage_trackable_tags_path, class: "nav-link" do
64-
.fa.fa-tag.fa-fw.icon-space-r-half
65-
Trackable Tags
43+
= t(:title, scope: 'pages.manage.messages')
44+
45+
%h6.sidebar-heading.d-flex.justify-content-between.align-items-center.px-3.mt-4.mb-1.text-muted
46+
%span
47+
= t(:logistics, scope: 'layouts.manage.navigation')
48+
%ul.nav.flex-column.mb-2
49+
%li.nav-item
50+
= active_link_to manage_checkins_path, class: "nav-link" do
51+
.fa.fa-drivers-license-o.fa-fw.icon-space-r-half
52+
= t(:title, scope: 'pages.manage.check-in')
53+
%li.nav-item
54+
= active_link_to manage_stats_path, class: "nav-link" do
55+
.fa.fa-table.fa-fw.icon-space-r-half
56+
= t(:title, scope: 'pages.manage.stats')
57+
%li.nav-item
58+
= active_link_to manage_trackable_tags_path, class: "nav-link" do
59+
.fa.fa-tag.fa-fw.icon-space-r-half
60+
= t(:title, scope: 'pages.manage.trackable-tags')
61+
62+
%h6.sidebar-heading.d-flex.justify-content-between.align-items-center.px-3.mt-4.mb-1.text-muted
63+
%span
64+
= t(:travel, scope: 'layouts.manage.navigation')
65+
%ul.nav.flex-column.mb-2
66+
%li.nav-item
67+
= active_link_to manage_bus_lists_path, class: "nav-link" do
68+
.fa.fa-bus.fa-fw.icon-space-r-half
69+
= t(:title, scope: 'pages.manage.bus-lists')
70+
%li.nav-item
71+
= active_link_to manage_schools_path, class: "nav-link" do
72+
.fa.fa-home.fa-fw.icon-space-r-half
73+
= t(:title, scope: 'pages.manage.schools')
74+
6675
- if current_user.admin?
6776
%h6.sidebar-heading.d-flex.justify-content-between.align-items-center.px-3.mt-4.mb-1.text-muted
68-
%span Advanced
77+
%span
78+
= t(:administration, scope: 'layouts.manage.navigation')
6979
%ul.nav.flex-column.mb-2
80+
%li.nav-item
81+
= active_link_to manage_users_path, class: "nav-link" do
82+
.fa.fa-users.fa-fw.icon-space-r-half
83+
= t(:title, scope: 'pages.manage.users')
7084
%li.nav-item
7185
= active_link_to manage_configs_path, class: "nav-link" do
7286
.fa.fa-wrench.fa-fw.icon-space-r-half
73-
Config
74-
.nav-item-description Manage configuration
87+
= t(:title, scope: 'pages.manage.settings')
88+
89+
%h6.sidebar-heading.d-flex.justify-content-between.align-items-center.px-3.mt-4.mb-1.text-muted
90+
%span
91+
= t(:advanced, scope: 'layouts.manage.navigation')
92+
%ul.nav.flex-column.mb-2
7593
%li.nav-item
7694
= active_link_to sidekiq_web_path, target: '_blank', class: "nav-link" do
7795
.fa.fa-tasks.fa-fw.icon-space-r-half
78-
Sidekiq
96+
= t(:title, scope: 'pages.manage.sidekiq')
7997
%span.fa.fa-external-link.icon-space-l-half
80-
.nav-item-description Monitor background jobs
98+
.nav-item-description
99+
= t(:sidekiq, scope: 'layouts.manage.navigation.descriptors')
81100
%li.nav-item
82101
= active_link_to blazer_path, target: '_blank', class: "nav-link" do
83102
.fa.fa-terminal.fa-fw.icon-space-r-half
84-
Blazer
103+
= t(:title, scope: 'pages.manage.blazer')
85104
%span.fa.fa-external-link.icon-space-l-half
86-
.nav-item-description Run custom SQL queries
105+
.nav-item-description
106+
= t(:blazer, scope: 'layouts.manage.navigation.descriptors')
87107
%li.nav-item
88108
= active_link_to oauth_applications_path, target: '_blank', class: "nav-link" do
89109
.fa.fa-unlock.fa-fw.icon-space-r-half
90-
Doorkeeper
110+
= t(:title, scope: 'pages.manage.doorkeeper')
91111
%span.fa.fa-external-link.icon-space-l-half
92-
.nav-item-description OAuth2 provider management
112+
.nav-item-description
113+
= t(:doorkeeper, scope: 'layouts.manage.navigation.descriptors')
93114
%li.nav-item
94115
= active_link_to manage_data_exports_path, class: "nav-link" do
95116
.fa.fa-download.fa-fw.icon-space-r-half
96-
Data Exports
97-
.nav-item-description Generate & export data
117+
= t(:title, scope: 'pages.manage.data-exports')
118+
.nav-item-description
119+
= t(:dataexports, scope: 'layouts.manage.navigation.descriptors')
98120
%main.col-md-10.ml-sm-auto.px-4{role: "main"}
99121
= render "layouts/manage/flashes"
100122
= yield

app/views/manage/bus_lists/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Bus Lists", docs: 'https://coderit.org/hackathon-manager/docs/busses' do
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.bus-lists'), docs: 'https://coderit.org/hackathon-manager/docs/busses' do
22
= link_to "New Bus List", new_manage_bus_list_path, class: "btn btn-sm btn-outline-secondary"
33

44
.mb-4

app/views/manage/checkins/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Check-in"
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.check-in')
22

33
.mb-4
44
%table.checkins.datatable.table.table-striped.table-hover{ "data-source" => datatable_manage_checkins_path(format: :json) }

app/views/manage/configs/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Hackathon Configuration"
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.settings')
22

33
.row
44
.col-lg-6.mb-3

app/views/manage/dashboard/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
= javascript_include_tag "vendor/queue.v1.min.js"
1010
= javascript_include_tag "vendor/topojson.v1.min.js"
1111

12-
= render "layouts/manage/page_title", title: "Dashboard"
12+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.dashboard')
1313

1414
.row
1515
.col

app/views/manage/data_exports/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Data Exports" do
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.data-exports') do
22
= link_to "New Data Export", new_manage_data_export_path, class: "btn btn-sm btn-outline-secondary"
33

44
%table.table.table-striped

app/views/manage/messages/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Messages" do
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.messages') do
22
= link_to "New Message", new_manage_message_path, class: "btn btn-sm btn-outline-secondary"
33

44
.mb-4

app/views/manage/questionnaires/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Questionnaires" do
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.questionnaires') do
22
= link_to "New Questionnaire", new_manage_questionnaire_path, class: "btn btn-sm btn-outline-secondary"
33

44
= render "questionnaire_datatable"

app/views/manage/schools/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Schools" do
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.schools') do
22
= link_to "New School", new_manage_school_path, class: "btn btn-sm btn-outline-secondary"
33

44
.mb-4

app/views/manage/stats/index.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
= render "layouts/manage/page_title", title: "Statistics & Info"
1+
= render "layouts/manage/page_title", title: t(:title, scope: 'pages.manage.stats')
22

33
.row
44
.col

0 commit comments

Comments
 (0)