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
2c7ebc6a
Commit
2c7ebc6a
authored
Jun 29, 2018
by
asadazam93
Committed by
AsadAzam
Jul 05, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added preview accepted status
parent
bde1b1c1
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
81 additions
and
49 deletions
+81
-49
course_discovery/apps/publisher/models.py
+11
-0
course_discovery/apps/publisher/templates/publisher/_approval_widget.html
+1
-5
course_discovery/apps/publisher/tests/test_models.py
+17
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
+0
-0
course_discovery/conf/locale/en/LC_MESSAGES/django.po
+37
-33
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
+13
-9
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/models.py
View file @
2c7ebc6a
...
@@ -906,6 +906,17 @@ class CourseRunState(TimeStampedModel, ChangedByMixin):
...
@@ -906,6 +906,17 @@ class CourseRunState(TimeStampedModel, ChangedByMixin):
""" Check that course run is in Review state or not."""
""" Check that course run is in Review state or not."""
return
self
.
name
==
CourseRunStateChoices
.
Review
return
self
.
name
==
CourseRunStateChoices
.
Review
@property
def
preview_status_for_publisher
(
self
):
"""
Calculate the preview status review, accepted or decline for publisher user
"""
if
self
.
owner_role
==
PublisherUserRole
.
CourseTeam
:
return
_
(
'Submitted for review'
)
elif
self
.
owner_role
==
PublisherUserRole
.
Publisher
and
self
.
preview_accepted
:
return
_
(
'Preview Accepted'
)
return
_
(
'Preview Declined'
)
class
PublisherUser
(
User
):
class
PublisherUser
(
User
):
""" Publisher User Proxy Model. """
""" Publisher User Proxy Model. """
...
...
course_discovery/apps/publisher/templates/publisher/_approval_widget.html
View file @
2c7ebc6a
...
@@ -39,11 +39,7 @@
...
@@ -39,11 +39,7 @@
</button>
</button>
{% endif %}
{% endif %}
{% elif course_run.course.publisher == request.user %}
{% elif course_run.course.publisher == request.user %}
{% if course_run.course_run_state.owner_role == 'course_team' %}
<span
class=
"preview-status"
>
{{course_run.course_run_state.preview_status_for_publisher}}
</span>
<span
class=
"preview-status"
>
{% trans "Submitted for review" %}
</span>
{% else %}
<span
class=
"preview-status"
>
{% trans "Preview Declined" %}
</span>
{% endif %}
<button
data-url=
"{% url 'publisher:api:update_course_run' course_run.id %}"
class=
"btn btn-neutral btn-edit-preview-url"
>
{% trans "Edit" %}
</button>
<button
data-url=
"{% url 'publisher:api:update_course_run' course_run.id %}"
class=
"btn btn-neutral btn-edit-preview-url"
>
{% trans "Edit" %}
</button>
{% endif %}
{% endif %}
{% elif course_run.course.publisher == request.user %}
{% elif course_run.course.publisher == request.user %}
...
...
course_discovery/apps/publisher/tests/test_models.py
View file @
2c7ebc6a
...
@@ -787,6 +787,23 @@ class CourseRunStateTests(TestCase):
...
@@ -787,6 +787,23 @@ class CourseRunStateTests(TestCase):
self
.
course_run_state
.
save
()
self
.
course_run_state
.
save
()
self
.
assertTrue
(
self
.
course_run_state
.
is_published
)
self
.
assertTrue
(
self
.
course_run_state
.
is_published
)
def
test_preview_status_for_publisher
(
self
):
"""
Verify that the method returns the correct status
"""
self
.
course_run_state
.
owner_role
=
PublisherUserRole
.
CourseTeam
self
.
course_run_state
.
save
()
self
.
assertEqual
(
self
.
course_run_state
.
preview_status_for_publisher
,
'Submitted for review'
)
self
.
course_run_state
.
owner_role
=
PublisherUserRole
.
Publisher
self
.
course_run_state
.
preview_accepted
=
True
self
.
course_run_state
.
save
()
self
.
assertEqual
(
self
.
course_run_state
.
preview_status_for_publisher
,
'Preview Accepted'
)
self
.
course_run_state
.
preview_accepted
=
False
self
.
course_run_state
.
save
()
self
.
assertEqual
(
self
.
course_run_state
.
preview_status_for_publisher
,
'Preview Declined'
)
def
test_is_draft
(
self
):
def
test_is_draft
(
self
):
"""
"""
Verify that method return is_draft status.
Verify that method return is_draft status.
...
...
course_discovery/conf/locale/en/LC_MESSAGES/django.mo
View file @
2c7ebc6a
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/django.po
View file @
2c7ebc6a
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: edx-platform\n"
"Project-Id-Version: edx-platform\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
5-24 15:22
+0000\n"
"POT-Creation-Date: 2018-0
7-05 12:03
+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
...
@@ -28,31 +28,31 @@ msgid ""
...
@@ -28,31 +28,31 @@ msgid ""
"parameter."
"parameter."
msgstr ""
msgstr ""
#: apps/api/serializers.py:40
4
#: apps/api/serializers.py:40
1
msgid "Number of courses contained in this catalog"
msgid "Number of courses contained in this catalog"
msgstr ""
msgstr ""
#: apps/api/serializers.py:40
7
#: apps/api/serializers.py:40
4
msgid "Usernames of users with explicit access to view this catalog"
msgid "Usernames of users with explicit access to view this catalog"
msgstr ""
msgstr ""
#: apps/api/serializers.py:47
3
#: apps/api/serializers.py:47
0
msgid "Language in which the course is administered"
msgid "Language in which the course is administered"
msgstr ""
msgstr ""
#: apps/api/serializers.py:5
42
#: apps/api/serializers.py:5
39
msgid "Dictionary mapping course run IDs to boolean values"
msgid "Dictionary mapping course run IDs to boolean values"
msgstr ""
msgstr ""
#: apps/api/serializers.py:69
7
#: apps/api/serializers.py:69
4
msgid "Dictionary mapping course IDs to boolean values"
msgid "Dictionary mapping course IDs to boolean values"
msgstr ""
msgstr ""
#: apps/api/serializers.py:8
52
#: apps/api/serializers.py:8
49
msgid "Languages that course runs in this program are offered in."
msgid "Languages that course runs in this program are offered in."
msgstr ""
msgstr ""
#: apps/api/serializers.py:85
6
#: apps/api/serializers.py:85
3
msgid ""
msgid ""
"Languages that course runs in this program have available transcripts in."
"Languages that course runs in this program have available transcripts in."
msgstr ""
msgstr ""
...
@@ -224,7 +224,7 @@ msgstr ""
...
@@ -224,7 +224,7 @@ msgstr ""
msgid "No"
msgid "No"
msgstr ""
msgstr ""
#: apps/course_metadata/admin.py:13
9
#: apps/course_metadata/admin.py:13
7
msgid "Included course runs"
msgid "Included course runs"
msgstr ""
msgstr ""
...
@@ -259,7 +259,7 @@ msgstr ""
...
@@ -259,7 +259,7 @@ msgstr ""
msgid "Deleted"
msgid "Deleted"
msgstr ""
msgstr ""
#: apps/course_metadata/forms.py:7
1
#: apps/course_metadata/forms.py:7
8
msgid "Programs can only be activated if they have a banner image."
msgid "Programs can only be activated if they have a banner image."
msgstr ""
msgstr ""
...
@@ -998,8 +998,20 @@ msgstr ""
...
@@ -998,8 +998,20 @@ msgstr ""
msgid "Approved by Marketing"
msgid "Approved by Marketing"
msgstr ""
msgstr ""
#: apps/publisher/models.py:915
msgid "Submitted for review"
msgstr ""
#: apps/publisher/models.py:917
msgid "Preview Accepted"
msgstr ""
#: apps/publisher/models.py:918
msgid "Preview Declined"
msgstr ""
#: apps/publisher/serializers.py:73
#: apps/publisher/serializers.py:73
#: apps/publisher/templates/publisher/_approval_widget.html:4
7
#: apps/publisher/templates/publisher/_approval_widget.html:4
3
#: apps/publisher/templates/publisher/course_detail/_edit_warning_popup.html:16
#: apps/publisher/templates/publisher/course_detail/_edit_warning_popup.html:16
#: apps/publisher/templates/publisher/course_run_detail/_edit_warning.html:17
#: apps/publisher/templates/publisher/course_run_detail/_edit_warning.html:17
msgid "Edit"
msgid "Edit"
...
@@ -1138,56 +1150,48 @@ msgstr ""
...
@@ -1138,56 +1150,48 @@ msgstr ""
msgid "Publish"
msgid "Publish"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:43
#: apps/publisher/templates/publisher/_approval_widget.html:46
msgid "Submitted for review"
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:45
msgid "Preview Declined"
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:50
#: apps/publisher/templates/publisher/seat_form.html:20
#: apps/publisher/templates/publisher/seat_form.html:20
msgid "Save"
msgid "Save"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:5
5
#: apps/publisher/templates/publisher/_approval_widget.html:5
1
msgid "ABOUT PAGE PREVIEW"
msgid "ABOUT PAGE PREVIEW"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:5
9
#: apps/publisher/templates/publisher/_approval_widget.html:5
5
msgid "Preview URL"
msgid "Preview URL"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:
60
#: apps/publisher/templates/publisher/_approval_widget.html:
56
msgid "View About page preview"
msgid "View About page preview"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:6
6
#: apps/publisher/templates/publisher/_approval_widget.html:6
2
msgid "Not available"
msgid "Not available"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:8
8
#: apps/publisher/templates/publisher/_approval_widget.html:8
4
msgid "Sent for Review"
msgid "Sent for Review"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:9
4
#: apps/publisher/templates/publisher/_approval_widget.html:9
0
msgid "Reviewed"
msgid "Reviewed"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:10
7
#: apps/publisher/templates/publisher/_approval_widget.html:10
3
msgid "day in ownership"
msgid "day in ownership"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:10
9
#: apps/publisher/templates/publisher/_approval_widget.html:10
5
msgid "days in ownership"
msgid "days in ownership"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:12
4
#: apps/publisher/templates/publisher/_approval_widget.html:12
0
msgid "change"
msgid "change"
msgstr ""
msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:14
4
#: apps/publisher/templates/publisher/_approval_widget.html:14
0
msgid "CHANGE"
msgid "CHANGE"
msgstr ""
msgstr ""
...
@@ -3352,7 +3356,7 @@ msgid ""
...
@@ -3352,7 +3356,7 @@ msgid ""
"the course to edX marketing for review. "
"the course to edX marketing for review. "
msgstr ""
msgstr ""
#: apps/publisher/views.py:335 apps/publisher/views.py:108
0
#: apps/publisher/views.py:335 apps/publisher/views.py:108
2
#, python-brace-format
#, python-brace-format
msgid "An error occurred while saving your changes. {error}"
msgid "An error occurred while saving your changes. {error}"
msgstr ""
msgstr ""
...
@@ -3360,7 +3364,7 @@ msgstr ""
...
@@ -3360,7 +3364,7 @@ msgstr ""
#: apps/publisher/views.py:340 apps/publisher/views.py:527
#: apps/publisher/views.py:340 apps/publisher/views.py:527
#: apps/publisher/views.py:601 apps/publisher/views.py:838
#: apps/publisher/views.py:601 apps/publisher/views.py:838
#: apps/publisher/views.py:883 apps/publisher/views.py:951
#: apps/publisher/views.py:883 apps/publisher/views.py:951
#: apps/publisher/views.py:108
6
#: apps/publisher/views.py:108
8
msgid ""
msgid ""
"The page could not be updated. Make sure that all values are correct, then "
"The page could not be updated. Make sure that all values are correct, then "
"try again."
"try again."
...
@@ -3428,7 +3432,7 @@ msgstr ""
...
@@ -3428,7 +3432,7 @@ msgstr ""
msgid "You have successfully created a course run for {course_title}."
msgid "You have successfully created a course run for {course_title}."
msgstr ""
msgstr ""
#: apps/publisher/views.py:106
4
#: apps/publisher/views.py:106
6
msgid "Course run updated successfully."
msgid "Course run updated successfully."
msgstr ""
msgstr ""
...
...
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.mo
View file @
2c7ebc6a
No preview for this file type
course_discovery/conf/locale/en/LC_MESSAGES/djangojs.po
View file @
2c7ebc6a
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: edx-platform\n"
"Project-Id-Version: edx-platform\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
5-24 15:22
+0000\n"
"POT-Creation-Date: 2018-0
7-05 12:03
+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/django.mo
View file @
2c7ebc6a
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/django.po
View file @
2c7ebc6a
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: edx-platform\n"
"Project-Id-Version: edx-platform\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
5-24 15:22
+0000\n"
"POT-Creation-Date: 2018-0
7-05 12:03
+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
...
@@ -1190,6 +1190,18 @@ msgstr "Àwäïtïng Märkétïng Révïéw Ⱡ'σяєм ιρѕυм ∂σłσя
...
@@ -1190,6 +1190,18 @@ msgstr "Àwäïtïng Märkétïng Révïéw Ⱡ'σяєм ιρѕυм ∂σłσя
msgid "Approved by Marketing"
msgid "Approved by Marketing"
msgstr "Àpprövéd ßý Märkétïng Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
msgstr "Àpprövéd ßý Märkétïng Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: apps/publisher/models.py
msgid "Submitted for review"
msgstr "Süßmïttéd för révïéw Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: apps/publisher/models.py
msgid "Preview Accepted"
msgstr "Prévïéw Àççéptéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αм#"
#: apps/publisher/models.py
msgid "Preview Declined"
msgstr "Prévïéw Déçlïnéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αм#"
#: apps/publisher/serializers.py
#: apps/publisher/serializers.py
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/course_detail/_edit_warning_popup.html
#: apps/publisher/templates/publisher/course_detail/_edit_warning_popup.html
...
@@ -1344,14 +1356,6 @@ msgid "Publish"
...
@@ -1344,14 +1356,6 @@ msgid "Publish"
msgstr "Püßlïsh Ⱡ'σяєм ιρѕυм #"
msgstr "Püßlïsh Ⱡ'σяєм ιρѕυм #"
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/_approval_widget.html
msgid "Submitted for review"
msgstr "Süßmïttéd för révïéw Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: apps/publisher/templates/publisher/_approval_widget.html
msgid "Preview Declined"
msgstr "Prévïéw Déçlïnéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αм#"
#: apps/publisher/templates/publisher/_approval_widget.html
#: apps/publisher/templates/publisher/seat_form.html
#: apps/publisher/templates/publisher/seat_form.html
msgid "Save"
msgid "Save"
msgstr "Sävé Ⱡ'σяєм ι#"
msgstr "Sävé Ⱡ'σяєм ι#"
...
...
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.mo
View file @
2c7ebc6a
No preview for this file type
course_discovery/conf/locale/eo/LC_MESSAGES/djangojs.po
View file @
2c7ebc6a
...
@@ -8,7 +8,7 @@ msgid ""
...
@@ -8,7 +8,7 @@ msgid ""
msgstr ""
msgstr ""
"Project-Id-Version: edx-platform\n"
"Project-Id-Version: edx-platform\n"
"Report-Msgid-Bugs-To: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-0
5-24 15:22
+0000\n"
"POT-Creation-Date: 2018-0
7-05 12:03
+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"PO-Revision-Date: 2018-04-09 20:13+0000\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Last-Translator: Muhammad Ayub khan <ayubkhan@edx.org>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\n"
"Language-Team: openedx-translation <openedx-translation@googlegroups.com>\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