Added LMS Settings.

The `livecode_url` is now part of LMS settings and not hardcoded in the code.
This commit is contained in:
Anand Chitipothu
2021-03-09 09:04:39 +00:00
parent fc6f60c4d7
commit 862878462b
7 changed files with 76 additions and 2 deletions

View File

@@ -67,13 +67,13 @@
{%- block script %}
{{ super() }}
<script type="text/javascript" src="http://livecode.dev.fossunited.org/static/livecode.js"></script>
<script type="text/javascript" src="{{ livecode_url }}/static/livecode.js"></script>
<script type="text/javascript">
$(function() {
$(".canvas-editor").each((i, e) => {
var editor = new LiveCodeEditor(e, {
runtime: "python-canvas",
base_url: "http://livecode.dev.fossunited.org"
base_url: "{{ livecode_url }}"
})
})
})

View File

@@ -7,6 +7,11 @@ def get_context(context):
topic_name = get_queryparam("topic", '/courses?course=' + course_name)
context.topic = get_topic(course_name, topic_name)
context.livecode_url = get_livecode_url()
def get_livecode_url():
doc = frappe.get_doc("LMS Settings")
return doc.livecode_url
def get_queryparam(name, redirect_when_not_found):
try: