Commit 6afded19 by Sylvia Pearce Committed by Waheed Ahmed

Updates to Publisher UI

parent 2d625f67
......@@ -96,11 +96,11 @@ class CustomCourseForm(CourseForm):
title = forms.CharField(label=_('Course Title'), required=True)
number = forms.CharField(label=_('Course Number'), required=True)
short_description = forms.CharField(
label=_('Brief Description'),
label=_('Short Description'),
widget=forms.Textarea, required=False, validators=[validate_text_count(max_length=255)]
)
full_description = forms.CharField(
label=_('Full Description'), widget=forms.Textarea, required=False,
label=_('Long Description'), widget=forms.Textarea, required=False,
validators=[validate_text_count(max_length=2500)]
)
prerequisites = forms.CharField(
......@@ -122,22 +122,23 @@ class CustomCourseForm(CourseForm):
)
secondary_subject = forms.ModelChoiceField(
queryset=subjects,
label=_('Secondary (optional)'),
label=_('Additional Subject (optional)'),
required=False
)
tertiary_subject = forms.ModelChoiceField(
queryset=subjects,
label=_('Tertiary (optional)'),
label=_('Additional Subject (optional)'),
required=False
)
level_type = forms.ModelChoiceField(
queryset=LevelType.objects.all().order_by('-name'),
label=_('Level'),
required=False
)
expected_learnings = forms.CharField(
label=_('Expected Learnings'), widget=forms.Textarea, required=False,
label=_('Expected Learning'), widget=forms.Textarea, required=False,
validators=[validate_text_count(max_length=2500)]
)
......@@ -237,6 +238,7 @@ class CustomCourseRunForm(CourseRunForm):
transcript_languages = forms.ModelMultipleChoiceField(
queryset=LanguageTag.objects.all(),
label=_('Transcript Languages'),
widget=LanguageModelSelect2Multiple(
url='language_tags:language-tag-autocomplete',
attrs={
......@@ -247,13 +249,13 @@ class CustomCourseRunForm(CourseRunForm):
)
is_xseries = forms.BooleanField(
label=_('Is XSeries?'),
label=_('XSeries'),
widget=forms.CheckboxInput,
required=False,
)
is_micromasters = forms.BooleanField(
label=_('Is MicroMasters?'),
label=_('MicroMasters'),
widget=forms.CheckboxInput,
required=False,
)
......@@ -261,6 +263,11 @@ class CustomCourseRunForm(CourseRunForm):
xseries_name = forms.CharField(label=_('XSeries Name'), required=False)
micromasters_name = forms.CharField(label=_('MicroMasters Name'), required=False)
lms_course_id = forms.CharField(label=_('Course Run Key'), required=False)
video_language = forms.ModelChoiceField(
queryset=LanguageTag.objects.all(),
label=_('Video Language'),
required=False
)
class Meta(CourseRunForm.Meta):
fields = (
......
......@@ -771,7 +771,7 @@ class CourseRunDetailTests(TestCase):
response = self.client.get(self.page_url)
self.assertIn('role_widgets', response.context)
self.assertContains(response, 'APPROVALS')
self.assertContains(response, 'REVIEWS')
def test_details_page_with_edit_permission(self):
""" Test that user can see edit button on course run detail page. """
......@@ -900,7 +900,7 @@ class CourseRunDetailTests(TestCase):
# Verify that content is sent for review and user can see Reviewed button as disabled.
self.assertContains(response, 'Send for Review')
self.assertContains(response, '0 day in ownership')
self.assertContains(response, 'days in ownership')
self.assertContains(response, self.get_expected_data(CourseRunStateChoices.Review, disabled=True))
self._data_for_review_button()
......@@ -1042,7 +1042,7 @@ class CourseRunDetailTests(TestCase):
assign_perm(OrganizationExtension.VIEW_COURSE, self.organization_extension.group, self.organization_extension)
response = self.client.get(self.page_url)
self.assertContains(response, 'COURSE PREVIEW')
self.assertContains(response, 'ABOUT PAGE PREVIEW')
self.assertContains(response, '<button class="btn btn-neutral btn-preview btn-preview-accept" type="button">')
self.assertContains(response, '<button class="btn btn-neutral btn-preview btn-preview-decline" type="button">')
self.assertContains(response, 'Reason for declining preview:')
......@@ -1060,7 +1060,7 @@ class CourseRunDetailTests(TestCase):
self.assertNotContains(
response, '<button class="btn btn-neutral btn-preview btn-preview-decline" type="button">'
)
self.assertContains(response, 'Approved')
self.assertContains(response, 'Accepted')
def test_course_preview(self):
"""Verify that publisher user can see preview widget."""
......@@ -1074,7 +1074,7 @@ class CourseRunDetailTests(TestCase):
preview_api_url = reverse('publisher:api:update_course_run', args=[self.course_run.id])
response = self.client.get(self.page_url)
self.assertContains(response, 'COURSE PREVIEW')
self.assertContains(response, 'ABOUT PAGE PREVIEW')
self.assertContains(
response,
'<button data-url="{url}" class="btn btn-neutral btn-edit-preview-url">'.format(url=preview_api_url)
......@@ -1085,7 +1085,7 @@ class CourseRunDetailTests(TestCase):
self.course_run.save()
response = self.client.get(self.page_url)
self.assertContains(response, 'COURSE PREVIEW')
self.assertContains(response, 'ABOUT PAGE PREVIEW')
self.assertContains(
response,
'<button data-url="{url}" class="btn btn-neutral btn-save-preview-url">'.format(url=preview_api_url)
......@@ -1751,8 +1751,8 @@ class CourseDetailViewTests(TestCase):
assign_perm(OrganizationExtension.VIEW_COURSE, self.organization_extension.group, self.organization_extension)
response = self.client.get(self.detail_page_url)
self.assertContains(response, 'APPROVALS')
self.assertContains(response, '0 day in ownership')
self.assertContains(response, 'REVIEWS')
self.assertContains(response, 'days in ownership')
self.assertContains(response, 'Send for Review')
self.assertContains(response, self.user.full_name)
# Verify that `Send for Review` button is disabled
......
......@@ -213,7 +213,7 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi
course_form = CustomCourseForm
run_form = CustomCourseRunForm
seat_form = CustomSeatForm
template_name = 'publisher/add_update_course_form.html'
template_name = 'publisher/add_course_form.html'
success_url = 'publisher:publisher_course_detail'
def get_success_url(self, course_id): # pylint: disable=arguments-differ
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 11:56-0400\n"
"POT-Creation-Date: 2017-04-27 12:23+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"
......
......@@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-04-20 11:56-0400\n"
"POT-Creation-Date: 2017-04-27 12:23+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"
......
......@@ -12,22 +12,22 @@
<img src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==" class="select-image" />
<input name="staff-image" id="staffImageSelect" type="file" accept="image/*" onchange="loadSelectedImage(this);">
</div>
<label class="field-label" for="given-name">{% trans "Name" %}:
<label class="field-label" for="given-name">{% trans "First Name" %}
<span class="required">* {% trans "required" %}</span>
</label>
<input class="field-input input-text" type="text" id="given-name" name="given-name" />
<label class="field-label" for="family-name">{% trans "Family Name" %}:
<label class="field-label" for="family-name">{% trans "Last Name" %}
<span class="required">* {% trans "required" %}</span>
</label>
<input class="field-input input-text" type="text" id="family-name" name="family-name" />
<label class="field-label" for="title">{% trans "Title" %}:
<label class="field-label" for="title">{% trans "Title" %}
<span class="required">* {% trans "required" %}</span>
</label>
<input class="field-input input-text" type="text" id="title" name="title" />
<label class="field-label">{% trans "Organization" %}:
<label class="field-label">{% trans "Organization" %}
<span class="required">* {% trans "required" %}</span>
</label>
......@@ -45,27 +45,27 @@
{% endif %}
{% endif %}
<label class="field-label" for="bio">{% trans "Bio" %}:
<label class="field-label" for="bio">{% trans "Bio" %}
<span class="required">* {% trans "required" %}</span>
</label>
<textarea class="field-textarea input-textarea textarea-medium textarea-block" id="bio" name="bio"></textarea>
<label class="field-label" for="facebook">{% trans "Facebook URL" %}:
<label class="field-label" for="facebook">{% trans "Facebook URL" %}
<span class="optional">* {% trans "optional" %}</span>
</label>
<input class="field-input input-text" type="text" id="facebook" name="facebook" />
<label class="field-label" for="twitter">{% trans "Twitter URL" %}:
<label class="field-label" for="twitter">{% trans "Twitter URL" %}
<span class="optional">* {% trans "optional" %}</span>
</label>
<input class="field-input input-text" type="text" id="twitter" name="twitter" />
<label class="field-label" for="blog">{% trans "Blog URL" %}:
<label class="field-label" for="blog">{% trans "Blog URL" %}
<span class="optional">* {% trans "optional" %}</span>
</label>
<input class="field-input input-text" type="text" id="blog" name="blog" />
<label class="field-label" for="majorWorks">{% trans "Major Works" %}:
<label class="field-label" for="majorWorks">{% trans "Major Works" %}
<span class="optional">({% trans "optional - one per line" %} )</span>
</label>
<textarea class="field-textarea input-textarea textarea-medium textarea-block" id="majorWorks" name="major-works"></textarea>
......
{% load i18n %}
<div class="approval-widget">
<h5 class="hd-5 emphasized approvals-heading">{% trans "APPROVALS" %}</h5>
<h5 class="hd-5 emphasized approvals-heading">{% trans "REVIEWS" %}</h5>
{% if is_course_run and not object.course.course_state.is_approved %}
<div class="parent-course-approval">
{% url 'publisher:publisher_course_detail' object.course.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.
{% blocktrans with course_name=object.course.title trimmed %}
You can currently edit information for this course run. However, before you can submit this course run for review, you must finalize the information for {{ link_start }}{{ course_url }}{{ link_middle }}{{ course_name }}{{ link_end }} with edX.
{% endblocktrans %}
{% endwith %}
</div>
......@@ -30,7 +30,7 @@
{% elif preview_accepted_date %}
<span class="state-status">
<span class="icon fa fa-check" aria-hidden="true"></span>
{% trans "Approved" %}<br>
{% trans "Accepted" %}<br>
{{ preview_accepted_date|date:'m/d/y H:i a' }}
</span>
{% if object.course_run_state.is_ready_to_publish and object.course.publisher == request.user %}
......@@ -48,18 +48,18 @@
</div>
<div class="layout-col layout-col-b">
<span class="preview-heading">
<strong>{% trans "COURSE PREVIEW" %}</strong>
<strong>{% trans "ABOUT PAGE PREVIEW" %}</strong>
</span>
<div class="preview-url">
{% if object.preview_url %}
<span class="preview-url-heading">{% trans "Preview URL" %} - </span>
<a href="{{ object.preview_url }}" target="_blank">{% trans "View course preview live" %}</a>
<a href="{{ object.preview_url }}" target="_blank">{% trans "View About page preview" %}</a>
{% else %}
{% if object.course.publisher == request.user %}
<input id="id-review-url" type="text">
<span class="error-message"></span>
{% else %}
<span>{% trans "Not available" %}</span>
<span>{% trans "About page preview not available" %}</span>
{% endif %}
{% endif %}
</div>
......@@ -98,7 +98,13 @@
<strong>{{ role_widget.heading }}</strong>
</span>
{% if role_widget.ownership %}
<span class="ownership-label">{{ role_widget.ownership.days }} {% trans "day in ownership" %}</span>
<span class="ownership-label">{{ role_widget.ownership.days }}
{% if role_widget.ownership.days == 1 %}
{% trans "day in ownership" %}
{% else %}
{% trans "days in ownership" %}
{% endif %}
</span>
{% endif %}
<div class="role-assignment-container">
<div id="userRoleContainer-{{ role_widget.course_role.role }}">
......
......@@ -13,8 +13,8 @@
<p>
{% url 'publisher:publisher_course_detail' parent_course.id as course_url %}
{% with link_start='<a href="' link_middle='">' link_end='</a>' %}
{% blocktrans %}
The fields below will only affect this new course run. If you feel the need edit information from the parent course then you may do so on the {{ link_start }}{{ course_url }}{{ link_middle }}parent course for this run{{ link_end }}.
{% blocktrans with course_name=parent_course.title %}
The information on this page applies only to this course run. To make changes to all course runs for this course, go to the {{ link_start }}{{ course_url }}{{ link_middle }}{{ course_name }}{{ link_end }} page.
{% endblocktrans %}
{% endwith %}
</p>
......@@ -27,11 +27,8 @@
<div class="course-form">
<div class="course-information">
<div class="copy-base">
<p>
{% blocktrans %}
The information in this section is required to create a course studio instance. You must fill all required information but are welcome to come back and enter the rest of the information when you are ready to announce the course, or you can do it all at once if you are ready to do so.
{% endblocktrans%}
</p>
<p>{% trans "The following information is required before edX can create a Studio URL for this course run." %} </p>
<p>{% trans "After you create this course run, you can add more information on the course run page." %}</p>
</div>
<fieldset class="form-group grid-container grid-manual">
<div class="field-title">{% trans "COURSE START DATE" %}</div>
......
......@@ -50,7 +50,7 @@
<div class="info-item history-field-container">
<div class="heading">
{% trans "Brief Description" %}
{% trans "Short Description" %}
</div>
<div class="current short_description">
{% with object.short_description as field %}
......@@ -62,7 +62,7 @@
<div class="info-item history-field-container">
<div class="heading">
{% trans "Full Description" %}
{% trans "Long Description" %}
</div>
<div class="current full_description">
{% with object.full_description as field %}
......@@ -74,7 +74,7 @@
<div class="info-item history-field-container">
<div class="heading">
{% trans "Expected Learnings" %}
{% trans "Expected Learning" %}
</div>
<div class="current expected_learnings">
{% with object.expected_learnings as field %}
......@@ -98,7 +98,7 @@
<div class="info-item history-field-container">
<div class="heading">
{% trans "Secondary Subject" %}
{% trans "Additional Subject" %}
</div>
<div class="current secondary_subject">
{% with object.secondary_subject as field %}
......@@ -110,7 +110,7 @@
<div class="info-item history-field-container">
<div class="heading">
{% trans "Tertiary Subject" %}
{% trans "Additional Subject" %}
</div>
<div class="current tertiary_subject">
{% with object.tertiary_subject as field %}
......@@ -183,7 +183,7 @@
</div>
<div class="info-item history-field-container">
<div class="heading">{% trans "Video Link" %}
<div class="heading">{% trans "About Video Link" %}
</div>
{% with object.video_link as value %}
{% if value %}
......
......@@ -43,7 +43,7 @@
<div class="field-container">
<div class="field-title">{% trans "Brief Description" %}</div>
<div class="field-title">{% trans "Short Description" %}</div>
<span class="object">{{ object.short_description }}</span>
<span class="history-object">
{% with history_object.short_description as field %}
......@@ -55,7 +55,7 @@
<div class="field-container">
<div class="field-title">{% trans "Full Description" %}</div>
<div class="field-title">{% trans "Long Description" %}</div>
<span class="object">{{ object.full_description }}</span>
<span class="history-object">
{% with history_object.full_description as field %}
......@@ -67,7 +67,7 @@
</div>
<div class="field-container">
<div class="field-title">{% trans "Expected Learnings" %}</div>
<div class="field-title">{% trans "Expected Learning" %}</div>
<span class="object">{{ object.expected_learnings }}</span>
<span class="history-object">
{% with history_object.expected_learnings as field %}
......@@ -89,7 +89,7 @@
</div>
<div class="field-container">
<div class="field-title">{% trans "Secondary Subject" %}</div>
<div class="field-title">{% trans "Additional Subject" %}</div>
<span class="object">{{ object.secondary_subject }}</span>
<span class="history-object">
{% with history_object.secondary_subject as field %}
......@@ -100,7 +100,7 @@
</div>
<div class="field-container">
<div class="field-title">{% trans "Tertiary Subject" %}</div>
<div class="field-title">{% trans "Additional Subject" %}</div>
<span class="object">{{ object.tertiary_subject }}</span>
<span class="history-object">
{% with history_object.tertiary_subject as field %}
......@@ -155,7 +155,7 @@
</div>
<div class="field-container">
<div class="field-title">{% trans "Video Link" %}</div>
<div class="field-title">{% trans "About Video Link" %}</div>
<span class="object">{{ object.video_link }}</span>
<span class="history-object">{{ history_object.video_link }}</span>
<span class="show-diff"></span>
......
......@@ -80,10 +80,10 @@
</div>
</div>
<div class="field-title">{% trans "STUDIO INSTANCE" %}</div>
<div class="field-title">{% trans "STUDIO URL" %}</div>
<div class="row">
<div class="col col-6 help-text">
<p>{% trans "This is the course studio URL." %}</p>
<p>{% trans "The Studio URL for this course run." %}</p>
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.lms_course_id.label_tag }} <span class="required">*</span></label>
......@@ -108,7 +108,7 @@
<div class="field-title">{% trans "PROGRAM ASSOCIATION" %}</div>
<div class="row">
<div class="col col-6 help-text">
{% trans "If this course is part of a program, select the program type and enter the name of the program." %}
{% trans "If this course is part of a program, select the program type, and then enter the name of the program." %}
</div>
<div class="col col-6">
<div class="row">
......@@ -177,7 +177,7 @@
<div class="field-title">{% trans "COURSE STAFF" %}</div>
<div class="row">
<div class="col col-6 help-text">
{% trans "The primary instructor or instructors in the course videos." %}
{% trans "The primary instructor or instructors for the course." %}
</div>
<div class="col col-6 instructor-select">
<label class="field-label ">{{ run_form.staff.label_tag }}</label>
......@@ -212,7 +212,7 @@
<div class="field-title">{% trans "LANGUAGE(S)" %}</div>
<div class="row">
<div class="col col-6 help-text">
{% trans "The languages available for videos, video transcripts, and course content other than videos and transcripts." %}
{% trans "The languages available for videos, video transcripts, and other course content." %}
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.language.label_tag }}</label>
......
......@@ -70,7 +70,7 @@
$(document).ready(function() {
$('#dataTableCourse').DataTable({
"autoWidth": false,
"oLanguage": { "sEmptyTable": gettext("Looks like you haven't created any course yet") }
"oLanguage": { "sEmptyTable": gettext("No courses have been created.") }
});
});
</script>
......
......@@ -30,7 +30,7 @@
{% endif %}
<li role="tab" id="tab-published" class="tab" aria-selected="false" aria-expanded="false"
aria-controls="published" tabindex="-1">
<span>{{ published_count }}</span>{% trans "PUBLISHED COURSE RUNS" %}
<span>{{ published_count }}</span>{% trans "PUBLISHED ABOUT PAGES" %}
</li>
</ul>
......
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