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
d5c0e25a
Commit
d5c0e25a
authored
Jun 15, 2016
by
estute
Committed by
GitHub
Jun 15, 2016
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #12765 from edx/release
Merge Release to Master
parents
a2bf90f6
f643f2dc
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
56 additions
and
26 deletions
+56
-26
cms/templates/js/certificate-details.underscore
+1
-1
cms/templates/js/content-group-details.underscore
+2
-2
cms/templates/js/group-configuration-details.underscore
+2
-2
cms/templates/js/show-textbook.underscore
+1
-1
common/static/sass/_mixins.scss
+0
-4
lms/djangoapps/student_account/test/test_views.py
+23
-0
lms/djangoapps/student_account/views.py
+27
-16
No files found.
cms/templates/js/certificate-details.underscore
View file @
d5c0e25a
...
@@ -64,7 +64,7 @@
...
@@ -64,7 +64,7 @@
<button class="edit"><span class="icon fa fa-pencil" aria-hidden="true"></span> <%- gettext("Edit") %></button>
<button class="edit"><span class="icon fa fa-pencil" aria-hidden="true"></span> <%- gettext("Edit") %></button>
</li>
</li>
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Delete') %>">
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Delete') %>">
<button class="delete action-icon"
><span class="icon fa fa-trash-o" aria-hidden="true"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o" aria-hidden="true"
></span></button>
</li>
</li>
<% } %>
<% } %>
</ul>
</ul>
...
...
cms/templates/js/content-group-details.underscore
View file @
d5c0e25a
...
@@ -28,11 +28,11 @@
...
@@ -28,11 +28,11 @@
</li>
</li>
<% if (_.isEmpty(usage)) { %>
<% if (_.isEmpty(usage)) { %>
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Delete') %>">
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Delete') %>">
<button class="delete action-icon"
><span class="icon fa fa-trash-o" aria-hidden="true"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o" aria-hidden="true"
></span></button>
</li>
</li>
<% } else { %>
<% } else { %>
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Cannot delete when in use by a unit') %>">
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Cannot delete when in use by a unit') %>">
<button class="delete action-icon is-disabled" aria-disabled="true" disabled="disabled"
><span class="icon fa fa-trash-o" aria-hidden="true"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon is-disabled" aria-disabled="true" disabled="disabled"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o" aria-hidden="true"
></span></button>
</li>
</li>
<% } %>
<% } %>
</ul>
</ul>
...
...
cms/templates/js/group-configuration-details.underscore
View file @
d5c0e25a
...
@@ -46,11 +46,11 @@
...
@@ -46,11 +46,11 @@
</li>
</li>
<% if (_.isEmpty(usage)) { %>
<% if (_.isEmpty(usage)) { %>
<li class="action action-delete wrapper-delete-button">
<li class="action action-delete wrapper-delete-button">
<button class="delete action-icon"
><span class="icon fa fa-trash-o" aria-hidden="true"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o" aria-hidden="true"
></span></button>
</li>
</li>
<% } else { %>
<% } else { %>
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Cannot delete when in use by an experiment') %>">
<li class="action action-delete wrapper-delete-button" data-tooltip="<%- gettext('Cannot delete when in use by an experiment') %>">
<button class="delete action-icon is-disabled" aria-disabled="true" aria-hidden="true"
><span class="icon fa fa-trash-o"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon is-disabled" aria-disabled="true" aria-hidden="true"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o"
></span></button>
</li>
</li>
<% } %>
<% } %>
</ul>
</ul>
...
...
cms/templates/js/show-textbook.underscore
View file @
d5c0e25a
...
@@ -40,7 +40,7 @@
...
@@ -40,7 +40,7 @@
<button class="edit"><%- gettext("Edit") %></button>
<button class="edit"><%- gettext("Edit") %></button>
</li>
</li>
<li class="action action-delete">
<li class="action action-delete">
<button class="delete action-icon"
><span class="icon fa fa-trash-o" aria-hidden="true"></span><span><%- gettext("Delete") %
></span></button>
<button class="delete action-icon"
title="<%- gettext('Delete') %>"><span class="icon fa fa-trash-o" aria-hidden="true"
></span></button>
</li>
</li>
</ul>
</ul>
...
...
common/static/sass/_mixins.scss
View file @
d5c0e25a
...
@@ -313,10 +313,6 @@
...
@@ -313,10 +313,6 @@
background-color
:
$gray-l1
;
background-color
:
$gray-l1
;
color
:
$white
;
color
:
$white
;
}
}
span
{
@extend
%cont-text-sr
;
}
}
}
// button with no button shell until hover for understated actions
// button with no button shell until hover for understated actions
...
...
lms/djangoapps/student_account/test/test_views.py
View file @
d5c0e25a
...
@@ -595,6 +595,29 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
...
@@ -595,6 +595,29 @@ class AccountSettingsViewTest(ThirdPartyAuthTestMixin, TestCase, ProgramsApiConf
self
.
assertEqual
(
order_detail
,
[])
self
.
assertEqual
(
order_detail
,
[])
def
test_order_history_with_no_product
(
self
):
response
=
{
'results'
:
[
factories
.
OrderFactory
(
lines
=
[
factories
.
OrderLineFactory
(
product
=
None
),
factories
.
OrderLineFactory
(
product
=
factories
.
ProductFactory
(
attribute_values
=
[
factories
.
ProductAttributeFactory
(
name
=
'certificate_type'
,
value
=
'verified'
)])
)
]
)
]
}
with
mock_get_orders
(
response
=
response
):
order_detail
=
get_user_orders
(
self
.
user
)
self
.
assertEqual
(
len
(
order_detail
),
1
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
@override_settings
(
SITE_NAME
=
settings
.
MICROSITE_LOGISTRATION_HOSTNAME
)
class
MicrositeLogistrationTests
(
TestCase
):
class
MicrositeLogistrationTests
(
TestCase
):
...
...
lms/djangoapps/student_account/views.py
View file @
d5c0e25a
...
@@ -334,21 +334,25 @@ def get_user_orders(user):
...
@@ -334,21 +334,25 @@ def get_user_orders(user):
for
order
in
commerce_user_orders
:
for
order
in
commerce_user_orders
:
if
order
[
'status'
]
.
lower
()
==
'complete'
:
if
order
[
'status'
]
.
lower
()
==
'complete'
:
for
line
in
order
[
'lines'
]:
for
line
in
order
[
'lines'
]:
for
attribute
in
line
[
'product'
][
'attribute_values'
]:
product
=
line
.
get
(
'product'
)
if
attribute
[
'name'
]
==
'certificate_type'
and
attribute
[
'value'
]
in
allowed_course_modes
:
if
product
:
try
:
for
attribute
in
product
[
'attribute_values'
]:
date_placed
=
datetime
.
strptime
(
order
[
'date_placed'
],
"
%
Y-
%
m-
%
dT
%
H:
%
M:
%
SZ"
)
if
attribute
[
'name'
]
==
'certificate_type'
and
attribute
[
'value'
]
in
allowed_course_modes
:
order_data
=
{
try
:
'number'
:
order
[
'number'
],
date_placed
=
datetime
.
strptime
(
order
[
'date_placed'
],
"
%
Y-
%
m-
%
dT
%
H:
%
M:
%
SZ"
)
'price'
:
order
[
'total_excl_tax'
],
order_data
=
{
'title'
:
order
[
'lines'
][
0
][
'title'
],
'number'
:
order
[
'number'
],
'order_date'
:
strftime_localized
(
date_placed
.
replace
(
tzinfo
=
pytz
.
UTC
),
'SHORT_DATE'
),
'price'
:
order
[
'total_excl_tax'
],
'receipt_url'
:
commerce_configuration
.
receipt_page
+
order
[
'number'
]
'title'
:
order
[
'lines'
][
0
][
'title'
],
}
'order_date'
:
strftime_localized
(
user_orders
.
append
(
order_data
)
date_placed
.
replace
(
tzinfo
=
pytz
.
UTC
),
'SHORT_DATE'
except
KeyError
:
),
log
.
exception
(
'Invalid order structure:
%
r'
,
order
)
'receipt_url'
:
commerce_configuration
.
receipt_page
+
order
[
'number'
]
return
no_data
}
user_orders
.
append
(
order_data
)
except
KeyError
:
log
.
exception
(
'Invalid order structure:
%
r'
,
order
)
return
no_data
return
user_orders
return
user_orders
...
@@ -421,6 +425,13 @@ def account_settings_context(request):
...
@@ -421,6 +425,13 @@ def account_settings_context(request):
user
=
request
.
user
user
=
request
.
user
year_of_birth_options
=
[(
unicode
(
year
),
unicode
(
year
))
for
year
in
UserProfile
.
VALID_YEARS
]
year_of_birth_options
=
[(
unicode
(
year
),
unicode
(
year
))
for
year
in
UserProfile
.
VALID_YEARS
]
try
:
user_orders
=
get_user_orders
(
user
)
except
:
# pylint: disable=bare-except
log
.
exception
(
'Error fetching order history from Otto.'
)
# Return empty order list as account settings page expect a list and
# it will be broken if exception raised
user_orders
=
[]
context
=
{
context
=
{
'auth'
:
{},
'auth'
:
{},
...
@@ -447,7 +458,7 @@ def account_settings_context(request):
...
@@ -447,7 +458,7 @@ def account_settings_context(request):
'user_preferences_api_url'
:
reverse
(
'preferences_api'
,
kwargs
=
{
'username'
:
user
.
username
}),
'user_preferences_api_url'
:
reverse
(
'preferences_api'
,
kwargs
=
{
'username'
:
user
.
username
}),
'disable_courseware_js'
:
True
,
'disable_courseware_js'
:
True
,
'show_program_listing'
:
ProgramsApiConfig
.
current
()
.
show_program_listing
,
'show_program_listing'
:
ProgramsApiConfig
.
current
()
.
show_program_listing
,
'order_history'
:
get_user_orders
(
user
)
'order_history'
:
user_orders
}
}
if
third_party_auth
.
is_enabled
():
if
third_party_auth
.
is_enabled
():
...
...
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