Commit 2c7ebc6a by asadazam93 Committed by AsadAzam

Added preview accepted status

parent bde1b1c1
...@@ -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. """
......
...@@ -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 %}
......
...@@ -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.
......
...@@ -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-05-24 15:22+0000\n" "POT-Creation-Date: 2018-07-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:404 #: apps/api/serializers.py:401
msgid "Number of courses contained in this catalog" msgid "Number of courses contained in this catalog"
msgstr "" msgstr ""
#: apps/api/serializers.py:407 #: apps/api/serializers.py:404
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:473 #: apps/api/serializers.py:470
msgid "Language in which the course is administered" msgid "Language in which the course is administered"
msgstr "" msgstr ""
#: apps/api/serializers.py:542 #: apps/api/serializers.py:539
msgid "Dictionary mapping course run IDs to boolean values" msgid "Dictionary mapping course run IDs to boolean values"
msgstr "" msgstr ""
#: apps/api/serializers.py:697 #: apps/api/serializers.py:694
msgid "Dictionary mapping course IDs to boolean values" msgid "Dictionary mapping course IDs to boolean values"
msgstr "" msgstr ""
#: apps/api/serializers.py:852 #: apps/api/serializers.py:849
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:856 #: apps/api/serializers.py:853
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:139 #: apps/course_metadata/admin.py:137
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:71 #: apps/course_metadata/forms.py:78
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:47 #: apps/publisher/templates/publisher/_approval_widget.html:43
#: 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:55 #: apps/publisher/templates/publisher/_approval_widget.html:51
msgid "ABOUT PAGE PREVIEW" msgid "ABOUT PAGE PREVIEW"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:59 #: apps/publisher/templates/publisher/_approval_widget.html:55
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:66 #: apps/publisher/templates/publisher/_approval_widget.html:62
msgid "Not available" msgid "Not available"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:88 #: apps/publisher/templates/publisher/_approval_widget.html:84
msgid "Sent for Review" msgid "Sent for Review"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:94 #: apps/publisher/templates/publisher/_approval_widget.html:90
msgid "Reviewed" msgid "Reviewed"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:107 #: apps/publisher/templates/publisher/_approval_widget.html:103
msgid "day in ownership" msgid "day in ownership"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:109 #: apps/publisher/templates/publisher/_approval_widget.html:105
msgid "days in ownership" msgid "days in ownership"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:124 #: apps/publisher/templates/publisher/_approval_widget.html:120
msgid "change" msgid "change"
msgstr "" msgstr ""
#: apps/publisher/templates/publisher/_approval_widget.html:144 #: apps/publisher/templates/publisher/_approval_widget.html:140
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:1080 #: apps/publisher/views.py:335 apps/publisher/views.py:1082
#, 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:1086 #: apps/publisher/views.py:1088
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:1064 #: apps/publisher/views.py:1066
msgid "Course run updated successfully." msgid "Course run updated successfully."
msgstr "" msgstr ""
......
...@@ -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-05-24 15:22+0000\n" "POT-Creation-Date: 2018-07-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"
......
...@@ -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-05-24 15:22+0000\n" "POT-Creation-Date: 2018-07-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é Ⱡ'σяєм ι#"
......
...@@ -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-05-24 15:22+0000\n" "POT-Creation-Date: 2018-07-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"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment