Compare commits
1 Commits
talks-thum
...
lms-quizes
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
05f28430b9 |
3
.gitignore
vendored
3
.gitignore
vendored
@@ -5,6 +5,3 @@
|
|||||||
tags
|
tags
|
||||||
community/docs/current
|
community/docs/current
|
||||||
community/public/dist
|
community/public/dist
|
||||||
__pycache__/
|
|
||||||
*.py[cod]
|
|
||||||
*$py.class
|
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('Discussion Message', {
|
|
||||||
// refresh: function(frm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
@@ -1,69 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-11 10:59:38.597046",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"thread",
|
|
||||||
"column_break_2",
|
|
||||||
"parent_message",
|
|
||||||
"section_break_4",
|
|
||||||
"message"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "message",
|
|
||||||
"fieldtype": "Long Text",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Message"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "thread",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Thread",
|
|
||||||
"options": "Discussion Thread"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_2",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "parent_message",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Parent Message",
|
|
||||||
"options": "Discussion Message"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_4",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-12 15:59:04.811286",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Community",
|
|
||||||
"name": "Discussion Message",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
from community.widgets import Widget, Widgets
|
|
||||||
|
|
||||||
class DiscussionMessage(Document):
|
|
||||||
def after_insert(self):
|
|
||||||
data = {
|
|
||||||
"message": self,
|
|
||||||
"widgets": Widgets()
|
|
||||||
}
|
|
||||||
template = frappe.render_template("community/templates/message_card.html", data)
|
|
||||||
thread_info = frappe.db.get_value("Discussion Thread", self.thread, ["reference_doctype", "reference_docname"], as_dict=True)
|
|
||||||
frappe.publish_realtime(event="publish_message",
|
|
||||||
message = {
|
|
||||||
"thread": self.thread,
|
|
||||||
"template": template,
|
|
||||||
"thread_info": thread_info
|
|
||||||
},
|
|
||||||
after_commit=True)
|
|
||||||
@@ -1,48 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class DiscussionThread(Document):
|
|
||||||
pass
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def submit_discussion(doctype, docname, message, title=None, thread_name=None):
|
|
||||||
thread = []
|
|
||||||
filters = {}
|
|
||||||
if doctype and docname:
|
|
||||||
filters = {
|
|
||||||
"reference_doctype": doctype,
|
|
||||||
"reference_docname": docname
|
|
||||||
}
|
|
||||||
|
|
||||||
elif thread_name:
|
|
||||||
filters = {
|
|
||||||
"name": thread_name
|
|
||||||
}
|
|
||||||
|
|
||||||
if filters:
|
|
||||||
thread = frappe.get_all("Discussion Thread",filters)
|
|
||||||
if len(thread):
|
|
||||||
thread = thread[0]
|
|
||||||
save_message(message, thread)
|
|
||||||
|
|
||||||
else:
|
|
||||||
thread = frappe.get_doc({
|
|
||||||
"doctype": "Discussion Thread",
|
|
||||||
"title": title,
|
|
||||||
"reference_doctype": doctype,
|
|
||||||
"reference_docname": docname
|
|
||||||
})
|
|
||||||
thread.save(ignore_permissions=True)
|
|
||||||
save_message(message, thread)
|
|
||||||
|
|
||||||
return thread.name
|
|
||||||
|
|
||||||
def save_message(message, thread):
|
|
||||||
frappe.get_doc({
|
|
||||||
"doctype": "Discussion Message",
|
|
||||||
"message": message,
|
|
||||||
"thread": thread.name
|
|
||||||
}).save(ignore_permissions=True)
|
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
{% set color = member.get_palette() %}
|
{% set color = member.get_palette() %}
|
||||||
<a class="button-links" href="/user/{{member.username}}">
|
<a href="/{{member.username}}">
|
||||||
<span class="avatar {{ avatar_class }}" title="{{ member.full_name }}">
|
<span class="avatar {{ avatar_class }}" title="{{ member.full_name }}">
|
||||||
{% if member.user_image %}
|
{% if member.user_image %}
|
||||||
<img class="avatar-frame standard-image" style="object-fit: cover;" src="{{ member.user_image }}" title="{{ member.full_name }}">
|
<img class="avatar-frame standard-image" style="object-fit: cover;" src="{{ member.user_image }}" title="{{ member.full_name }}">
|
||||||
|
|||||||
@@ -1,70 +0,0 @@
|
|||||||
<div class="discussions">
|
|
||||||
|
|
||||||
<form class="discussion-form {% if doctype or thread %} discussion-on-page {% endif %}" id="discussion-form">
|
|
||||||
|
|
||||||
|
|
||||||
<div class="form-group" {% if title or thread %} style="display: none;" {% endif %}>
|
|
||||||
<div class="control-input-wrapper">
|
|
||||||
<div class="control-input">
|
|
||||||
<input type="text" autocomplete="off" class="input-with-feedback form-control thread-title"
|
|
||||||
data-fieldtype="Data" data-fieldname="feedback_comments" placeholder="Title" spellcheck="false" {% if title
|
|
||||||
%} value="{{ title }}" {% endif %}></input>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="form-group">
|
|
||||||
<div class="control-input-wrapper">
|
|
||||||
<div class="control-input">
|
|
||||||
<textarea type="text" autocomplete="off" class="input-with-feedback form-control comment-field"
|
|
||||||
data-fieldtype="Text" data-fieldname="feedback_comments" placeholder="Enter a comment..."
|
|
||||||
spellcheck="false"></textarea>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="comment-footer">
|
|
||||||
<div class="button is-secondary pull-right" id="submit-discussion"
|
|
||||||
{% if doctype %} data-doctype="{{ doctype | urlencode}}" {% endif %}
|
|
||||||
{% if docname %} data-docname="{{ docname | urlencode}}" {% endif %}
|
|
||||||
{% if thread %} data-thread="{{ thread }}" {% endif %}>
|
|
||||||
Post</div>
|
|
||||||
</div>
|
|
||||||
</form>
|
|
||||||
</div>
|
|
||||||
<script>
|
|
||||||
frappe.ready(() => {
|
|
||||||
$("#submit-discussion").click((e) => {
|
|
||||||
submit_discussion(e);
|
|
||||||
})
|
|
||||||
})
|
|
||||||
|
|
||||||
var submit_discussion = (e) => {
|
|
||||||
var message = $(".comment-field").val().trim();
|
|
||||||
|
|
||||||
if (message) {
|
|
||||||
var doctype = $(e.currentTarget).attr("data-doctype");
|
|
||||||
doctype = doctype ? decodeURIComponent(doctype) : doctype;
|
|
||||||
|
|
||||||
var docname = $(e.currentTarget).attr("data-docname");
|
|
||||||
docname = docname ? decodeURIComponent(docname) : docname;
|
|
||||||
|
|
||||||
frappe.call({
|
|
||||||
method: "community.community.doctype.discussion_thread.discussion_thread.submit_discussion",
|
|
||||||
args: {
|
|
||||||
"doctype": doctype ? doctype : "",
|
|
||||||
"docname": docname ? docname : "",
|
|
||||||
"message": $(".comment-field").val(),
|
|
||||||
"title": $(".thread-title").val(),
|
|
||||||
"thread_name": $(e.currentTarget).attr("data-thread")
|
|
||||||
},
|
|
||||||
callback: (data) => {
|
|
||||||
if (! $(".discussion-on-page").length) {
|
|
||||||
$("#discussion-modal").modal("hide");
|
|
||||||
window.location.href = `/discussions/${data.message}`;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
|
||||||
</script>
|
|
||||||
@@ -1,80 +0,0 @@
|
|||||||
{% if doctype and docname and not thread %}
|
|
||||||
|
|
||||||
{% set thread_info = frappe.get_all("Discussion Thread", {"reference_doctype": doctype, "reference_docname": docname},
|
|
||||||
["name"]) %}
|
|
||||||
|
|
||||||
{% if thread_info | length %}
|
|
||||||
{% set thread = thread_info[0].name %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if thread %}
|
|
||||||
{% set messages = frappe.get_all("Discussion Message", {"thread": thread}, ["name", "message", "owner", "creation"],
|
|
||||||
order_by="creation") %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
{% if doctype %}
|
|
||||||
<div class="course-home-headings mt-5"> Discussions </div>
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="messages mt-5">
|
|
||||||
{% for message in messages %}
|
|
||||||
{% include "community/templates/message_card.html" %}
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{% if frappe.session.user == "Guest" or (condition is defined and not condition) %}
|
|
||||||
<div class="d-flex flex-column align-items-center font-weight-bold">
|
|
||||||
Want to join the discussion?
|
|
||||||
{% if frappe.session.user == "Guest" %}
|
|
||||||
<div class="button is-primary mt-5" id="login-from-discussion">Log In</div>
|
|
||||||
{% elif not condition %}
|
|
||||||
<div class="button is-primary mt-5" id="login-from-discussion" data-redirect="{{ redirect_to }}">{{ button_name }}</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
{% else %}
|
|
||||||
{{ widgets.DiscussionComment(doctype=doctype, docname=docname, title=title, thread=thread ) }}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<script>
|
|
||||||
frappe.ready(() => {
|
|
||||||
setup_socket_io();
|
|
||||||
|
|
||||||
$("#login-from-discussion").click((e) => {
|
|
||||||
login_from_discussion(e);
|
|
||||||
})
|
|
||||||
|
|
||||||
})
|
|
||||||
|
|
||||||
var setup_socket_io = () => {
|
|
||||||
const assets = [
|
|
||||||
"/assets/frappe/js/lib/socket.io.min.js",
|
|
||||||
"/assets/frappe/js/frappe/socketio_client.js",
|
|
||||||
]
|
|
||||||
frappe.require(assets, () => {
|
|
||||||
|
|
||||||
if (window.dev_server) {
|
|
||||||
frappe.boot.socketio_port = "9000";
|
|
||||||
}
|
|
||||||
|
|
||||||
frappe.socketio.init(9000);
|
|
||||||
var target = $("#submit-discussion");
|
|
||||||
|
|
||||||
frappe.socketio.socket.on("publish_message", (data) => {
|
|
||||||
if (target.attr("data-thread") == data.thread
|
|
||||||
|| (decodeURIComponent(target.attr("data-doctype")) == data.thread_info.reference_doctype
|
|
||||||
&& decodeURIComponent(target.attr("data-docname")) == data.thread_info.reference_docname)) {
|
|
||||||
$(".comment-field").val("");
|
|
||||||
$(".messages").append(data.template);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
var login_from_discussion = (e) => {
|
|
||||||
var redirect = $(e.currentTarget).attr("data-redirect") || window.location.href;
|
|
||||||
window.location.href = `/login?redirect-to=${redirect}`;
|
|
||||||
}
|
|
||||||
|
|
||||||
</script>
|
|
||||||
@@ -1,14 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('Attendee', {
|
|
||||||
onload: function (frm) {
|
|
||||||
frm.set_query('user', function (doc) {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
"ignore_user_type": 1,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('Event Details', {
|
|
||||||
// refresh: function(frm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
@@ -1,68 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"autoname": "field:event_name",
|
|
||||||
"creation": "2021-08-11 10:05:41.072432",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event_name",
|
|
||||||
"start_date",
|
|
||||||
"end_date",
|
|
||||||
"event_description"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "event_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Event Name",
|
|
||||||
"reqd": 1,
|
|
||||||
"unique": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "start_date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Start Date",
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "end_date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "End Date",
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event_description",
|
|
||||||
"fieldtype": "Markdown Editor",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Event Description"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-18 23:51:30.432691",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Event Details",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-11 11:17:28.452289",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event",
|
|
||||||
"ticket",
|
|
||||||
"attendee"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "ticket",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Ticket"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "attendee",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "attendee",
|
|
||||||
"options": "Attendee"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-20 13:38:28.688115",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Event Ticket",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class EventTicket(Document):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestEventTicket(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -1,87 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-16 16:26:46.189119",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event",
|
|
||||||
"is_paid",
|
|
||||||
"column_break_3",
|
|
||||||
"user",
|
|
||||||
"full_name",
|
|
||||||
"company",
|
|
||||||
"section_break_7",
|
|
||||||
"description"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fetch_from": "user.full_name",
|
|
||||||
"fieldname": "full_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Full Name",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Company "
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "description",
|
|
||||||
"fieldtype": "Text Editor",
|
|
||||||
"label": "Description"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": "0",
|
|
||||||
"fieldname": "is_paid",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Is Paid"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "User",
|
|
||||||
"options": "User"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_3",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_7",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-20 16:32:58.031324",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Exhibitor",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"title_field": "user",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class Exhibitor(Document):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestExhibitor(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-11 10:51:47.234690",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event",
|
|
||||||
"user",
|
|
||||||
"full_name"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "full_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Full Name",
|
|
||||||
"unique": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "User"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-20 17:03:26.733195",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Host",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"title_field": "user",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class Host(Document):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestHost(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('Speaker', {
|
|
||||||
// refresh: function(frm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
@@ -1,72 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-11 10:37:32.124651",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event",
|
|
||||||
"company",
|
|
||||||
"column_break_8",
|
|
||||||
"user",
|
|
||||||
"full_name"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "User",
|
|
||||||
"options": "User"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fetch_from": "user.full_name",
|
|
||||||
"fieldname": "full_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Full Name",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Company"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_8",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-20 16:53:43.968260",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Speaker",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"title_field": "user",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class Speaker(Document):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestSpeaker(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('Talk', {
|
|
||||||
// refresh: function(frm) {
|
|
||||||
|
|
||||||
// }
|
|
||||||
});
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-18 08:42:58.711932",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"event",
|
|
||||||
"title",
|
|
||||||
"url",
|
|
||||||
"column_break_5",
|
|
||||||
"speaker",
|
|
||||||
"category",
|
|
||||||
"thumbnail",
|
|
||||||
"schedule_section",
|
|
||||||
"date",
|
|
||||||
"status",
|
|
||||||
"column_break_11",
|
|
||||||
"start_time",
|
|
||||||
"end_time",
|
|
||||||
"section_break_9",
|
|
||||||
"about",
|
|
||||||
"attachment",
|
|
||||||
"name_of_the_speaker"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Title"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "name_of_the_speaker",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Name of the Speaker"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "url",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Video Embed Link"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "thumbnail",
|
|
||||||
"fieldtype": "Attach",
|
|
||||||
"label": "Preview Image"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "about",
|
|
||||||
"fieldtype": "Text",
|
|
||||||
"label": "About the Talk"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "attachment",
|
|
||||||
"fieldtype": "Attach",
|
|
||||||
"label": "Attachment"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "speaker",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Speaker",
|
|
||||||
"options": "Speaker"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": "Pending",
|
|
||||||
"fieldname": "status",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Status",
|
|
||||||
"options": "Pending\nApproved\nRejected"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_5",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_9",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "category",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Category"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "schedule_section",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"label": "Date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_11",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "start_time",
|
|
||||||
"fieldtype": "Time",
|
|
||||||
"label": "Start Time"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "end_time",
|
|
||||||
"fieldtype": "Time",
|
|
||||||
"label": "End Time"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-24 11:46:34.476903",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Talk",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"title_field": "title",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,29 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
|
|
||||||
class Talk(Document):
|
|
||||||
def before_save(self):
|
|
||||||
if not self.speaker:
|
|
||||||
self.save_speaker()
|
|
||||||
|
|
||||||
def save_speaker(self):
|
|
||||||
exists = frappe.db.exists({
|
|
||||||
'doctype': 'Speaker',
|
|
||||||
'user': frappe.session.user
|
|
||||||
})
|
|
||||||
|
|
||||||
if exists:
|
|
||||||
self.speaker = frappe.db.get_value(
|
|
||||||
'Speaker', {'user': frappe.session.user}, ["name"])
|
|
||||||
|
|
||||||
else:
|
|
||||||
speaker = frappe.get_doc({
|
|
||||||
"doctype": "Speaker",
|
|
||||||
"event": self.event,
|
|
||||||
"user": frappe.session.user
|
|
||||||
}).save(ignore_permissions=True)
|
|
||||||
self.speaker = speaker
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestTalk(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
frappe.ready(function () {
|
|
||||||
frappe.web_form.after_save = () => {
|
|
||||||
setTimeout(function () {
|
|
||||||
window.location.href = '/about';
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
{
|
|
||||||
"accept_payment": 0,
|
|
||||||
"allow_comments": 0,
|
|
||||||
"allow_delete": 0,
|
|
||||||
"allow_edit": 0,
|
|
||||||
"allow_incomplete": 0,
|
|
||||||
"allow_multiple": 0,
|
|
||||||
"allow_print": 0,
|
|
||||||
"amount": 0.0,
|
|
||||||
"amount_based_on_field": 0,
|
|
||||||
"apply_document_permissions": 0,
|
|
||||||
"button_label": "",
|
|
||||||
"creation": "2021-08-19 15:26:56.594526",
|
|
||||||
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}",
|
|
||||||
"doc_type": "Attendee",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Form",
|
|
||||||
"idx": 0,
|
|
||||||
"is_standard": 1,
|
|
||||||
"login_required": 1,
|
|
||||||
"max_attachment_size": 0,
|
|
||||||
"modified": "2021-08-23 10:13:19.224367",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "attendee-registration",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"payment_button_label": "Buy Now",
|
|
||||||
"published": 1,
|
|
||||||
"route": "/attendee-registration",
|
|
||||||
"route_to_success_link": 1,
|
|
||||||
"show_attachments": 0,
|
|
||||||
"show_in_grid": 0,
|
|
||||||
"show_sidebar": 0,
|
|
||||||
"sidebar_items": [],
|
|
||||||
"success_url": "/about",
|
|
||||||
"title": "Attendee Registration",
|
|
||||||
"web_form_fields": [
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "User",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "User",
|
|
||||||
"read_only": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Company",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "what_are_you_hoping_to_learn",
|
|
||||||
"fieldtype": "Text",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "What are you hoping to learn",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
|
||||||
# do your magic here
|
|
||||||
pass
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
frappe.ready(function () {
|
|
||||||
frappe.web_form.after_save = () => {
|
|
||||||
setTimeout(function () {
|
|
||||||
window.location.href = '/about';
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,76 +0,0 @@
|
|||||||
{
|
|
||||||
"accept_payment": 0,
|
|
||||||
"allow_comments": 0,
|
|
||||||
"allow_delete": 0,
|
|
||||||
"allow_edit": 0,
|
|
||||||
"allow_incomplete": 0,
|
|
||||||
"allow_multiple": 0,
|
|
||||||
"allow_print": 0,
|
|
||||||
"amount": 0.0,
|
|
||||||
"amount_based_on_field": 0,
|
|
||||||
"apply_document_permissions": 0,
|
|
||||||
"button_label": "Save",
|
|
||||||
"creation": "2021-08-16 16:27:06.566564",
|
|
||||||
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}",
|
|
||||||
"doc_type": "Exhibitor",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Form",
|
|
||||||
"idx": 0,
|
|
||||||
"is_standard": 1,
|
|
||||||
"login_required": 1,
|
|
||||||
"max_attachment_size": 0,
|
|
||||||
"modified": "2021-08-23 10:12:24.038572",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "exhibitor-registration",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"payment_button_label": "Buy Now",
|
|
||||||
"published": 1,
|
|
||||||
"route": "exhibitor-registration",
|
|
||||||
"route_to_success_link": 0,
|
|
||||||
"show_attachments": 0,
|
|
||||||
"show_in_grid": 0,
|
|
||||||
"show_sidebar": 0,
|
|
||||||
"sidebar_items": [],
|
|
||||||
"success_url": "",
|
|
||||||
"title": "Exhibitor Registration",
|
|
||||||
"web_form_fields": [
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "User",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "User",
|
|
||||||
"read_only": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Company ",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "description",
|
|
||||||
"fieldtype": "Text Editor",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Description",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
|
||||||
# do your magic here
|
|
||||||
pass
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
frappe.ready(function () {
|
|
||||||
frappe.web_form.after_save = () => {
|
|
||||||
setTimeout(function () {
|
|
||||||
window.location.href = '/about';
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,102 +0,0 @@
|
|||||||
{
|
|
||||||
"accept_payment": 0,
|
|
||||||
"allow_comments": 0,
|
|
||||||
"allow_delete": 0,
|
|
||||||
"allow_edit": 0,
|
|
||||||
"allow_incomplete": 0,
|
|
||||||
"allow_multiple": 0,
|
|
||||||
"allow_print": 0,
|
|
||||||
"amount": 0.0,
|
|
||||||
"amount_based_on_field": 0,
|
|
||||||
"apply_document_permissions": 0,
|
|
||||||
"button_label": "Submit",
|
|
||||||
"client_script": "",
|
|
||||||
"creation": "2021-08-19 15:16:22.341723",
|
|
||||||
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}",
|
|
||||||
"doc_type": "Talk",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Form",
|
|
||||||
"idx": 0,
|
|
||||||
"is_standard": 1,
|
|
||||||
"login_required": 1,
|
|
||||||
"max_attachment_size": 0,
|
|
||||||
"modified": "2021-08-23 10:18:17.486228",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "purpose-a-talk",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"payment_button_label": "Buy Now",
|
|
||||||
"published": 1,
|
|
||||||
"route": "propose-talk",
|
|
||||||
"route_to_success_link": 0,
|
|
||||||
"show_attachments": 0,
|
|
||||||
"show_in_grid": 0,
|
|
||||||
"show_sidebar": 0,
|
|
||||||
"sidebar_items": [],
|
|
||||||
"success_message": "Talk Submitted!",
|
|
||||||
"success_url": "/purpose-a-talk",
|
|
||||||
"title": "Propose a Talk",
|
|
||||||
"web_form_fields": [
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Title",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "category",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Category",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Event",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "Event Details",
|
|
||||||
"read_only": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "about",
|
|
||||||
"fieldtype": "Text Editor",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "About",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "attachment",
|
|
||||||
"fieldtype": "Attach",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Attachment",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
frappe.ready(function () {
|
|
||||||
frappe.web_form.after_save = () => {
|
|
||||||
setTimeout(function () {
|
|
||||||
window.location.href = '/event/conference2021/propose-talk';
|
|
||||||
}, 2000);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
@@ -1,89 +0,0 @@
|
|||||||
{
|
|
||||||
"accept_payment": 0,
|
|
||||||
"allow_comments": 0,
|
|
||||||
"allow_delete": 0,
|
|
||||||
"allow_edit": 0,
|
|
||||||
"allow_incomplete": 0,
|
|
||||||
"allow_multiple": 0,
|
|
||||||
"allow_print": 0,
|
|
||||||
"amount": 0.0,
|
|
||||||
"amount_based_on_field": 0,
|
|
||||||
"apply_document_permissions": 0,
|
|
||||||
"button_label": "Register",
|
|
||||||
"creation": "2021-08-19 15:29:01.167930",
|
|
||||||
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}",
|
|
||||||
"doc_type": "Speaker",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Form",
|
|
||||||
"idx": 0,
|
|
||||||
"is_standard": 1,
|
|
||||||
"login_required": 1,
|
|
||||||
"max_attachment_size": 0,
|
|
||||||
"modified": "2021-08-20 16:16:51.107177",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "speaker-registration",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"payment_button_label": "Buy Now",
|
|
||||||
"published": 1,
|
|
||||||
"route": "speaker-registration",
|
|
||||||
"route_to_success_link": 1,
|
|
||||||
"show_attachments": 0,
|
|
||||||
"show_in_grid": 0,
|
|
||||||
"show_sidebar": 0,
|
|
||||||
"sidebar_items": [],
|
|
||||||
"success_url": "/speaker-registration",
|
|
||||||
"title": "Speaker Registration",
|
|
||||||
"web_form_fields": [
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Event",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "Event Details",
|
|
||||||
"read_only": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "user",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "User",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"options": "User",
|
|
||||||
"read_only": 1,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "full_name",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Full Name",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"show_in_filter": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_read_on_all_link_options": 0,
|
|
||||||
"fieldname": "company",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"label": "Company",
|
|
||||||
"max_length": 0,
|
|
||||||
"max_value": 0,
|
|
||||||
"read_only": 0,
|
|
||||||
"reqd": 1,
|
|
||||||
"show_in_filter": 0
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import frappe
|
|
||||||
|
|
||||||
def get_context(context):
|
|
||||||
# do your magic here
|
|
||||||
pass
|
|
||||||
@@ -1,28 +0,0 @@
|
|||||||
<div class="section-with-cards">
|
|
||||||
<h1 class="course-home-headings">{{title}}</h1>
|
|
||||||
{%- if subtitle -%}
|
|
||||||
<p class="section-description">{{ subtitle }}</p>
|
|
||||||
{%- endif -%}
|
|
||||||
<div>
|
|
||||||
<div class="mentors-section">
|
|
||||||
{% for exhibitor in exhibitor_details %}
|
|
||||||
{% set exhibitor_doc = frappe.db.get_value("Exhibitor", exhibitor.exhibitor, ["user", "company"], as_dict= True)
|
|
||||||
%}
|
|
||||||
{% set member = frappe.get_doc("User", exhibitor_doc.user) %}
|
|
||||||
|
|
||||||
<div class="common-card-style member-card">
|
|
||||||
{{ widgets.Avatar(member=member, avatar_class="avatar-large")}}
|
|
||||||
<div class="small-title member-card-title">
|
|
||||||
{{ member.full_name }}
|
|
||||||
</div>
|
|
||||||
<div class="small-title">
|
|
||||||
{{exhibitor_doc.company}}
|
|
||||||
</div>
|
|
||||||
<a class="stretched-link" href=""></a>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
<div class="event-btn"><a href="/exhibitor-registration?new=1&user={{ frappe.session.user }}&event={{ event }}"
|
|
||||||
class="btn btn-primary ">Become an Exhibitor</a></div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"__unsaved": 1,
|
|
||||||
"creation": "2021-08-13 15:05:41.606772",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Template",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Title",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "subtitle",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Subtitle",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "exhibitor_details",
|
|
||||||
"fieldtype": "Table Break",
|
|
||||||
"label": "Exhibitor Details",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "exhibitor",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Exhibitor",
|
|
||||||
"options": "Exhibitor",
|
|
||||||
"reqd": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idx": 1,
|
|
||||||
"modified": "2021-08-20 16:28:22.779057",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Exhibitor Section",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"standard": 1,
|
|
||||||
"template": "",
|
|
||||||
"type": "Section"
|
|
||||||
}
|
|
||||||
@@ -1,3 +0,0 @@
|
|||||||
<div class="section-with-cards">
|
|
||||||
<h1 class="course-home-headings">{{title}}</h1>
|
|
||||||
</div>
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
{
|
|
||||||
"__unsaved": 1,
|
|
||||||
"creation": "2021-08-20 08:12:29.549625",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Template",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Title",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "subtitle",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Subtitle",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"__unsaved": 1,
|
|
||||||
"fieldname": "hosts",
|
|
||||||
"fieldtype": "Table Break",
|
|
||||||
"label": "Hosts",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "host",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Host",
|
|
||||||
"options": "Host",
|
|
||||||
"reqd": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idx": 0,
|
|
||||||
"modified": "2021-08-20 08:16:25.805456",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Host Section",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"standard": 1,
|
|
||||||
"template": "",
|
|
||||||
"type": "Section"
|
|
||||||
}
|
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<div class="section-with-cards">
|
|
||||||
<h1 class="course-home-headings">{{section_title}}</h1>
|
|
||||||
{%- if subtitle -%}
|
|
||||||
<p class="section-description">{{ subtitle }}</p>
|
|
||||||
{%- endif -%}
|
|
||||||
<div class="mentors-section">
|
|
||||||
{% for speaker in speaker_details %}
|
|
||||||
{% set speaker_doc = frappe.db.get_value("Speaker", speaker.speaker, ["user", "company"], as_dict= True)
|
|
||||||
%}
|
|
||||||
{% set member = frappe.get_doc("User", speaker_doc.user) %}
|
|
||||||
|
|
||||||
<div class="common-card-style member-card">
|
|
||||||
{{ widgets.Avatar(member=member, avatar_class="avatar-large") }}
|
|
||||||
|
|
||||||
<div class="small-title member-card-title">
|
|
||||||
{{ member.full_name }}
|
|
||||||
</div>
|
|
||||||
<div class="small-title">
|
|
||||||
{{speaker_doc.company}}
|
|
||||||
</div>
|
|
||||||
<a class="stretched-link" href=""></a>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="event-btn">
|
|
||||||
<a href='/propose-talk?new=1&event={{ event }}' class="btn btn-primary ">Propose a Talk</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"__unsaved": 1,
|
|
||||||
"creation": "2021-08-12 21:15:14.492000",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Template",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "section_title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Section Title",
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "subtitle",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Subtitle",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event_",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event ",
|
|
||||||
"options": "Event Details",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "speaker_details",
|
|
||||||
"fieldtype": "Table Break",
|
|
||||||
"label": "Speaker Details",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "speaker",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Speaker",
|
|
||||||
"options": "Speaker",
|
|
||||||
"reqd": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idx": 1,
|
|
||||||
"modified": "2021-08-20 10:59:54.965714",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Speaker Section",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"standard": 1,
|
|
||||||
"template": "",
|
|
||||||
"type": "Section"
|
|
||||||
}
|
|
||||||
@@ -1,75 +0,0 @@
|
|||||||
<div class="section-with-cards">
|
|
||||||
<div class="course-home-headings">{{title}}</div>
|
|
||||||
{%- if subtitle -%}
|
|
||||||
<p class="section-description">{{ subtitle }}</p>
|
|
||||||
{%- endif -%}
|
|
||||||
<div class="cards-parent">
|
|
||||||
|
|
||||||
{% for talk in talk_details %}
|
|
||||||
|
|
||||||
{% set talk_doc = frappe.db.get_value('Talk', talk.talk,
|
|
||||||
["title", "category", "speaker", "url", "thumbnail", "date", "start_time", "end_time"], as_dict=True) %}
|
|
||||||
{% set speaker_info = frappe.db.get_value("Speaker", talk_doc.speaker, ["user"], as_dict=True) %}
|
|
||||||
{% set member = frappe.get_doc("User", speaker_info.user) %}
|
|
||||||
|
|
||||||
{% if talk_doc.thumbnail %}
|
|
||||||
{% set thumbnail = talk_doc.thumbnail %}
|
|
||||||
{% else %}
|
|
||||||
{% set video_id = talk_doc.url and talk_doc.url.split("/")[-1] %}
|
|
||||||
{% set thumbnail = video_id and "https://img.youtube.com/vi/" + video_id + "/maxresdefault.jpg" %}
|
|
||||||
{% endif %}
|
|
||||||
|
|
||||||
<div class="common-card-style flex-column">
|
|
||||||
<div class="course-image {% if not thumbnail %}default-image{% endif %}" {% if thumbnail %}
|
|
||||||
style="background-image: url( {{ thumbnail }} );" {% endif %}>
|
|
||||||
<div class="course-tags">
|
|
||||||
{% for tag in talk_doc.category.split(",") %}
|
|
||||||
<div class="course-card-pills">{{ tag }}</div>
|
|
||||||
{% endfor %}
|
|
||||||
</div>
|
|
||||||
{% if not thumbnail %}
|
|
||||||
<div class="default-image-text">{{ talk_doc.title[0] }}</div>
|
|
||||||
{% endif %}
|
|
||||||
</div>
|
|
||||||
<div class="course-card-content">
|
|
||||||
<div class="course-card-content"></div>
|
|
||||||
<div class="course-card-title">{{talk_doc.title}}</div>
|
|
||||||
<div class="muted-text mb-3">
|
|
||||||
{% if talk_doc.date %}
|
|
||||||
<span>
|
|
||||||
<img src="/assets/community/icons/calendar.svg">
|
|
||||||
{{ frappe.utils.format_date(talk_doc.date, "medium") }}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
<span class="pull-right">
|
|
||||||
{% if talk_doc.start_time %}
|
|
||||||
<span class="mr-3">
|
|
||||||
<b>From:</b>
|
|
||||||
{{ frappe.utils.format_time(talk_doc.start_time, "HH:mm") }}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
{% if talk_doc.end_time %}
|
|
||||||
<span>
|
|
||||||
<b>To:</b>
|
|
||||||
{{ frappe.utils.format_time(talk_doc.end_time, "HH:mm") }}
|
|
||||||
</span>
|
|
||||||
{% endif %}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
<div class="card-divider"></div>
|
|
||||||
<div class="course-card-meta-2">
|
|
||||||
{{ widgets.Avatar(member=member, avatar_class="avatar-small")}}
|
|
||||||
<span class="course-instructor"> {{ member.full_name }} </span>
|
|
||||||
<span class="small-title company-name"></span>
|
|
||||||
</div>
|
|
||||||
<div class="view-talk-link">
|
|
||||||
Vew Talk
|
|
||||||
<img class="ml-3" src="/assets/community/icons/black-arrow.svg" />
|
|
||||||
</div>
|
|
||||||
<a class="stretched-link" href="{{talk_doc.url}}"></a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
{% endfor %}
|
|
||||||
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
@@ -1,49 +0,0 @@
|
|||||||
{
|
|
||||||
"__unsaved": 1,
|
|
||||||
"creation": "2021-08-13 11:34:07.611034",
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Web Template",
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "title",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Title",
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "subtitle",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"label": "Subtitle",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "event",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Event",
|
|
||||||
"options": "Event Details",
|
|
||||||
"reqd": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "talk_details",
|
|
||||||
"fieldtype": "Table Break",
|
|
||||||
"label": "Talk Details",
|
|
||||||
"reqd": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "talk",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"label": "Talk",
|
|
||||||
"options": "Talk",
|
|
||||||
"reqd": 0
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"idx": 1,
|
|
||||||
"modified": "2021-08-20 10:58:45.556636",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "Event Management",
|
|
||||||
"name": "Talk Section",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"standard": 1,
|
|
||||||
"template": "",
|
|
||||||
"type": "Section"
|
|
||||||
}
|
|
||||||
@@ -1,373 +0,0 @@
|
|||||||
[
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "linkedin",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "mobile_no",
|
|
||||||
"label": "LinkedIn ID",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-linkedin",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "github",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "linkedin",
|
|
||||||
"label": "Github ID",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-github",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "medium",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "github",
|
|
||||||
"label": "Medium ID",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-medium",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "city",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "mute_sounds",
|
|
||||||
"label": "City",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-city",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "college",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "city",
|
|
||||||
"label": "College Name",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-college",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "branch",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "college",
|
|
||||||
"label": "Branch",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-branch",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"allow_in_quick_entry": 0,
|
|
||||||
"allow_on_submit": 0,
|
|
||||||
"bold": 0,
|
|
||||||
"collapsible": 0,
|
|
||||||
"collapsible_depends_on": null,
|
|
||||||
"columns": 0,
|
|
||||||
"default": null,
|
|
||||||
"depends_on": null,
|
|
||||||
"description": null,
|
|
||||||
"docstatus": 0,
|
|
||||||
"doctype": "Custom Field",
|
|
||||||
"dt": "User",
|
|
||||||
"fetch_from": null,
|
|
||||||
"fetch_if_empty": 0,
|
|
||||||
"fieldname": "profession",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"hidden": 0,
|
|
||||||
"hide_border": 0,
|
|
||||||
"hide_days": 0,
|
|
||||||
"hide_seconds": 0,
|
|
||||||
"ignore_user_permissions": 0,
|
|
||||||
"ignore_xss_filter": 0,
|
|
||||||
"in_global_search": 0,
|
|
||||||
"in_list_view": 0,
|
|
||||||
"in_preview": 0,
|
|
||||||
"in_standard_filter": 0,
|
|
||||||
"insert_after": "medium",
|
|
||||||
"label": "Profession",
|
|
||||||
"length": 0,
|
|
||||||
"mandatory_depends_on": null,
|
|
||||||
"modified": "2021-06-30 14:46:55.834145",
|
|
||||||
"name": "User-profession",
|
|
||||||
"no_copy": 0,
|
|
||||||
"non_negative": 0,
|
|
||||||
"options": null,
|
|
||||||
"parent": null,
|
|
||||||
"parentfield": null,
|
|
||||||
"parenttype": null,
|
|
||||||
"permlevel": 0,
|
|
||||||
"precision": "",
|
|
||||||
"print_hide": 0,
|
|
||||||
"print_hide_if_no_value": 0,
|
|
||||||
"print_width": null,
|
|
||||||
"read_only": 0,
|
|
||||||
"read_only_depends_on": null,
|
|
||||||
"report_hide": 0,
|
|
||||||
"reqd": 0,
|
|
||||||
"search_index": 0,
|
|
||||||
"translatable": 1,
|
|
||||||
"unique": 0,
|
|
||||||
"width": null
|
|
||||||
}
|
|
||||||
]
|
|
||||||
@@ -3,14 +3,13 @@
|
|||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from frappe import _
|
|
||||||
|
|
||||||
class CommunityProjectMember(Document):
|
class CommunityProjectMember(Document):
|
||||||
def validate(self):
|
def validate(self):
|
||||||
self.validate_if_already_member()
|
self.validate_if_already_member()
|
||||||
|
|
||||||
def validate_if_already_member(self):
|
def validate_if_already_member(self):
|
||||||
if frappe.get_all("Community Project Member", {"owner": self.owner}):
|
if frappe.get_all("Community Project Member", {"owner": self.owner}):
|
||||||
frappe.throw(_("You have already applied for the membership of this project."))
|
frappe.throw(_("You have already applied for the membership of this project."))
|
||||||
|
|||||||
@@ -85,8 +85,7 @@ web_include_css = "community.bundle.css"
|
|||||||
# Override standard doctype classes
|
# Override standard doctype classes
|
||||||
|
|
||||||
override_doctype_class = {
|
override_doctype_class = {
|
||||||
"User": "community.overrides.user.CustomUser",
|
"User": "community.overrides.user.CustomUser"
|
||||||
"Web Template": "community.overrides.web_template.CustomWebTemplate"
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Document Events
|
# Document Events
|
||||||
@@ -105,8 +104,6 @@ doc_events = {
|
|||||||
# ]
|
# ]
|
||||||
#}
|
#}
|
||||||
|
|
||||||
fixtures = ["Custom Field"]
|
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
# -------
|
# -------
|
||||||
|
|
||||||
@@ -131,48 +128,50 @@ fixtures = ["Custom Field"]
|
|||||||
# auto_cancel_exempted_doctypes = ["Auto Repeat"]
|
# auto_cancel_exempted_doctypes = ["Auto Repeat"]
|
||||||
|
|
||||||
# Add all simple route rules here
|
# Add all simple route rules here
|
||||||
website_route_rules = [
|
primary_rules = [
|
||||||
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
||||||
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
||||||
{"from_route": "/courses/<course>/<topic>", "to_route": "courses/topic"},
|
{"from_route": "/courses/<course>/<topic>", "to_route": "courses/topic"},
|
||||||
{"from_route": "/hackathons/<hackathon>", "to_route": "hackathons/hackathon"},
|
{"from_route": "/hackathons/<hackathon>", "to_route": "hackathons/hackathon"},
|
||||||
{"from_route": "/hackathons/<hackathon>/<project>", "to_route": "hackathons/project"},
|
{"from_route": "/hackathons/<hackathon>/<project>", "to_route": "hackathons/project"},
|
||||||
{"from_route": "/add-a-new-batch", "to_route": "add-a-new-batch"},
|
{"from_route": "/dashboard", "to_route": ""},
|
||||||
{"from_route": "/courses/<course>/home", "to_route": "batch/home"},
|
{"from_route": "/add-a-new-batch", "to_route": "add-a-new-batch"},
|
||||||
{"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
|
{"from_route": "/courses/<course>/<batch>/home", "to_route": "batch/home"},
|
||||||
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
|
{"from_route": "/courses/<course>/<batch>/learn", "to_route": "batch/learn"},
|
||||||
{"from_route": "/courses/<course>/schedule", "to_route": "batch/schedule"},
|
{"from_route": "/courses/<course>/<batch>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
|
||||||
{"from_route": "/courses/<course>/members", "to_route": "batch/members"},
|
{"from_route": "/courses/<course>/<batch>/schedule", "to_route": "batch/schedule"},
|
||||||
{"from_route": "/courses/<course>/discuss", "to_route": "batch/discuss"},
|
{"from_route": "/courses/<course>/<batch>/members", "to_route": "batch/members"},
|
||||||
{"from_route": "/courses/<course>/about", "to_route": "batch/about"},
|
{"from_route": "/courses/<course>/<batch>/discuss", "to_route": "batch/discuss"},
|
||||||
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
|
{"from_route": "/courses/<course>/<batch>/about", "to_route": "batch/about"},
|
||||||
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
|
{"from_route": "/courses/<course>/<batch>/progress", "to_route": "batch/progress"}
|
||||||
{"from_route": "/discussions/<discussion>", "to_route": "discussions/discussion"},
|
|
||||||
{"from_route": "/user/<string(minlength=4):username>", "to_route": "profiles/profile"},
|
|
||||||
]
|
]
|
||||||
|
|
||||||
website_redirects = [
|
# Any frappe default URL is blocked by profile-rules, add it here to unblock it
|
||||||
{"source": "/update-profile", "target": "/edit-profile"},
|
whitelist = [
|
||||||
|
"/home",
|
||||||
|
"/login",
|
||||||
|
"/update-password",
|
||||||
|
"/update-profile",
|
||||||
|
"/third-party-apps",
|
||||||
|
"/website_script.js",
|
||||||
|
"/courses",
|
||||||
|
"/sketches",
|
||||||
|
"/admin",
|
||||||
|
"/socket.io",
|
||||||
|
"/hackathons",
|
||||||
|
"/dashboard",
|
||||||
|
"/join-request"
|
||||||
|
"/add-a-new-batch",
|
||||||
|
"/new-sign-up",
|
||||||
|
"/message"
|
||||||
]
|
]
|
||||||
|
whitelist_rules = [{"from_route": p, "to_route": p[1:]} for p in whitelist]
|
||||||
|
|
||||||
|
# regex rule to match all profiles
|
||||||
|
profile_rules = [
|
||||||
|
{"from_route": "/<string(minlength=4):username>", "to_route": "profiles/profile"},
|
||||||
|
]
|
||||||
|
|
||||||
|
website_route_rules = primary_rules + whitelist_rules + profile_rules
|
||||||
|
|
||||||
update_website_context = 'community.widgets.update_website_context'
|
update_website_context = 'community.widgets.update_website_context'
|
||||||
|
|
||||||
## Specify the additional tabs to be included in the user profile page.
|
|
||||||
## Each entry must be a subclass of community.community.plugins.ProfileTab
|
|
||||||
# profile_tabs = []
|
|
||||||
|
|
||||||
## Specify the extension to be used to control what scripts and stylesheets
|
|
||||||
## to be included in lesson pages. The specified value must be be a
|
|
||||||
## subclass of community.community.plugins.PageExtension
|
|
||||||
# community_lesson_page_extension = None
|
|
||||||
|
|
||||||
community_lesson_page_extensions = [
|
|
||||||
"community.plugins.LiveCodeExtension"
|
|
||||||
]
|
|
||||||
|
|
||||||
## Markdown Macros for Lessons
|
|
||||||
community_markdown_macro_renderers = {
|
|
||||||
"Exercise": "community.plugins.exercise_renderer",
|
|
||||||
"Quiz": "community.plugins.quiz_renderer",
|
|
||||||
"YouTubeVideo": "community.plugins.youtube_video_renderer",
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -15,6 +15,13 @@ def autosave_section(section, code):
|
|||||||
doc.insert()
|
doc.insert()
|
||||||
return {"name": doc.name}
|
return {"name": doc.name}
|
||||||
|
|
||||||
|
@frappe.whitelist()
|
||||||
|
def get_section(name):
|
||||||
|
"""Saves the code edited in one of the sections.
|
||||||
|
"""
|
||||||
|
doc = frappe.get_doc("LMS Section", name)
|
||||||
|
return doc and doc.as_dict()
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def submit_solution(exercise, code):
|
def submit_solution(exercise, code):
|
||||||
"""Submits a solution.
|
"""Submits a solution.
|
||||||
@@ -29,14 +36,14 @@ def submit_solution(exercise, code):
|
|||||||
return {"name": doc.name, "creation": doc.creation}
|
return {"name": doc.name, "creation": doc.creation}
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def save_current_lesson(course_name, lesson_name):
|
def save_current_lesson(batch_name, lesson_name):
|
||||||
"""Saves the current lesson for a student/mentor.
|
"""Saves the current lesson for a student/mentor.
|
||||||
"""
|
"""
|
||||||
name = frappe.get_value(
|
name = frappe.get_value(
|
||||||
doctype="LMS Batch Membership",
|
doctype="LMS Batch Membership",
|
||||||
filters={
|
filters={
|
||||||
"course": course_name,
|
"batch": batch_name,
|
||||||
"member": frappe.session.user
|
"member_email": frappe.session.user
|
||||||
},
|
},
|
||||||
fieldname="name")
|
fieldname="name")
|
||||||
if not name:
|
if not name:
|
||||||
|
|||||||
@@ -2,15 +2,7 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Chapter', {
|
frappe.ui.form.on('Chapter', {
|
||||||
|
// refresh: function(frm) {
|
||||||
|
|
||||||
onload: function (frm) {
|
// }
|
||||||
frm.set_query("lesson", "lessons", function () {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
"chapter": frm.doc.name,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -8,10 +8,9 @@
|
|||||||
"field_order": [
|
"field_order": [
|
||||||
"course",
|
"course",
|
||||||
"title",
|
"title",
|
||||||
"column_break_3",
|
|
||||||
"description",
|
"description",
|
||||||
"section_break_5",
|
"locked",
|
||||||
"lessons"
|
"index_"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -22,9 +21,15 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
"fieldtype": "Small Text",
|
"fieldtype": "Markdown Editor",
|
||||||
"label": "Description"
|
"label": "Description"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "locked",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Locked"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "course",
|
"fieldname": "course",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
@@ -33,18 +38,10 @@
|
|||||||
"options": "LMS Course"
|
"options": "LMS Course"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "lessons",
|
"default": "1",
|
||||||
"fieldtype": "Table",
|
"fieldname": "index_",
|
||||||
"label": "Lessons",
|
"fieldtype": "Int",
|
||||||
"options": "Lessons"
|
"label": "Index"
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_3",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_5",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
@@ -55,7 +52,7 @@
|
|||||||
"link_fieldname": "chapter"
|
"link_fieldname": "chapter"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2021-08-19 13:43:51.025072",
|
"modified": "2021-05-13 21:05:20.531890",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Chapter",
|
"name": "Chapter",
|
||||||
|
|||||||
@@ -7,4 +7,9 @@ import frappe
|
|||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class Chapter(Document):
|
class Chapter(Document):
|
||||||
pass
|
def get_lessons(self):
|
||||||
|
rows = frappe.db.get_all("Lesson",
|
||||||
|
filters={"chapter": self.name},
|
||||||
|
fields='*',
|
||||||
|
order_by="index_")
|
||||||
|
return [frappe.get_doc(dict(row, doctype='Lesson')) for row in rows]
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-07-27 16:25:02.903245",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"chapter"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "chapter",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Chapter",
|
|
||||||
"options": "Chapter",
|
|
||||||
"reqd": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"istable": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-07-27 16:25:02.903245",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "LMS",
|
|
||||||
"name": "Chapters",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class Chapters(Document):
|
|
||||||
pass
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
// Copyright (c) 2021, FOSS United and contributors
|
||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Event Ticket', {
|
frappe.ui.form.on('Code Revision', {
|
||||||
// refresh: function(frm) {
|
// refresh: function(frm) {
|
||||||
|
|
||||||
// }
|
// }
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
{
|
{
|
||||||
"actions": [],
|
"actions": [],
|
||||||
"creation": "2021-06-28 13:36:36.146718",
|
"creation": "2021-04-07 00:26:28.806520",
|
||||||
"doctype": "DocType",
|
"doctype": "DocType",
|
||||||
"editable_grid": 1,
|
"editable_grid": 1,
|
||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"review",
|
"section",
|
||||||
"rating",
|
"code",
|
||||||
"course"
|
"author"
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
"fieldname": "review",
|
"fieldname": "section",
|
||||||
"fieldtype": "Small Text",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Review"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "rating",
|
|
||||||
"fieldtype": "Rating",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Rating"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "course",
|
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Course",
|
"label": "Section",
|
||||||
"options": "LMS Course"
|
"options": "LMS Section"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "code",
|
||||||
|
"fieldtype": "Code",
|
||||||
|
"label": "Code"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "author",
|
||||||
|
"fieldtype": "Link",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Author",
|
||||||
|
"options": "User"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-05 14:57:03.841430",
|
"modified": "2021-04-14 11:26:19.628317",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Course Review",
|
"name": "Code Revision",
|
||||||
"owner": "Administrator",
|
"owner": "Administrator",
|
||||||
"permissions": [
|
"permissions": [
|
||||||
{
|
{
|
||||||
@@ -53,5 +53,6 @@
|
|||||||
],
|
],
|
||||||
"sort_field": "modified",
|
"sort_field": "modified",
|
||||||
"sort_order": "DESC",
|
"sort_order": "DESC",
|
||||||
|
"title_field": "section",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2021, FOSS United and contributors
|
# Copyright (c) 2021, FOSS United and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
|
from __future__ import unicode_literals
|
||||||
# import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class EventDetails(Document):
|
class CodeRevision(Document):
|
||||||
pass
|
pass
|
||||||
@@ -1,8 +1,10 @@
|
|||||||
|
# -*- coding: utf-8 -*-
|
||||||
# Copyright (c) 2021, FOSS United and Contributors
|
# Copyright (c) 2021, FOSS United and Contributors
|
||||||
# See license.txt
|
# See license.txt
|
||||||
|
from __future__ import unicode_literals
|
||||||
|
|
||||||
# import frappe
|
# import frappe
|
||||||
import unittest
|
import unittest
|
||||||
|
|
||||||
class TestDiscussionMessage(unittest.TestCase):
|
class TestCodeRevision(unittest.TestCase):
|
||||||
pass
|
pass
|
||||||
@@ -15,9 +15,7 @@
|
|||||||
"hints",
|
"hints",
|
||||||
"tests",
|
"tests",
|
||||||
"image",
|
"image",
|
||||||
"lesson",
|
"lesson"
|
||||||
"index_",
|
|
||||||
"index_label"
|
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -29,7 +27,6 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "course",
|
"fieldname": "course",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Course",
|
"label": "Course",
|
||||||
"options": "LMS Course"
|
"options": "LMS Course"
|
||||||
},
|
},
|
||||||
@@ -76,27 +73,13 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "lesson",
|
"fieldname": "lesson",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Link",
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Lesson",
|
"label": "Lesson",
|
||||||
"options": "Lesson"
|
"options": "Lesson"
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "index_",
|
|
||||||
"fieldtype": "Int",
|
|
||||||
"label": "Index",
|
|
||||||
"read_only": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "index_label",
|
|
||||||
"fieldtype": "Data",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Index Label",
|
|
||||||
"read_only": 1
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-06-01 05:22:15.656013",
|
"modified": "2021-05-20 13:23:12.340928",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Exercise",
|
"name": "Exercise",
|
||||||
@@ -116,8 +99,8 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"search_fields": "title",
|
"search_fields": "title",
|
||||||
"sort_field": "index_label",
|
"sort_field": "modified",
|
||||||
"sort_order": "ASC",
|
"sort_order": "DESC",
|
||||||
"title_field": "title",
|
"title_field": "title",
|
||||||
"track_changes": 1
|
"track_changes": 1
|
||||||
}
|
}
|
||||||
@@ -3,8 +3,12 @@
|
|||||||
|
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
from ..lms_sketch.livecode import livecode_to_svg
|
||||||
|
|
||||||
class Exercise(Document):
|
class Exercise(Document):
|
||||||
|
def before_save(self):
|
||||||
|
self.image = livecode_to_svg(None, self.answer)
|
||||||
|
|
||||||
def get_user_submission(self):
|
def get_user_submission(self):
|
||||||
"""Returns the latest submission for this user.
|
"""Returns the latest submission for this user.
|
||||||
"""
|
"""
|
||||||
@@ -21,6 +25,7 @@ class Exercise(Document):
|
|||||||
order_by="creation desc",
|
order_by="creation desc",
|
||||||
page_length=1)
|
page_length=1)
|
||||||
|
|
||||||
|
print("get_user_submission", result)
|
||||||
if result:
|
if result:
|
||||||
return result[0]
|
return result[0]
|
||||||
|
|
||||||
@@ -38,6 +43,8 @@ class Exercise(Document):
|
|||||||
course = frappe.get_doc("LMS Course", self.course)
|
course = frappe.get_doc("LMS Course", self.course)
|
||||||
batch = course.get_student_batch(user)
|
batch = course.get_student_batch(user)
|
||||||
|
|
||||||
|
image = livecode_to_svg(None, code)
|
||||||
|
|
||||||
doc = frappe.get_doc(
|
doc = frappe.get_doc(
|
||||||
doctype="Exercise Submission",
|
doctype="Exercise Submission",
|
||||||
exercise=self.name,
|
exercise=self.name,
|
||||||
@@ -45,8 +52,8 @@ class Exercise(Document):
|
|||||||
course=self.course,
|
course=self.course,
|
||||||
lesson=self.lesson,
|
lesson=self.lesson,
|
||||||
batch=batch and batch.name,
|
batch=batch and batch.name,
|
||||||
|
image=image,
|
||||||
solution=code)
|
solution=code)
|
||||||
doc.insert(ignore_permissions=True)
|
doc.insert(ignore_permissions=True)
|
||||||
|
|
||||||
return doc
|
return doc
|
||||||
|
|
||||||
|
|||||||
@@ -6,17 +6,12 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"exercise",
|
"exercise",
|
||||||
"status",
|
"solution",
|
||||||
"batch",
|
|
||||||
"column_break_4",
|
|
||||||
"exercise_title",
|
"exercise_title",
|
||||||
"course",
|
"course",
|
||||||
|
"batch",
|
||||||
"lesson",
|
"lesson",
|
||||||
"section_break_8",
|
"image"
|
||||||
"solution",
|
|
||||||
"image",
|
|
||||||
"test_results",
|
|
||||||
"comments"
|
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -26,6 +21,12 @@
|
|||||||
"label": "Exercise",
|
"label": "Exercise",
|
||||||
"options": "Exercise"
|
"options": "Exercise"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "solution",
|
||||||
|
"fieldtype": "Code",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Solution"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fetch_from": "exercise.title",
|
"fetch_from": "exercise.title",
|
||||||
"fieldname": "exercise_title",
|
"fieldname": "exercise_title",
|
||||||
@@ -60,41 +61,11 @@
|
|||||||
"fieldtype": "Code",
|
"fieldtype": "Code",
|
||||||
"label": "Image",
|
"label": "Image",
|
||||||
"read_only": 1
|
"read_only": 1
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "status",
|
|
||||||
"fieldtype": "Select",
|
|
||||||
"label": "Status",
|
|
||||||
"options": "Correct\nIncorrect"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "test_results",
|
|
||||||
"fieldtype": "Small Text",
|
|
||||||
"label": "Test Results"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "comments",
|
|
||||||
"fieldtype": "Small Text",
|
|
||||||
"label": "Comments"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "solution",
|
|
||||||
"fieldtype": "Code",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Solution"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_4",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_8",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-06-24 16:22:50.570845",
|
"modified": "2021-05-21 11:28:45.833018",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Exercise Submission",
|
"name": "Exercise Submission",
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
# Copyright (c) 2021, FOSS United and contributors
|
||||||
# For license information, please see license.txt
|
# For license information, please see license.txt
|
||||||
|
|
||||||
import frappe
|
# import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
|
|
||||||
class ExerciseSubmission(Document):
|
class ExerciseSubmission(Document):
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -30,13 +30,10 @@ class InviteRequest(Document):
|
|||||||
return user
|
return user
|
||||||
|
|
||||||
def send_email(self):
|
def send_email(self):
|
||||||
site_name = "Mon.School"
|
subject = _("Your request has been approved.")
|
||||||
subject = _("Welcome to {0}!").format(site_name)
|
|
||||||
|
|
||||||
args = {
|
args = {
|
||||||
"full_name": self.full_name,
|
"full_name": self.full_name,
|
||||||
"signup_form_link": "/new-sign-up?invite_code={0}".format(self.name),
|
"signup_form_link": "/new-sign-up?invite_code={0}".format(self.name),
|
||||||
"site_name": site_name,
|
|
||||||
"site_url": frappe.utils.get_url()
|
"site_url": frappe.utils.get_url()
|
||||||
}
|
}
|
||||||
frappe.sendmail(
|
frappe.sendmail(
|
||||||
@@ -45,8 +42,7 @@ class InviteRequest(Document):
|
|||||||
subject=subject,
|
subject=subject,
|
||||||
header=[subject, "green"],
|
header=[subject, "green"],
|
||||||
template = "lms_invite_request_approved",
|
template = "lms_invite_request_approved",
|
||||||
args=args,
|
args=args)
|
||||||
now=True)
|
|
||||||
|
|
||||||
@frappe.whitelist(allow_guest=True)
|
@frappe.whitelist(allow_guest=True)
|
||||||
def create_invite_request(invite_email):
|
def create_invite_request(invite_email):
|
||||||
@@ -62,8 +58,7 @@ def create_invite_request(invite_email):
|
|||||||
|
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"doctype": "Invite Request",
|
"doctype": "Invite Request",
|
||||||
"invite_email": invite_email,
|
"invite_email": invite_email
|
||||||
"status": "Approved"
|
|
||||||
}).save(ignore_permissions=True)
|
}).save(ignore_permissions=True)
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ class TestInviteRequest(unittest.TestCase):
|
|||||||
filters={"invite_email": "test_invite@example.com"},
|
filters={"invite_email": "test_invite@example.com"},
|
||||||
fieldname=["invite_email", "status", "signup_email"],
|
fieldname=["invite_email", "status", "signup_email"],
|
||||||
as_dict=True)
|
as_dict=True)
|
||||||
self.assertEqual(invite.status, "Approved")
|
self.assertEqual(invite.status, "Pending")
|
||||||
self.assertEqual(invite.signup_email, None)
|
self.assertEqual(invite.signup_email, None)
|
||||||
|
|
||||||
def test_create_invite_request_update(self):
|
def test_create_invite_request_update(self):
|
||||||
|
|||||||
@@ -2,47 +2,7 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Lesson', {
|
frappe.ui.form.on('Lesson', {
|
||||||
setup: function (frm) {
|
// refresh: function(frm) {
|
||||||
frm.trigger('setup_help');
|
|
||||||
},
|
|
||||||
setup_help(frm) {
|
|
||||||
frm.get_field('help').html(`
|
|
||||||
<p>You can add some more additional content to the lesson using a special syntax. The table below mentions all types of dynamic content that you can add to the lessons and the syntax for the same.</p>
|
|
||||||
<div class="row font-weight-bold mb-3">
|
|
||||||
<div class="col-sm-4">
|
|
||||||
Content Type
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
Syntax
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
// }
|
||||||
<div class="col-sm-4">
|
|
||||||
YouTube Video
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
{{ YouTubeVideo("unique_embed_id") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-sm-4">
|
|
||||||
Exercise
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
{{ Exercise("exercise_name") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row mb-3">
|
|
||||||
<div class="col-sm-4">
|
|
||||||
Quiz
|
|
||||||
</div>
|
|
||||||
<div class="col-sm-4">
|
|
||||||
{{ Quiz("lms_quiz_name") }}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
`);
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -7,14 +7,11 @@
|
|||||||
"engine": "InnoDB",
|
"engine": "InnoDB",
|
||||||
"field_order": [
|
"field_order": [
|
||||||
"chapter",
|
"chapter",
|
||||||
"include_in_preview",
|
"lesson_type",
|
||||||
"column_break_4",
|
|
||||||
"title",
|
"title",
|
||||||
"index_label",
|
"index_",
|
||||||
"section_break_6",
|
|
||||||
"body",
|
"body",
|
||||||
"help_section",
|
"sections"
|
||||||
"help"
|
|
||||||
],
|
],
|
||||||
"fields": [
|
"fields": [
|
||||||
{
|
{
|
||||||
@@ -24,50 +21,41 @@
|
|||||||
"label": "Chapter",
|
"label": "Chapter",
|
||||||
"options": "Chapter"
|
"options": "Chapter"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": "Video",
|
||||||
|
"fieldname": "lesson_type",
|
||||||
|
"fieldtype": "Select",
|
||||||
|
"in_list_view": 1,
|
||||||
|
"label": "Lesson Type",
|
||||||
|
"options": "Video\nText\nQuiz"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "title",
|
"fieldname": "title",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Title"
|
"label": "Title"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"default": "1",
|
||||||
|
"fieldname": "index_",
|
||||||
|
"fieldtype": "Int",
|
||||||
|
"label": "Index"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "body",
|
"fieldname": "body",
|
||||||
"fieldtype": "Markdown Editor",
|
"fieldtype": "Markdown Editor",
|
||||||
"label": "Body"
|
"label": "Body"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "index_label",
|
"fieldname": "sections",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Table",
|
||||||
"label": "Index Label",
|
"label": "Sections",
|
||||||
"read_only": 1
|
"options": "LMS Section"
|
||||||
},
|
|
||||||
{
|
|
||||||
"default": "0",
|
|
||||||
"fieldname": "include_in_preview",
|
|
||||||
"fieldtype": "Check",
|
|
||||||
"label": "Include In Preview"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "section_break_6",
|
|
||||||
"fieldtype": "Section Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_4",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "help_section",
|
|
||||||
"fieldtype": "Section Break",
|
|
||||||
"label": "Help"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "help",
|
|
||||||
"fieldtype": "HTML"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-07-27 16:28:29.203624",
|
"modified": "2021-05-13 20:03:51.510605",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "Lesson",
|
"name": "Lesson",
|
||||||
|
|||||||
@@ -5,91 +5,41 @@
|
|||||||
from __future__ import unicode_literals
|
from __future__ import unicode_literals
|
||||||
import frappe
|
import frappe
|
||||||
from frappe.model.document import Document
|
from frappe.model.document import Document
|
||||||
from ...md import markdown_to_html, find_macros
|
from ...section_parser import SectionParser
|
||||||
|
|
||||||
class Lesson(Document):
|
class Lesson(Document):
|
||||||
def before_save(self):
|
def before_save(self):
|
||||||
dynamic_documents = ["Exercise", "Quiz"]
|
sections = SectionParser().parse(self.body or "")
|
||||||
for section in dynamic_documents:
|
self.sections = [self.make_lms_section(i, s) for i, s in enumerate(sections)]
|
||||||
self.update_lesson_name_in_document(section)
|
for s in self.sections:
|
||||||
|
if s.type == "exercise":
|
||||||
|
e = s.get_exercise()
|
||||||
|
e.lesson = self.name
|
||||||
|
e.save()
|
||||||
|
|
||||||
def update_lesson_name_in_document(self, section):
|
def get_sections(self):
|
||||||
doctype_map= {
|
return sorted(self.get('sections'), key=lambda s: s.index)
|
||||||
"Exercise": "Exercise",
|
|
||||||
"Quiz": "LMS Quiz"
|
|
||||||
}
|
|
||||||
macros = find_macros(self.body)
|
|
||||||
documents = [value for name, value in macros if name == section]
|
|
||||||
index = 1
|
|
||||||
for name in documents:
|
|
||||||
e = frappe.get_doc(doctype_map[section], name)
|
|
||||||
e.lesson = self.name
|
|
||||||
e.index_ = index
|
|
||||||
e.save()
|
|
||||||
index += 1
|
|
||||||
self.update_orphan_documents(doctype_map[section], documents)
|
|
||||||
|
|
||||||
def update_orphan_documents(self, doctype, documents):
|
def make_lms_section(self, index, section):
|
||||||
"""Updates the documents that were previously part of this lesson,
|
s = frappe.new_doc('LMS Section', parent_doc=self, parentfield='sections')
|
||||||
but not any more.
|
s.type = section.type
|
||||||
|
s.id = section.id
|
||||||
|
s.label = section.label
|
||||||
|
s.contents = section.contents
|
||||||
|
s.index = index
|
||||||
|
return s
|
||||||
|
|
||||||
|
def get_next(self):
|
||||||
|
"""Returns the number for the next lesson.
|
||||||
|
|
||||||
|
The return value would be like 1.2, 2.1 etc.
|
||||||
|
It will be None if there is no next lesson.
|
||||||
"""
|
"""
|
||||||
linked_documents = {row['name'] for row in frappe.get_all(doctype, {"lesson": self.name})}
|
|
||||||
active_documents = set(documents)
|
|
||||||
orphan_documents = linked_documents - active_documents
|
|
||||||
for name in orphan_documents:
|
|
||||||
ex = frappe.get_doc(doctype, name)
|
|
||||||
ex.lesson = None
|
|
||||||
ex.index_ = 0
|
|
||||||
ex.index_label = ""
|
|
||||||
ex.save()
|
|
||||||
|
|
||||||
def render_html(self):
|
|
||||||
return markdown_to_html(self.body)
|
|
||||||
|
|
||||||
def get_exercises(self):
|
def get_prev(self):
|
||||||
if not self.body:
|
"""Returns the number for the prev lesson.
|
||||||
return []
|
|
||||||
|
|
||||||
macros = find_macros(self.body)
|
The return value would be like 1.2, 2.1 etc.
|
||||||
exercises = [value for name, value in macros if name == "Exercise"]
|
It will be None if there is no next lesson.
|
||||||
return [frappe.get_doc("Exercise", name) for name in exercises]
|
"""
|
||||||
|
|
||||||
def get_progress(self):
|
|
||||||
return frappe.db.get_value("LMS Course Progress", {"lesson": self.name, "owner": frappe.session.user}, "status")
|
|
||||||
|
|
||||||
def get_slugified_class(self):
|
|
||||||
if self.get_progress():
|
|
||||||
return ("").join([ s for s in self.get_progress().lower().split() ])
|
|
||||||
return
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def save_progress(lesson, course, status):
|
|
||||||
if not frappe.db.exists("LMS Batch Membership",
|
|
||||||
{
|
|
||||||
"member": frappe.session.user,
|
|
||||||
"course": course
|
|
||||||
}):
|
|
||||||
return
|
|
||||||
|
|
||||||
if frappe.db.exists("LMS Course Progress",
|
|
||||||
{
|
|
||||||
"lesson": lesson,
|
|
||||||
"owner": frappe.session.user,
|
|
||||||
"course": course
|
|
||||||
}):
|
|
||||||
doc = frappe.get_doc("LMS Course Progress",
|
|
||||||
{
|
|
||||||
"lesson": lesson,
|
|
||||||
"owner": frappe.session.user,
|
|
||||||
"course": course
|
|
||||||
})
|
|
||||||
doc.status = status
|
|
||||||
doc.save(ignore_permissions=True)
|
|
||||||
else:
|
|
||||||
frappe.get_doc({
|
|
||||||
"doctype": "LMS Course Progress",
|
|
||||||
"lesson": lesson,
|
|
||||||
"status": status,
|
|
||||||
}).save(ignore_permissions=True)
|
|
||||||
course_details = frappe.get_doc("LMS Course", course)
|
|
||||||
return course_details.get_course_progress()
|
|
||||||
|
|||||||
@@ -1,31 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-07-27 16:25:48.269536",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"lesson"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "lesson",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"label": "Lesson",
|
|
||||||
"options": "Lesson"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"istable": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-07-27 16:53:52.732191",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "LMS",
|
|
||||||
"name": "Lessons",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
|
|
||||||
class Lessons(Document):
|
|
||||||
pass
|
|
||||||
@@ -33,7 +33,8 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "title",
|
"fieldname": "title",
|
||||||
"fieldtype": "Data",
|
"fieldtype": "Data",
|
||||||
"label": "Title"
|
"label": "Title",
|
||||||
|
"unique": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "description",
|
"fieldname": "description",
|
||||||
@@ -119,7 +120,7 @@
|
|||||||
"link_fieldname": "batch"
|
"link_fieldname": "batch"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"modified": "2021-06-16 10:51:05.403726",
|
"modified": "2021-05-26 16:43:57.399747",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Batch",
|
"name": "LMS Batch",
|
||||||
|
|||||||
@@ -19,7 +19,15 @@ class LMSBatch(Document):
|
|||||||
frappe.throw(_("You are not a mentor of the course {0}").format(course.title))
|
frappe.throw(_("You are not a mentor of the course {0}").format(course.title))
|
||||||
|
|
||||||
def after_insert(self):
|
def after_insert(self):
|
||||||
create_membership(batch=self.name, course=self.course, member_type="Mentor")
|
create_membership(batch=self.name, member_type="Mentor")
|
||||||
|
|
||||||
|
def get_mentors(self):
|
||||||
|
memberships = frappe.get_all(
|
||||||
|
"LMS Batch Membership",
|
||||||
|
{"batch": self.name, "member_type": "Mentor"},
|
||||||
|
["member"])
|
||||||
|
member_names = [m['member'] for m in memberships]
|
||||||
|
return find_all("User", name=["IN", member_names])
|
||||||
|
|
||||||
def is_member(self, email, member_type=None):
|
def is_member(self, email, member_type=None):
|
||||||
"""Checks if a person is part of a batch.
|
"""Checks if a person is part of a batch.
|
||||||
@@ -35,6 +43,24 @@ class LMSBatch(Document):
|
|||||||
filters['member_type'] = member_type
|
filters['member_type'] = member_type
|
||||||
return frappe.db.exists("LMS Batch Membership", filters)
|
return frappe.db.exists("LMS Batch Membership", filters)
|
||||||
|
|
||||||
|
def get_students(self):
|
||||||
|
"""Returns (email, full_name, username) of all the students of this batch as a list of dict.
|
||||||
|
"""
|
||||||
|
memberships = frappe.get_all(
|
||||||
|
"LMS Batch Membership",
|
||||||
|
{"batch": self.name, "member_type": "Student"},
|
||||||
|
["member"])
|
||||||
|
member_names = [m['member'] for m in memberships]
|
||||||
|
return find_all("User", name=["IN", member_names])
|
||||||
|
|
||||||
|
def get_messages(self):
|
||||||
|
messages = frappe.get_all("LMS Message", {"batch": self.name}, ["*"], order_by="creation")
|
||||||
|
for message in messages:
|
||||||
|
message.message = frappe.utils.md_to_html(message.message)
|
||||||
|
if message.author == frappe.session.user:
|
||||||
|
message.author_name = "You"
|
||||||
|
message.is_author = True
|
||||||
|
return messages
|
||||||
|
|
||||||
def get_membership(self, email):
|
def get_membership(self, email):
|
||||||
"""Returns the membership document of given user.
|
"""Returns the membership document of given user.
|
||||||
@@ -54,6 +80,11 @@ class LMSBatch(Document):
|
|||||||
membership = self.get_membership(user)
|
membership = self.get_membership(user)
|
||||||
return membership and membership.current_lesson
|
return membership and membership.current_lesson
|
||||||
|
|
||||||
|
def get_learn_url(self, lesson_number):
|
||||||
|
if not lesson_number:
|
||||||
|
return
|
||||||
|
return f"/courses/{self.course}/{self.name}/learn/{lesson_number}"
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def save_message(message, batch):
|
def save_message(message, batch):
|
||||||
doc = frappe.get_doc({
|
doc = frappe.get_doc({
|
||||||
@@ -63,38 +94,3 @@ def save_message(message, batch):
|
|||||||
"message": message
|
"message": message
|
||||||
})
|
})
|
||||||
doc.save(ignore_permissions=True)
|
doc.save(ignore_permissions=True)
|
||||||
|
|
||||||
def switch_batch(course_name, email, batch_name):
|
|
||||||
"""Switches the user from the current batch of the course to a new batch.
|
|
||||||
"""
|
|
||||||
membership = frappe.get_last_doc(
|
|
||||||
"LMS Batch Membership",
|
|
||||||
filters={"course": course_name, "member": email})
|
|
||||||
|
|
||||||
batch = frappe.get_doc("LMS Batch", batch_name)
|
|
||||||
if not batch:
|
|
||||||
raise ValueError(f"Invalid Batch: {batch_name}")
|
|
||||||
|
|
||||||
if batch.course != course_name:
|
|
||||||
raise ValueError("Can not switch batches across courses")
|
|
||||||
|
|
||||||
if batch.is_member(email):
|
|
||||||
print(f"{email} is already a member of {batch.title}")
|
|
||||||
return
|
|
||||||
|
|
||||||
old_batch = frappe.get_doc("LMS Batch", membership.batch)
|
|
||||||
|
|
||||||
print("updating membership", membership.name)
|
|
||||||
membership.batch = batch_name
|
|
||||||
membership.save()
|
|
||||||
|
|
||||||
# update exercise submissions
|
|
||||||
filters = {
|
|
||||||
"owner": email,
|
|
||||||
"batch": old_batch.name
|
|
||||||
}
|
|
||||||
for name in frappe.db.get_all("Exercise Submission", filters=filters, pluck='name'):
|
|
||||||
doc = frappe.get_doc("Exercise Submission", name)
|
|
||||||
print("updating exercise submission", name)
|
|
||||||
doc.batch = batch_name
|
|
||||||
doc.save()
|
|
||||||
|
|||||||
@@ -10,5 +10,5 @@ frappe.ui.form.on('LMS Batch Membership', {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -37,7 +37,6 @@
|
|||||||
"fieldname": "member_type",
|
"fieldname": "member_type",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Member Type",
|
"label": "Member Type",
|
||||||
"options": "\nStudent\nMentor\nStaff"
|
"options": "\nStudent\nMentor\nStaff"
|
||||||
},
|
},
|
||||||
@@ -45,6 +44,7 @@
|
|||||||
"default": "Member",
|
"default": "Member",
|
||||||
"fieldname": "role",
|
"fieldname": "role",
|
||||||
"fieldtype": "Select",
|
"fieldtype": "Select",
|
||||||
|
"in_standard_filter": 1,
|
||||||
"label": "Role",
|
"label": "Role",
|
||||||
"options": "\nMember\nAdmin"
|
"options": "\nMember\nAdmin"
|
||||||
},
|
},
|
||||||
@@ -63,10 +63,10 @@
|
|||||||
{
|
{
|
||||||
"fetch_from": "batch.course",
|
"fetch_from": "batch.course",
|
||||||
"fieldname": "course",
|
"fieldname": "course",
|
||||||
"fieldtype": "Link",
|
"fieldtype": "Data",
|
||||||
"in_list_view": 1,
|
"in_list_view": 1,
|
||||||
"label": "Course",
|
"label": "Course",
|
||||||
"options": "LMS Course"
|
"read_only": 1
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"fieldname": "current_lesson",
|
"fieldname": "current_lesson",
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2021-08-04 17:10:42.708479",
|
"modified": "2021-05-24 12:40:57.125694",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Batch Membership",
|
"name": "LMS Batch Membership",
|
||||||
|
|||||||
@@ -14,65 +14,42 @@ class LMSBatchMembership(Document):
|
|||||||
self.validate_membership_in_different_batch_same_course()
|
self.validate_membership_in_different_batch_same_course()
|
||||||
|
|
||||||
def validate_membership_in_same_batch(self):
|
def validate_membership_in_same_batch(self):
|
||||||
filters={
|
|
||||||
"member": self.member,
|
|
||||||
"course": self.course,
|
|
||||||
"name": ["!=", self.name]
|
|
||||||
}
|
|
||||||
if self.batch:
|
|
||||||
filters["batch"] = self.batch
|
|
||||||
previous_membership = frappe.db.get_value("LMS Batch Membership",
|
previous_membership = frappe.db.get_value("LMS Batch Membership",
|
||||||
filters,
|
filters={
|
||||||
|
"member": self.member,
|
||||||
|
"batch": self.batch,
|
||||||
|
"name": ["!=", self.name]
|
||||||
|
},
|
||||||
fieldname=["member_type","member"],
|
fieldname=["member_type","member"],
|
||||||
as_dict=1)
|
as_dict=1)
|
||||||
|
|
||||||
if previous_membership:
|
if previous_membership:
|
||||||
member_name = frappe.db.get_value("User", self.member, "full_name")
|
member_name = frappe.db.get_value("User", self.member, "full_name")
|
||||||
course_title = frappe.db.get_value("LMS Course", self.course, "title")
|
frappe.throw(_("{0} is already a {1} of {2}").format(member_name, previous_membership.member_type, self.batch))
|
||||||
frappe.throw(_("{0} is already a {1} of the course {2}").format(member_name, previous_membership.member_type, course_title))
|
|
||||||
|
|
||||||
def validate_membership_in_different_batch_same_course(self):
|
def validate_membership_in_different_batch_same_course(self):
|
||||||
"""Ensures that a studnet is only part of one batch.
|
|
||||||
"""
|
|
||||||
# nothing to worry if the member is not a student
|
|
||||||
if self.member_type != "Student":
|
|
||||||
return
|
|
||||||
|
|
||||||
course = frappe.db.get_value("LMS Batch", self.batch, "course")
|
course = frappe.db.get_value("LMS Batch", self.batch, "course")
|
||||||
memberships = frappe.get_all(
|
previous_membership = frappe.get_all("LMS Batch Membership",
|
||||||
"LMS Batch Membership",
|
filters={
|
||||||
filters={
|
"member": self.member,
|
||||||
"member": self.member,
|
"name": ["!=", self.name]
|
||||||
"name": ["!=", self.name],
|
},
|
||||||
"member_type": "Student",
|
fields=["batch", "member_type", "name"]
|
||||||
"course": self.course
|
)
|
||||||
},
|
|
||||||
fields=["batch", "member_type", "name"]
|
|
||||||
)
|
|
||||||
|
|
||||||
if memberships:
|
for membership in previous_membership:
|
||||||
membership = memberships[0]
|
batch_course = frappe.db.get_value("LMS Batch", membership.batch, "course")
|
||||||
member_name = frappe.db.get_value("User", self.member, "full_name")
|
if batch_course == course and (membership.member_type == "Student" or self.member_type == "Student"):
|
||||||
frappe.throw(_("{0} is already a Student of {1} course through {2} batch").format(member_name, course, membership.batch))
|
member_name = frappe.db.get_value("User", self.member, "full_name")
|
||||||
|
frappe.throw(_("{0} is already a {1} of {2} course through {3} batch").format(member_name, membership.member_type, course, membership.batch))
|
||||||
|
|
||||||
@frappe.whitelist()
|
@frappe.whitelist()
|
||||||
def create_membership(course, batch=None, member=None, member_type="Student", role="Member"):
|
def create_membership(batch, member=None, member_type="Student", role="Member"):
|
||||||
frappe.get_doc({
|
frappe.get_doc({
|
||||||
"doctype": "LMS Batch Membership",
|
"doctype": "LMS Batch Membership",
|
||||||
"batch": batch,
|
"batch": batch,
|
||||||
"course": course,
|
|
||||||
"role": role,
|
"role": role,
|
||||||
"member_type": member_type,
|
"member_type": member_type,
|
||||||
"member": member or frappe.session.user
|
"member": member or frappe.session.user
|
||||||
}).save(ignore_permissions=True)
|
}).save(ignore_permissions=True)
|
||||||
return "OK"
|
return "OK"
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def update_current_membership(batch, course, member):
|
|
||||||
all_memberships = frappe.get_all("LMS Batch Membership", {"member": member, "course": course})
|
|
||||||
for membership in all_memberships:
|
|
||||||
frappe.db.set_value("LMS Batch Membership", membership.name, "is_current", 0)
|
|
||||||
|
|
||||||
current_membership = frappe.get_all("LMS Batch Membership", {"batch": batch, "member": member})
|
|
||||||
if len(current_membership):
|
|
||||||
frappe.db.set_value("LMS Batch Membership", current_membership[0].name, "is_current", 1)
|
|
||||||
|
|||||||
@@ -1,14 +0,0 @@
|
|||||||
// Copyright (c) 2021, FOSS United and contributors
|
|
||||||
// For license information, please see license.txt
|
|
||||||
|
|
||||||
frappe.ui.form.on('LMS Certification', {
|
|
||||||
onload: function (frm) {
|
|
||||||
frm.set_query("student", function (doc) {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
"ignore_user_type": 1,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
});
|
|
||||||
@@ -1,70 +0,0 @@
|
|||||||
{
|
|
||||||
"actions": [],
|
|
||||||
"creation": "2021-08-16 15:47:19.494055",
|
|
||||||
"doctype": "DocType",
|
|
||||||
"editable_grid": 1,
|
|
||||||
"engine": "InnoDB",
|
|
||||||
"field_order": [
|
|
||||||
"student",
|
|
||||||
"issue_date",
|
|
||||||
"column_break_3",
|
|
||||||
"course",
|
|
||||||
"expiry_date"
|
|
||||||
],
|
|
||||||
"fields": [
|
|
||||||
{
|
|
||||||
"fieldname": "student",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Student",
|
|
||||||
"options": "User"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "issue_date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"label": "Issue Date"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "column_break_3",
|
|
||||||
"fieldtype": "Column Break"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "course",
|
|
||||||
"fieldtype": "Link",
|
|
||||||
"in_list_view": 1,
|
|
||||||
"in_standard_filter": 1,
|
|
||||||
"label": "Course",
|
|
||||||
"options": "LMS Course"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"fieldname": "expiry_date",
|
|
||||||
"fieldtype": "Date",
|
|
||||||
"label": "Expiry Date"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"index_web_pages_for_search": 1,
|
|
||||||
"links": [],
|
|
||||||
"modified": "2021-08-16 15:47:19.494055",
|
|
||||||
"modified_by": "Administrator",
|
|
||||||
"module": "LMS",
|
|
||||||
"name": "LMS Certification",
|
|
||||||
"owner": "Administrator",
|
|
||||||
"permissions": [
|
|
||||||
{
|
|
||||||
"create": 1,
|
|
||||||
"delete": 1,
|
|
||||||
"email": 1,
|
|
||||||
"export": 1,
|
|
||||||
"print": 1,
|
|
||||||
"read": 1,
|
|
||||||
"report": 1,
|
|
||||||
"role": "System Manager",
|
|
||||||
"share": 1,
|
|
||||||
"write": 1
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"sort_field": "modified",
|
|
||||||
"sort_order": "DESC",
|
|
||||||
"track_changes": 1
|
|
||||||
}
|
|
||||||
@@ -1,41 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and contributors
|
|
||||||
# For license information, please see license.txt
|
|
||||||
|
|
||||||
import frappe
|
|
||||||
from frappe.model.document import Document
|
|
||||||
from frappe.utils import nowdate, add_years
|
|
||||||
from frappe import _
|
|
||||||
from frappe.utils.pdf import get_pdf
|
|
||||||
|
|
||||||
class LMSCertification(Document):
|
|
||||||
|
|
||||||
def validate(self):
|
|
||||||
certificates = frappe.get_all("LMS Certification", {
|
|
||||||
"student": self.student,
|
|
||||||
"course": self.course,
|
|
||||||
"expiry_date": [">", nowdate()]
|
|
||||||
})
|
|
||||||
if len(certificates):
|
|
||||||
full_name = frappe.db.get_value("User", self.student, "full_name")
|
|
||||||
course_name = frappe.db.get_value("LMS Course", self.course, "title")
|
|
||||||
frappe.throw(_("There is already a valid certificate for user {0} for the course {1}").format(full_name, course_name))
|
|
||||||
|
|
||||||
@frappe.whitelist()
|
|
||||||
def create_certificate(course):
|
|
||||||
course_details = frappe.get_doc("LMS Course", course)
|
|
||||||
certificate = course_details.is_certified()
|
|
||||||
|
|
||||||
if certificate:
|
|
||||||
return certificate
|
|
||||||
|
|
||||||
else:
|
|
||||||
expires_after_yrs = course_details.expiry
|
|
||||||
certificate = frappe.get_doc({
|
|
||||||
"doctype": "LMS Certification",
|
|
||||||
"student": frappe.session.user,
|
|
||||||
"course": course,
|
|
||||||
"issue_date": nowdate(),
|
|
||||||
"expiry_date": add_years(nowdate(), int(expires_after_yrs))
|
|
||||||
})
|
|
||||||
certificate.save(ignore_permissions=True)
|
|
||||||
return certificate.name
|
|
||||||
@@ -1,8 +0,0 @@
|
|||||||
# Copyright (c) 2021, FOSS United and Contributors
|
|
||||||
# See license.txt
|
|
||||||
|
|
||||||
# import frappe
|
|
||||||
import unittest
|
|
||||||
|
|
||||||
class TestLMSCertification(unittest.TestCase):
|
|
||||||
pass
|
|
||||||
@@ -2,24 +2,7 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('LMS Course', {
|
frappe.ui.form.on('LMS Course', {
|
||||||
|
// refresh: function(frm) {
|
||||||
|
|
||||||
onload: function (frm) {
|
// }
|
||||||
|
|
||||||
frm.set_query("chapter", "chapters", function () {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
"course": frm.doc.name,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
|
|
||||||
frm.set_query("instructor", function (doc) {
|
|
||||||
return {
|
|
||||||
filters: {
|
|
||||||
"ignore_user_type": 1,
|
|
||||||
}
|
|
||||||
};
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user