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 icons to module menu items

Aaron Contrerasa6aaeb0dcf77
diff --git a/config/initializers/menus.rb b/config/initializers/menus.rb
index 37851cb2ebc..d9a6fa897a7 100644
--- a/config/initializers/menus.rb
+++ b/config/initializers/menus.rb
@@ -35,6 +35,7 @@ Redmine::MenuManager.map :top_menu do |menu|
{ controller: '/projects', project_id: nil, action: 'index' },
context: :modules,
caption: I18n.t('label_projects_menu'),
+ icon: 'projects',
if: Proc.new {
(User.current.logged? || !Setting.login_required?)
}
@@ -42,6 +43,7 @@ Redmine::MenuManager.map :top_menu do |menu|
{ controller: '/work_packages', project_id: nil, state: nil, action: 'index' },
context: :modules,
caption: I18n.t('label_work_package_plural'),
+ icon: 'work-packages',
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
User.current.allowed_to_globally?(:view_work_packages)
@@ -50,6 +52,7 @@ Redmine::MenuManager.map :top_menu do |menu|
{ controller: '/news', project_id: nil, action: 'index' },
context: :modules,
caption: I18n.t('label_news_plural'),
+ icon: 'news',
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
User.current.allowed_to_globally?(:view_news)
diff --git a/modules/boards/lib/open_project/boards/engine.rb b/modules/boards/lib/open_project/boards/engine.rb
index a3b965d9aef..8909046d18c 100644
--- a/modules/boards/lib/open_project/boards/engine.rb
+++ b/modules/boards/lib/open_project/boards/engine.rb
@@ -57,6 +57,7 @@ module OpenProject::Boards
:boards, { controller: '/boards/boards', action: 'overview' },
context: :modules,
caption: :project_module_board_view,
+ icon: 'boards',
if: Proc.new {
OpenProject::FeatureDecisions.more_global_index_pages_active? &&
(User.current.logged? || !Setting.login_required?) &&
diff --git a/modules/calendar/lib/open_project/calendar/engine.rb b/modules/calendar/lib/open_project/calendar/engine.rb
index 3664a173024..d99e4d0c87b 100644
--- a/modules/calendar/lib/open_project/calendar/engine.rb
+++ b/modules/calendar/lib/open_project/calendar/engine.rb
@@ -41,6 +41,8 @@ module OpenProject::Calendar
contract_actions: { calendar: %i[read] }
end
+ # TODO: Add calendar icon to module menu item when Global Calendar Page is added
+
menu :project_menu,
:calendar_view,
{ controller: '/calendar/calendars', action: 'index' },
diff --git a/modules/meeting/lib/open_project/meeting/engine.rb b/modules/meeting/lib/open_project/meeting/engine.rb
index 98ff2c5043f..0d85082ea5b 100644
--- a/modules/meeting/lib/open_project/meeting/engine.rb
+++ b/modules/meeting/lib/open_project/meeting/engine.rb
@@ -67,6 +67,7 @@ module OpenProject::Meeting
:meetings, { controller: '/meetings', action: 'index', project_id: nil },
context: :modules,
caption: :label_meeting_plural,
+ icon: 'meetings',
if: Proc.new {
OpenProject::FeatureDecisions.more_global_index_pages_active? &&
(User.current.logged? || !Setting.login_required?) &&
diff --git a/modules/reporting/lib/open_project/reporting/engine.rb b/modules/reporting/lib/open_project/reporting/engine.rb
index bb85ebe9049..1647dfb84f7 100644
--- a/modules/reporting/lib/open_project/reporting/engine.rb
+++ b/modules/reporting/lib/open_project/reporting/engine.rb
@@ -63,6 +63,7 @@ module OpenProject::Reporting
:cost_reports_global,
{ controller: '/cost_reports', action: 'index', project_id: nil },
caption: :cost_reports_title,
+ icon: 'cost-reports',
if: Proc.new {
(User.current.logged? || !Setting.login_required?) &&
(
diff --git a/modules/team_planner/lib/open_project/team_planner/engine.rb b/modules/team_planner/lib/open_project/team_planner/engine.rb
index fe0f83cb255..00c9f25a81b 100644
--- a/modules/team_planner/lib/open_project/team_planner/engine.rb
+++ b/modules/team_planner/lib/open_project/team_planner/engine.rb
@@ -58,6 +58,7 @@ module OpenProject::TeamPlanner
:team_planners, { controller: '/team_planner/team_planner', action: :overview },
context: :modules,
caption: :'team_planner.label_team_planner_plural',
+ icon: 'team-planner',
if: Proc.new {
OpenProject::FeatureDecisions.more_global_index_pages_active? &&
(User.current.logged? || !Setting.login_required?) &&