OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
openproject/lib/redmine/menu_manager/top_menu_helper.rb

174 lines
5.3 KiB

#-- copyright
# OpenProject is an open source project management software.
# Copyright (C) 2012-2021 the OpenProject GmbH
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License version 3.
#
# OpenProject is a fork of ChiliProject, which is a fork of Redmine. The copyright follows:
# Copyright (C) 2006-2013 Jean-Philippe Lang
# Copyright (C) 2010-2013 the ChiliProject Team
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# See docs/COPYRIGHT.rdoc for more details.
#++
module Redmine::MenuManager::TopMenuHelper
include Redmine::MenuManager::TopMenu::HelpMenu
include Redmine::MenuManager::TopMenu::ProjectsMenu
include Redmine::MenuManager::TopMenu::QuickAddMenu
def render_top_menu_left
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
content_tag :ul, class: 'op-app-menu op-app-menu_drop-left' do
[render_main_top_menu_nodes,
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
render_projects_top_menu_node,
render_quick_add_menu].join.html_safe
end
end
def render_top_menu_right
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
content_tag :ul, class: 'op-app-menu' do
[render_module_top_menu_node,
[26688] In-app notifications (#9399) * Add bell icon to icon font * Add in app notification in top menu * Add fullscreen modal * Add notification modal and items * Style items * Toggle details of item * Mark all read * Add no results box * wip specification for event api * Add events table, query and index * Send out events from WP notification mailer job There we have the recipients present * Add cleanup job for older events with a setting * Hide bell notification when not logged * Add specs for events API index/show * Fix setting yml key * remove pry in event creation * Fix before hook in events API to after_validation * Fix polymorphic association raising exception for aggregated journals * Fix typo in read_ian * Fix yml entry for mentioned * Add read/unread post actions to event API and add specs * Wire up API to frontend * Fix order on events * Switch to unread in notification * Add event query * rename WPEventService * route wp mail sending over events * rename spec methods * author becomes watcher * correct message call signature * rename events to notifications * renname parameter to reflect notification nature * create author watcher for existing work packages * Merge unreadCount from store * Take a stab at polymorphic representers * Fix link generation in polymorphic resources For journals, no title is being generated however * Fix frontend model for context * Use timer for polling * add notification_setting data layer * Fix show resource spec * Fix duplicate class in notification bell item * Add minimal feature spec for notification * API for notification settings * Persist notifications * adapt work package notification creation to notification settings * extract notified_on_all * consolidate wp#recipients * concentrate wp notification in journal service * simplify methods * Remove unused patch endpoint * Add specs for rendering and parsing notification settings * Contract spec * Update service spec * adapt specs * Angular notifications frontend commit e29dced64699eb5f2443b9307c78343c9a58d1ee Author: Wieland Lindenthal <w.lindenthal@forkmerge.com> Date: Mon Jun 21 17:34:50 2021 +0200 Create Akita store and query for notification settings commit 1a45c26c1a0c147d15393e49d2625aca4851a64d Author: Wieland Lindenthal <w.lindenthal@forkmerge.com> Date: Mon Jun 21 11:09:25 2021 +0200 Remove tabs from notificaition settings page commit 0ea21e90c13a197f8bf2cfba1b60ddcff4e5e827 Author: Oliver Günther <mail@oliverguenther.de> Date: Sun Jun 20 21:55:48 2021 +0200 WIP in app settings * migrate notification data * add project visible filter to project query * Add inline-create and table display grouped by project * Add notifications under admin/users * Remove notifications partial * Rename notififcations store to user preferences store * Add setting for self_notified and hook that up to the backend * Add aria-label to table checkboxes * Restyle table and toolbar * replace remains of mail_notifications attribute * initialize notification settings for new user * adapt my_preferences references * reenable no self notified for documents * adapt specs * Avoid has_many :notifcation_settings Rails magically autosaves the user's preferences when the user gets saved, which somehow also tries to save the notfifications even when unchanged. This breaks some specs such as the avatar upload spec. As we can't update the assocation through rails anyway, just delegate to the user for reading instead. * Restore update method of notification settings * Restore update spec * fix spec syntax * lint scss * linting * Fix content_tag for bell icon * Add feature specs for notification settings * Disable ContentTag cop * use visible filter to get projects for notification The visible filter will reduce the project list down to the set of projects visible to the user provided as a parameter. This includes public projects. * test for actual mail sending * adapt me resource path this.apiV3Service.users.me changed its type in 0d6c0b6bc7620de94e00e72b36d6cbc1ec4c8db4 * Implement changed migration * Linting * Add actor to notification representer * Fix factory creating a duplicate WP journal * Add work packages loading and journal details to notification entry component * IAN basic facets, keep and expanded states. * Fix notification bell spec * Render body separately and add auto updating relative time * Add fixedTime title * Add actor to notification entry * Fix clicking links on work package and project * Tiny styling changes on entry row * Disable count in notification if larger than 99 (wont fit) * Introduce virtual scrolling to entry table * allow delaying & prevent mail sending if ain read Introduces a setting to delay mail sending after a journal aggregation time has expired. That way, users can confirm a notification in app. If they do before the delay expires, no mail is sent out additionally for that user. * consolidate notifications (in&out) into shared admin menu Co-authored-by: ulferts <jens.ulferts@googlemail.com> Co-authored-by: Wieland Lindenthal <w.lindenthal@forkmerge.com>
3 years ago
render_notification_top_menu_node,
render_help_top_menu_node,
render_user_top_menu_node].join.html_safe
end
end
private
[26688] In-app notifications (#9399) * Add bell icon to icon font * Add in app notification in top menu * Add fullscreen modal * Add notification modal and items * Style items * Toggle details of item * Mark all read * Add no results box * wip specification for event api * Add events table, query and index * Send out events from WP notification mailer job There we have the recipients present * Add cleanup job for older events with a setting * Hide bell notification when not logged * Add specs for events API index/show * Fix setting yml key * remove pry in event creation * Fix before hook in events API to after_validation * Fix polymorphic association raising exception for aggregated journals * Fix typo in read_ian * Fix yml entry for mentioned * Add read/unread post actions to event API and add specs * Wire up API to frontend * Fix order on events * Switch to unread in notification * Add event query * rename WPEventService * route wp mail sending over events * rename spec methods * author becomes watcher * correct message call signature * rename events to notifications * renname parameter to reflect notification nature * create author watcher for existing work packages * Merge unreadCount from store * Take a stab at polymorphic representers * Fix link generation in polymorphic resources For journals, no title is being generated however * Fix frontend model for context * Use timer for polling * add notification_setting data layer * Fix show resource spec * Fix duplicate class in notification bell item * Add minimal feature spec for notification * API for notification settings * Persist notifications * adapt work package notification creation to notification settings * extract notified_on_all * consolidate wp#recipients * concentrate wp notification in journal service * simplify methods * Remove unused patch endpoint * Add specs for rendering and parsing notification settings * Contract spec * Update service spec * adapt specs * Angular notifications frontend commit e29dced64699eb5f2443b9307c78343c9a58d1ee Author: Wieland Lindenthal <w.lindenthal@forkmerge.com> Date: Mon Jun 21 17:34:50 2021 +0200 Create Akita store and query for notification settings commit 1a45c26c1a0c147d15393e49d2625aca4851a64d Author: Wieland Lindenthal <w.lindenthal@forkmerge.com> Date: Mon Jun 21 11:09:25 2021 +0200 Remove tabs from notificaition settings page commit 0ea21e90c13a197f8bf2cfba1b60ddcff4e5e827 Author: Oliver Günther <mail@oliverguenther.de> Date: Sun Jun 20 21:55:48 2021 +0200 WIP in app settings * migrate notification data * add project visible filter to project query * Add inline-create and table display grouped by project * Add notifications under admin/users * Remove notifications partial * Rename notififcations store to user preferences store * Add setting for self_notified and hook that up to the backend * Add aria-label to table checkboxes * Restyle table and toolbar * replace remains of mail_notifications attribute * initialize notification settings for new user * adapt my_preferences references * reenable no self notified for documents * adapt specs * Avoid has_many :notifcation_settings Rails magically autosaves the user's preferences when the user gets saved, which somehow also tries to save the notfifications even when unchanged. This breaks some specs such as the avatar upload spec. As we can't update the assocation through rails anyway, just delegate to the user for reading instead. * Restore update method of notification settings * Restore update spec * fix spec syntax * lint scss * linting * Fix content_tag for bell icon * Add feature specs for notification settings * Disable ContentTag cop * use visible filter to get projects for notification The visible filter will reduce the project list down to the set of projects visible to the user provided as a parameter. This includes public projects. * test for actual mail sending * adapt me resource path this.apiV3Service.users.me changed its type in 0d6c0b6bc7620de94e00e72b36d6cbc1ec4c8db4 * Implement changed migration * Linting * Add actor to notification representer * Fix factory creating a duplicate WP journal * Add work packages loading and journal details to notification entry component * IAN basic facets, keep and expanded states. * Fix notification bell spec * Render body separately and add auto updating relative time * Add fixedTime title * Add actor to notification entry * Fix clicking links on work package and project * Tiny styling changes on entry row * Disable count in notification if larger than 99 (wont fit) * Introduce virtual scrolling to entry table * allow delaying & prevent mail sending if ain read Introduces a setting to delay mail sending after a journal aggregation time has expired. That way, users can confirm a notification in app. If they do before the delay expires, no mail is sent out additionally for that user. * consolidate notifications (in&out) into shared admin menu Co-authored-by: ulferts <jens.ulferts@googlemail.com> Co-authored-by: Wieland Lindenthal <w.lindenthal@forkmerge.com>
3 years ago
def render_notification_top_menu_node
return ''.html_safe unless User.current.logged?
content_tag('li', class: 'op-app-menu--item') do
tag('op-in-app-notification-bell')
end
end
def render_user_top_menu_node(items = first_level_menu_items_for(:account_menu))
if User.current.logged?
render_user_drop_down items
elsif omniauth_direct_login?
render_direct_login
else
render_login_drop_down
end
end
def render_login_drop_down
url = { controller: '/account', action: 'login' }
link = link_to url,
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
class: 'op-app-menu--item-action',
title: I18n.t(:label_login) do
concat('<span class="op-app-menu--item-title hidden-for-mobile">'.concat(I18n.t(:label_login)).concat('</span>').html_safe)
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
concat('<i class="op-app-menu--item-dropdown-indicator button--dropdown-indicator hidden-for-mobile"></i>'.html_safe)
concat('<i class="icon2 icon-user hidden-for-desktop"></i>'.html_safe)
end
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
render_menu_dropdown(link, menu_item_class: '') do
render_login_partial
end
end
def render_direct_login
link = link_to signin_path,
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
class: 'op-app-menu--item-action login',
title: I18n.t(:label_login) do
concat('<span class="op-app-menu--item-title hidden-for-mobile">'.concat(I18n.t(:label_login)).concat('</span>').html_safe)
concat('<i class="icon2 icon-user hidden-for-desktop"></i>'.html_safe)
end
Refactor/app header (#9110) * [35527] Add quick add button menu in top menu * Add quick menu item to top menu * Refactor top_menu.sass to follow BEM * Only render project-based path if persisted * Render project types when in project context * Add headline and determine if any types are visible * Hide quick add menu for unauthorized users * Fix login menu dropdown by adding class * Add schematic for correctly generating components * Add augment service for triggering invite user modal * Fix allowed_to? check in menu * Add spec * Highlight types and show all * Fix help menu overridden * Extend spec * Add parent_id to project in dropdown and expand advanced settings * Reload the page if the modal returned any data * Fix invalid url allowed check if there is no URL to check * Basic BEM changes * Remove old classes * Update more classes * Update togling logic * Fixed menu opening and some styles * Added op-menu * Fix some help menu styles * Add op-menu to help menug * Add avatar border * Fix auth_provider_spec * Fix zen mode * Fix static link help menu * Fixed top menu specs * Fix self registration specs * Fix logout spec * Fix bim revit navigation spec * Fixed menu permissions spec * Fix homescreen onboarding tour spec * Fix top menu item spec * Remove unused file * Fix a lot of mobile styles * Fix more mobile styles * Fixed build * Move quick add menu to right hand side * Improve quick-add-button styles, fix main-menu-toggle close icon * Remove add new project spec * Fix spec * Update project dropdown styles * Fix click handler for chrome mobile, update some styles Co-authored-by: Oliver Günther <mail@oliverguenther.de>
4 years ago
content_tag :li, class: "" do
concat link
end
end
def render_user_drop_down(items)
avatar = avatar User.current
render_menu_dropdown_with_items(
label: avatar.presence || '',
label_options: {
title: User.current.name,
icon: (avatar.present? ? 'overridden-by-avatar' : 'icon-user')
},
items: items,
options: { drop_down_id: 'user-menu', menu_item_class: 'last-child' }
)
end
def render_login_partial
partial =
if OpenProject::Configuration.disable_password_login?
'account/omniauth_login'
else
'account/login'
end
render partial: partial
end
def render_module_top_menu_node(items = more_top_menu_items)
unless items.empty?
render_menu_dropdown_with_items(
label: '',
label_options: { icon: 'icon-menu', title: I18n.t('label_modules') },
items: items,
options: { drop_down_id: 'more-menu', drop_down_class: 'drop-down--modules ', menu_item_class: 'hidden-for-mobile' }
)
end
end
def render_main_top_menu_nodes(items = main_top_menu_items)
items.map do |item|
render_menu_node(item)
end.join(' ')
end
# Menu items for the main top menu
def main_top_menu_items
split_top_menu_into_main_or_more_menus[:base]
end
# Menu items for the modules top menu
def more_top_menu_items
split_top_menu_into_main_or_more_menus[:modules]
end
def project_menu_items
split_top_menu_into_main_or_more_menus[:projects]
end
def help_menu_item
split_top_menu_into_main_or_more_menus[:help]
end
# Split the :top_menu into separate :main and :modules items
def split_top_menu_into_main_or_more_menus
@top_menu_split ||= begin
items = Hash.new { |h, k| h[k] = [] }
first_level_menu_items_for(:top_menu) do |item|
if item.name == :help
items[:help] = item
else
context = item.context || :modules
items[context] << item
end
end
items
end
end
end