feat: base template and patch for onboarding
This commit is contained in:
10
lms/templates/lms_base.html
Normal file
10
lms/templates/lms_base.html
Normal file
@@ -0,0 +1,10 @@
|
||||
{% extends "templates/base.html" %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% include "lms/templates/onboarding_header.html" %}
|
||||
{% block page_content %}
|
||||
Hello, world!
|
||||
{% endblock %}
|
||||
{% endblock %}
|
||||
@@ -1,14 +1,13 @@
|
||||
{% set is_onboarding_complete = frappe.db.get_single_value("LMS Settings", "is_onboarding_complete") %}
|
||||
|
||||
{% if has_course_moderator_role() and not is_onboarding_complete %}
|
||||
|
||||
{% set onboarding_settings = frappe.db.get_single_value("LMS Settings", "is_onboarding_complete") %}
|
||||
{% set course_created = frappe.db.count("LMS Course") %}
|
||||
{% set first_course = frappe.db.get_all("LMS Course", order_by="creation", pluck="name")[0] %}
|
||||
{% set chapter_created = frappe.db.count("Course Chapter") %}
|
||||
{% set lesson_created = frappe.db.count("Course Lesson") %}
|
||||
{% set quiz_created = frappe.db.count("LMS Quiz") %}
|
||||
{% set first_course = frappe.db.get_all("LMS Course", order_by="creation", pluck="name")[0] %}
|
||||
|
||||
{% set is_onboarding_complete = onboarding_settings or (course_created and chapter_created and lesson_created and quiz_created) %}
|
||||
|
||||
{% if has_course_moderator_role() and not is_onboarding_complete %}
|
||||
<div class="onboarding-parent">
|
||||
<div class="container">
|
||||
<div class="onboarding-skip">{{ _("Skip") }}</div>
|
||||
@@ -24,7 +23,7 @@
|
||||
</svg>
|
||||
{{ _("Create a Course") }}
|
||||
</a>
|
||||
<a class="onboarding-steps-link" {% if course_created %} href="/courses/{{ first_course }}?edit=1" {% endif %}>
|
||||
<a class="onboarding-steps-link" {% if course_created %} href="/courses/{{ first_course }}?edit=1" {% else %} disabled {% endif %}>
|
||||
<svg class="icon icon-md">
|
||||
<use href="{% if chapter_created %} #icon-green-check-circled {% else %} #icon-disabled-check {% endif %}">
|
||||
</use>
|
||||
|
||||
Reference in New Issue
Block a user