From 7683cba2c39b3c08a602a4e02f83f7130b49b6b5 Mon Sep 17 00:00:00 2001 From: Andy Armstrong Date: Thu, 11 Sep 2014 11:50:03 -0400 Subject: [PATCH] Add support for UX reference templates in LMS --- lms/djangoapps/debug/views.py | 19 +- .../instructor_dashboard/membership.html | 369 ++++++++++++++++++ lms/urls.py | 3 + 3 files changed, 390 insertions(+), 1 deletion(-) create mode 100644 lms/templates/ux/reference/instructor_dashboard/membership.html diff --git a/lms/djangoapps/debug/views.py b/lms/djangoapps/debug/views.py index 6794c30348..280674efbc 100644 --- a/lms/djangoapps/debug/views.py +++ b/lms/djangoapps/debug/views.py @@ -3,7 +3,7 @@ import pprint import traceback -from django.http import Http404, HttpResponse +from django.http import Http404, HttpResponse, HttpResponseNotFound from django.contrib.auth.decorators import login_required from django.utils.html import escape @@ -12,6 +12,8 @@ from edxmako.shortcuts import render_to_response from codejail.safe_exec import safe_exec +from mako.exceptions import TopLevelLookupException + @login_required @ensure_csrf_cookie @@ -43,3 +45,18 @@ def show_parameters(request): for name, value in sorted(request.POST.items()): html.append(escape("POST {}: {!r}".format(name, value))) return HttpResponse("\n".join("

{}

".format(h) for h in html)) + + +def show_reference_template(request, template): + """ + Shows the specified template as an HTML page. This is used only in debug mode to allow the UX team + to produce and work with static reference templates. + e.g. /template/ux/reference/container.html shows the template under ux/reference/container.html + + Note: dynamic parameters can also be passed to the page. + e.g. /template/ux/reference/container.html?name=Foo + """ + try: + return render_to_response(template, request.GET.dict()) + except TopLevelLookupException: + return HttpResponseNotFound("Couldn't find template {template}".format(template=template)) diff --git a/lms/templates/ux/reference/instructor_dashboard/membership.html b/lms/templates/ux/reference/instructor_dashboard/membership.html new file mode 100644 index 0000000000..3a1370aeae --- /dev/null +++ b/lms/templates/ux/reference/instructor_dashboard/membership.html @@ -0,0 +1,369 @@ +<%! from django.utils.translation import ugettext as _ %> +<%! from django.core.urlresolvers import reverse %> + +<%inherit file="/main.html" /> +<%namespace name='static' file='/static_content.html'/> + +<%block name="pagetitle">Instructor Dashboard +<%block name="nav_skip">#instructor-dashboard-content + +<%block name="headextra"> +<%static:css group='style-course-vendor'/> +<%static:css group='style-vendor-tinymce-content'/> +<%static:css group='style-vendor-tinymce-skin'/> +<%static:css group='style-course'/> + + + + + + + + + + + + + + + + + +<%static:js group='module-descriptor-js'/> +<%static:js group='instructor_dash'/> + + +
+
+
+

Instructor Dashboard

+ +
+

Batch Enrollment

+

+ + +

+ +
+ + +
+ +

+ If this option is checked, users who have not yet registered for {platform_name} will be automatically enrolled.").format(platform_name=settings.PLATFORM_NAME)} + If this option is left unchecked, users who have not yet registered for {platform_name} will not be enrolled, but will be allowed to enroll once they make an account.").format(platform_name=settings.PLATFORM_NAME)} +

+ Checking this box has no effect if 'Unenroll' is selected. +

+
+
+ +
+ + + +
+ +
+ + +
+
+
+
+ +
+ +
+

Batch Beta Tester Addition

+

+ + + +

+ +
+ + +
+ +

+ If this option is checked, users who have not enrolled in your course will be automatically enrolled. +

+ Checking this box has no effect if 'Remove beta testers' is selected. +

+
+
+ +
+ + + +
+ +
+ + +
+ +
+
+
+ +
+ +
+ ## Translators: an "Administration List" is a list, such as Course Staff, that users can be added to. +

Administration List Management

+ +
+ +
+ ## Translators: an "Administrator Group" is a group, such as Course Staff, that users can be added to. + + + +
+ + +

+ Staff cannot modify staff or beta tester lists. To modify these lists, " + "contact your instructor and ask them to add you as an instructor for staff " + "and beta lists, or a discussion admin for discussion management. +

+ +
+ +
+ +
+ +
+ +
+ +
+
+ +
+ +
+

+ Cohort Management + Cohorts are such and such and are used for this and that to do all the things +

+ + +
+
+ +
+ + + +
+ + +
+
+ + +
+

You currently have no cohort groups configured

+ +
+

Please complete your cohort group configuration by creating groups within Studio

+
+ + +
+ + +
+

There's currently an error with your cohorts configuration within this course.

+ +
+

Error output (if any and near-human legible/comprehendable can be displayed here)

+
+ + +
+ + +
+
+

+ Cohort Name Can be Placed Here and Should Accommodate Almost Everything + (contains 12,546 Students) +

+ +
+

This cohort group's current management set up:

+
+ Students are added to this group automatically + What does this mean? +
+ + +
+
+ + +
+
+ +

Add students to this cohort group

+ +
+

Please Note: Adding a student to this group will remove them from any groups they are currently a part of.

+
+ + +
+

2,546 students have been added to this cohort group

+ +
+
    +
  • 1,245 were removed from Cohort Name is Placed Here and Should Accommodate Almost Everything
  • +
  • 1,245 were removed from Cohort Name is Placed Here and Should Accommodate Almost Everything
  • +
  • 1,245 were removed from Cohort Name is Placed Here and Should Accommodate Almost Everything
  • +
+
+
+ + +
+

There were 25 errors when trying to add students:

+ +
+
    +
  • Unknown user: ahgaeubgoq
  • +
  • Unknown user: hagaihga
  • +
  • Unknown user: ahgaeubgoq
  • +
  • Unknown user: ahgaeubgoq
  • +
  • Unknown user: hagaihga
  • +
+
+ + +
+ +
+
+ + + +
+
+ + +
+
+
+ + +
+

You may view individual student information for each cohort via your entire course profile data download on the data download view

+
+
+
diff --git a/lms/urls.py b/lms/urls.py index 8754b8de78..a944af95a3 100644 --- a/lms/urls.py +++ b/lms/urls.py @@ -531,6 +531,9 @@ urlpatterns = patterns(*urlpatterns) if settings.DEBUG: urlpatterns += static(settings.STATIC_URL, document_root=settings.STATIC_ROOT) + # in debug mode, allow any template to be rendered (most useful for UX reference templates) + urlpatterns += url(r'^template/(?P