Commit 9296a555 by Asad Azam Committed by AsadAzam

Fixed Optional/Required Fields in Courses and Course Runs

parent 08eec630
......@@ -537,7 +537,7 @@ class CourseState(TimeStampedModel, ChangedByMixin):
return all([
course.title, course.number, course.short_description, course.full_description,
course.organizations.first(), course.level_type, course.expected_learnings,
course.prerequisites, course.primary_subject, course.image, course.course_team_admin
course.primary_subject, course.image, course.course_team_admin
])
@transition(field=name, source='*', target=CourseStateChoices.Draft)
......@@ -658,7 +658,9 @@ class CourseRunState(TimeStampedModel, ChangedByMixin):
course_run.course.course_state.is_approved, course_run.has_valid_seats, course_run.start, course_run.end,
course_run.pacing_type, course_run.has_valid_staff, course_run.is_valid_micromasters,
course_run.is_valid_professional_certificate, course_run.is_valid_xseries, course_run.language,
course_run.transcript_languages.all(), course_run.lms_course_id
course_run.transcript_languages.all(), course_run.lms_course_id, course_run.min_effort,
course_run.max_effort, course_run.video_language
])
def __str__(self):
......
......@@ -158,7 +158,7 @@
</div>
<div class="current prerequisites">
{% with object.prerequisites as field %}
{% include "publisher/_render_required_field.html" %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
<div class="show-diff"></div>
......
......@@ -219,7 +219,7 @@
</div>
</div>
<div class="field-title">{% trans "ESTIMATED EFFORT" %} <span class="optional float-right">Optional</span></div>
<div class="field-title">{% trans "ESTIMATED EFFORT" %} <span class="required float-right">* Required for review</span></div>
<div class="row">
<div class="col col-6">
{% trans "The number of hours per week the learner should expect to spend on the course. This may be a range." %}
......@@ -253,7 +253,7 @@
<label class="field-label ">{{ run_form.transcript_languages.label_tag }} <span class="required">*</span></label>
{{ run_form.transcript_languages}}
<label class="field-label margin-top20">{{ run_form.video_language.label_tag }}</label>
<label class="field-label margin-top20">{{ run_form.video_language.label_tag }} <span class="required">*</span></label>
{{ run_form.video_language}}
</div>
</div>
......
......@@ -95,7 +95,9 @@
{% if object.min_effort and object.max_effort %}
{{ object.min_effort }}-{{ object.max_effort }} {% trans "hours per week" %}
{% else %}
{% trans "(Optional) Not yet added" %}
{% with object.estimated_effort as field %}
{% include "publisher/_render_required_field.html" %}
{% endwith %}
{% endif %}
</div>
</div>
......@@ -128,7 +130,7 @@
</div>
<div>
{% with object.video_language as field %}
{% include "publisher/_render_optional_field.html" %}
{% include "publisher/_render_required_field.html" %}
{% endwith %}
</div>
</div>
......
......@@ -139,7 +139,9 @@
{% if object.min_effort and object.max_effort %}
{{ object.min_effort }} {% trans "to" %} {{ object.max_effort }} {% trans "hours per week" %}
{% else %}
{% trans "(Optional) Not yet added" %}
{% with object.estimated_effort as field %}
{% include "publisher/_render_required_field.html" %}
{% endwith %}
{% endif %}
</div>
</div>
......@@ -222,7 +224,7 @@
</div>
<div class="copy">
{% with object.prerequisite as field %}
{% include "publisher/_render_required_field.html" %}
{% include "publisher/_render_optional_field.html" %}
{% endwith %}
</div>
</div>
......
......@@ -87,7 +87,7 @@
</div>
<div class="copy">
{% with object.video_language as field %}
{% include "publisher/_render_optional_field.html" %}
{% include "publisher/_render_required_field.html" %}
{% endwith %}
</div>
</div>
......
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