feat: base template and patch for onboarding
This commit is contained in:
@@ -143,13 +143,14 @@
|
||||
"default": "0",
|
||||
"fieldname": "is_onboarding_complete",
|
||||
"fieldtype": "Check",
|
||||
"label": "Is Onboarding Complete"
|
||||
"label": "Is Onboarding Complete",
|
||||
"read_only": 1
|
||||
}
|
||||
],
|
||||
"index_web_pages_for_search": 1,
|
||||
"issingle": 1,
|
||||
"links": [],
|
||||
"modified": "2022-12-19 18:36:33.987735",
|
||||
"modified": "2022-12-20 11:44:06.317159",
|
||||
"modified_by": "Administrator",
|
||||
"module": "LMS",
|
||||
"name": "LMS Settings",
|
||||
@@ -170,4 +171,4 @@
|
||||
"sort_order": "DESC",
|
||||
"states": [],
|
||||
"track_changes": 1
|
||||
}
|
||||
}
|
||||
@@ -1,3 +1,3 @@
|
||||
frappe.pages['lms-home'].on_page_load = function(wrapper) {
|
||||
window.location.href = '/courses'
|
||||
}
|
||||
frappe.pages["lms-home"].on_page_load = function (wrapper) {
|
||||
window.location.href = "/courses";
|
||||
};
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<div>
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
<h3 class="section-title">{{ _(title) }}</h3>
|
||||
{% if subtitle %}
|
||||
<p> {{ _(subtitle) }} </p>
|
||||
|
||||
@@ -42,3 +42,4 @@ lms.patches.v0_0.quiz_submission_result
|
||||
lms.patches.v0_0.skill_to_user_skill
|
||||
lms.patches.v0_0.rename_instructor_role
|
||||
lms.patches.v0_0.change_course_creation_settings #12-12-2022
|
||||
lms.patches.v0_0.check_onboarding_status #21-12-2022
|
||||
|
||||
6
lms/patches/v0_0/check_onboarding_status.py
Normal file
6
lms/patches/v0_0/check_onboarding_status.py
Normal file
@@ -0,0 +1,6 @@
|
||||
import frappe
|
||||
|
||||
def execute():
|
||||
if frappe.db.count("LMS Course") and frappe.db.count("Course Chapter") \
|
||||
and frappe.db.count("Course Lesson") and frappe.db.count("LMS Quiz"):
|
||||
frappe.db.set_value("LMS Settings", None, "is_onboarding_complete", True)
|
||||
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>
|
||||
|
||||
@@ -1,29 +1,26 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% from "www/macros/livecode.html" import LiveCodeEditorJS, LiveCodeEditor with context %}
|
||||
|
||||
{% block title %}
|
||||
|
||||
{% block title %}
|
||||
{% if lesson.title %}
|
||||
{{ lesson.title }} - {{ course.title }}
|
||||
{% else %}
|
||||
{{ _("New Lesson") }}
|
||||
{% endif %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
<link rel="stylesheet" href="/assets/frappe/css/hljs-night-owl.css">
|
||||
|
||||
{% for ext in page_extensions %}
|
||||
{{ ext.render_header() }}
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style lesson-page">
|
||||
<div class="container course-details-page">
|
||||
{{ BreadCrumb(course, lesson) }}
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="common-page-style" style="background-color: var(--fg-color);">
|
||||
<div class="container">
|
||||
|
||||
@@ -4,11 +4,6 @@
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}
|
||||
{{ _(class_info.title) }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{{ BreadCrumb(class_info) }}
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}
|
||||
{{ _("All Classes") }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{% if has_course_moderator_role() %}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}
|
||||
{{ student.first_name }} 's {{ _("Progress") }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{{ BreadCrumb(class_info, student) }}
|
||||
|
||||
@@ -1,35 +1,44 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% block title %}{{ _('Community') }}{% endblock %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}
|
||||
{{ _('Community') }}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
<div class="container">
|
||||
|
||||
<input class="search pull-right" id="search-user" placeholder="{{ _('Search') }}">
|
||||
<input class="search pull-right" id="search-user" placeholder="{{ _('Search') }}">
|
||||
<div class="course-home-headings">{{ _("People") }} </div>
|
||||
|
||||
<div class="course-home-headings">{{ _("Community") }} </div>
|
||||
<div class="empty-state alert alert-dismissible hide" id="search-empty-state">
|
||||
<a href="#" class="close-search-empty-state" aria-label="close">×</a>
|
||||
<div>
|
||||
<img class="icon icon-xl" src="/assets/frappe/images/ui-states/search-empty-state.svg">
|
||||
</div>
|
||||
<div class="empty-state-text">
|
||||
<div class="empty-state-heading">
|
||||
{{ _("No results found") }}
|
||||
</div>
|
||||
<div class="course-meta">
|
||||
{{ _("Try some other keyword or explore our community") }}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="empty-state alert alert-dismissible hide" id="search-empty-state">
|
||||
<a href="#" class="close-search-empty-state" aria-label="close">×</a>
|
||||
<div>
|
||||
<img class="icon icon-xl" src="/assets/frappe/images/ui-states/search-empty-state.svg">
|
||||
</div>
|
||||
<div class="empty-state-text">
|
||||
<div class="empty-state-heading">{{ _("No results found") }}</div>
|
||||
<div class="course-meta">{{ _("Try some other keyword or explore our community") }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="member-parent">
|
||||
{% for user in users %}
|
||||
{{ widgets.MemberCard(member=user, show_course_count=False, avatar_class="avatar-large") }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
|
||||
<div class="member-parent">
|
||||
{% for user in users %}
|
||||
{{ widgets.MemberCard(member=user, show_course_count=False, avatar_class="avatar-large") }}
|
||||
{% endfor %}
|
||||
</div>
|
||||
{% if user_count > user_details | length %}
|
||||
<div class="mt-10 d-flex justify-content-center">
|
||||
<div class="button is-secondary" id="load-more" data-start="30" data-count="{{ user_count }}">{{ _("Load More") }}</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if user_count > user_details | length %}
|
||||
<div class="mt-10 d-flex justify-content-center">
|
||||
<div class="btn btn-md btn-default" id="load-more" data-start="30" data-count="{{ user_count }}">
|
||||
{{ _("Load More") }}
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
||||
|
||||
@@ -1,15 +1,10 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}
|
||||
{{ course.title if course.title else _("New Course") }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style pt-0 pb-0">
|
||||
<div class="course-home-top-container">
|
||||
{{ CourseHomeHeader(course) }}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
|
||||
|
||||
{% block title %}
|
||||
@@ -6,13 +6,7 @@
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
{% include "lms/templates/onboarding_header.html" %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
{% if restriction %}
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}{{ _('Job Openings') }}{% endblock %}
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
<div class="common-page-style">
|
||||
|
||||
<div class="container">
|
||||
|
||||
@@ -1,11 +1,8 @@
|
||||
{% extends "templates/base.html" %}
|
||||
{% extends "lms/templates/lms_base.html" %}
|
||||
{% block title %}{{ _(job.job_title) }}{% endblock %}
|
||||
|
||||
{% block head_include %}
|
||||
{% include "public/icons/symbol-defs.svg" %}
|
||||
{% endblock %}
|
||||
|
||||
{% block content %}
|
||||
{% block page_content %}
|
||||
|
||||
<div class="common-page-style">
|
||||
<div class="container">
|
||||
|
||||
Reference in New Issue
Block a user