Skip to content

Commit

Permalink
feat: Adding course templates functionality.
Browse files Browse the repository at this point in the history
  • Loading branch information
awais786 committed Dec 12, 2024
1 parent bd10dae commit 2a39a45
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 3 additions & 1 deletion cms/djangoapps/contentstore/views/import_export.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import logging
import os
import re
import requests
import shutil
from wsgiref.util import FileWrapper

Expand All @@ -25,6 +26,7 @@
from django.views.decorators.csrf import ensure_csrf_cookie
from django.views.decorators.http import require_GET, require_http_methods
from django.shortcuts import render
from django.urls import reverse

from edx_django_utils.monitoring import set_custom_attribute, set_custom_attributes_for_course_key
from opaque_keys.edx.keys import CourseKey
Expand Down Expand Up @@ -474,7 +476,7 @@ def course_templates(request, course_key_string):
courselike_key = CourseKey.from_string(course_key_string)
organization = courselike_key.org
successful_url = f"http://localhost:18010/api/contentstore/v1/course_templates/{course_key_string}"
import requests

courses = []
resp = requests.get(successful_url)
if resp.status_code == 200:
Expand Down
3 changes: 3 additions & 0 deletions cms/templates/widgets/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,9 @@ <h3 class="title"><span class="label">${_("Tools")}</span> <span class="icon fa
<a href="${reverse('export_git', kwargs=dict(course_key_string=str(course_key)))}">${_("Export to Git")}</a>
</li>
% endif
<li class="nav-item nav-course-tools-export-git">
<a href="${reverse('course_templates', args=[str(course_key)])}">${_("Course Templates")}</a>
</li>
<li class="nav-item nav-course-tools-checklists">
<a href="${checklists_url}">${_("Checklists")}</a>
</li>
Expand Down

0 comments on commit 2a39a45

Please sign in to comment.