Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
C
course-discovery
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
course-discovery
Commits
9f43e82c
Commit
9f43e82c
authored
Jan 31, 2018
by
Jeff LaJoie
Committed by
Jeff LaJoie
Feb 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
LEARNER-3771: Adds versioned view for Course Runs
parent
831dadc6
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
63 additions
and
28 deletions
+63
-28
course_discovery/apps/publisher/templates/publisher/course_run_detail/_all.html
+25
-23
course_discovery/apps/publisher/tests/factories.py
+1
-0
course_discovery/apps/publisher/tests/test_views.py
+22
-0
course_discovery/apps/publisher/views.py
+2
-0
course_discovery/apps/publisher/wrappers.py
+9
-1
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.po
+1
-1
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.po
+1
-1
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
+1
-1
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.mo
+0
-0
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.po
+1
-1
No files found.
course_discovery/apps/publisher/templates/publisher/course_run_detail/_all.html
View file @
9f43e82c
...
@@ -29,34 +29,36 @@
...
@@ -29,34 +29,36 @@
<div>
{{ course_run.end }}
</div>
<div>
{{ course_run.end }}
</div>
</div>
</div>
<div
class=
"info-item"
>
{% if is_seat_version %}
<div
class=
"heading"
>
<div
class=
"info-item"
>
{% trans "Enrollment Track" %}
<div
class=
"heading"
>
{% trans "Enrollment Track" %}
</div>
<div>
{{ course_run.course_type }}
</div>
</div>
</div>
<div>
{{ course_run.course_type }}
</div>
</div>
{% if course_run.seat_price %}
{% if course_run.seat_price %}
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<div
class=
"heading"
>
<div
class=
"heading"
>
{% trans "Certificate Price" %}
{% trans "Certificate Price" %}
</div>
</div>
<div>
<div>
${{ course_run.seat_price }}
${{ course_run.seat_price }}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% if course_run.credit_seat_price %}
{% if course_run.credit_seat_price %}
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<div
class=
"heading"
>
<div
class=
"heading"
>
{% trans "Credit Price" %}
{% trans "Credit Price" %}
</div>
</div>
<div>
<div>
${{ course_run.credit_seat_price }}
${{ course_run.credit_seat_price }}
</div>
</div>
</div>
</div>
{% endif %}
{% endif %}
{% endif %}
<div
class=
"info-item"
>
<div
class=
"info-item"
>
<div
class=
"heading"
>
<div
class=
"heading"
>
...
...
course_discovery/apps/publisher/tests/factories.py
View file @
9f43e82c
...
@@ -27,6 +27,7 @@ class CourseFactory(factory.DjangoModelFactory):
...
@@ -27,6 +27,7 @@ class CourseFactory(factory.DjangoModelFactory):
learner_testimonial
=
FuzzyText
()
learner_testimonial
=
FuzzyText
()
level_type
=
factory
.
SubFactory
(
factories
.
LevelTypeFactory
)
level_type
=
factory
.
SubFactory
(
factories
.
LevelTypeFactory
)
image
=
factory
.
django
.
ImageField
()
image
=
factory
.
django
.
ImageField
()
version
=
FuzzyInteger
(
0
,
1
)
primary_subject
=
factory
.
SubFactory
(
factories
.
SubjectFactory
)
primary_subject
=
factory
.
SubFactory
(
factories
.
SubjectFactory
)
secondary_subject
=
factory
.
SubFactory
(
factories
.
SubjectFactory
)
secondary_subject
=
factory
.
SubFactory
(
factories
.
SubjectFactory
)
...
...
course_discovery/apps/publisher/tests/test_views.py
View file @
9f43e82c
...
@@ -824,6 +824,28 @@ class CourseRunDetailTests(SiteMixin, TestCase):
...
@@ -824,6 +824,28 @@ class CourseRunDetailTests(SiteMixin, TestCase):
self
.
course_run
.
enrollment_end
]:
self
.
course_run
.
enrollment_end
]:
self
.
assertContains
(
response
,
value
.
strftime
(
self
.
date_format
))
self
.
assertContains
(
response
,
value
.
strftime
(
self
.
date_format
))
def
test_course_run_with_version
(
self
):
"""
Verify that a SEAT_VERSION course still shows enrollment
track data, and an ENTITLEMENT_VERSION course does not
"""
self
.
client
.
logout
()
self
.
client
.
login
(
username
=
self
.
user
.
username
,
password
=
USER_PASSWORD
)
# For SEAT_VERSION Enrollment Track should be shown
self
.
course
.
version
=
Course
.
SEAT_VERSION
self
.
course
.
save
()
response
=
self
.
client
.
get
(
self
.
page_url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertContains
(
response
,
'Enrollment Track'
)
# For ENTITLEMENT_VERSION no Enrollment Track should be show
self
.
course
.
version
=
Course
.
ENTITLEMENT_VERSION
self
.
course
.
save
()
response
=
self
.
client
.
get
(
self
.
page_url
)
self
.
assertEqual
(
response
.
status_code
,
200
)
self
.
assertNotContains
(
response
,
'Enrollment Track'
)
def
test_detail_page_with_comments
(
self
):
def
test_detail_page_with_comments
(
self
):
""" Verify that detail page contains all the data along with comments
""" Verify that detail page contains all the data along with comments
for course.
for course.
...
...
course_discovery/apps/publisher/views.py
View file @
9f43e82c
...
@@ -229,6 +229,8 @@ class CourseRunDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionM
...
@@ -229,6 +229,8 @@ class CourseRunDetailView(mixins.LoginRequiredMixin, mixins.PublisherPermissionM
if
current_owner_role
.
role
==
PublisherUserRole
.
ProjectCoordinator
if
current_owner_role
.
role
==
PublisherUserRole
.
ProjectCoordinator
else
_
(
'project coordinator'
))
else
_
(
'project coordinator'
))
context
[
'is_in_preview_review'
]
=
course_run
.
is_in_preview_review
context
[
'is_in_preview_review'
]
=
course_run
.
is_in_preview_review
context
[
'is_seat_version'
]
=
course_run
.
is_seat_version
context
[
'is_entitlement_version'
]
=
course_run
.
is_entitlement_version
return
context
return
context
...
...
course_discovery/apps/publisher/wrappers.py
View file @
9f43e82c
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
...
@@ -6,7 +6,7 @@ from django.utils.translation import ugettext_lazy as _
from
course_discovery.apps.course_metadata.choices
import
CourseRunPacing
from
course_discovery.apps.course_metadata.choices
import
CourseRunPacing
from
course_discovery.apps.publisher.choices
import
PublisherUserRole
from
course_discovery.apps.publisher.choices
import
PublisherUserRole
from
course_discovery.apps.publisher.models
import
Seat
from
course_discovery.apps.publisher.models
import
Course
,
Seat
from
course_discovery.apps.publisher_comments.models
import
Comments
,
CommentTypeChoices
from
course_discovery.apps.publisher_comments.models
import
Comments
,
CommentTypeChoices
...
@@ -151,6 +151,14 @@ class CourseRunWrapper(BaseWrapper):
...
@@ -151,6 +151,14 @@ class CourseRunWrapper(BaseWrapper):
)
)
@property
@property
def
is_seat_version
(
self
):
return
self
.
wrapped_obj
.
course
.
version
==
Course
.
SEAT_VERSION
@property
def
is_entitlement_version
(
self
):
return
self
.
wrapped_obj
.
course
.
version
==
Course
.
ENTITLEMENT_VERSION
@property
def
organization_key
(
self
):
def
organization_key
(
self
):
organization
=
self
.
wrapped_obj
.
course
.
organizations
.
first
()
organization
=
self
.
wrapped_obj
.
course
.
organizations
.
first
()
if
not
organization
:
if
not
organization
:
...
...
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
View file @
9f43e82c
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/django.po
View file @
9f43e82c
...
@@ -7,7 +7,7 @@ msgid ""
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-0
5 18:37
+0000\n"
"POT-Creation-Date: 2018-02-0
6 14:34
+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.mo
View file @
9f43e82c
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.po
View file @
9f43e82c
...
@@ -7,7 +7,7 @@ msgid ""
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-0
5 18:37
+0000\n"
"POT-Creation-Date: 2018-02-0
6 14:34
+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
View file @
9f43e82c
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
View file @
9f43e82c
...
@@ -7,7 +7,7 @@ msgid ""
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-0
5 18:37
+0000\n"
"POT-Creation-Date: 2018-02-0
6 14:34
+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.mo
View file @
9f43e82c
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.po
View file @
9f43e82c
...
@@ -7,7 +7,7 @@ msgid ""
...
@@ -7,7 +7,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-02-0
5 18:37
+0000\n"
"POT-Creation-Date: 2018-02-0
6 14:34
+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
...
...
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