Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
E
edx-platform
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
edx
edx-platform
Commits
ff8c4a6e
Commit
ff8c4a6e
authored
Dec 20, 2016
by
Gregory Martin
Committed by
GitHub
Dec 20, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #14178 from edx/yro_set-default-timezone-settings
add blankTitle option
parents
8c009881
909f35bb
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
12 deletions
+18
-12
common/test/acceptance/tests/lms/test_account_settings.py
+1
-1
lms/static/js/spec/student_account/account_settings_fields_spec.js
+3
-2
lms/static/js/student_account/views/account_settings_factory.js
+2
-1
lms/templates/fields/field_dropdown_account.underscore
+12
-8
No files found.
common/test/acceptance/tests/lms/test_account_settings.py
View file @
ff8c4a6e
...
...
@@ -421,7 +421,7 @@ class AccountSettingsPageTest(AccountSettingsTestMixin, AcceptanceTest):
self
.
_test_dropdown_field
(
u'time_zone'
,
u'Time Zone'
,
u''
,
u'
Default (Local Time Zone)
'
,
[
u'Europe/Kiev ({abbr}, UTC{offset})'
.
format
(
abbr
=
kiev_abbr
,
offset
=
kiev_offset
),
u'US/Pacific ({abbr}, UTC{offset})'
.
format
(
abbr
=
pacific_abbr
,
offset
=
pacific_offset
),
...
...
lms/static/js/spec/student_account/account_settings_fields_spec.js
View file @
ff8c4a6e
...
...
@@ -54,7 +54,8 @@ define(['backbone',
valueAttribute
:
'time_zone'
,
groupOptions
:
[{
groupTitle
:
gettext
(
'All Time Zones'
),
selectOptions
:
FieldViewsSpecHelpers
.
SELECT_OPTIONS
selectOptions
:
FieldViewsSpecHelpers
.
SELECT_OPTIONS
,
blankTitle
:
'Default (Local Time Zone)'
}],
persistChanges
:
true
,
required
:
true
...
...
@@ -97,7 +98,7 @@ define(['backbone',
// expect time zone dropdown to have two subheaders (country/all time zone sub-headers) with new values
expect
(
timeZoneView
.
$
(
groupsSelector
).
length
).
toBe
(
2
);
expect
(
timeZoneView
.
$
(
groupOptionsSelector
).
length
).
toBe
(
5
);
expect
(
timeZoneView
.
$
(
groupOptionsSelector
).
length
).
toBe
(
6
);
expect
(
timeZoneView
.
$
(
groupOptionsSelector
)[
0
].
value
).
toBe
(
'America/Guyana'
);
// select time zone option from option
...
...
lms/static/js/student_account/views/account_settings_factory.js
View file @
ff8c4a6e
...
...
@@ -118,7 +118,8 @@
helpMessage
:
gettext
(
'Select the time zone for displaying course dates. If you do not specify a time zone, course dates, including assignment deadlines, will be displayed in your browser
\'
s local time zone.'
),
// eslint-disable-line max-len
groupOptions
:
[{
groupTitle
:
gettext
(
'All Time Zones'
),
selectOptions
:
fieldsData
.
time_zone
.
options
selectOptions
:
fieldsData
.
time_zone
.
options
,
blankTitle
:
gettext
(
'Default (Local Time Zone)'
)
}],
persistChanges
:
true
})
...
...
lms/templates/fields/field_dropdown_account.underscore
View file @
ff8c4a6e
...
...
@@ -20,16 +20,20 @@
<span class="u-field-value-readonly"></span>
<% } else { %>
<select name="select" id="u-field-select-<%- id %>" aria-describedby="u-field-help-message-<%- id %>">
<% if (showBlankOption) { %>
<option value=""></option>
<% } %>
<% _.each(groupOptions, function(groupOption) { %>
<% if (groupOption.groupTitle != null) { %>
<optgroup label="<%- groupOption.groupTitle %>">
<% if (showBlankOption) { %>
<% if (groupOption.blankTitle) { %>
<option value=""><%- groupOption.blankTitle %></option>
<% } else { %>
<option value=""></option>
<% } %>
<% } %>
<% _.each(groupOption.selectOptions, function(selectOption) { %>
<option value="<%- selectOption[0] %>"><%- selectOption[1] %></option>
<% }); %>
<% if (groupOption.groupTitle != null) { %>
<optgroup label="<%- groupOption.groupTitle %>">
<% } %>
<% _.each(groupOption.selectOptions, function(selectOption) { %>
<option value="<%- selectOption[0] %>"><%- selectOption[1] %></option>
<% }); %>
<% }); %>
</select>
<span class="icon-caret-down" aria-hidden="true"></span>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment