Deleted Old LMS Content

This commit is contained in:
scmmishra 2018-11-13 16:32:38 +05:30 committed by Aditya Hase
parent d7c993f028
commit f9f7318d3f
16 changed files with 0 additions and 649 deletions

View File

@ -1,37 +0,0 @@
{% extends "frappe_theme/templates/base.html" %}
{% block title %}ERPNext Academy{% endblock %}
{% from "templates/includes/media.html" import media %}
{% block content %}
<div id="content-holder" data-type="{{ content_type }}" data-content="{{ content.name }}" data-course="{{ course_name }}" data-program="{{ program_name }}">
{% include "www/lms/templates/includes/" + content_type.lower() + ".html" %}
</div>
<style>
.footer-message {
display: none;
}
.video-top-section {
padding-top: 3rem !important;
padding-bottom: 1rem !important;
}
.video-description-section {
padding-top: 0em !important;
}
.article-top-section {
padding-top: 3rem !important;
padding-bottom: 0rem !important;
}
.article-content-section {
padding-top: 0em !important;
}
.quiz-section {
padding-top: 3rem !important;
padding-bottom: 0rem !important;
}
</style>
{% endblock %}

View File

@ -1,47 +0,0 @@
function submitQuiz() {
formData = new FormData(quiz);
var form_object = {};
formData.forEach(function (value, key) {
form_object[key] = value;
});
frappe.call({
method: "erpnext.education.utils.evaluate_quiz",
args: {
"quiz_response": form_object,
"quiz": $('#content-holder').data('content'),
"course": $('#content-holder').data('course'),
"program": $('#content-holder').data('program')
},
async: false,
callback: function (r) {
if (r) {
$("input[type=radio]").attr('disabled', true);
$("#quiz-actions").attr('hidden', true);
$("#post-quiz-actions").attr('hidden', false);
$("#result").html(r.message);
}
}
});
}
function addActivity() {
frappe.call({
method: "erpnext.education.utils.add_activity",
args: {
"content_type": $('#content-holder').data('type'),
"content": $('#content-holder').data('content'),
"course": $('#content-holder').data('course'),
"program": $('#content-holder').data('program'),
}
})
}
function addFinalActivity() {
addActivity()
frappe.call({
method: "erpnext.education.utils.mark_course_complete",
args: {
"course": $('#content-holder').data('course'),
},
})
}

View File

@ -1,32 +0,0 @@
from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
def get_context(context):
if frappe.form_dict['course']:
# Save form_dict variables
program_name = frappe.form_dict["program"]
course_name = frappe.form_dict["course"]
content_name = frappe.form_dict["content"]
content_type = frappe.form_dict["type"]
# Get the required doctypes
current_course = frappe.get_doc("Course", course_name)
current_content = frappe.get_doc(content_type, content_name)
# Saving context variables for Jinja
context.content = current_content
context.course_name = course_name
context.program_name = program_name
context.content_type = content_type
context.next_content_type, context.next_content = get_next_content(content_name, content_type, current_course.get_content_info())
if content_type == "Quiz":
context.questions = current_content.get_questions()
def get_next_content(c_name, c_type, content_list):
try:
next = content_list[content_list.index([c_type, c_name]) + 1]
return next[0], next[1]
except IndexError:
return None, None

View File

@ -1,101 +0,0 @@
.page-content {
padding-bottom: 0px !important;
}
.dashboard-section {
margin: auto;
max-width: 90%;
}
.dashboard-section h1 {
font-size: 1.5em;
}
@media(min-width: 768px) {
.dashboard-section {
max-width: 80%;
}
}
@media(min-width: 992px) {
.dashboard-section {
max-width: 65%;
}
}
.hero-content h1 {
font-size: 1.85em;
font-weight: 300;
}
.hero {
border-bottom: 0px;
}
.erp-hero {
border-bottom: 1px solid #e1e9f0;
}
.hero-content p {
margin-bottom: 100px;
}
.navbar {
border-bottom: 0px;
}
.main-illustration {
margin: -90px 0 -60px -32px;
min-height: 420px;
}
.hero-title {
font-size: 32px;
}
@media screen and (max-width: 750px) {
.main-illustration {
min-height: inherit;
}
}
@media screen and (max-width: 480px) {
.main-illustration {
margin: -60px 0 -20px -16px;
}
.hero-title {
font-size: 26px;
}
.hero-title+p {
font-size: 16px;
}
}
.modal-dialog {
max-width: 800px;
margin: 30px auto;
}
.modal-body {
position: relative;
padding: 0px;
background-color: black;
}
.close {
position: absolute;
right: -30px;
top: 0;
z-index: 999;
font-size: 2rem;
font-weight: normal;
color: #fff;
opacity: 1;
}
.video-btn {
color: white !important;
}

View File

@ -1,81 +0,0 @@
{% extends "frappe_theme/templates/base.html" %}
{% block title %}{{settings.portal_title}}{% endblock %}
{% from "templates/includes/media.html" import media %}
{% macro featured_card(program_name, description, hero_image, code) %}
<div class='card-deck mt-5'>
<div class="card">
<img src="{{ hero_image }}" style='height: 150px'>
<div class='card-body'>
<a href="/lms/program?program={{ code }}">
<h5 class='card-title'>{{ program_name }}</h5>
</a>
<div>{{ description }}</div>
</div>
<div class='card-footer text-right'>
<!-- <a class='video-btn btn btn-secondary btn-sm' data-toggle="modal" data-src=" insert jinja stuff here " data-target="#myModal">Watch -->
<!-- Intro</a>&nbsp;&nbsp; -->
<a class='btn btn-secondary btn-sm' href="/enroll?course=user">Enroll Now</a>
</div>
</div>
</div>
{% endmacro %}
{% block content %}
<section class='top-section'>
<div class='container'>
<div class='text-center'>
<!-- <img class="main-illustration" src='/assets/erpnext_com/img/erpnext_com_illustration.png'
style='width: 700px;'> -->
</div>
<h1>{{settings.portal_title}}</h1>
<ul class="list-group">
</ul>
<p class='lead'>
{{settings.description}}</p>
<p class="mt-4">
<a class="btn btn-primary btn-lg" href="/enroll">
Explore Courses</a>
</p>
</section>
<section class='section-padding section-bg'>
<div class='container'>
<h3 class='text-center'>Featured Programs</h3>
<p class='lead text-center'>Master Engineering</p>
{% for program in featured %}
{{ featured_card(program.program_name, program.description, program.hero_image, program.program_code) }}
{% endfor %}
<div class='mt-4 text-center'>
<a class="btn btn-primary btn-lg" href="/program">View All</a>
</div>
</div>
</section>
{% include "www/lms/templates/includes/highlights.html" %}
<div class="container">
<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-body">
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
<!-- 16:9 aspect ratio -->
<div class="embed-responsive embed-responsive-16by9">
<iframe id="ytplayer" type="text/html" class="embed-responsive-item" allowscriptaccess="always"></iframe>
</div>
</div>
</div>
</div>
</div>
</div>
<style>
.footer-message {
display: none;
}
</style>
{% endblock %}

View File

@ -1,30 +0,0 @@
$(function () {
setTimeout(function () {
$(".later").fadeIn();
}, 1000);
});
$(document).ready(function () {
var $videoSrc;
// Gets the video src from the data-src on each button
$('.video-btn').click(function () {
$videoSrc = $(this).attr("data-src");
console.log($videoSrc);
});
console.log($videoSrc);
// when the modal is opened autoplay it
$('#myModal').on('shown.bs.modal', function (e) {
// set the video src to autoplay and not to show related video. Youtube related video is like a box of chocolates... you never know what you're gonna get
$("#ytplayer").attr('src', "https://www.youtube.com/embed/" + $videoSrc + "?autoplay=0");
})
// stop playing the youtube video when I close the modal
$('#myModal').on('hide.bs.modal', function (e) {
// a poor man's stop video
$("#ytplayer").attr('src', $videoSrc);
})
// document ready
});

View File

@ -1,7 +0,0 @@
from __future__ import unicode_literals
import frappe
import erpnext.education.utils as utils
def get_context(context):
context.featured = utils.get_featured_programs()
context.settings = frappe.get_doc("Education Settings")

View File

@ -1,69 +0,0 @@
{% extends "frappe_theme/templates/base.html" %}
{% block title %}ERPNext Academy{% endblock %}
{% macro course_card(course) %}
<div class="card mt-3" data-list="getting-started">
<div class='card-body'>
<div class="row">
<div class="course-details col-xs-8 col-sm-9 col-md-10">
<h5>{{ course.course_name }}</h5>
<span class="course-list text-muted" id="getting-started">
Course Content
<ul class="mb-0 mt-1">
{% for content in course.course_content %}
<li>{{ content.content }}</li>
{% endfor %}
</ul>
</span>
</div>
<div class='text-center col-xs-4 col-sm-3 col-md-2'>
{% if not check_complete(course.name) %}
<a class='btn btn-primary btn-sm btn-block' href="/lms/course?program={{ program.program_code }}&course={{ course.name }}&type={{course.course_content[0].content_type}}&content={{ course.course_content[0].content }}">Start Course</a>
{% else %}
<a class='btn btn-success btn-sm btn-block' href="/lms/course?program={{ program.program_code }}&course={{ course.name }}&type={{course.course_content[0].content_type}}&content={{ course.course_content[0].content }}">Complete</a>
{% endif %}
</div>
</div>
</div>
</div>
{% endmacro %}
{% block content %}
<section class='top-section'>
<div class='container'>
<div class='text-center'>
<!-- <img class="main-illustration" src='/assets/academy/img/expert.png' style='width: 700px;'> -->
</div>
<h1>{{ program.program_name }}</h1>
<p class='lead'>{{ program.description }}</p>
<p class="mt-4">
<a class="btn btn-primary btn-lg" href="/program/course">
Continue Learning</a>
</p>
</section>
<section class='section-padding section-bg'>
<div class='container'>
<h3 class='text-center'>Courses</h3>
<p class='lead text-center'>Curated Courses and Content</p>
{% for course_item in course_list %}
{{ course_card(course_item) }}
{% endfor %}
</div>
</section>
{% include "www/lms/templates/includes/highlights.html" %}
<style>
.footer-message {
display: none;
}
@media (max-width: 767px) {
.course-details {
margin-bottom: 1rem !important;
}
}
</style>
{% endblock %}

View File

@ -1,21 +0,0 @@
from __future__ import unicode_literals
import erpnext.education.utils as utils
import frappe
def get_context(context):
program = frappe.get_doc("Program", frappe.form_dict["program"])
course_list = program.get_course_list()
context.program = program
context.course_list = course_list
context.check_complete = check_complete
def check_complete(course_name):
try:
enrollment = utils.get_course_enrollment(course_name, frappe.session.user)
completed = frappe.get_value('Course Enrollment', enrollment['name'], "completed")
return bool(completed)
except:
return False

View File

@ -1,30 +0,0 @@
<section class='article-top-section video-section-bg'>
<div class='container'>
<div class="row">
<div class="col-md-8">
<h2>{{ content.title }}</h2>
<span class="text-muted">
Published on {{ content.publish_date }}, by {{ content.author }}
</span>
</div>
<div class="col-md-4 text-right">
{% include "www/lms/templates/includes/lms-nav.html" %}
</div>
</div>
<hr>
</div>
</section>
<section class="article-content-section">
<div class='container'>
<div class="content">
{{ content.content }}
</div>
<div class="text-right">
{% include "www/lms/templates/includes/lms-nav.html" %}
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>

View File

@ -1,60 +0,0 @@
<footer class="bg-dark pt-4">
<div class="container">
<div class="row mt-4 mb-5">
<div class='col-sm-12 col-md-6 mb-4' style='display: flex; flex-direction: column; justify-content: space-between;'>
<img src="/assets/academy/img/graduation-cap.svg"
style='height: 50px; width: 50px;'>
<div class="text-muted">
<div style="line-height: 2">
&copy;<span id="year"></span> Frappe Technologies Pvt. Ltd.
</div>
</div>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<h6 class='text-light'>Social</h6>
<ul class="list-unstyled">
<li class="py-2">
<a href="https://frappe.io/blog" class="text-muted">Blog</a>
</li>
<li class="py-2">
<a href="https://discuss.erpnext.com" class="text-muted">Forum</a>
</li>
<li class="py-2">
<a href="https://github.com/frappe" class="text-muted">GitHub</a>
</li>
<li class="py-2">
<a href="https://twitter.com/erpnext" class="text-muted">Twitter</a>
</li>
<li class="py-2">
<a href="https://medium.com/frapp%C3%A9-thoughts" class="text-muted">Medium</a>
</li>
<li class="py-2">
<a href="https://www.facebook.com/ERPNext" class="text-muted">Facebook</a>
</li>
</ul>
</div>
<div class="col-xs-12 col-sm-6 col-md-3">
<h6 class='text-light'>Company</h6>
<ul class="list-unstyled">
<li class="py-2">
<a href="https://erpnext.com" class="text-muted">ERPNext</a>
</li>
<li class="py-2">
<a href="https://frappe.io/about" class="text-muted">Team</a>
</li>
<li class="py-2">
<a href="https://frappe.io/about" class="text-muted">Jobs</a>
</li>
<li class="py-2">
<a href="https://frappe.io/about#contact" class="text-muted">Contact</a>
</li>
</ul>
</div>
</div>
<div class='mt-4 text-muted text-center'>"Be the change, you wish to see in the world ~ M. K. Gandhi"
</div>
</footer>
<!--Javascript-->

View File

@ -1,41 +0,0 @@
<section class="section-padding">
<div class='container'>
<h3 class='text-center'>Highlights</h3>
<div class='card-deck mt-5'>
<div class="card">
<div class='card-body'>
<h5 class='card-title'>Curated Courses</h5>
<div>Learning paths specifically designed for the your use cases, whether you are a user, developer
or an
implementer</div>
</div>
<div class='card-footer'>
<a href="#" class='text-muted small'>Explore Learning Paths</a>
</div>
</div>
<div class="card">
<div class='card-body'>
<h5 class='card-title'>Comprehensive Content</h5>
<div>Content designed to cover all the fundamentals as well as expert tips and techniques to make
the most out of ERPNext.</div>
</div>
<div class='card-footer'>
<a href="#" class='text-muted small'>View Course List</a>
</div>
</div>
<div class="card">
<div class='card-body'>
<h5 class='card-title'>Certification</h5>
<div>ERPNext is open source and infinitely extensible. Customize it, build upon it, add your own
apps built with
<a href="https://frappe.io" class="underline">Frappe Framework</a>.</div>
</div>
<div class='card-footer'>
<a href="#" class='text-muted small'>Certification Benefits</a>
</div>
</div>
</div>
</div>
</section>

View File

@ -1,6 +0,0 @@
<a class='btn btn-outline-secondary' href="#">Previous</a>
{% if next_content != None %}
<a class='btn btn-primary' onclick="addActivity()" href="/lms/course?program={{ program_name }}&course={{ course_name }}&type={{ next_content_type }}&content={{ next_content }}">Next</a>
{% else %}
<a class='btn btn-primary' onclick="addFinalActivity()" href="/lms/program?program={{ program_name }}">Finish Course</a>
{% endif %}

View File

@ -1,52 +0,0 @@
{% macro quiz(loop_index, question) %}
<div class="question mt-4" id="{{ question.question }}" data-question="{{ question.name }}">
<h5>{{ loop_index }}{{ question.question }}</h5>
<div class="options ml-2">
{% for option in question.options %}
<div class="form-check pb-1">
<input class="form-check-input" type="radio" name="{{ question.name }}" id="{{loop_index}}-{{ option.option }}" value="{{ option.option }}">
<label class="form-check-label" for="{{loop_index}}-{{ option.option }}">
{{ option.option }}
</label>
</div>
{% endfor %}
</div>
</div>
{% endmacro %}
<section class="quiz-section">
<div class='container'>
<div class="row">
<div class="col-md-8">
<h2>{{ content.title }}</h2>
</div>
</div>
<div class="content">
<hr>
<form id="quiz" name="{{ content.name }}">
<div id="quiz-body">
{% for q in questions %}
{{ quiz(loop.index|str +". ", q) }}
{% endfor %}
</div>
<div class="mt-3">
<div id="quiz-actions" class="text-right">
<button class='btn btn-outline-secondary' type="reset">Reset</button>
<button class='btn btn-primary' type="button" onclick="submitQuiz()">Submit</button>
</div>
<div id="post-quiz-actions" class="row" hidden="hidden">
<div class="col-md-8 text-left">
<h3>Your Score: <span id="result"></span></h3>
</div>
<div class="col-md-4 text-right">
{% include "www/lms/templates/includes/lms-nav.html" %}
</div>
</div>
</div>
</form>
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>

View File

@ -1,35 +0,0 @@
<section class='video-top-section video-section-bg'>
<div class='container'>
<div class="embed-responsive embed-responsive-16by9">
<iframe class="embed-responsive-item" src="https://www.youtube.com/embed/{{ content.url.split('v=')[1].split('&')[0] }}" allowfullscreen></iframe>
</div>
<div class="mt-3 row">
<div class="col-md-8">
<h2>{{ content.name }}</h2>
<span class="text-muted">
<i class="octicon octicon-clock" title="Duration"></i> {{ content.duration }} Mins
&mdash; Published on {{ content.publish_date }}.
</span>
</div>
<div class="col-md-4 text-right">
{% include "www/lms/templates/includes/lms-nav.html" %}
</div>
</div>
<hr>
</div>
</section>
<section class="video-description-section">
<div class='container'>
<div class="content">
{{ content.description }}
</div>
<div class="text-right hidden">
<a class='btn btn-outline-secondary' href="/classrooms/module">Previous</a>
<a class='btn btn-primary' href="/classrooms/module">Next</a>
</div>
<div class="mt-3 text-right">
<a class="text-muted" href="/report"><i class="octicon octicon-issue-opened" title="Report"></i> Report a
Mistake</a>
</div>
</div>
</section>