Commit 6d716199 by Waheed Ahmed Committed by Awais Qureshi

Added studio instance widget on course run edit.

ECOM-6068
parent 4fb3e077
...@@ -52,15 +52,16 @@ def send_email_for_change_state(course_run): ...@@ -52,15 +52,16 @@ def send_email_for_change_state(course_run):
logger.exception('Failed to send email notifications for change state of course-run %s', course_run.id) logger.exception('Failed to send email notifications for change state of course-run %s', course_run.id)
def send_email_for_studio_instance_created(course_run): def send_email_for_studio_instance_created(course_run, updated_text=_('created')):
""" Send an email to course team on studio instance creation. """ Send an email to course team on studio instance creation.
Arguments: Arguments:
course_run (CourseRun): CourseRun object course_run (CourseRun): CourseRun object
updated_text (String): String object
""" """
try: try:
object_path = reverse('publisher:publisher_course_run_detail', kwargs={'pk': course_run.id}) object_path = reverse('publisher:publisher_course_run_detail', kwargs={'pk': course_run.id})
subject = _('Studio instance created') subject = _('Studio instance {updated_text}').format(updated_text=updated_text) # pylint: disable=no-member
to_addresses = course_run.course.get_course_users_emails() to_addresses = course_run.course.get_course_users_emails()
from_address = settings.PUBLISHER_FROM_EMAIL from_address = settings.PUBLISHER_FROM_EMAIL
...@@ -70,6 +71,7 @@ def send_email_for_studio_instance_created(course_run): ...@@ -70,6 +71,7 @@ def send_email_for_studio_instance_created(course_run):
partner_coordinator = course_user_roles.filter(role=PublisherUserRole.PartnerCoordinator).first() partner_coordinator = course_user_roles.filter(role=PublisherUserRole.PartnerCoordinator).first()
context = { context = {
'updated_text': updated_text,
'course_run': course_run, 'course_run': course_run,
'course_run_page_url': 'https://{host}{path}'.format( 'course_run_page_url': 'https://{host}{path}'.format(
host=Site.objects.get_current().domain.strip('/'), path=object_path host=Site.objects.get_current().domain.strip('/'), path=object_path
......
...@@ -4,7 +4,10 @@ Course publisher forms. ...@@ -4,7 +4,10 @@ Course publisher forms.
from dal import autocomplete from dal import autocomplete
from django import forms from django import forms
from django.template.loader import render_to_string from django.template.loader import render_to_string
from django.core.exceptions import ValidationError
from django.utils.translation import ugettext_lazy as _ from django.utils.translation import ugettext_lazy as _
from opaque_keys import InvalidKeyError
from opaque_keys.edx.keys import CourseKey
from course_discovery.apps.course_metadata.choices import CourseRunPacing from course_discovery.apps.course_metadata.choices import CourseRunPacing
from course_discovery.apps.course_metadata.models import Person, Organization, Subject from course_discovery.apps.course_metadata.models import Person, Organization, Subject
...@@ -245,13 +248,14 @@ class CustomCourseRunForm(CourseRunForm): ...@@ -245,13 +248,14 @@ class CustomCourseRunForm(CourseRunForm):
xseries_name = forms.CharField(label=_('XSeries Name'), required=False) xseries_name = forms.CharField(label=_('XSeries Name'), required=False)
micromasters_name = forms.CharField(label=_('MicroMasters Name'), required=False) micromasters_name = forms.CharField(label=_('MicroMasters Name'), required=False)
lms_course_id = forms.CharField(label=_('Course Run Key'), required=False)
class Meta(CourseRunForm.Meta): class Meta(CourseRunForm.Meta):
fields = ( fields = (
'length', 'transcript_languages', 'language', 'min_effort', 'max_effort', 'length', 'transcript_languages', 'language', 'min_effort', 'max_effort',
'contacted_partner_manager', 'target_content', 'pacing_type', 'video_language', 'contacted_partner_manager', 'target_content', 'pacing_type', 'video_language',
'staff', 'start', 'end', 'is_xseries', 'xseries_name', 'is_micromasters', 'staff', 'start', 'end', 'is_xseries', 'xseries_name', 'is_micromasters',
'micromasters_name', 'micromasters_name', 'lms_course_id',
) )
def save(self, commit=True, course=None, changed_by=None): # pylint: disable=arguments-differ def save(self, commit=True, course=None, changed_by=None): # pylint: disable=arguments-differ
...@@ -268,6 +272,19 @@ class CustomCourseRunForm(CourseRunForm): ...@@ -268,6 +272,19 @@ class CustomCourseRunForm(CourseRunForm):
return course_run return course_run
def clean_lms_course_id(self):
lms_course_id = self.cleaned_data['lms_course_id']
if lms_course_id:
try:
CourseKey.from_string(lms_course_id)
except InvalidKeyError:
raise ValidationError("Invalid course key.")
return lms_course_id
return None
class SeatForm(BaseCourseForm): class SeatForm(BaseCourseForm):
""" Course Seat Form. """ """ Course Seat Form. """
......
...@@ -70,10 +70,7 @@ class FormValidMixin(object): ...@@ -70,10 +70,7 @@ class FormValidMixin(object):
def check_roles_access(user): def check_roles_access(user):
""" Return True if user is part of a role that gives implicit access. """ """ Return True if user is part of a role that gives implicit access. """
if is_publisher_admin(user) or is_internal_user(user): return is_publisher_admin(user) or is_internal_user(user)
return True
return False
def check_course_organization_permission(user, course, permission): def check_course_organization_permission(user, course, permission):
......
...@@ -108,6 +108,7 @@ class CreateCourseViewTests(TestCase): ...@@ -108,6 +108,7 @@ class CreateCourseViewTests(TestCase):
course_dict = model_to_dict(self.course) course_dict = model_to_dict(self.course)
course_dict['number'] = 'test course' course_dict['number'] = 'test course'
course_dict['image'] = '' course_dict['image'] = ''
course_dict['lms_course_id'] = ''
response = self.client.post(reverse('publisher:publisher_courses_new'), course_dict) response = self.client.post(reverse('publisher:publisher_courses_new'), course_dict)
self.assertEqual(response.status_code, 400) self.assertEqual(response.status_code, 400)
...@@ -381,7 +382,9 @@ class CreateCourseRunViewTests(TestCase): ...@@ -381,7 +382,9 @@ class CreateCourseRunViewTests(TestCase):
post_data = model_to_dict(self.course) post_data = model_to_dict(self.course)
post_data.update(self.course_run_dict) post_data.update(self.course_run_dict)
post_data.update(factory.build(dict, FACTORY_CLASS=factories.SeatFactory)) post_data.update(factory.build(dict, FACTORY_CLASS=factories.SeatFactory))
self._pop_valuse_from_dict(post_data, ['id', 'upgrade_deadline', 'image', 'team_admin', 'start']) self._pop_valuse_from_dict(
post_data, ['id', 'upgrade_deadline', 'image', 'team_admin', 'start', 'lms_course_id']
)
response = self.client.post( response = self.client.post(
reverse('publisher:publisher_course_runs_new', kwargs={'parent_course_id': self.course.id}), reverse('publisher:publisher_course_runs_new', kwargs={'parent_course_id': self.course.id}),
...@@ -421,7 +424,7 @@ class CreateCourseRunViewTests(TestCase): ...@@ -421,7 +424,7 @@ class CreateCourseRunViewTests(TestCase):
'price': new_price 'price': new_price
} }
) )
self._pop_valuse_from_dict(post_data, ['id', 'course', 'course_run']) self._pop_valuse_from_dict(post_data, ['id', 'course', 'course_run', 'lms_course_id'])
assign_perm( assign_perm(
OrganizationExtension.VIEW_COURSE_RUN, self.organization_extension.group, self.organization_extension OrganizationExtension.VIEW_COURSE_RUN, self.organization_extension.group, self.organization_extension
) )
...@@ -1703,6 +1706,7 @@ class CourseRunEditViewTests(TestCase): ...@@ -1703,6 +1706,7 @@ class CourseRunEditViewTests(TestCase):
course_dict.pop('video_language') course_dict.pop('video_language')
course_dict.pop('end') course_dict.pop('end')
course_dict.pop('priority') course_dict.pop('priority')
course_dict['lms_course_id'] = ''
course_dict['start'] = self.start_date_time course_dict['start'] = self.start_date_time
course_dict['end'] = self.end_date_time course_dict['end'] = self.end_date_time
course_dict['organization'] = self.organization_extension.organization.id course_dict['organization'] = self.organization_extension.organization.id
...@@ -1910,3 +1914,67 @@ class CourseRunEditViewTests(TestCase): ...@@ -1910,3 +1914,67 @@ class CourseRunEditViewTests(TestCase):
'The following course run has been submitted for {{ state }}'.format( 'The following course run has been submitted for {{ state }}'.format(
state=course_run.state.name state=course_run.state.name
) )
def test_studio_instance_on_edit_page(self):
"""
Verify that internal users can update course key from edit page.
"""
response = self.client.get(self.edit_page_url)
self.assertContains(response, 'Course Run Key')
self.assertContains(response, 'name="lms_course_id"')
self.updated_dict['lms_course_id'] = 'course-v1:edxTest+Test342+2016Q1'
response = self.client.post(self.edit_page_url, self.updated_dict)
self.assertRedirects(
response,
expected_url=reverse('publisher:publisher_course_run_detail', kwargs={'pk': self.new_course_run.id}),
status_code=302,
target_status_code=200
)
self.new_course_run = CourseRun.objects.get(id=self.new_course_run.id)
self.assertEqual(self.new_course_run.lms_course_id, self.updated_dict['lms_course_id'])
self.assert_email_sent(
reverse('publisher:publisher_course_run_detail', kwargs={'pk': self.new_course_run.id}),
'Studio instance updated',
'EdX has updated a Studio instance for '
)
def assert_email_sent(self, object_path, subject, expected_body):
"""
DRY method to assert sent email data.
"""
self.assertEqual(len(mail.outbox), 2)
self.assertEqual(str(mail.outbox[1].subject), subject)
body = mail.outbox[1].body.strip()
self.assertIn(expected_body, body)
page_url = 'https://{host}{path}'.format(host=Site.objects.get_current().domain.strip('/'), path=object_path)
self.assertIn(page_url, body)
def test_studio_instance_with_course_team(self):
"""
Verify that non internal users cannot see course key field.
"""
non_internal_user, __ = create_non_staff_user_and_login(self)
non_internal_user.groups.add(self.organization_extension.group)
assign_perm(
OrganizationExtension.EDIT_COURSE_RUN, self.organization_extension.group, self.organization_extension
)
response = self.client.get(self.edit_page_url)
self.assertNotContains(response, 'name="lms_course_id"')
self.assertContains(response, 'Course Run Key')
self.assertContains(response, 'STUDIO URL')
self.assertContains(response, 'Not yet created')
self.new_course_run.lms_course_id = 'course-v1:edxTest+Test342+2016Q1'
self.new_course_run.save()
response = self.client.get(self.edit_page_url)
self.assertContains(response, self.new_course_run.lms_course_id)
...@@ -18,7 +18,7 @@ from guardian.shortcuts import get_objects_for_user ...@@ -18,7 +18,7 @@ from guardian.shortcuts import get_objects_for_user
from course_discovery.apps.core.models import User from course_discovery.apps.core.models import User
from course_discovery.apps.publisher.choices import PublisherUserRole from course_discovery.apps.publisher.choices import PublisherUserRole
from course_discovery.apps.publisher.emails import send_email_for_course_creation from course_discovery.apps.publisher import emails
from course_discovery.apps.publisher.forms import ( from course_discovery.apps.publisher.forms import (
SeatForm, CustomCourseForm, CustomCourseRunForm, SeatForm, CustomCourseForm, CustomCourseRunForm,
CustomSeatForm, UpdateCourseForm CustomSeatForm, UpdateCourseForm
...@@ -252,7 +252,7 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi ...@@ -252,7 +252,7 @@ class CreateCourseView(mixins.LoginRequiredMixin, mixins.PublisherUserRequiredMi
'{email} when the Studio instance has been created.').format(email=request.user.email)) '{email} when the Studio instance has been created.').format(email=request.user.email))
# sending email for notifying new course is created. # sending email for notifying new course is created.
send_email_for_course_creation(course, run_course) emails.send_email_for_course_creation(course, run_course)
return HttpResponseRedirect(self.get_success_url(run_course.id)) return HttpResponseRedirect(self.get_success_url(run_course.id))
except Exception as e: # pylint: disable=broad-except except Exception as e: # pylint: disable=broad-except
...@@ -458,6 +458,7 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix ...@@ -458,6 +458,7 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix
'organization_name': organization.name, 'organization_name': organization.name,
'organization': organization, 'organization': organization,
'publisher_hide_features_for_pilot': waffle.switch_is_active('publisher_hide_features_for_pilot'), 'publisher_hide_features_for_pilot': waffle.switch_is_active('publisher_hide_features_for_pilot'),
'is_internal_user': mixins.check_roles_access(self.request.user),
'edit_mode': True, 'edit_mode': True,
} }
...@@ -491,6 +492,7 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix ...@@ -491,6 +492,7 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix
context = self.get_context_data() context = self.get_context_data()
course_run = context.get('course_run') course_run = context.get('course_run')
lms_course_id = course_run.lms_course_id
course_form = self.course_form( course_form = self.course_form(
request.POST, request.FILES, request.POST, request.FILES,
...@@ -523,6 +525,9 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix ...@@ -523,6 +525,9 @@ class CourseRunEditView(mixins.LoginRequiredMixin, mixins.PublisherPermissionMix
if course_run.state.name != State.DRAFT: if course_run.state.name != State.DRAFT:
course_run.change_state(user=user) course_run.change_state(user=user)
if lms_course_id != course_run.lms_course_id:
emails.send_email_for_studio_instance_created(course_run, updated_text=_('updated'))
# pylint: disable=no-member # pylint: disable=no-member
messages.success(request, _('Course run updated successfully.')) messages.success(request, _('Course run updated successfully.'))
return HttpResponseRedirect(reverse(self.success_url, kwargs={'pk': course_run.id})) return HttpResponseRedirect(reverse(self.success_url, kwargs={'pk': course_run.id}))
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 12:46+0500\n" "POT-Creation-Date: 2017-01-27 13:02+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: apps/api/filters.py #: apps/api/filters.py
#, python-brace-format #, python-brace-format
...@@ -452,7 +452,12 @@ msgid "Course Run {title}-{pacing_type}-{start} state has been changed." ...@@ -452,7 +452,12 @@ msgid "Course Run {title}-{pacing_type}-{start} state has been changed."
msgstr "" msgstr ""
#: apps/publisher/emails.py #: apps/publisher/emails.py
msgid "Studio instance created" msgid "created"
msgstr ""
#: apps/publisher/emails.py
#, python-brace-format
msgid "Studio instance {updated_text}"
msgstr "" msgstr ""
#: apps/publisher/emails.py #: apps/publisher/emails.py
...@@ -554,6 +559,10 @@ msgid "MicroMasters Name" ...@@ -554,6 +559,10 @@ msgid "MicroMasters Name"
msgstr "" msgstr ""
#: apps/publisher/forms.py #: apps/publisher/forms.py
msgid "Course Run Key"
msgstr ""
#: apps/publisher/forms.py
msgid "Only audit seat can be without price." msgid "Only audit seat can be without price."
msgstr "" msgstr ""
...@@ -723,6 +732,10 @@ msgid "There was an error saving course run, {error}" ...@@ -723,6 +732,10 @@ msgid "There was an error saving course run, {error}"
msgstr "" msgstr ""
#: apps/publisher/views.py #: apps/publisher/views.py
msgid "updated"
msgstr ""
#: apps/publisher/views.py
msgid "Course run updated successfully." msgid "Course run updated successfully."
msgstr "" msgstr ""
...@@ -1254,6 +1267,24 @@ msgid "" ...@@ -1254,6 +1267,24 @@ msgid ""
msgstr "" msgstr ""
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
msgid "STUDIO INSTANCE"
msgstr ""
#: templates/publisher/add_update_course_form.html
msgid "This is the course studio URL."
msgstr ""
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_detail/_widgets.html
msgid "STUDIO URL"
msgstr ""
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_detail/_widgets.html
msgid "Not yet created"
msgstr ""
#: templates/publisher/add_update_course_form.html
msgid "PROGRAM ASSOCIATION" msgid "PROGRAM ASSOCIATION"
msgstr "" msgstr ""
...@@ -1604,14 +1635,6 @@ msgid "" ...@@ -1604,14 +1635,6 @@ msgid ""
" " " "
msgstr "" msgstr ""
#: templates/publisher/course_detail/_widgets.html
msgid "STUDIO URL"
msgstr ""
#: templates/publisher/course_detail/_widgets.html
msgid "Not yet created"
msgstr ""
#: templates/publisher/course_edit_form.html #: templates/publisher/course_edit_form.html
msgid "UPDATE COURSE" msgid "UPDATE COURSE"
msgstr "" msgstr ""
...@@ -2239,7 +2262,7 @@ msgstr "" ...@@ -2239,7 +2262,7 @@ msgstr ""
#: templates/publisher/email/studio_instance_created.html #: templates/publisher/email/studio_instance_created.html
#, python-format #, python-format
msgid "" msgid ""
"EdX has created a Studio instance for " "EdX has %(updated_text)s a Studio instance for "
"%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s " "%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s "
"%(link_end)s. You can now edit this course and configure your course team in" "%(link_end)s. You can now edit this course and configure your course team in"
" Studio." " Studio."
...@@ -2302,7 +2325,7 @@ msgstr "" ...@@ -2302,7 +2325,7 @@ msgstr ""
#: templates/publisher/email/studio_instance_created.txt #: templates/publisher/email/studio_instance_created.txt
#, python-format #, python-format
msgid "" msgid ""
"EdX has created a Studio instance for %(course_name)s: " "EdX has %(updated_text)s a Studio instance for %(course_name)s: "
"%(course_run_page_url)s. You can now edit this course in Studio." "%(course_run_page_url)s. You can now edit this course in Studio."
msgstr "" msgstr ""
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 12:46+0500\n" "POT-Creation-Date: 2017-01-27 13:02+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
#: static/js/catalogs-change-form.js #: static/js/catalogs-change-form.js
msgid "Preview" msgid "Preview"
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 12:46+0500\n" "POT-Creation-Date: 2017-01-27 13:02+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: apps/api/filters.py #: apps/api/filters.py
...@@ -564,8 +564,13 @@ msgstr "" ...@@ -564,8 +564,13 @@ msgstr ""
"ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#" "ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя α#"
#: apps/publisher/emails.py #: apps/publisher/emails.py
msgid "Studio instance created" msgid "created"
msgstr "Stüdïö ïnstänçé çréätéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σ#" msgstr "çréätéd Ⱡ'σяєм ιρѕυм #"
#: apps/publisher/emails.py
#, python-brace-format
msgid "Studio instance {updated_text}"
msgstr "Stüdïö ïnstänçé {updated_text} Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#"
#: apps/publisher/emails.py #: apps/publisher/emails.py
#, python-brace-format #, python-brace-format
...@@ -668,6 +673,10 @@ msgid "MicroMasters Name" ...@@ -668,6 +673,10 @@ msgid "MicroMasters Name"
msgstr "MïçröMästérs Nämé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#" msgstr "MïçröMästérs Nämé Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмє#"
#: apps/publisher/forms.py #: apps/publisher/forms.py
msgid "Course Run Key"
msgstr "Çöürsé Rün Kéý Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт#"
#: apps/publisher/forms.py
msgid "Only audit seat can be without price." msgid "Only audit seat can be without price."
msgstr "" msgstr ""
"Önlý äüdït séät çän ßé wïthöüt prïçé. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, " "Önlý äüdït séät çän ßé wïthöüt prïçé. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, "
...@@ -866,6 +875,10 @@ msgstr "" ...@@ -866,6 +875,10 @@ msgstr ""
"¢σηѕє¢тєтυя #" "¢σηѕє¢тєтυя #"
#: apps/publisher/views.py #: apps/publisher/views.py
msgid "updated"
msgstr "üpdätéd Ⱡ'σяєм ιρѕυм #"
#: apps/publisher/views.py
msgid "Course run updated successfully." msgid "Course run updated successfully."
msgstr "" msgstr ""
"Çöürsé rün üpdätéd süççéssfüllý. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тє#" "Çöürsé rün üpdätéd süççéssfüllý. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тє#"
...@@ -1496,6 +1509,24 @@ msgstr "" ...@@ -1496,6 +1509,24 @@ msgstr ""
"éndïng süçh äs .1x ör .2x. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #" "éndïng süçh äs .1x ör .2x. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, #"
#: templates/publisher/add_update_course_form.html #: templates/publisher/add_update_course_form.html
msgid "STUDIO INSTANCE"
msgstr "STÛDÌÖ ÌNSTÀNÇÉ Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт α#"
#: templates/publisher/add_update_course_form.html
msgid "This is the course studio URL."
msgstr "Thïs ïs thé çöürsé stüdïö ÛRL. Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢т#"
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_detail/_widgets.html
msgid "STUDIO URL"
msgstr "STÛDÌÖ ÛRL Ⱡ'σяєм ιρѕυм ∂σłσ#"
#: templates/publisher/add_update_course_form.html
#: templates/publisher/course_detail/_widgets.html
msgid "Not yet created"
msgstr "Nöt ýét çréätéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт α#"
#: templates/publisher/add_update_course_form.html
msgid "PROGRAM ASSOCIATION" msgid "PROGRAM ASSOCIATION"
msgstr "PRÖGRÀM ÀSSÖÇÌÀTÌÖN Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#" msgstr "PRÖGRÀM ÀSSÖÇÌÀTÌÖN Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт,#"
...@@ -1938,14 +1969,6 @@ msgstr "" ...@@ -1938,14 +1969,6 @@ msgstr ""
" Çréätéd %(created_date)s ät %(created_time)s ßý %(created_by)s\n" " Çréätéd %(created_date)s ät %(created_time)s ßý %(created_by)s\n"
" Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя#" " Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢тєтυя#"
#: templates/publisher/course_detail/_widgets.html
msgid "STUDIO URL"
msgstr "STÛDÌÖ ÛRL Ⱡ'σяєм ιρѕυм ∂σłσ#"
#: templates/publisher/course_detail/_widgets.html
msgid "Not yet created"
msgstr "Nöt ýét çréätéd Ⱡ'σяєм ιρѕυм ∂σłσя ѕιт α#"
#: templates/publisher/course_edit_form.html #: templates/publisher/course_edit_form.html
msgid "UPDATE COURSE" msgid "UPDATE COURSE"
msgstr "ÛPDÀTÉ ÇÖÛRSÉ Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#" msgstr "ÛPDÀTÉ ÇÖÛRSÉ Ⱡ'σяєм ιρѕυм ∂σłσя ѕι#"
...@@ -2622,15 +2645,15 @@ msgstr "Déär %(course_team_name)s, Ⱡ'σяєм ιρѕυм ∂σł#" ...@@ -2622,15 +2645,15 @@ msgstr "Déär %(course_team_name)s, Ⱡ'σяєм ιρѕυм ∂σł#"
#: templates/publisher/email/studio_instance_created.html #: templates/publisher/email/studio_instance_created.html
#, python-format #, python-format
msgid "" msgid ""
"EdX has created a Studio instance for " "EdX has %(updated_text)s a Studio instance for "
"%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s " "%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s "
"%(link_end)s. You can now edit this course and configure your course team in" "%(link_end)s. You can now edit this course and configure your course team in"
" Studio." " Studio."
msgstr "" msgstr ""
"ÉdX häs çréätéd ä Stüdïö ïnstänçé för " "ÉdX häs %(updated_text)s ä Stüdïö ïnstänçé för "
"%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s " "%(link_start)s%(course_run_page_url)s%(link_middle)s %(course_name)s "
"%(link_end)s. Ýöü çän nöw édït thïs çöürsé änd çönfïgüré ýöür çöürsé téäm ïn" "%(link_end)s. Ýöü çän nöw édït thïs çöürsé änd çönfïgüré ýöür çöürsé téäm ïn"
" Stüdïö. Ⱡ'σяє#" " Stüdïö. Ⱡ'σяєм ιρ#"
#: templates/publisher/email/studio_instance_created.html #: templates/publisher/email/studio_instance_created.html
#, python-format #, python-format
...@@ -2715,12 +2738,12 @@ msgstr "" ...@@ -2715,12 +2738,12 @@ msgstr ""
#: templates/publisher/email/studio_instance_created.txt #: templates/publisher/email/studio_instance_created.txt
#, python-format #, python-format
msgid "" msgid ""
"EdX has created a Studio instance for %(course_name)s: " "EdX has %(updated_text)s a Studio instance for %(course_name)s: "
"%(course_run_page_url)s. You can now edit this course in Studio." "%(course_run_page_url)s. You can now edit this course in Studio."
msgstr "" msgstr ""
"ÉdX häs çréätéd ä Stüdïö ïnstänçé för %(course_name)s: " "ÉdX häs %(updated_text)s ä Stüdïö ïnstänçé för %(course_name)s: "
"%(course_run_page_url)s. Ýöü çän nöw édït thïs çöürsé ïn Stüdïö. Ⱡ'σяєм " "%(course_run_page_url)s. Ýöü çän nöw édït thïs çöürsé ïn Stüdïö. Ⱡ'σяєм "
"ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє#" "ιρѕυм ∂σłσя ѕιт αмєт, ¢σηѕє¢т#"
#: templates/publisher/email/studio_instance_created.txt #: templates/publisher/email/studio_instance_created.txt
#, python-format #, python-format
......
...@@ -7,14 +7,14 @@ msgid "" ...@@ -7,14 +7,14 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2017-01-27 12:46+0500\n" "POT-Creation-Date: 2017-01-27 13:02+0500\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n" "Content-Transfer-Encoding: 8bit\n"
"Language: \n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n" "Plural-Forms: nplurals=2; plural=(n != 1);\n"
#: static/js/catalogs-change-form.js #: static/js/catalogs-change-form.js
......
...@@ -185,6 +185,29 @@ ...@@ -185,6 +185,29 @@
</div> </div>
</div> </div>
{% if edit_mode %}
<div class="field-title">{% trans "STUDIO INSTANCE" %}</div>
<div class="row">
<div class="col col-6 help-text">
<p>{% trans "This is the course studio URL." %}</p>
</div>
<div class="col col-6">
<label class="field-label ">{{ run_form.lms_course_id.label_tag }}</label>
{% if is_internal_user %}
{{ run_form.lms_course_id }}
{% else %}
<div class="studio-url">
<span class="studio-url-heading">{% trans "STUDIO URL" %} - </span>
{% if run_form.lms_course_id.value %}
<a class="studio-link" href="#" target="_blank">{{ course_run.lms_course_id }}</a>
{% else %}
{% trans "Not yet created" %}
{% endif %}
</div>
{% endif %}
</div>
</div>
{% endif %}
</fieldset> </fieldset>
</div> </div>
</div> </div>
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
{% endblocktrans %} {% endblocktrans %}
<p> <p>
{% blocktrans with link_start='<a href="' link_middle='">' link_end='</a>' trimmed %} {% blocktrans with link_start='<a href="' link_middle='">' link_end='</a>' trimmed %}
EdX has created a Studio instance for {{ link_start }}{{ course_run_page_url }}{{ link_middle }} {{ course_name }} {{ link_end }}. EdX has {{ updated_text }} a Studio instance for {{ link_start }}{{ course_run_page_url }}{{ link_middle }} {{ course_name }} {{ link_end }}.
You can now edit this course and configure your course team in Studio. You can now edit this course and configure your course team in Studio.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
Dear {{ course_team_name }}, Dear {{ course_team_name }},
{% endblocktrans %} {% endblocktrans %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
EdX has created a Studio instance for {{ course_name }}: {{ course_run_page_url }}. EdX has {{ updated_text }} a Studio instance for {{ course_name }}: {{ course_run_page_url }}.
You can now edit this course in Studio. You can now edit this course in Studio.
{% endblocktrans %} {% endblocktrans %}
......
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