Commit 0098e790 by tasawernawaz Committed by Tasawer Nawaz

check added for parent course not approved state

ECOM-6290
parent 2095a841
......@@ -1103,6 +1103,22 @@ class CourseRunDetailTests(TestCase):
self.course_run.save()
self.course_run.staff.add(PersonFactory())
def test_parent_course_not_approved(self):
""" Verify that if parent course is not approved than their will be a message
shown on course run detail page that user can't submit for approval.
"""
self.user.groups.add(Group.objects.get(name=INTERNAL_USER_GROUP_NAME))
response = self.client.get(self.page_url)
self.assertNotContains(response, '<div class="parent-course-approval">')
# change course state to review.
self.course.course_state.name = CourseStateChoices.Review
self.course.course_state.save()
response = self.client.get(self.page_url)
self.assertContains(response, '<div class="parent-course-approval">')
# pylint: disable=attribute-defined-outside-init
@ddt.ddt
......
......@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-17 15:19+0500\n"
"POT-Creation-Date: 2017-02-20 17:52+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: apps/api/filters.py
#, python-brace-format
......@@ -950,6 +950,14 @@ msgid "APPROVALS"
msgstr ""
#: templates/publisher/_approval_widget.html
#, python-format
msgid ""
"The %(link_start)s%(course_url)s%(link_middle)s parent course %(link_end)s "
"for this course run has changes that must be approved before you can submit "
"this course run for approval. You can save changes to this course run."
msgstr ""
#: templates/publisher/_approval_widget.html
msgid "Reviewed"
msgstr ""
......
......@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-17 15:19+0500\n"
"POT-Creation-Date: 2017-02-20 17:52+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: static/js/catalogs-change-form.js
msgid "Preview"
......
......@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-17 15:19+0500\n"
"POT-Creation-Date: 2017-02-20 17:52+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/api/filters.py
......@@ -1104,6 +1104,23 @@ msgid "APPROVALS"
msgstr "ÀPPRÖVÀLS Ⱡ'σяєм ιρѕυм ∂σł#"
#: templates/publisher/_approval_widget.html
#, python-format
msgid ""
"The %(link_start)s%(course_url)s%(link_middle)s parent course %(link_end)s "
"for this course run has changes that must be approved before you can submit "
"this course run for approval. You can save changes to this course run."
msgstr ""
"Thé %(link_start)s%(course_url)s%(link_middle)s pärént çöürsé %(link_end)s "
"för thïs çöürsé rün häs çhängés thät müst ßé äpprövéd ßéföré ýöü çän süßmït "
"thïs çöürsé rün för äppröväl. Ýöü çän sävé çhängés tö thïs çöürsé rün. "
"Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α∂ιριѕι¢ιηg єłιт, ѕє∂ ∂σ єιυѕмσ∂ "
"тємρσя ιη¢ι∂ι∂υηт υт łαвσяє єт ∂σłσяє мαgηα αłιqυα. υт єηιм α∂ мιηιм νєηιαм,"
" qυιѕ ησѕтяυ∂ єχєя¢ιтαтιση υłłαм¢σ łαвσяιѕ ηιѕι υт αłιqυιρ єχ єα ¢σммσ∂σ "
"¢σηѕєqυαт. ∂υιѕ αυтє ιяυяє ∂σłσя ιη яєρяєнєη∂єяιт ιη νσłυρтαтє νєłιт єѕѕє "
"¢ιłłυм ∂σłσяє єυ ƒυgιαт ηυłłα ραяιαтυя. єχ¢єρтєυя ѕιηт σ¢¢αє¢αт ¢υρι∂αтαт "
"ηση ρяσι∂єηт, ѕυηт ιη #"
#: templates/publisher/_approval_widget.html
msgid "Reviewed"
msgstr "Révïéwéd Ⱡ'σяєм ιρѕυм ∂#"
......
......@@ -7,14 +7,14 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-02-17 15:19+0500\n"
"POT-Creation-Date: 2017-02-20 17:52+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: static/js/catalogs-change-form.js
......
......@@ -594,3 +594,9 @@
font-weight: 600;
}
}
.parent-course-approval {
margin-bottom: 15px;
background-color: #F2F2F2;
padding: 20px;
}
......@@ -4,6 +4,18 @@
<div class="margin-top20">
<h5 class="hd-5 emphasized approvals-heading">{% trans "APPROVALS" %}</h5>
</div>
{% if is_course_run and not object.course.course_state.is_approved %}
<div class="parent-course-approval">
{% url 'publisher:publisher_course_detail' object.id as course_url %}
{% with link_start='<a href="' link_middle='">' link_end='</a>' %}
{% blocktrans trimmed %}
The {{ link_start }}{{ course_url }}{{ link_middle }} parent course {{ link_end }} for this course run has changes that must be approved before you can submit this course run for approval. You can save changes to this course run.
{% endblocktrans %}
{% endwith %}
</div>
{% endif %}
{% for role_widget in role_widgets %}
<div class="role-widget">
<div class="role-assignment-container">
......
......@@ -68,7 +68,9 @@
<aside id="right-panel" class="layout-col layout-col-a layout-col-a-custom">
<div id="approval-widget" class="approval-widget {% if not publisher_approval_widget_feature %}hidden{% endif %}">
{% with is_course_run=True %}
{% include 'publisher/course_run_detail/_widgets.html' %}
{% endwith %}
</div>
<div id="comments-widget" class="comment-container {% if not publisher_comment_widget_feature %}hidden{% endif %}">
{% include 'comments/add_auth_comments.html' %}
......
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