Compare commits

..

1 Commits

Author SHA1 Message Date
pateljannat
4c55f1f71c fix: exhibitor template 2021-08-19 12:16:05 +05:30
155 changed files with 2266 additions and 10010 deletions

View File

@@ -63,7 +63,7 @@ To setup the repository locally follow the steps mentioned below:
1. Run bench get-app https://github.com/fossunited/community. 1. Run bench get-app https://github.com/fossunited/community.
1. Run bench --site community.test install-app community. 1. Run bench --site community.test install-app community.
1. Map your site to localhost with the command ```bench --site community.test add-to-hosts``` 1. Map your site to localhost with the command ```bench --site community.test add-to-hosts```
1. Now open the URL http://community.test:8000/ in your browser, you should see the app running. 1. Now open the URL http://community.test:8000/docs in your browser, you should see the app running.
### Contribution Guidelines (for The Hard Way) ### Contribution Guidelines (for The Hard Way)

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Discussion Message', {
// refresh: function(frm) {
// }
});

View File

@@ -5,31 +5,49 @@
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"topic", "thread",
"reply" "column_break_2",
"parent_message",
"section_break_4",
"message"
], ],
"fields": [ "fields": [
{ {
"fieldname": "reply", "fieldname": "message",
"fieldtype": "Long Text", "fieldtype": "Long Text",
"in_list_view": 1, "in_list_view": 1,
"label": "Reply" "label": "Message"
}, },
{ {
"fieldname": "topic", "fieldname": "thread",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1, "in_standard_filter": 1,
"label": "Topic", "label": "Thread",
"options": "Discussion Topic" "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, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-27 15:06:51.362714", "modified": "2021-08-12 15:59:04.811286",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Community", "module": "Community",
"name": "Discussion Reply", "name": "Discussion Message",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {

View File

@@ -0,0 +1,22 @@
# 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)

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
import unittest import unittest
class TestDiscussionReply(unittest.TestCase): class TestDiscussionMessage(unittest.TestCase):
pass pass

View File

@@ -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
from community.widgets import Widgets
class DiscussionReply(Document):
def after_insert(self):
data = {
"reply": self,
"topic": {
"name": self.topic
},
"widgets": Widgets()
}
template = frappe.render_template("community/templates/discussions/reply_card.html", data)
topic_info = frappe.get_all("Discussion Topic", {"name": self.topic}, ["reference_doctype", "reference_docname", "name", "title", "owner", "creation"])
sidebar = frappe.render_template("community/templates/discussions/sidebar.html", { "topic": topic_info[0], "widgets": Widgets() })
new_topic_template = frappe.render_template("community/templates/discussions/reply_section.html", { "topics": topic_info, "widgets": Widgets() })
frappe.publish_realtime(event="publish_message",
message = {
"template": template,
"topic_info": topic_info[0],
"sidebar": sidebar,
"new_topic_template": new_topic_template
},
after_commit=True)

View File

@@ -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('Discussion Topic', { frappe.ui.form.on('Discussion Thread', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }

View File

@@ -33,7 +33,7 @@
"modified": "2021-08-11 12:29:43.564123", "modified": "2021-08-11 12:29:43.564123",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Community", "module": "Community",
"name": "Discussion Topic", "name": "Discussion Thread",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -54,4 +54,4 @@
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "title", "title_field": "title",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -0,0 +1,48 @@
# 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)

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
import unittest import unittest
class TestDiscussionTopic(unittest.TestCase): class TestDiscussionThread(unittest.TestCase):
pass pass

View File

@@ -1,35 +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 DiscussionTopic(Document):
pass
@frappe.whitelist()
def submit_discussion(doctype, docname, reply, title, topic_name=None):
if topic_name:
save_message(reply, topic_name)
return topic_name
topic = frappe.get_doc({
"doctype": "Discussion Topic",
"title": title,
"reference_doctype": doctype,
"reference_docname": docname
})
topic.save(ignore_permissions=True)
save_message(reply, topic.name)
return topic.name
def save_message(reply, topic):
frappe.get_doc({
"doctype": "Discussion Reply",
"reply": reply,
"topic": topic
}).save(ignore_permissions=True)
@frappe.whitelist()
def get_docname(route):
return frappe.db.get_value("Web Page", {"route": route}, ["name"])

View File

@@ -1,2 +0,0 @@
{% set docname = frappe.db.get_value("Web Page", {"route": ""}, ["name"])%}
{{ widgets.DiscussionMessage(doctype="Web Page", docname=docname) }}

View File

@@ -1,17 +0,0 @@
{
"__islocal": true,
"__unsaved": 1,
"creation": "2021-08-30 12:42:31.550200",
"docstatus": 0,
"doctype": "Web Template",
"fields": [],
"idx": 0,
"modified": "2021-08-30 12:42:31.550200",
"modified_by": "Administrator",
"module": "Community",
"name": "Discussions",
"owner": "Administrator",
"standard": 1,
"template": "",
"type": "Section"
}

View File

@@ -1,5 +1,5 @@
{% set color = member.get_palette() %} {% set color = member.get_palette() %}
<a class="button-links" href="{{ get_profile_url(member.username) }}"> <a class="button-links" 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 }}">

View File

@@ -1,28 +0,0 @@
<form class="discussion-form">
<div class="form-group">
<div class="control-input-wrapper">
<div class="control-input">
<input type="text" autocomplete="off" class="input-with-feedback form-control topic-title" data-fieldtype="Data"
data-fieldname="feedback_comments" placeholder="Title" spellcheck="false"></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-default pull-right mb-5 submit-discussion" data-doctype="{{ doctype | urlencode }}"
data-docname="{{ docname | urlencode }}">
Post</div>
</div>
</form>

View File

@@ -0,0 +1,70 @@
<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>

View File

@@ -1,54 +1,80 @@
{% set topics = frappe.get_all("Discussion Topic", {% if doctype and docname and not thread %}
{"reference_doctype": doctype, "reference_docname": docname}, ["name", "title", "owner", "creation"]) %}
{% include "community/templates/discussions/topic_modal.html" %} {% set thread_info = frappe.get_all("Discussion Thread", {"reference_doctype": doctype, "reference_docname": docname},
["name"]) %}
<div class="discussions-parent"> {% if thread_info | length %}
<div class="discussions-header"> {% set thread = thread_info[0].name %}
<span class="course-home-headings">{{_('Discussions')}}</span>
{% if topics %}
{% include "community/templates/discussions/button.html" %}
{% endif %}
</div>
{% if topics %}
<div class="common-card-style thread-card course-content-parent" data-doctype="{{ doctype }}"
data-docname="{{ docname }}">
<div class="discussions-sidebar">
{% include "community/templates/discussions/search.html" %}
{% for topic in topics %}
{% set replies = frappe.get_all("Discussion Reply", {"topic": topic.name})%}
{% include "community/templates/discussions/sidebar.html" %}
{% endfor %}
</div>
<div class="mr-2" id="discussion-group">
{% include "community/templates/discussions/reply_section.html" %}
</div>
</div>
{% else %}
<div id="no-discussions" class="common-card-style thread-card">
<div class="no-discussions">
<div class="font-weight-bold">No Discussions</div>
<div class="muted-text mt-3 mb-3">There are no discussions for this {{ doctype | lower }}, why don't you start
one! </div>
{% if frappe.session.user == "Guest" %}
<div class="button is-primary mt-3" id="login-from-discussion">Log In</div>
{% elif not condition %}
<div class="button is-primary mt-3" id="login-from-discussion" data-redirect="{{ redirect_to }}">
{{ button_name }}
</div>
{% else %}
{% include "community/templates/discussions/button.html" %}
{% endif %}
</div>
</div>
</div>
{% endif %} {% 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> </div>
{% block script %} {% if frappe.session.user == "Guest" or (condition is defined and not condition) %}
<script>{% include "community/templates/discussions/discussions.js" %}</script> <div class="d-flex flex-column align-items-center font-weight-bold">
{% endblock %} Want to join the discussion?
{% if frappe.session.user == "Guest" %}
<div class="button is-primary" id="login-from-discussion">Log In</div>
{% elif not condition %}
<div class="button is-primary" 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>

View File

@@ -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,
}
};
});
}
});

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Attendee Registration', {
// refresh: function(frm) {
// }
});

View File

@@ -5,15 +5,40 @@
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"user", "attendee_info_section",
"full_name", "name1",
"column_break_3", "email",
"phone_number",
"occupation",
"company", "company",
"is_paid",
"section_break_6",
"what_are_you_hoping_to_learn" "what_are_you_hoping_to_learn"
], ],
"fields": [ "fields": [
{
"fieldname": "attendee_info_section",
"fieldtype": "Section Break",
"label": "Attendee Info"
},
{
"fieldname": "name1",
"fieldtype": "Data",
"label": "Name"
},
{
"fieldname": "email",
"fieldtype": "Data",
"label": "Email"
},
{
"fieldname": "phone_number",
"fieldtype": "Data",
"label": "Phone Number"
},
{
"fieldname": "occupation",
"fieldtype": "Data",
"label": "Occupation"
},
{ {
"fieldname": "company", "fieldname": "company",
"fieldtype": "Data", "fieldtype": "Data",
@@ -22,42 +47,15 @@
{ {
"fieldname": "what_are_you_hoping_to_learn", "fieldname": "what_are_you_hoping_to_learn",
"fieldtype": "Text", "fieldtype": "Text",
"label": "What are you hoping to learn?" "label": "What are you hoping to learn"
},
{
"fieldname": "user",
"fieldtype": "Link",
"label": "User",
"options": "User"
},
{
"fetch_from": "user.full_name",
"fieldname": "full_name",
"fieldtype": "Data",
"label": "Full Name",
"read_only": 1
},
{
"default": "0",
"fieldname": "is_paid",
"fieldtype": "Check",
"label": "Is Paid"
},
{
"fieldname": "column_break_3",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_6",
"fieldtype": "Section Break"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-20 17:03:09.741997", "modified": "2021-08-11 10:07:53.262504",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Attendee", "name": "Attendee Registration",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -75,6 +73,5 @@
], ],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "user",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class Exhibitor(Document): class AttendeeRegistration(Document):
pass pass

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestAttendeeRegistration(unittest.TestCase):
pass

View File

@@ -19,7 +19,7 @@
"fieldname": "attendee", "fieldname": "attendee",
"fieldtype": "Link", "fieldtype": "Link",
"label": "attendee", "label": "attendee",
"options": "Attendee" "options": "Attendee Registration"
}, },
{ {
"fieldname": "event", "fieldname": "event",
@@ -30,7 +30,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-20 13:38:28.688115", "modified": "2021-08-18 09:51:14.654098",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Event Ticket", "name": "Event Ticket",

View File

@@ -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
}

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Exhibitor Registration', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,54 @@
{
"actions": [],
"autoname": "Exhibitor-Regis-.####.",
"creation": "2021-08-16 16:26:46.189119",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"full_name",
"company",
"logo"
],
"fields": [
{
"fieldname": "full_name",
"fieldtype": "Data",
"label": "Full Name"
},
{
"fieldname": "company",
"fieldtype": "Data",
"label": "Company "
},
{
"fieldname": "logo",
"fieldtype": "Attach Image",
"label": "Logo"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-18 20:08:31.591935",
"modified_by": "Administrator",
"module": "Event Management",
"name": "Exhibitor Registration",
"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
}

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class Speaker(Document): class ExhibitorRegistration(Document):
pass pass

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestExhibitorRegistration(unittest.TestCase):
pass

View File

@@ -1,13 +1,15 @@
{ {
"actions": [], "actions": [],
"autoname": "field:full_name",
"creation": "2021-08-11 10:51:47.234690", "creation": "2021-08-11 10:51:47.234690",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"event", "event",
"user", "full_name",
"full_name" "user_image",
"title"
], ],
"fields": [ "fields": [
{ {
@@ -16,22 +18,29 @@
"label": "Event", "label": "Event",
"options": "Event Details" "options": "Event Details"
}, },
{
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title"
},
{ {
"fieldname": "full_name", "fieldname": "full_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"label": "Full Name", "label": "Full Name",
"reqd": 1,
"unique": 1 "unique": 1
}, },
{ {
"fieldname": "user", "fieldname": "user_image",
"fieldtype": "Data", "fieldtype": "Attach Image",
"label": "User" "label": "Image"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-20 17:03:26.733195", "modified": "2021-08-11 23:54:17.790263",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Host", "name": "Host",
@@ -52,6 +61,5 @@
], ],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "user",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -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('Discussion Reply', { frappe.ui.form.on('Previous Content', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }

View File

@@ -1,41 +1,37 @@
{ {
"actions": [], "actions": [],
"creation": "2021-08-11 10:37:32.124651", "autoname": "format:PRE-VID-BY-{name_of_the_speaker}-{####}",
"creation": "2021-08-18 08:42:58.711932",
"doctype": "DocType", "doctype": "DocType",
"editable_grid": 1, "editable_grid": 1,
"engine": "InnoDB", "engine": "InnoDB",
"field_order": [ "field_order": [
"event", "event",
"company", "title",
"column_break_8", "name_of_the_speaker",
"user", "url",
"full_name" "thumbnail"
], ],
"fields": [ "fields": [
{ {
"fieldname": "user", "fieldname": "title",
"fieldtype": "Link",
"in_list_view": 1,
"label": "User",
"options": "User"
},
{
"fetch_from": "user.full_name",
"fieldname": "full_name",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "label": "Title"
"label": "Full Name",
"read_only": 1
}, },
{ {
"fieldname": "company", "fieldname": "name_of_the_speaker",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "label": "Name of the Speaker"
"label": "Company"
}, },
{ {
"fieldname": "column_break_8", "fieldname": "url",
"fieldtype": "Column Break" "fieldtype": "Data",
"label": "Video Embed Link"
},
{
"fieldname": "thumbnail",
"fieldtype": "Data",
"label": "Preview Image (Link)"
}, },
{ {
"fieldname": "event", "fieldname": "event",
@@ -46,10 +42,10 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-20 16:53:43.968260", "modified": "2021-08-18 09:37:03.278439",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Speaker", "name": "Previous Content",
"owner": "Administrator", "owner": "Administrator",
"permissions": [ "permissions": [
{ {
@@ -67,6 +63,5 @@
], ],
"sort_field": "modified", "sort_field": "modified",
"sort_order": "DESC", "sort_order": "DESC",
"title_field": "user",
"track_changes": 1 "track_changes": 1
} }

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
from frappe.model.document import Document from frappe.model.document import Document
class Attendee(Document): class PreviousContent(Document):
pass pass

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
import unittest import unittest
class TestExhibitor(unittest.TestCase): class TestPreviousContent(unittest.TestCase):
pass pass

View File

@@ -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('Exhibitor', { frappe.ui.form.on('Schedule', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }

View File

@@ -0,0 +1,63 @@
{
"actions": [],
"autoname": "Schedule-.####",
"creation": "2021-08-11 10:50:23.522178",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"event",
"speaker",
"slot"
],
"fields": [
{
"fieldname": "speaker",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Speaker",
"options": "Speaker Registration",
"reqd": 1
},
{
"fieldname": "slot",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Slot",
"options": "Slot",
"reqd": 1
},
{
"fieldname": "event",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Event",
"options": "Event Details",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-18 09:46:18.694910",
"modified_by": "Administrator",
"module": "Event Management",
"name": "Schedule",
"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
}

View File

@@ -0,0 +1,18 @@
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class Schedule(Document):
def before_save(self):
exists = frappe.db.exists(
"Schedule",
{
"Event": self.event,
"slot": self.slot
},
)
if exists:
frappe.throw("Slot already Assigned")

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
import unittest import unittest
class TestAttendee(unittest.TestCase): class TestSchedule(unittest.TestCase):
pass pass

View File

@@ -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('Talk', { frappe.ui.form.on('Slot', {
// refresh: function(frm) { // refresh: function(frm) {
// } // }

View File

@@ -0,0 +1,69 @@
{
"actions": [],
"autoname": "format:SLOT-{date}-{start_time}",
"creation": "2021-08-11 11:19:50.276917",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"event",
"date",
"start_time",
"end_time"
],
"fields": [
{
"fieldname": "event",
"fieldtype": "Link",
"in_list_view": 1,
"label": "Event",
"options": "Event Details",
"reqd": 1
},
{
"fieldname": "date",
"fieldtype": "Date",
"in_list_view": 1,
"label": "Date",
"reqd": 1
},
{
"fieldname": "start_time",
"fieldtype": "Time",
"in_list_view": 1,
"label": "Start Time",
"reqd": 1
},
{
"fieldname": "end_time",
"fieldtype": "Time",
"in_list_view": 1,
"label": "End Time",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-18 23:51:47.850435",
"modified_by": "Administrator",
"module": "Event Management",
"name": "Slot",
"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
}

View File

@@ -0,0 +1,14 @@
# 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 getdate
class Slot(Document):
def before_save(self):
event = frappe.get_doc("Event Details", self.event)
if getdate(self.date) < event.start_date or getdate(self.date) > event.end_date:
frappe.throw("Slot should be in Event's span")

View File

@@ -4,5 +4,5 @@
# import frappe # import frappe
import unittest import unittest
class TestTalk(unittest.TestCase): class TestSlot(unittest.TestCase):
pass pass

View File

@@ -1,14 +0,0 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Speaker', {
onload: function (frm) {
frm.set_query('user', function (doc) {
return {
filters: {
"ignore_user_type": 1,
}
};
});
}
});

View File

@@ -1,8 +0,0 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestSpeaker(unittest.TestCase):
pass

View File

@@ -0,0 +1,8 @@
// Copyright (c) 2021, FOSS United and contributors
// For license information, please see license.txt
frappe.ui.form.on('Speaker Registration', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,149 @@
{
"actions": [],
"autoname": "SPEAKER-REGIS.####.",
"creation": "2021-08-11 10:37:32.124651",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"speaker_info_section",
"full_name",
"email",
"phone_number",
"job_title",
"company",
"column_break_8",
"picture",
"bio",
"talk_info_section",
"topic",
"title",
"column_break_13",
"about",
"attachment",
"status"
],
"fields": [
{
"fieldname": "speaker_info_section",
"fieldtype": "Section Break",
"label": "Speaker Info"
},
{
"fieldname": "email",
"fieldtype": "Data",
"label": "Email",
"reqd": 1,
"unique": 1
},
{
"fieldname": "phone_number",
"fieldtype": "Data",
"label": "Phone Number",
"unique": 1
},
{
"fieldname": "job_title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Job Title",
"reqd": 1
},
{
"fieldname": "company",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Company",
"reqd": 1
},
{
"fieldname": "picture",
"fieldtype": "Attach Image",
"label": "Profile Image",
"reqd": 1
},
{
"fieldname": "bio",
"fieldtype": "Text",
"label": "Bio"
},
{
"fieldname": "talk_info_section",
"fieldtype": "Section Break",
"label": "Talk Info"
},
{
"fieldname": "topic",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Topic",
"options": "Delivery\nCloud\nCustomer Success\nMarketing\nDevelopment\nHR\nCustomer Stories",
"reqd": 1
},
{
"fieldname": "title",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Title",
"reqd": 1
},
{
"fieldname": "about",
"fieldtype": "Text",
"label": "About",
"reqd": 1
},
{
"fieldname": "attachment",
"fieldtype": "Attach",
"label": "Attachment"
},
{
"fieldname": "column_break_8",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_13",
"fieldtype": "Column Break"
},
{
"default": "Applied",
"fieldname": "status",
"fieldtype": "Select",
"in_list_view": 1,
"label": "Status",
"options": "Applied\nPending\nApproved\nRejected"
},
{
"fieldname": "full_name",
"fieldtype": "Data",
"in_list_view": 1,
"label": "Full Name",
"reqd": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2021-08-18 09:48:19.602309",
"modified_by": "Administrator",
"module": "Event Management",
"name": "Speaker Registration",
"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
}

View File

@@ -0,0 +1,10 @@
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
import frappe
from frappe.model.document import Document
class SpeakerRegistration(Document):
def on_update(self):
pass

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestSpeakerRegistration(unittest.TestCase):
pass

View File

@@ -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 16:47:34.557010",
"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
}

View File

@@ -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
})
speaker.save(ignore_permissions=True)
self.speaker = speaker.name

View File

@@ -1,11 +1,3 @@
frappe.ready(function () { frappe.ready(function() {
frappe.web_form.after_load = () => { // bind events here
frappe.web_form.set_value("user", frappe.session.user);
}
frappe.web_form.after_save = () => {
setTimeout(function () {
window.location.href = '/about';
}, 2000);
}
}) })

View File

@@ -9,43 +9,88 @@
"amount": 0.0, "amount": 0.0,
"amount_based_on_field": 0, "amount_based_on_field": 0,
"apply_document_permissions": 0, "apply_document_permissions": 0,
"button_label": "", "button_label": "Register",
"creation": "2021-08-19 15:26:56.594526", "creation": "2021-08-11 10:08:24.418743",
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}", "doc_type": "Attendee Registration",
"doc_type": "Attendee",
"docstatus": 0, "docstatus": 0,
"doctype": "Web Form", "doctype": "Web Form",
"idx": 0, "idx": 0,
"is_standard": 1, "is_standard": 1,
"login_required": 1, "login_required": 1,
"max_attachment_size": 0, "max_attachment_size": 0,
"modified": "2021-08-24 19:57:25.516319", "modified": "2021-08-18 11:35:06.067390",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "attendee-registration", "name": "attendee-registration",
"owner": "Administrator", "owner": "Administrator",
"payment_button_label": "Buy Now", "payment_button_label": "Buy Now",
"published": 1, "published": 1,
"route": "attendee-registration", "route": "event/conference2021/attendee-registration",
"route_to_success_link": 1, "route_to_success_link": 0,
"show_attachments": 0, "show_attachments": 0,
"show_in_grid": 0, "show_in_grid": 0,
"show_sidebar": 0, "show_sidebar": 0,
"sidebar_items": [], "sidebar_items": [],
"success_url": "/about", "success_url": "/event/conference20221",
"title": "Attendee Registration", "title": "Attendee Registration",
"web_form_fields": [ "web_form_fields": [
{ {
"allow_read_on_all_link_options": 0, "allow_read_on_all_link_options": 0,
"default": "", "fieldname": "attendee_info_section",
"fieldname": "user", "fieldtype": "Section Break",
"fieldtype": "Data",
"hidden": 0, "hidden": 0,
"label": "User", "label": "Attendee Info",
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"options": "User", "read_only": 0,
"read_only": 1, "reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "name1",
"fieldtype": "Data",
"hidden": 0,
"label": "Name",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "email",
"fieldtype": "Data",
"hidden": 0,
"label": "Email",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "phone_number",
"fieldtype": "Data",
"hidden": 0,
"label": "Phone Number",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "occupation",
"fieldtype": "Data",
"hidden": 0,
"label": "Occupation",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0, "reqd": 0,
"show_in_filter": 0 "show_in_filter": 0
}, },
@@ -74,4 +119,4 @@
"show_in_filter": 0 "show_in_filter": 0
} }
] ]
} }

View File

@@ -1,12 +1,3 @@
frappe.ready(function () { frappe.ready(function() {
// bind events here
frappe.web_form.after_load = () => { })
frappe.web_form.set_value("user", frappe.session.user);
}
frappe.web_form.after_save = () => {
setTimeout(function () {
window.location.href = '/about';
}, 2000);
}
})

View File

@@ -11,40 +11,38 @@
"apply_document_permissions": 0, "apply_document_permissions": 0,
"button_label": "Save", "button_label": "Save",
"creation": "2021-08-16 16:27:06.566564", "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 Registration",
"doc_type": "Exhibitor",
"docstatus": 0, "docstatus": 0,
"doctype": "Web Form", "doctype": "Web Form",
"idx": 0, "idx": 0,
"is_standard": 1, "is_standard": 1,
"login_required": 1, "login_required": 1,
"max_attachment_size": 0, "max_attachment_size": 0,
"modified": "2021-08-23 10:12:24.038572", "modified": "2021-08-17 11:51:02.929819",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "exhibitor-registration", "name": "exhibitor-registration",
"owner": "Administrator", "owner": "Administrator",
"payment_button_label": "Buy Now", "payment_button_label": "Buy Now",
"published": 1, "published": 1,
"route": "exhibitor-registration", "route": "event/conference2021/exhibitor-registration",
"route_to_success_link": 0, "route_to_success_link": 0,
"show_attachments": 0, "show_attachments": 0,
"show_in_grid": 0, "show_in_grid": 0,
"show_sidebar": 0, "show_sidebar": 0,
"sidebar_items": [], "sidebar_items": [],
"success_url": "", "success_url": "/exhibitor-registration",
"title": "Exhibitor Registration", "title": "Exhibitor Registration",
"web_form_fields": [ "web_form_fields": [
{ {
"allow_read_on_all_link_options": 0, "allow_read_on_all_link_options": 0,
"fieldname": "user", "fieldname": "full_name",
"fieldtype": "Data", "fieldtype": "Data",
"hidden": 0, "hidden": 0,
"label": "User", "label": "Full Name",
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"options": "User", "read_only": 0,
"read_only": 1,
"reqd": 0, "reqd": 0,
"show_in_filter": 0 "show_in_filter": 0
}, },
@@ -62,10 +60,10 @@
}, },
{ {
"allow_read_on_all_link_options": 0, "allow_read_on_all_link_options": 0,
"fieldname": "description", "fieldname": "logo",
"fieldtype": "Text Editor", "fieldtype": "Attach Image",
"hidden": 0, "hidden": 0,
"label": "Description", "label": "Logo",
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"read_only": 0, "read_only": 0,

View File

@@ -1,11 +0,0 @@
frappe.ready(function () {
frappe.web_form.after_load = () => {
frappe.web_form.set_value("user", frappe.session.user);
}
frappe.web_form.after_save = () => {
setTimeout(function () {
window.location.href = '/about';
}, 2000);
}
})

View File

@@ -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-24 19:57:06.806994",
"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": "thumbnail",
"fieldtype": "Attach",
"hidden": 0,
"label": "Preview Image",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"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
}
]
}

View File

@@ -1,5 +0,0 @@
import frappe
def get_context(context):
# do your magic here
pass

View File

@@ -1,10 +1,3 @@
frappe.ready(function () { frappe.ready(function() {
frappe.web_form.after_load = () => { // bind events here
frappe.web_form.set_value("user", frappe.session.user);
}
frappe.web_form.after_save = () => {
setTimeout(function () {
window.location.href = '/event/conference2021/propose-talk';
}, 2000);
}
}) })

View File

@@ -9,55 +9,41 @@
"amount": 0.0, "amount": 0.0,
"amount_based_on_field": 0, "amount_based_on_field": 0,
"apply_document_permissions": 0, "apply_document_permissions": 0,
"button_label": "Register", "button_label": "Submit",
"creation": "2021-08-19 15:29:01.167930", "creation": "2021-08-11 20:52:20.308925",
"custom_css": "[data-doctype=\"Web Form\"] {\n max-width: 720px;\n margin: 6rem auto;\n}", "doc_type": "Speaker Registration",
"doc_type": "Speaker",
"docstatus": 0, "docstatus": 0,
"doctype": "Web Form", "doctype": "Web Form",
"idx": 0, "idx": 0,
"introduction_text": "<div class=\"ql-editor read-mode\"><p><br></p></div>",
"is_standard": 1, "is_standard": 1,
"login_required": 1, "login_required": 1,
"max_attachment_size": 0, "max_attachment_size": 0,
"modified": "2021-08-20 16:16:51.107177", "modified": "2021-08-18 20:00:46.756407",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "speaker-registration", "name": "speaker-registration",
"owner": "Administrator", "owner": "Administrator",
"payment_button_label": "Buy Now", "payment_button_label": "Buy Now",
"published": 1, "published": 1,
"route": "speaker-registration", "route": "event/conference2021/speaker-registration",
"route_to_success_link": 1, "route_to_success_link": 1,
"show_attachments": 0, "show_attachments": 0,
"show_in_grid": 0, "show_in_grid": 0,
"show_sidebar": 0, "show_sidebar": 0,
"sidebar_items": [], "sidebar_items": [],
"success_url": "/speaker-registration", "success_url": "/event/conference2021/about",
"title": "Speaker Registration", "title": "Speaker Registration",
"web_form_fields": [ "web_form_fields": [
{ {
"allow_read_on_all_link_options": 0, "allow_read_on_all_link_options": 0,
"fieldname": "event", "fieldname": "speaker_info_section",
"fieldtype": "Link", "fieldtype": "Section Break",
"hidden": 0, "hidden": 0,
"label": "Event", "label": "Speaker Info",
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"options": "Event Details", "read_only": 0,
"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, "reqd": 0,
"show_in_filter": 0 "show_in_filter": 0
}, },
@@ -70,6 +56,42 @@
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"read_only": 0, "read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "email",
"fieldtype": "Data",
"hidden": 0,
"label": "Email",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 1,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "phone_number",
"fieldtype": "Data",
"hidden": 0,
"label": "Phone Number",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "job_title",
"fieldtype": "Data",
"hidden": 0,
"label": "Job Title",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0, "reqd": 0,
"show_in_filter": 0 "show_in_filter": 0
}, },
@@ -82,8 +104,115 @@
"max_length": 0, "max_length": 0,
"max_value": 0, "max_value": 0,
"read_only": 0, "read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "column_break_8",
"fieldtype": "Column Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "picture",
"fieldtype": "Attach Image",
"hidden": 0,
"label": "Picture",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "bio",
"fieldtype": "Text",
"hidden": 0,
"label": "Bio",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "talk_info_section",
"fieldtype": "Section Break",
"hidden": 0,
"label": "Talk Info",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "topic",
"fieldtype": "Select",
"hidden": 0,
"label": "Topic",
"max_length": 0,
"max_value": 0,
"options": "Delivery\nCloud\nCustomer Success\nMarketing\nDevelopment\nHR\nCustomer Stories",
"read_only": 0,
"reqd": 1, "reqd": 1,
"show_in_filter": 0 "show_in_filter": 0
},
{
"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": "column_break_13",
"fieldtype": "Column Break",
"hidden": 0,
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "about",
"fieldtype": "Data",
"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
} }
] ]
} }

View File

@@ -1,28 +1,20 @@
<div class="section-with-cards"> <div class="section-with-cards">
<h1 class="course-home-headings">{{title}}</h1> <div class="courses-header">
{%- if subtitle -%} <span>{{ title }}</span>
<p class="section-description">{{ subtitle }}</p> {% set cta_link = "/exhibitor-registration" if frappe.session.user != "Guest" else
{%- endif -%} "/login?redirect_to=exhibitor-registration" %}
<div> <a href={{cta_link}} class="button is-primary pull-right">Become an Exhibitor</a>
<div class="mentors-section"> </div>
{% for exhibitor in exhibitor_details %} <div class="speaker-cards-parent">
{% set exhibitor_doc = frappe.db.get_value("Exhibitor", exhibitor.exhibitor, ["user", "company"], as_dict= True) {% for exhibitor in exhibitor_details %}
%} {% set exhibitor_doc = frappe.db.get_value("Exhibitor Registration", exhibitor.exhibitor, ["logo", "company"],
{% set member = frappe.get_doc("User", exhibitor_doc.user) %} as_dict=True) %}
<div class="common-card-style flex-column exhibitor-card">
<div class="common-card-style member-card"> <span>
{{ widgets.Avatar(member=member, avatar_class="avatar-large")}} <img class="standard-image company-logo" src="{{exhibitor_doc.logo}}" />
<div class="small-title member-card-title"> </span>
{{ member.full_name }} <div class="font-weight-bold mt-5">{{exhibitor_doc.company}}</div>
</div>
<div class="small-title">
{{exhibitor_doc.company}}
</div>
<a class="stretched-link" href=""></a>
</div>
{% endfor %}
</div> </div>
<div class="event-btn"><a href="/exhibitor-registration?new=1&user={{ frappe.session.user }}&event={{ event }}" {% endfor %}
class="btn btn-primary ">Become an Exhibitor</a></div>
</div> </div>
</div> </div>

View File

@@ -33,12 +33,12 @@
"fieldname": "exhibitor", "fieldname": "exhibitor",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Exhibitor", "label": "Exhibitor",
"options": "Exhibitor", "options": "Exhibitor Registration",
"reqd": 0 "reqd": 0
} }
], ],
"idx": 1, "idx": 1,
"modified": "2021-08-20 16:28:22.779057", "modified": "2021-08-19 10:57:20.815230",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Exhibitor Section", "name": "Exhibitor Section",

View File

@@ -1,3 +0,0 @@
<div class="section-with-cards">
<h1 class="course-home-headings">{{title}}</h1>
</div>

View File

@@ -0,0 +1,38 @@
<div class="section-with-cards">
<div class="course-home-headings">{{title}}</div>
<div class="speaker-cards-parent">
{% for video in talk_details %}
{% set video_details = frappe.get_doc('Previous Content', video.previous_content, filters={
'event': event
}) %}
<div class="common-card-style talk-card">
<div class="course-image" style="background-image: url({{video_details.thumbnail}})">
<div class="course-tags"></div>
</div>
<div class="course-card-content">
<div class="course-card-meta muted-text">
<span> ERPNext </span>
</div>
<div class="course-card-title">{{video_details.title}}</div>
<div class="card-divider"></div>
<div class="course-card-meta-2">
<a class="button-links" href="/rushabh">
<span class="avatar avatar-small" title="Rushabh Mehta">
<img class="avatar-frame standard-image" style="object-fit: cover"
src="{{video_details.thumbnail}}"
title={{video_details.name_of_the_speaker}} />
</span>
</a>
<span class="course-instructor"> {{video_details.name_of_the_speaker}} </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="{{video_details.url}}"></a>
</div>
</div>
{% endfor %}
</div>
</div>

View File

@@ -17,6 +17,7 @@
"reqd": 0 "reqd": 0
}, },
{ {
"__unsaved": 1,
"fieldname": "event", "fieldname": "event",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Event", "label": "Event",
@@ -30,18 +31,20 @@
"reqd": 0 "reqd": 0
}, },
{ {
"fieldname": "talk", "__islocal": 1,
"__unsaved": 1,
"fieldname": "previous_content",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Talk", "label": "Previous Content",
"options": "Talk", "options": "Previous Content",
"reqd": 0 "reqd": 0
} }
], ],
"idx": 1, "idx": 1,
"modified": "2021-08-20 10:58:45.556636", "modified": "2021-08-18 10:03:50.193908",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Talk Section", "name": "Previous Talk",
"owner": "Administrator", "owner": "Administrator",
"standard": 1, "standard": 1,
"template": "", "template": "",

View File

@@ -0,0 +1,78 @@
{% set schedule_docs = frappe.get_all("Schedule", fields =["speaker", "slot"], filters={
'event': event
},) %}
{% set slot_data = {} %}
{% for schedule in schedule_docs %}
{% set speaker = frappe.get_doc("Speaker Registration", schedule.speaker) %}
{% set slot = frappe.get_doc("Slot", schedule.slot) %}
{% set slot_data = slot_data.setdefault(slot.date, []).append({
"slot": slot.name|string,
"start_time": slot.start_time,
"end_time": slot.end_time,
"speaker": speaker.name,
"picture": speaker.picture,
"about": speaker.about,
"title": speaker.title,
"full_name": speaker.full_name,
"email": speaker.email
}) %}
{% endfor %}
<div class="courses-header">{{title}}</div>
<div class="common-page-style">
<div class="container">
<div class="course-content-parent">
<div class="course-details-outline">
<div class="course-home-outline">
<div class="coure-outline">
<div>
{% for day in slot_data %}
<div class="small-title chapter-title" data-target="#apps-sites-and-bench"
data-toggle="collapse" aria-expanded="false">
<img class="chapter-icon" src="/assets/community/icons/chevron-right.svg" />
{{day}}
</div>
<div class="card-divider"></div>
</div>
{% endfor %}
</div>
</div>
<div>
{% for day in slot_data %}
{% set outer_loop = loop %}
<div class="course-details-outline">
<div class="course-home-headings">{{day}}</div>
<div class="coure-outline">
{% for slot in slot_data[day] %}
<div class="schedule-container">
<div class="schedule-inner-container">
<span class="info-speaker-avatar">
<span class="info-avatar avatar avatar-small">
<img class="avatar-frame standard-image" src="{{slot.picture}}" />
</span>
<h6 class="info-speaker">{{slot.full_name}}</h6>
</span>
<div class="schedule-title">{{slot.title}}</div>
<div class="schedule-slot">
{{ frappe.format(slot.start_time, {'fieldtype': 'Time'})}} - {{
frappe.format(slot.end_time, {'fieldtype': 'Time'}) }}
</div>
<div class="chapter-title small-title" data-toggle="collapse" data-target="#slot-{{loop.index}}-{{outer_loop.index}}" aria-expanded="false" aria-controls="collapseExample">
<img class="chapter-icon" src="/assets/community/icons/chevron-right.svg">
</div>
</div>
<div class="collapse" id="slot-{{loop.index}}-{{outer_loop.index}}">
<p class="schedule-info">{{slot.about}}</p>
</div>
<div class="card-divider"></div>
{% endfor %}
</div>
</div>
{% endfor %}
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -1,6 +1,6 @@
{ {
"__unsaved": 1, "__unsaved": 1,
"creation": "2021-08-20 08:12:29.549625", "creation": "2021-08-17 16:43:49.506200",
"docstatus": 0, "docstatus": 0,
"doctype": "Web Template", "doctype": "Web Template",
"fields": [ "fields": [
@@ -8,7 +8,7 @@
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"label": "Title", "label": "Title",
"reqd": 0 "reqd": 1
}, },
{ {
"fieldname": "subtitle", "fieldname": "subtitle",
@@ -18,24 +18,18 @@
}, },
{ {
"__unsaved": 1, "__unsaved": 1,
"fieldname": "hosts", "fieldname": "event",
"fieldtype": "Table Break",
"label": "Hosts",
"reqd": 0
},
{
"fieldname": "host",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Host", "label": "Event",
"options": "Host", "options": "Event Details",
"reqd": 0 "reqd": 1
} }
], ],
"idx": 0, "idx": 0,
"modified": "2021-08-20 08:16:25.805456", "modified": "2021-08-18 10:13:49.300196",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Host Section", "name": "Schedule Section",
"owner": "Administrator", "owner": "Administrator",
"standard": 1, "standard": 1,
"template": "", "template": "",

View File

@@ -1,30 +1,23 @@
<div class="section-with-cards"> <div class="section-with-cards">
<h1 class="course-home-headings">{{section_title}}</h1> <h1 class="course-home-headings">{{section_title}}</h1>
{%- if subtitle -%} <div class="speaker-cards-parent">
<p class="section-description">{{ subtitle }}</p> {% for speaker in speaker_details %}
{%- endif -%} {% set speaker_doc = frappe.get_doc("Speaker Registration", speaker.speaker) %}
<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"> <div class="common-card-style member-card">
{{ widgets.Avatar(member=member, avatar_class="avatar-large") }} <span class="avatar avatar-large">
<img class="avatar-frame" src="{{speaker_doc.picture}}" />
</span>
<div class="small-title talk-title mt-5">
{{ speaker_doc.full_name }}
</div>
<div class="small-title mt-5 bb">{{speaker_doc.job_title}}</div>
<div class="small-title company-name">{{speaker_doc.company}}</div>
</div>
{% endfor %}
<div class="small-title member-card-title"> </div>
{{ member.full_name }} {%- if cta_link -%}
</div> <div class="event-btn"><a href={{cta_link}} class="btn btn-primary ">Become a Speaker</a></div>
<div class="small-title"> {%- endif -%}
{{speaker_doc.company}} </div>
</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>

View File

@@ -17,12 +17,19 @@
"reqd": 0 "reqd": 0
}, },
{ {
"__unsaved": 1,
"fieldname": "event_", "fieldname": "event_",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Event ", "label": "Event ",
"options": "Event Details", "options": "Event Details",
"reqd": 0 "reqd": 0
}, },
{
"fieldname": "cta_link",
"fieldtype": "Data",
"label": "CTA Link",
"reqd": 0
},
{ {
"fieldname": "speaker_details", "fieldname": "speaker_details",
"fieldtype": "Table Break", "fieldtype": "Table Break",
@@ -33,12 +40,12 @@
"fieldname": "speaker", "fieldname": "speaker",
"fieldtype": "Link", "fieldtype": "Link",
"label": "Speaker", "label": "Speaker",
"options": "Speaker", "options": "Speaker Registration",
"reqd": 0 "reqd": 0
} }
], ],
"idx": 1, "idx": 1,
"modified": "2021-08-20 10:59:54.965714", "modified": "2021-08-18 10:06:03.032441",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "Event Management", "module": "Event Management",
"name": "Speaker Section", "name": "Speaker Section",

View File

@@ -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>

View File

@@ -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
@@ -131,31 +130,67 @@ 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>/<certificate>", "to_route": "courses/certificate"}, {"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": "/courses/<course>/learn", "to_route": "batch/learn"}, {"from_route": "/add-a-new-batch", "to_route": "add-a-new-batch"},
{"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"}, {"from_route": "/courses/<course>/home", "to_route": "batch/home"},
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"}, {"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
{"from_route": "/courses/<course>/join", "to_route": "batch/join"}, {"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>", "to_route": "batch/learn"},
{"from_route": "/courses/<course>/schedule", "to_route": "batch/schedule"},
{"from_route": "/courses/<course>/members", "to_route": "batch/members"},
{"from_route": "/courses/<course>/discuss", "to_route": "batch/discuss"},
{"from_route": "/courses/<course>/about", "to_route": "batch/about"},
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
{"from_route": "/discussions/<discussion>", "to_route": "discussions/discussion"}
] ]
# Any frappe default URL is blocked by profile-rules, add it here to unblock it
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",
"/about",
"/edit-profile",
"/attendee-registration",
"/speaker-registration",
"/event",
"/hello",
"/exhibitor-registration",
"/discussions"
]
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
website_redirects = [ website_redirects = [
{"source": "/update-profile", "target": "/edit-profile"}, {"source": "/update-profile", "target": "/edit-profile"},
] ]
update_website_context = [ update_website_context = 'community.widgets.update_website_context'
'community.widgets.update_website_context',
]
jinja = {
"methods": [
"community.page_renderers.get_profile_url"
],
"filters": []
}
## Specify the additional tabs to be included in the user profile page. ## Specify the additional tabs to be included in the user profile page.
## Each entry must be a subclass of community.community.plugins.ProfileTab ## Each entry must be a subclass of community.community.plugins.ProfileTab
# profile_tabs = [] # profile_tabs = []
@@ -174,14 +209,4 @@ community_markdown_macro_renderers = {
"Exercise": "community.plugins.exercise_renderer", "Exercise": "community.plugins.exercise_renderer",
"Quiz": "community.plugins.quiz_renderer", "Quiz": "community.plugins.quiz_renderer",
"YouTubeVideo": "community.plugins.youtube_video_renderer", "YouTubeVideo": "community.plugins.youtube_video_renderer",
"Video": "community.plugins.video_renderer"
} }
# page_renderer to manage profile pages
page_renderer = [
"community.page_renderers.ProfileRedirectPage",
"community.page_renderers.ProfilePage"
]
# set this to "/" to have profiles on the top-level
profile_url_prefix = "/users/"

View File

@@ -8,9 +8,7 @@
"field_order": [ "field_order": [
"course", "course",
"title", "title",
"column_break_3",
"description", "description",
"section_break_5",
"lessons" "lessons"
], ],
"fields": [ "fields": [
@@ -18,12 +16,11 @@
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"label": "Title", "label": "Title"
"reqd": 1
}, },
{ {
"fieldname": "description", "fieldname": "description",
"fieldtype": "Small Text", "fieldtype": "Markdown Editor",
"label": "Description" "label": "Description"
}, },
{ {
@@ -31,22 +28,13 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Course", "label": "Course",
"options": "LMS Course", "options": "LMS Course"
"reqd": 1
}, },
{ {
"fieldname": "lessons", "fieldname": "lessons",
"fieldtype": "Table", "fieldtype": "Table",
"label": "Lessons", "label": "Lessons",
"options": "Lessons" "options": "Lessons"
},
{
"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,
@@ -57,7 +45,7 @@
"link_fieldname": "chapter" "link_fieldname": "chapter"
} }
], ],
"modified": "2021-08-31 10:43:45.866864", "modified": "2021-07-27 16:28:08.667964",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "Chapter", "name": "Chapter",

View File

@@ -3,6 +3,11 @@
import frappe import frappe
from frappe.model.document import Document from frappe.model.document import Document
from ..lesson.lesson import update_progress
class ExerciseSubmission(Document): class ExerciseSubmission(Document):
pass
def after_insert(self):
course_details = frappe.get_doc("LMS Course", self.course)
if not (course_details.is_mentor(frappe.session.user) or frappe.flags.in_test):
update_progress(self.lesson)

View File

@@ -17,15 +17,6 @@ frappe.ui.form.on('Lesson', {
</div> </div>
</div> </div>
<div class="row mb-3">
<div class="col-sm-4">
Video
</div>
<div class="col-sm-4">
{{ Video("url_of_source") }}
</div>
</div>
<div class="row mb-3"> <div class="row mb-3">
<div class="col-sm-4"> <div class="col-sm-4">
YouTube Video YouTube Video

View File

@@ -22,21 +22,18 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Chapter", "label": "Chapter",
"options": "Chapter", "options": "Chapter"
"reqd": 1
}, },
{ {
"fieldname": "title", "fieldname": "title",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1, "in_list_view": 1,
"label": "Title", "label": "Title"
"reqd": 1
}, },
{ {
"fieldname": "body", "fieldname": "body",
"fieldtype": "Markdown Editor", "fieldtype": "Markdown Editor",
"label": "Body", "label": "Body"
"reqd": 1
}, },
{ {
"fieldname": "index_label", "fieldname": "index_label",
@@ -70,7 +67,7 @@
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-31 10:44:14.168257", "modified": "2021-07-27 16:28:29.203624",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "Lesson", "name": "Lesson",

View File

@@ -8,7 +8,7 @@ from frappe.model.document import Document
from ...md import markdown_to_html, find_macros from ...md import markdown_to_html, find_macros
class Lesson(Document): class Lesson(Document):
def on_update(self): def before_save(self):
dynamic_documents = ["Exercise", "Quiz"] dynamic_documents = ["Exercise", "Quiz"]
for section in dynamic_documents: for section in dynamic_documents:
self.update_lesson_name_in_document(section) self.update_lesson_name_in_document(section)
@@ -91,5 +91,42 @@ def save_progress(lesson, course, status):
"lesson": lesson, "lesson": lesson,
"status": status, "status": status,
}).save(ignore_permissions=True) }).save(ignore_permissions=True)
course_details = frappe.get_doc("LMS Course", course) return "OK"
return course_details.get_course_progress()
def update_progress(lesson):
user = frappe.session.user
if not all_dynamic_content_submitted(lesson, user):
return
if frappe.db.exists("LMS Course Progress", {"lesson": lesson, "owner": user}):
course_progress = frappe.get_doc("LMS Course Progress", {"lesson": lesson, "owner": user})
course_progress.status = "Complete"
course_progress.save(ignore_permissions=True)
def all_dynamic_content_submitted(lesson, user):
all_exercises_submitted = check_all_exercise_submission(lesson, user)
all_quiz_submitted = check_all_quiz_submitted(lesson, user)
return all_exercises_submitted and all_quiz_submitted
def check_all_exercise_submission(lesson, user):
exercise_names = frappe.get_list("Exercise", {"lesson": lesson}, pluck="name", ignore_permissions=True)
if not len(exercise_names):
return True
query = {
"exercise": ["in", exercise_names],
"owner": user
}
if frappe.db.count("Exercise Submission", query) == len(exercise_names):
return True
return False
def check_all_quiz_submitted(lesson, user):
quizzes = frappe.get_list("LMS Quiz", {"lesson": lesson}, pluck="name", ignore_permissions=True)
if not len(quizzes):
return True
query = {
"quiz": ["in", quizzes],
"owner": user
}
if frappe.db.count("LMS Quiz Submission", query) == len(quizzes):
return True
return False

View File

@@ -13,14 +13,13 @@
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"label": "Lesson", "label": "Lesson",
"options": "Lesson", "options": "Lesson"
"reqd": 1
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"istable": 1, "istable": 1,
"links": [], "links": [],
"modified": "2021-08-31 10:44:42.048232", "modified": "2021-07-27 16:53:52.732191",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "Lessons", "name": "Lessons",

View File

@@ -35,6 +35,14 @@ 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_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.

View File

@@ -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,
}
};
});
}
});

View File

@@ -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
}

View File

@@ -1,45 +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 = int(course_details.expiry)
expiry_date = None
if expires_after_yrs:
expiry_date = add_years(nowdate(), expires_after_yrs)
certificate = frappe.get_doc({
"doctype": "LMS Certification",
"student": frappe.session.user,
"course": course,
"issue_date": nowdate(),
"expiry_date": expiry_date
})
certificate.save(ignore_permissions=True)
return certificate.name

View File

@@ -1,8 +0,0 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestLMSCertification(unittest.TestCase):
pass

View File

@@ -4,7 +4,6 @@
frappe.ui.form.on('LMS Course', { frappe.ui.form.on('LMS Course', {
onload: function (frm) { onload: function (frm) {
frm.set_query("chapter", "chapters", function () { frm.set_query("chapter", "chapters", function () {
return { return {
filters: { filters: {
@@ -12,14 +11,6 @@ frappe.ui.form.on('LMS Course', {
} }
}; };
}); });
frm.set_query("instructor", function (doc) {
return {
filters: {
"ignore_user_type": 1,
}
};
});
} }
}); });

View File

@@ -18,21 +18,14 @@
"video_link", "video_link",
"image", "image",
"column_break_3", "column_break_3",
"instructor",
"tags", "tags",
"section_break_7",
"is_published", "is_published",
"column_break_9",
"upcoming", "upcoming",
"column_break_11",
"disable_self_learning", "disable_self_learning",
"section_break_5", "section_break_5",
"short_introduction", "short_introduction",
"description", "description",
"chapters", "chapters"
"certification_section",
"enable_certification",
"expiry"
], ],
"fields": [ "fields": [
{ {
@@ -101,46 +94,6 @@
"fieldtype": "Table", "fieldtype": "Table",
"label": "Chapters", "label": "Chapters",
"options": "Chapters" "options": "Chapters"
},
{
"fieldname": "instructor",
"fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Instructor",
"options": "User"
},
{
"fieldname": "section_break_7",
"fieldtype": "Section Break",
"label": "Course Settings"
},
{
"fieldname": "column_break_9",
"fieldtype": "Column Break"
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
},
{
"fieldname": "certification_section",
"fieldtype": "Section Break",
"label": "Certification"
},
{
"default": "0",
"fieldname": "enable_certification",
"fieldtype": "Check",
"label": "Enable Certification"
},
{
"default": "0",
"depends_on": "enable_certification",
"fieldname": "expiry",
"fieldtype": "Select",
"label": "Certification Expires After Years",
"options": "0\n1\n2\n3\n4\n5\n6\n7\n8\n9\n10"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
@@ -162,7 +115,7 @@
"link_fieldname": "course" "link_fieldname": "course"
} }
], ],
"modified": "2021-08-25 11:04:57.211898", "modified": "2021-07-28 19:01:50.677445",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Course", "name": "LMS Course",

View File

@@ -144,8 +144,6 @@ class LMSCourse(Document):
return batch_name and frappe.get_doc("LMS Batch", batch_name) return batch_name and frappe.get_doc("LMS Batch", batch_name)
def get_instructor(self): def get_instructor(self):
if self.instructor:
return frappe.get_doc("User", self.instructor)
return frappe.get_doc("User", self.owner) return frappe.get_doc("User", self.owner)
def get_chapters(self): def get_chapters(self):
@@ -349,16 +347,6 @@ class LMSCourse(Document):
"next": numbers[index+1] if index+1 < len(numbers) else None "next": numbers[index+1] if index+1 < len(numbers) else None
} }
def is_certified(self):
certificate = frappe.get_all("LMS Certification",
{
"student": frappe.session.user,
"course": self.name
})
if len(certificate):
return certificate[0].name
return
@frappe.whitelist() @frappe.whitelist()
def reindex_exercises(doc): def reindex_exercises(doc):
course_data = json.loads(doc) course_data = json.loads(doc)

View File

@@ -26,14 +26,13 @@
"fieldname": "course", "fieldname": "course",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1, "in_list_view": 1,
"in_standard_filter": 1,
"label": "Course", "label": "Course",
"options": "LMS Course" "options": "LMS Course"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-31 12:37:23.832131", "modified": "2021-07-05 14:57:03.841430",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Course Review", "name": "LMS Course Review",

View File

@@ -1,10 +1,12 @@
# 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 community.lms.doctype.lesson.lesson import update_progress
import frappe import frappe
from frappe.model.document import Document from frappe.model.document import Document
import json import json
from frappe import _ from frappe import _
from ..lesson.lesson import update_progress
class LMSQuiz(Document): class LMSQuiz(Document):
def validate(self): def validate(self):

View File

@@ -13,8 +13,6 @@
{ {
"fieldname": "quiz", "fieldname": "quiz",
"fieldtype": "Link", "fieldtype": "Link",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Quiz", "label": "Quiz",
"options": "LMS Quiz" "options": "LMS Quiz"
}, },
@@ -27,13 +25,12 @@
{ {
"fieldname": "score", "fieldname": "score",
"fieldtype": "Data", "fieldtype": "Data",
"in_list_view": 1,
"label": "Score" "label": "Score"
} }
], ],
"index_web_pages_for_search": 1, "index_web_pages_for_search": 1,
"links": [], "links": [],
"modified": "2021-08-26 12:24:15.973829", "modified": "2021-06-07 14:19:54.958989",
"modified_by": "Administrator", "modified_by": "Administrator",
"module": "LMS", "module": "LMS",
"name": "LMS Quiz Submission", "name": "LMS Quiz Submission",

View File

@@ -20,7 +20,6 @@ import markdown
from markdown import Extension from markdown import Extension
from markdown.inlinepatterns import InlineProcessor from markdown.inlinepatterns import InlineProcessor
import xml.etree.ElementTree as etree import xml.etree.ElementTree as etree
import html as HTML
def markdown_to_html(text): def markdown_to_html(text):
"""Renders markdown text into html. """Renders markdown text into html.
@@ -110,5 +109,4 @@ def sanitize_html(html, macro):
classname = "" classname = ""
if macro == "YouTubeVideo": if macro == "YouTubeVideo":
classname = "lesson-video" classname = "lesson-video"
return "<div class='" + classname + "'>" + "\n".join(str(node) for node in nodes) + "</div>" return "<div class='" + classname + "'>" + "\n".join(str(node) for node in nodes) + "</div>"

View File

@@ -8,7 +8,7 @@ frappe.ready(function () {
frappe.web_form.after_save = () => { frappe.web_form.after_save = () => {
setTimeout(() => { setTimeout(() => {
window.location.href = `/profile_/${frappe.web_form.get_value(["username"])}`; window.location.href = `/${frappe.web_form.get_value(["username"])}`;
}) })
} }
}) })

Some files were not shown because too many files have changed in this diff Show More