%namespace name='static' file='/static_content.html'/> <%! from django.utils.translation import ugettext as _ from common.djangoapps.student.models import anonymous_id_for_user from opaque_keys.edx.keys import CourseKey from hashlib import sha256 from eox_tagging.models import Tag %> <% # set doc language direction import json from django.utils.translation import get_language_bidi dir_rtl = 'rtl' if get_language_bidi() else 'ltr' course_mode_class = course_mode if course_mode else '' %> <% def get_tags(username, course_id): tags = {} certificate_tags = Tag.objects.find_all_tags_for("generatedcertificate", {"username": username, "course_id": course_id}) for tag in certificate_tags: tags[tag.tag_type]= tag.tag_value return tags tags = get_tags(username, course_id) accomplishment_copy_course_name = tags.get("course_name") certificate_date_issued = tags.get("emision_date") accomplishment_copy_description_full = tags.get("accomplishment_description") signatures = [] signatures_keys = [key for key, value in tags.items() if key.endswith("image") and value ] for signatures_key in signatures_keys: signatures.append({"name": tags.get(f"{signatures_key[:12]}name"), "signature_image_path": tags.get(signatures_key), "title":tags.get(f"{signatures_key[:12]}job_title"), "organization": tags.get(f"{signatures_key[:12]}organization") }) %>