summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMałgorzata Ksionek <meksionek@gmail.com>2019-04-02 11:25:56 +0200
committerMałgorzata Ksionek <meksionek@gmail.com>2019-04-02 11:41:24 +0200
commit02dd82000f840338cc05dd38a925fa38302bbf69 (patch)
tree9792b833ad49eeec296e3fecd12bb8145c93112b
parente12944be0b2f6d4ee1a4dbfae49683bae77f1ac7 (diff)
downloadgitlab-ce-57620-add-time-preferences-for-user.tar.gz
-rw-r--r--app/views/profiles/show.html.haml46
-rw-r--r--locale/gitlab.pot6
-rw-r--r--spec/features/profiles/user_edit_profile_spec.rb4
3 files changed, 30 insertions, 26 deletions
diff --git a/app/views/profiles/show.html.haml b/app/views/profiles/show.html.haml
index 8a05b572abc..76395f3a0ed 100644
--- a/app/views/profiles/show.html.haml
+++ b/app/views/profiles/show.html.haml
@@ -64,29 +64,29 @@
prepend: emoji_button,
append: reset_message_button,
placeholder: s_("Profiles|What's your status?")
-
- %hr
- .row.user-time-preferences
- .col-lg-4.profile-settings-sidebar
- %h4.prepend-top-0= s_("Profiles|Time settings")
- %p= s_("Profiles|This settings will update how dates and times are displayed for you.")
- .col-lg-8
- -# TODO: might need an entry in user/profile.md to describe some of these settings
- %h5= ("Time zone")
- = dropdown_tag(_("Select a timezone"), options: { toggle_class: 'btn js-timezone-dropdown', title: _("Select a timezone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
- %input.hidden{ :type => 'hidden', :id => 'user_timezone', :name => 'user[timezone]', value: ActiveSupport::TimeZone::MAPPING.key(@user.timezone) }
- %h5= ("Time format")
- .checkbox-icon-inline-wrapper
- - time_format_label = capture do
- = s_("Profiles|Display time in 24 hour format")
- = f.check_box :time_format_in_24h, label: time_format_label, inline: true, wrapper_class: 'mr-0'
- = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'time-settings')
- %h5= ("Time display")
- .checkbox-icon-inline-wrapper
- - time_display_label = capture do
- = s_("Profiles|Use relative times")
- = f.check_box :time_display_relative, label: time_display_label, inline: true, wrapper_class: 'mr-0'
- = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'time-settings')
+ - if Feature.enabled?(:user_time_settings)
+ %hr
+ .row.user-time-preferences
+ .col-lg-4.profile-settings-sidebar
+ %h4.prepend-top-0= s_("Profiles|Time settings")
+ %p= s_("Profiles|These settings will update how dates and times are displayed for you.")
+ .col-lg-8
+ -# TODO: might need an entry in user/profile.md to describe some of these settings
+ %h5= ("Time zone")
+ = dropdown_tag(_("Select a timezone"), options: { toggle_class: 'btn js-timezone-dropdown', title: _("Select a timezone"), filter: true, placeholder: s_("OfSearchInADropdown|Filter"), data: { data: timezone_data } } )
+ %input.hidden{ :type => 'hidden', :id => 'user_timezone', :name => 'user[timezone]', value: ActiveSupport::TimeZone::MAPPING.key(@user.timezone) }
+ %h5= ("Time format")
+ .checkbox-icon-inline-wrapper
+ - time_format_label = capture do
+ = s_("Profiles|Display time in 24 hour format")
+ = f.check_box :time_format_in_24h, label: time_format_label, inline: true, wrapper_class: 'mr-0'
+ = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'time-settings')
+ %h5= ("Time display")
+ .checkbox-icon-inline-wrapper
+ - time_display_label = capture do
+ = s_("Profiles|Use relative times")
+ = f.check_box :time_display_relative, label: time_display_label, inline: true, wrapper_class: 'mr-0'
+ = link_to icon('question-circle'), help_page_path('user/profile/index.md', anchor: 'time-settings')
%hr
.row
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index 9275e998ea4..197097f92c3 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -6196,6 +6196,9 @@ msgstr ""
msgid "Profiles|The maximum file size allowed is 200KB."
msgstr ""
+msgid "Profiles|These settings will update how dates and times are displayed for you."
+msgstr ""
+
msgid "Profiles|This doesn't look like a public SSH key, are you sure you want to add it?"
msgstr ""
@@ -6211,9 +6214,6 @@ msgstr ""
msgid "Profiles|This information will appear on your profile"
msgstr ""
-msgid "Profiles|This settings will update how dates and times are displayed for you."
-msgstr ""
-
msgid "Profiles|Time settings"
msgstr ""
diff --git a/spec/features/profiles/user_edit_profile_spec.rb b/spec/features/profiles/user_edit_profile_spec.rb
index 7ac9f375dac..80e0f830c44 100644
--- a/spec/features/profiles/user_edit_profile_spec.rb
+++ b/spec/features/profiles/user_edit_profile_spec.rb
@@ -332,6 +332,10 @@ describe 'User edit profile' do
let(:issue) { create(:issue, project: project)}
let(:project) { create(:project) }
+ before do
+ stub_feature_flags(user_time_settings: true)
+ end
+
it 'shows the user time preferences form' do
expect(page).to have_content('Time settings')
end