{"action":"created","comment":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/comments/25910693","id":25910693,"diff_hunk":"@@ -224,3 +232,227 @@ def update_example_certificate(request):\n \n     # Let the XQueue know that we handled the response\n     return JsonResponse({'return_code': 0})\n+\n+\n+# pylint: disable=too-many-statements, bad-continuation\n+@login_required\n+def render_html_view(request):\n+    \"\"\"\n+    This view generates an HTML representation of the specified student's certificate\n+    If a certificate is not available, we display a \"Sorry!\" screen instead\n+    \"\"\"\n+    invalid_template_path = 'certificates/invalid.html'\n+\n+    # Feature Flag check\n+    if not settings.FEATURES.get('CERTIFICATES_HTML_VIEW', False):\n+        return render_to_response(invalid_template_path)\n+\n+    context = {}\n+    course_id = request.GET.get('course', None)\n+    context['course'] = course_id\n+    if not course_id:\n+        return render_to_response(invalid_template_path, context)\n+\n+    # Course Lookup\n+    try:\n+        course_key = CourseKey.from_string(course_id)\n+    except InvalidKeyError:\n+        return render_to_response(invalid_template_path, context)\n+    course = modulestore().get_course(course_key)\n+    if not course:\n+        return render_to_response(invalid_template_path, context)\n+\n+    # Certificate Lookup\n+    try:\n+        certificate = GeneratedCertificate.objects.get(\n+            user=request.user,\n+            course_id=course_key\n+        )\n+    except GeneratedCertificate.DoesNotExist:\n+        return render_to_response(invalid_template_path, context)\n+\n+    # Load static output values from configuration,\n+    configuration = CertificateHtmlViewConfiguration.get_config()\n+    context = configuration.get('default', {})\n+    # Override the defaults with any mode-specific static values\n+    context.update(configuration.get(certificate.mode, {}))\n+    # Override further with any course-specific static values\n+    context.update(course.cert_html_view_overrides)\n+\n+    # Populate dynamic output values using the course/certificate data loaded above\n+    user_fullname = request.user.profile.name\n+    company_name = context.get('company_name')\n+    context['accomplishment_copy_name'] = user_fullname\n+    context['accomplishment_copy_course_org'] = course.org\n+    context['accomplishment_copy_course_name'] = course.display_name\n+    context['certificate_id_number'] = certificate.verify_uuid\n+    context['certificate_verify_url'] = _(\"{prefix}{uuid}{suffix}\").format(\n+        prefix=context.get('certificate_verify_url_prefix'),\n+        uuid=certificate.verify_uuid,\n+        suffix=context.get('certificate_verify_url_suffix')\n+    )\n+    context['logo_alt'] = company_name\n+\n+    accd_course_org_html = '<span class=\"detail--xuniversity\">{org}</span>'.format(org=course.org)\n+    accd_company_name_html = '<span class=\"detail--company\">{company_name}</span>'.format(company_name=company_name)\n+    # Translators:\n+    context['accomplishment_copy_course_description'] = _('a course of study offered by {org}, through {name}.').format(\n+        org=accd_course_org_html,\n+        name=accd_company_name_html\n+    )\n+\n+    # Translators:\n+    context['accomplishment_more_title'] = _(\"More Information About {user_name}'s Certificate:\").format(\n+        user_name=user_fullname\n+    )\n+\n+    # Translators:\n+    context['certificate_date_issued_title'] = _(\"Issued On:\")\n+\n+    # Translators:\n+    context['certificate_date_issued'] = _('{month} {day}, {year}').format(\n+        month=certificate.modified_date.strftime(\"%B\"),\n+        day=certificate.modified_date.day,\n+        year=certificate.modified_date.year\n+    )\n+\n+    # Translators:\n+    context['certificate_id_number_title'] = _('Certificate ID Number')\n+\n+    # Translators:\n+    context['certificate_info_title'] = _('About {company_name} Certificates').format(\n+        company_name=company_name\n+    )\n+\n+    cert_info_honor_code_html = \"<a href='{tos_url}'>{company_name} Honor Code</a>\".format(\n+        tos_url=context.get('company_tos_url'),\n+        company_name=company_name\n+    )\n+    cert_info_verified_html = \"<a href='{verified_cert_url}'>verifying your identity</a>\".format(\n+        verified_cert_url=context.get('company_verified_certificate_url')\n+    )\n+    # Translators:\n+    context['certificate_info_description'] = _(\"{company_name} acknowledges achievements through certificates, which \"\n+                                                \"are awarded for various activities {company_name} students complete \"\n+                                                \"under the {honor_code_html}.  Some certificates require completing \"\n+                                                \"additional steps, such as {verifying_html}.\").format(\n+        company_name=company_name,\n+        honor_code_html=cert_info_honor_code_html,\n+        verifying_html=cert_info_verified_html\n+    )\n+\n+    # Translators:\n+    context['certificate_type_title'] = _('{certificate_type} Certfificate').format(\n+        certificate_type=context.get('certificate_type')\n+    )\n+\n+    # Translators:\n+    context['certificate_verify_title'] = _(\"How {company_name} Validates Student Certificates\").format(\n+        company_name=company_name\n+    )\n+\n+    # Translators:\n+    context['certificate_verify_description'] = _(\"Certificates issued by {company_name} are signed by a gpg key so \"","path":"lms/djangoapps/certificates/views.py","position":159,"original_position":159,"commit_id":"3274d2e8451f3c591126781a3f2c2e52697449af","original_commit_id":"3274d2e8451f3c591126781a3f2c2e52697449af","user":{"login":"sarina","id":1985317,"avatar_url":"https://avatars.githubusercontent.com/u/1985317?v=3","gravatar_id":"","url":"https://api.github.com/users/sarina","html_url":"https://github.com/sarina","followers_url":"https://api.github.com/users/sarina/followers","following_url":"https://api.github.com/users/sarina/following{/other_user}","gists_url":"https://api.github.com/users/sarina/gists{/gist_id}","starred_url":"https://api.github.com/users/sarina/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sarina/subscriptions","organizations_url":"https://api.github.com/users/sarina/orgs","repos_url":"https://api.github.com/users/sarina/repos","events_url":"https://api.github.com/users/sarina/events{/privacy}","received_events_url":"https://api.github.com/users/sarina/received_events","type":"User","site_admin":false},"body":"Might want to link to an explanation about gpg keys, public keys, etc. It's totally cool to just have a resource in the translators' comment so they can read & understand.","created_at":"2015-03-05T22:58:47Z","updated_at":"2015-03-05T22:58:47Z","html_url":"https://github.com/edx/edx-platform/pull/7113#discussion_r25910693","pull_request_url":"https://api.github.com/repos/edx/edx-platform/pulls/7113","_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments/25910693"},"html":{"href":"https://github.com/edx/edx-platform/pull/7113#discussion_r25910693"},"pull_request":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7113"}}},"pull_request":{"url":"https://api.github.com/repos/edx/edx-platform/pulls/7113","id":30027642,"html_url":"https://github.com/edx/edx-platform/pull/7113","diff_url":"https://github.com/edx/edx-platform/pull/7113.diff","patch_url":"https://github.com/edx/edx-platform/pull/7113.patch","issue_url":"https://api.github.com/repos/edx/edx-platform/issues/7113","number":7113,"state":"open","locked":false,"title":"Added Certificates Web/HTML View","user":{"login":"mattdrayer","id":4520595,"avatar_url":"https://avatars.githubusercontent.com/u/4520595?v=3","gravatar_id":"","url":"https://api.github.com/users/mattdrayer","html_url":"https://github.com/mattdrayer","followers_url":"https://api.github.com/users/mattdrayer/followers","following_url":"https://api.github.com/users/mattdrayer/following{/other_user}","gists_url":"https://api.github.com/users/mattdrayer/gists{/gist_id}","starred_url":"https://api.github.com/users/mattdrayer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mattdrayer/subscriptions","organizations_url":"https://api.github.com/users/mattdrayer/orgs","repos_url":"https://api.github.com/users/mattdrayer/repos","events_url":"https://api.github.com/users/mattdrayer/events{/privacy}","received_events_url":"https://api.github.com/users/mattdrayer/received_events","type":"User","site_admin":false},"body":"@marcotuts -- here is the initial changeset for the certificates web/html view that we've been working on -- take a look and let me know what you think.  I can provision a sandbox if you think it would be helpful at this stage.\r\n\r\n@fredsmith @andywaldrop @martynjames -- FYI on this PR","created_at":"2015-02-25T21:35:19Z","updated_at":"2015-03-05T22:58:47Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76d68649530309810684b6b83f0163987199cd87","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/edx/edx-platform/pulls/7113/commits","review_comments_url":"https://api.github.com/repos/edx/edx-platform/pulls/7113/comments","review_comment_url":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}","comments_url":"https://api.github.com/repos/edx/edx-platform/issues/7113/comments","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/3274d2e8451f3c591126781a3f2c2e52697449af","head":{"label":"edx:mattdrayer/certs-web-view","ref":"mattdrayer/certs-web-view","sha":"3274d2e8451f3c591126781a3f2c2e52697449af","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-03-05T20:56:12Z","pushed_at":"2015-03-05T22:24:19Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1783354,"stargazers_count":1775,"watchers_count":1775,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1014,"mirror_url":null,"open_issues_count":137,"forks":1014,"open_issues":137,"watchers":1775,"default_branch":"master"}},"base":{"label":"edx:master","ref":"master","sha":"c430eaed55b941f94785fd31c7cb4c11babf9068","user":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"repo":{"id":10391073,"name":"edx-platform","full_name":"edx/edx-platform","owner":{"login":"edx","id":3179841,"avatar_url":"https://avatars.githubusercontent.com/u/3179841?v=3","gravatar_id":"","url":"https://api.github.com/users/edx","html_url":"https://github.com/edx","followers_url":"https://api.github.com/users/edx/followers","following_url":"https://api.github.com/users/edx/following{/other_user}","gists_url":"https://api.github.com/users/edx/gists{/gist_id}","starred_url":"https://api.github.com/users/edx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/edx/subscriptions","organizations_url":"https://api.github.com/users/edx/orgs","repos_url":"https://api.github.com/users/edx/repos","events_url":"https://api.github.com/users/edx/events{/privacy}","received_events_url":"https://api.github.com/users/edx/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/edx/edx-platform","description":"Open edX, the edX platform that powers http://edx.org","fork":false,"url":"https://api.github.com/repos/edx/edx-platform","forks_url":"https://api.github.com/repos/edx/edx-platform/forks","keys_url":"https://api.github.com/repos/edx/edx-platform/keys{/key_id}","collaborators_url":"https://api.github.com/repos/edx/edx-platform/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/edx/edx-platform/teams","hooks_url":"https://api.github.com/repos/edx/edx-platform/hooks","issue_events_url":"https://api.github.com/repos/edx/edx-platform/issues/events{/number}","events_url":"https://api.github.com/repos/edx/edx-platform/events","assignees_url":"https://api.github.com/repos/edx/edx-platform/assignees{/user}","branches_url":"https://api.github.com/repos/edx/edx-platform/branches{/branch}","tags_url":"https://api.github.com/repos/edx/edx-platform/tags","blobs_url":"https://api.github.com/repos/edx/edx-platform/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/edx/edx-platform/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/edx/edx-platform/git/refs{/sha}","trees_url":"https://api.github.com/repos/edx/edx-platform/git/trees{/sha}","statuses_url":"https://api.github.com/repos/edx/edx-platform/statuses/{sha}","languages_url":"https://api.github.com/repos/edx/edx-platform/languages","stargazers_url":"https://api.github.com/repos/edx/edx-platform/stargazers","contributors_url":"https://api.github.com/repos/edx/edx-platform/contributors","subscribers_url":"https://api.github.com/repos/edx/edx-platform/subscribers","subscription_url":"https://api.github.com/repos/edx/edx-platform/subscription","commits_url":"https://api.github.com/repos/edx/edx-platform/commits{/sha}","git_commits_url":"https://api.github.com/repos/edx/edx-platform/git/commits{/sha}","comments_url":"https://api.github.com/repos/edx/edx-platform/comments{/number}","issue_comment_url":"https://api.github.com/repos/edx/edx-platform/issues/comments{/number}","contents_url":"https://api.github.com/repos/edx/edx-platform/contents/{+path}","compare_url":"https://api.github.com/repos/edx/edx-platform/compare/{base}...{head}","merges_url":"https://api.github.com/repos/edx/edx-platform/merges","archive_url":"https://api.github.com/repos/edx/edx-platform/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/edx/edx-platform/downloads","issues_url":"https://api.github.com/repos/edx/edx-platform/issues{/number}","pulls_url":"https://api.github.com/repos/edx/edx-platform/pulls{/number}","milestones_url":"https://api.github.com/repos/edx/edx-platform/milestones{/number}","notifications_url":"https://api.github.com/repos/edx/edx-platform/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/edx/edx-platform/labels{/name}","releases_url":"https://api.github.com/repos/edx/edx-platform/releases{/id}","created_at":"2013-05-30T20:20:38Z","updated_at":"2015-03-05T20:56:12Z","pushed_at":"2015-03-05T22:24:19Z","git_url":"git://github.com/edx/edx-platform.git","ssh_url":"git@github.com:edx/edx-platform.git","clone_url":"https://github.com/edx/edx-platform.git","svn_url":"https://github.com/edx/edx-platform","homepage":"http://openedx.org/","size":1783354,"stargazers_count":1775,"watchers_count":1775,"language":"Python","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":true,"forks_count":1014,"mirror_url":null,"open_issues_count":137,"forks":1014,"open_issues":137,"watchers":1775,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7113"},"html":{"href":"https://github.com/edx/edx-platform/pull/7113"},"issue":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7113"},"comments":{"href":"https://api.github.com/repos/edx/edx-platform/issues/7113/comments"},"review_comments":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7113/comments"},"review_comment":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/edx/edx-platform/pulls/7113/commits"},"statuses":{"href":"https://api.github.com/repos/edx/edx-platform/statuses/3274d2e8451f3c591126781a3f2c2e52697449af"}}}}