From 5dd1d5782e748382cfef14a87efbdcea3b8bbbb2 Mon Sep 17 00:00:00 2001 From: Filipa Lacerda Date: Tue, 5 Sep 2017 18:22:20 +0100 Subject: [PATCH] Fixes the Cookie path Prepares for i18n --- app/assets/javascripts/user_callout.js | 2 +- app/views/shared/_auto_devops_callout.html.haml | 12 +++++------- lib/gitlab/gon_helper.rb | 2 +- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/app/assets/javascripts/user_callout.js b/app/assets/javascripts/user_callout.js index eab6cee0886..6165d97f425 100644 --- a/app/assets/javascripts/user_callout.js +++ b/app/assets/javascripts/user_callout.js @@ -22,7 +22,7 @@ export default class UserCallout { const $currentTarget = $(e.currentTarget); if (this.options.setCalloutPerProject) { - Cookies.set(this.cookieName, 'true', { expires: 365, path: gon.project_url }); + Cookies.set(this.cookieName, 'true', { expires: 365, path: gon.project_path }); } else { Cookies.set(this.cookieName, 'true', { expires: 365 }); } diff --git a/app/views/shared/_auto_devops_callout.html.haml b/app/views/shared/_auto_devops_callout.html.haml index d0b61282d20..ab377d32915 100644 --- a/app/views/shared/_auto_devops_callout.html.haml +++ b/app/views/shared/_auto_devops_callout.html.haml @@ -6,12 +6,10 @@ .svg-container = custom_icon('icon_autodevops') .user-callout-copy - %h4 - Auto DevOps (Beta) + %h4= _('Auto DevOps (Beta)') + %p= _('Auto DevOps can be activated for this project. It will automatically build, test, and deploy your application based on a predefined CI/CD configuration.') %p - Auto DevOps can be activated for this project. It will automatically build, test, and deploy your application based on a predefined CI/CD configuration. - %p - Learn more in the - = link_to 'Auto DevOps documentation', help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer' + #{s_('Learn more in the')} + = link_to _('Auto DevOps documentation'), help_page_path('topics/autodevops/index.md'), target: '_blank', rel: 'noopener noreferrer' - = link_to 'Enable in settings', project_settings_ci_cd_path(@project), class: 'btn btn-primary js-close-callout' + = link_to _('Enable in settings'), project_settings_ci_cd_path(@project), class: 'btn btn-primary js-close-callout' diff --git a/lib/gitlab/gon_helper.rb b/lib/gitlab/gon_helper.rb index c8564951a24..6a80162e373 100644 --- a/lib/gitlab/gon_helper.rb +++ b/lib/gitlab/gon_helper.rb @@ -30,7 +30,7 @@ module Gitlab end def add_gon_project_variables - gon.project_url = project_url(project) + gon.project_path = project_path(project) end end end