diff options
author | Mike Greiling <mike@pixelcog.com> | 2017-08-07 22:44:47 -0500 |
---|---|---|
committer | Mike Greiling <mike@pixelcog.com> | 2017-08-07 22:44:47 -0500 |
commit | 0994bbf9dd79413b3c22381bc2d82fcc41aa13bc (patch) | |
tree | 4488184f950fb66ae761209952722bb72bf18b72 /app/helpers | |
parent | 1375db509a4cd30d759d588ee85a8aec2771d78a (diff) | |
parent | 9e7ac48bc11141762816f157247baaf9e61618b3 (diff) | |
download | gitlab-ce-0994bbf9dd79413b3c22381bc2d82fcc41aa13bc.tar.gz |
Merge branch 'master' into ide
* master: (86 commits)
Show all labels
33874 confidential issue redesign
Exclude merge_jid on Import/Export attribute configuration
Resolve "User dropdown in filtered search does not load avatar on `master`"
Re-add column locked_at on migration rollback
Group-level new issue & MR using previously selected project
[EE Backport] Update log audit event in omniauth_callbacks_controller.rb
more eagerly bail when the state is prevented
Move locked_at removal to post-deployment migration
Add class to other sidebars
Improve mobile sidebar
reduce iterations by keeping a count of remaining enablers
Store & use ConvDev percentages returned by Version app
Store MergeWorker JID on merge request, and clean up stuck merges
Backport changes in https://gitlab.com/gitlab-org/gitlab-ee/merge_requests/2551 to CE
DRY up caching in AbstractReferenceFilter
Update CHANGELOG
Add CHANGELOG entry
Fix html structure Removes test for removed behavior
Port form back to use form_tag
...
Diffstat (limited to 'app/helpers')
-rw-r--r-- | app/helpers/application_helper.rb | 4 | ||||
-rw-r--r-- | app/helpers/avatars_helper.rb | 3 | ||||
-rw-r--r-- | app/helpers/gitlab_routing_helper.rb | 16 | ||||
-rw-r--r-- | app/helpers/milestones_routing_helper.rb | 17 | ||||
-rw-r--r-- | app/helpers/nav_helper.rb | 1 |
5 files changed, 24 insertions, 17 deletions
diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index 22f637946d9..bcee81bdc15 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -306,6 +306,10 @@ module ApplicationHelper cookies["new_nav"] == "true" end + def collapsed_sidebar? + cookies["sidebar_collapsed"] == "true" + end + def show_new_repo? cookies["new_repo"] == "true" && body_data_page != 'projects:show' end diff --git a/app/helpers/avatars_helper.rb b/app/helpers/avatars_helper.rb index 0e068d4b51c..4b51269533c 100644 --- a/app/helpers/avatars_helper.rb +++ b/app/helpers/avatars_helper.rb @@ -19,7 +19,8 @@ module AvatarsHelper class: %W[avatar has-tooltip s#{avatar_size}].push(*options[:css_class]), alt: "#{user_name}'s avatar", title: user_name, - data: data_attributes + data: data_attributes, + lazy: true ) end diff --git a/app/helpers/gitlab_routing_helper.rb b/app/helpers/gitlab_routing_helper.rb index 1f7db9b2eb8..d4a91e533c1 100644 --- a/app/helpers/gitlab_routing_helper.rb +++ b/app/helpers/gitlab_routing_helper.rb @@ -47,14 +47,6 @@ module GitlabRoutingHelper project_pipeline_path(pipeline.project, pipeline.id, *args) end - def milestone_path(entity, *args) - if entity.is_group_milestone? - group_milestone_path(entity.group, entity, *args) - elsif entity.is_project_milestone? - project_milestone_path(entity.project, entity, *args) - end - end - def issue_url(entity, *args) project_issue_url(entity.project, entity, *args) end @@ -67,14 +59,6 @@ module GitlabRoutingHelper project_pipeline_url(pipeline.project, pipeline.id, *args) end - def milestone_url(entity, *args) - if entity.is_group_milestone? - group_milestone_url(entity.group, entity, *args) - elsif entity.is_project_milestone? - project_milestone_url(entity.project, entity, *args) - end - end - def pipeline_job_url(pipeline, build, *args) project_job_url(pipeline.project, build.id, *args) end diff --git a/app/helpers/milestones_routing_helper.rb b/app/helpers/milestones_routing_helper.rb new file mode 100644 index 00000000000..766d5262018 --- /dev/null +++ b/app/helpers/milestones_routing_helper.rb @@ -0,0 +1,17 @@ +module MilestonesRoutingHelper + def milestone_path(milestone, *args) + if milestone.is_group_milestone? + group_milestone_path(milestone.group, milestone, *args) + elsif milestone.is_project_milestone? + project_milestone_path(milestone.project, milestone, *args) + end + end + + def milestone_url(milestone, *args) + if milestone.is_group_milestone? + group_milestone_url(milestone.group, milestone, *args) + elsif milestone.is_project_milestone? + project_milestone_url(milestone.project, milestone, *args) + end + end +end diff --git a/app/helpers/nav_helper.rb b/app/helpers/nav_helper.rb index b1205b8529b..b63b3b70903 100644 --- a/app/helpers/nav_helper.rb +++ b/app/helpers/nav_helper.rb @@ -2,6 +2,7 @@ module NavHelper def page_with_sidebar_class class_name = page_gutter_class class_name << 'page-with-new-sidebar' if defined?(@new_sidebar) && @new_sidebar + class_name << 'page-with-icon-sidebar' if collapsed_sidebar? && @new_sidebar class_name end |