diff options
Diffstat (limited to 'app/helpers/search_helper.rb')
-rw-r--r-- | app/helpers/search_helper.rb | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 4f9e1322b56..80cc568820a 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -163,15 +163,26 @@ module SearchHelper if @project.present? opts[:data]['project-id'] = @project.id opts[:data]['base-endpoint'] = project_path(@project) - else - # Group context + elsif @group.present? opts[:data]['group-id'] = @group.id opts[:data]['base-endpoint'] = group_canonical_path(@group) + else + opts[:data]['base-endpoint'] = root_dashboard_path end opts end + def search_history_storage_prefix + if @project.present? + @project.full_path + elsif @group.present? + @group.full_path + else + 'dashboard' + end + end + # Sanitize a HTML field for search display. Most tags are stripped out and the # maximum length is set to 200 characters. def search_md_sanitize(object, field) |