Compare commits

..

37 Commits

Author SHA1 Message Date
pateljannat
ff1363b437 fix: certificate, profile, quiz, and video markdown 2021-08-25 21:01:13 +05:30
Jannat Patel
952e3a9906 Merge pull request #190 from fossunited/web-form-changes
fix: web form issues
2021-08-24 21:23:23 +05:30
pateljannat
9d530e35fb fix: web form issues 2021-08-24 20:58:12 +05:30
Jannat Patel
2c2ad78eb7 Merge pull request #189 from sumaiya2908/event-registration
fix: attendee-route
2021-08-24 18:09:27 +05:30
Summayya
f61c5a2fa1 fix: implicit user in speaker and exhibitor 2021-08-24 17:47:58 +05:30
Summayya
3e24ff9678 fix: implicit user 2021-08-24 17:27:16 +05:30
Summayya
b0280c3be4 fix: attendee-route 2021-08-24 16:40:46 +05:30
Jannat Patel
b10eb5c979 Merge pull request #188 from fossunited/talks-thumbnail
fix: talk card schedule
2021-08-24 12:27:13 +05:30
pateljannat
e2072c72da fix: talk card schedule 2021-08-24 12:12:55 +05:30
Jannat Patel
84a43912db Merge pull request #186 from fossunited/fixes
fix: minor issues
2021-08-23 18:52:14 +05:30
pateljannat
841819436a fix: minor issues 2021-08-23 18:22:36 +05:30
pateljannat
14a984c75f Merge branch 'main' of https://github.com/frappe/community into fixes 2021-08-23 11:14:35 +05:30
Jannat Patel
445de61ce4 Merge pull request #185 from fossunited/web-form-url-fixes
fix: web form redirects
2021-08-23 10:32:40 +05:30
pateljannat
f83007788d fix: web form redirects 2021-08-23 10:22:40 +05:30
Jannat Patel
aefee791ca Merge pull request #184 from sumaiya2908/event-management
fix: redirections
2021-08-23 10:21:24 +05:30
Summayya
00154d80df fix: redirections 2021-08-23 10:08:43 +05:30
Summayya
a1e12d29ac fix: redirections 2021-08-23 10:02:06 +05:30
Jannat Patel
5069832165 Merge pull request #183 from fossunited/event-doctype-fixes
fix: event doctypes and templates
2021-08-20 17:41:56 +05:30
pateljannat
e2cb003935 fix: doctypes and templates 2021-08-20 17:35:13 +05:30
Jannat Patel
b83a10c282 Merge pull request #180 from sumaiya2908/event-management
Create web templates for event management
2021-08-20 15:34:48 +05:30
Summayya
c6fc0a22d2 fix: add user to exhibitor doctype 2021-08-20 15:26:47 +05:30
pateljannat
c6d3994383 fix: course page 2021-08-20 14:23:18 +05:30
Summayya
07f9721aeb fix: remove speaker-registration 2021-08-20 13:45:40 +05:30
Summayya
dba956e473 fix: remove speaker-registration 2021-08-20 13:41:11 +05:30
Summayya
2894a5e479 fix: change date format 2021-08-19 17:22:01 +05:30
Summayya
ad0913500c fix: link user to speaker/attendee 2021-08-19 16:08:54 +05:30
Jannat Patel
79a765b725 Merge pull request #182 from fossunited/profile-urls
fix: profile urls
2021-08-19 12:05:59 +05:30
pateljannat
eaec991f47 fix: chapter teaser drawer 2021-08-19 10:06:39 +05:30
pateljannat
e31b189045 fix: profile urls 2021-08-19 09:35:02 +05:30
Summayya
eb58b1c149 fix: remove hover 2021-08-18 23:53:02 +05:30
Summayya
af9760f944 fix: remove div in schedule template 2021-08-18 19:49:12 +05:30
Summayya
21b2412362 fix: remove dummy data 2021-08-18 19:41:37 +05:30
Summayya
7e5e167eec fix: remove dummy data 2021-08-18 19:40:35 +05:30
Jannat Patel
7bf254319b Merge pull request #181 from fossunited/certification
feat: certification
2021-08-18 18:39:12 +05:30
Summayya
7c3189e273 fix:conflict 2021-08-18 11:41:09 +05:30
Summayya
ace74febc7 Template for Previous content 2021-08-18 11:37:04 +05:30
Summayya
8dbdabd52c Create web templates for event management 2021-08-17 22:31:15 +05:30
110 changed files with 1886 additions and 198 deletions

View File

@@ -1,5 +1,5 @@
{% set color = member.get_palette() %}
<a class="button-links" href="/{{member.username}}">
<a class="button-links" href="/user/{{member.username}}">
<span class="avatar {{ avatar_class }}" title="{{ member.full_name }}">
{% if member.user_image %}
<img class="avatar-frame standard-image" style="object-fit: cover;" src="{{ member.user_image }}" title="{{ member.full_name }}">

View File

@@ -28,9 +28,9 @@ order_by="creation") %}
<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" id="login-from-discussion">Log In</div>
<div class="button is-primary mt-5" 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>
<div class="button is-primary mt-5" id="login-from-discussion" data-redirect="{{ redirect_to }}">{{ button_name }}</div>
{% endif %}
</div>
{% else %}

View File

View File

@@ -0,0 +1,14 @@
// 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,80 @@
{
"actions": [],
"creation": "2021-08-11 10:07:53.262504",
"doctype": "DocType",
"editable_grid": 1,
"engine": "InnoDB",
"field_order": [
"user",
"full_name",
"column_break_3",
"company",
"is_paid",
"section_break_6",
"what_are_you_hoping_to_learn"
],
"fields": [
{
"fieldname": "company",
"fieldtype": "Data",
"label": "Company"
},
{
"fieldname": "what_are_you_hoping_to_learn",
"fieldtype": "Text",
"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,
"links": [],
"modified": "2021-08-20 17:03:09.741997",
"modified_by": "Administrator",
"module": "Event Management",
"name": "Attendee",
"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
# import frappe
from frappe.model.document import Document
class Attendee(Document):
pass

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestAttendee(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('Event Details', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,68 @@
{
"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
}

View File

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

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestEventDetails(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('Event Ticket', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,55 @@
{
"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
}

View File

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

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestEventTicket(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('Exhibitor', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,87 @@
{
"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
# import frappe
from frappe.model.document import Document
class Exhibitor(Document):
pass

View File

@@ -0,0 +1,8 @@
# Copyright (c) 2021, FOSS United and Contributors
# See license.txt
# import frappe
import unittest
class TestExhibitor(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('Host', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,57 @@
{
"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
}

View File

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

View File

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

View File

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

@@ -0,0 +1,72 @@
{
"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
}

View File

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

View File

@@ -0,0 +1,8 @@
# 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('Talk', {
// refresh: function(frm) {
// }
});

View File

@@ -0,0 +1,139 @@
{
"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

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

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

View File

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

@@ -0,0 +1,77 @@
{
"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-24 19:57:25.516319",
"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,
"default": "",
"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
}
]
}

View File

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

View File

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

@@ -0,0 +1,76 @@
{
"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
}
]
}

View File

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

View File

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

@@ -0,0 +1,102 @@
{
"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

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

View File

@@ -0,0 +1,10 @@
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 = '/event/conference2021/propose-talk';
}, 2000);
}
})

View File

@@ -0,0 +1,89 @@
{
"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
}
]
}

View File

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

View File

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

View File

@@ -0,0 +1,49 @@
{
"__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"
}

View File

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

View File

@@ -0,0 +1,43 @@
{
"__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"
}

View File

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

View File

@@ -0,0 +1,49 @@
{
"__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"
}

View File

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

@@ -0,0 +1,49 @@
{
"__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"
}

View File

@@ -85,7 +85,8 @@ web_include_css = "community.bundle.css"
# Override standard doctype classes
override_doctype_class = {
"User": "community.overrides.user.CustomUser"
"User": "community.overrides.user.CustomUser",
"Web Template": "community.overrides.web_template.CustomWebTemplate"
}
# Document Events
@@ -130,7 +131,7 @@ fixtures = ["Custom Field"]
# auto_cancel_exempted_doctypes = ["Auto Repeat"]
# Add all simple route rules here
primary_rules = [
website_route_rules = [
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
{"from_route": "/courses/<course>", "to_route": "courses/course"},
{"from_route": "/courses/<course>/<certificate>", "to_route": "courses/certificate"},
@@ -146,40 +147,10 @@ primary_rules = [
{"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"}
{"from_route": "/discussions/<discussion>", "to_route": "discussions/discussion"},
{"from_route": "/user/<string(minlength=4):username>", "to_route": "profiles/profile"},
]
# 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",
"/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 = [
{"source": "/update-profile", "target": "/edit-profile"},
]
@@ -204,4 +175,5 @@ community_markdown_macro_renderers = {
"Exercise": "community.plugins.exercise_renderer",
"Quiz": "community.plugins.quiz_renderer",
"YouTubeVideo": "community.plugins.youtube_video_renderer",
"Video": "community.plugins.video_renderer"
}

View File

@@ -8,7 +8,9 @@
"field_order": [
"course",
"title",
"column_break_3",
"description",
"section_break_5",
"lessons"
],
"fields": [
@@ -20,7 +22,7 @@
},
{
"fieldname": "description",
"fieldtype": "Markdown Editor",
"fieldtype": "Small Text",
"label": "Description"
},
{
@@ -35,6 +37,14 @@
"fieldtype": "Table",
"label": "Lessons",
"options": "Lessons"
},
{
"fieldname": "column_break_3",
"fieldtype": "Column Break"
},
{
"fieldname": "section_break_5",
"fieldtype": "Section Break"
}
],
"index_web_pages_for_search": 1,
@@ -45,7 +55,7 @@
"link_fieldname": "chapter"
}
],
"modified": "2021-07-27 16:28:08.667964",
"modified": "2021-08-19 13:43:51.025072",
"modified_by": "Administrator",
"module": "LMS",
"name": "Chapter",

View File

@@ -3,11 +3,6 @@
import frappe
from frappe.model.document import Document
from ..lesson.lesson import update_progress
class ExerciseSubmission(Document):
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)
pass

View File

@@ -17,6 +17,15 @@ frappe.ui.form.on('Lesson', {
</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="col-sm-4">
YouTube Video

View File

@@ -93,41 +93,3 @@ def save_progress(lesson, course, status):
}).save(ignore_permissions=True)
course_details = frappe.get_doc("LMS Course", course)
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

@@ -35,14 +35,6 @@ class LMSBatch(Document):
filters['member_type'] = member_type
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):
"""Returns the membership document of given user.

View File

@@ -29,13 +29,17 @@ def create_certificate(course):
return certificate
else:
expires_after_yrs = course_details.expiry
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": add_years(nowdate(), int(expires_after_yrs))
"expiry_date": expiry_date
})
certificate.save(ignore_permissions=True)
return certificate.name

View File

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

View File

@@ -18,9 +18,13 @@
"video_link",
"image",
"column_break_3",
"instructor",
"tags",
"section_break_7",
"is_published",
"column_break_9",
"upcoming",
"column_break_11",
"disable_self_learning",
"section_break_5",
"short_introduction",
@@ -98,6 +102,27 @@
"label": "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",
@@ -137,7 +162,7 @@
"link_fieldname": "course"
}
],
"modified": "2021-08-18 18:02:12.623807",
"modified": "2021-08-25 11:04:57.211898",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Course",

View File

@@ -144,6 +144,8 @@ class LMSCourse(Document):
return batch_name and frappe.get_doc("LMS Batch", batch_name)
def get_instructor(self):
if self.instructor:
return frappe.get_doc("User", self.instructor)
return frappe.get_doc("User", self.owner)
def get_chapters(self):

View File

@@ -1,12 +1,10 @@
# Copyright (c) 2021, FOSS United and contributors
# For license information, please see license.txt
from community.lms.doctype.lesson.lesson import update_progress
import frappe
from frappe.model.document import Document
import json
from frappe import _
from ..lesson.lesson import update_progress
class LMSQuiz(Document):
def validate(self):

View File

@@ -20,6 +20,7 @@ import markdown
from markdown import Extension
from markdown.inlinepatterns import InlineProcessor
import xml.etree.ElementTree as etree
import html as HTML
def markdown_to_html(text):
"""Renders markdown text into html.
@@ -109,4 +110,5 @@ def sanitize_html(html, macro):
classname = ""
if macro == "YouTubeVideo":
classname = "lesson-video"
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 = () => {
setTimeout(() => {
window.location.href = `/${frappe.web_form.get_value(["username"])}`;
window.location.href = `/user/${frappe.web_form.get_value(["username"])}`;
})
}
})

View File

@@ -14,15 +14,15 @@
</div>
{% endif %}
{% set is_instructor = frappe.session.user == course.instructor %}
<div class="lessons">
{% for lesson in course.get_lessons(chapter) %}
<div class="lesson-info{% if membership.current_lesson == lesson.name %} active-lesson {% endif %}">
{% if membership or lesson.include_in_preview %}
<a class="lesson-links"
href="{{ course.get_learn_url(lesson.number) }}{{course.query_parameter}}"
{% if membership or lesson.include_in_preview or is_instructor %}
<a class="lesson-links" href="{{ course.get_learn_url(lesson.number) }}{{course.query_parameter}}"
data-course="{{ course.name }}">
{{ lesson.title }}
@@ -56,6 +56,11 @@
<script>
frappe.ready(() => {
expand_the_active_chapter();
$(".chapter-title").click((e) => {
rotate_chapter_icon(e);
});
})
var expand_the_first_chapter = () => {
@@ -97,4 +102,14 @@
$(element).siblings(".chapter-title").children(".chapter-icon").css("transform", "rotate(90deg)");
}
var rotate_chapter_icon = (e) => {
e.preventDefault();
var icon = $(e.currentTarget).children(".chapter-icon");
if (icon.css("transform") == "none") {
icon.css("transform", "rotate(90deg)");
} else {
icon.css("transform", "none");
}
}
</script>

View File

@@ -12,7 +12,7 @@
{% endif %}
<div class="course-author">
{% with author = course.get_instructor() %}
{{ widgets.Avatar(member=author, avatar_class="avatar-medium") }} <a href="/{{author.username}}">{{ author.full_name }}</a>
{{ widgets.Avatar(member=author, avatar_class="avatar-medium") }} <a href="/user/{{author.username}}">{{ author.full_name }}</a>
{% endwith %}
</div>
</div>

View File

@@ -1,6 +1,6 @@
<div class="instructor">
{{ widgets.Avatar(member=instructor, avatar_class="avatar-medium") }}
<a class="ml-1 instructor-title" href="/{{instructor.username}}">{{ instructor.full_name }}</a>
<a class="ml-1 instructor-title" href="/user/{{instructor.username}}">{{ instructor.full_name }}</a>
<div class="instructor-subtitle">Course Creator</div>
<!-- <div class="instructor-subtitle">Created {{instructor.get_course_count()}} courses</div> -->
</div>

View File

@@ -11,5 +11,5 @@
Created {{ course_count }} {{ suffix }}
</div>
{% endif %}
<a class="stretched-link" href="/{{ member.username }}"></a>
<a class="stretched-link" href="/user/{{ member.username }}"></a>
</div>

View File

@@ -18,7 +18,7 @@
<div class="review-card-footer">
<div>
{{ widgets.Avatar(member=review.owner_details, avatar_class="avatar-medium") }}
<a class="button-links" href="/{{review.owner_details.username}}">
<a class="button-links" href="/user/{{review.owner_details.username}}">
<span class="course-instructor">
{{ review.owner_details.full_name }}
</span>

View File

@@ -2,3 +2,4 @@ Community
Hackathon
LMS
Conference
Event Management

View File

@@ -0,0 +1,15 @@
import frappe
from frappe.website.doctype.web_template.web_template import WebTemplate
from community.widgets import Widgets
import json
class CustomWebTemplate(WebTemplate):
def render(self, values=None):
if not values:
values = {}
values = frappe.parse_json(values)
values.update({"values": values})
values.update({"widgets": Widgets()})
template = self.get_template(self.standard)
return frappe.render_template(template, values)

View File

@@ -8,3 +8,4 @@ community.patches.replace_member_with_user_in_lms_message
community.patches.replace_member_with_user_in_mentor_request
community.patches.v0_0.chapter_lesson_index_table
execute:frappe.delete_doc("DocType", "LMS Message")
community.patches.v0_0.course_instructor_update

View File

@@ -0,0 +1,7 @@
import frappe
def execute():
frappe.reload_doc("lms", "doctype", "lms_course")
courses = frappe.get_all("LMS Course", fields=["name", "owner"])
for course in courses:
frappe.db.set_value("LMS Course", course.name, "instructor", course.owner)

View File

@@ -106,3 +106,6 @@ def youtube_video_renderer(video_id):
allowfullscreen>
</iframe>
"""
def video_renderer(src):
return "<video controls width='100%'><source src={0} type='video/mp4'></video>".format(src)

View File

@@ -279,6 +279,16 @@ input[type=checkbox] {
line-height: 135%;
color: var(--text-color);
}
.view-talk-link {
background: var(--button-background);
border-radius: 4px;
font-size: 14px;
padding: 8px 22px 8px;
text-align: center;
line-height: 135%;
color: var(--text-color);
}
.cards-parent {
display: grid;
@@ -620,6 +630,10 @@ input[type=checkbox] {
margin-bottom: 0.75rem;
}
.course-content-parent .chapter-description {
font-size: 0.7rem;
}
.chapter-icon {
margin-right: .25rem;
}
@@ -749,6 +763,10 @@ input[type=checkbox] {
padding: 20px 0px 16px;
}
.member-card .talk-title{
font-weight: bold;
}
.member-card-large {
width: 256px;
height: 188px;
@@ -774,6 +792,7 @@ input[type=checkbox] {
font-weight: bold;
}
.member-card-xl .member-card-title {
font-weight: bold;
}
@@ -828,6 +847,11 @@ input[type=checkbox] {
margin: 0;
}
.avatar-medium-schedule{
width: 70px;
height: 70px;
}
.avatar-large {
width: 88px;
height: 88px;
@@ -1263,6 +1287,99 @@ pre {
font-size: 1rem;
}
.talk-title {
border-bottom: 1px solid #cecdcd;
}
.mt-5 {
margin-top: 5px;
}
.company-name {
font-weight: bold;
}
.speaker-cards-parent {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
-moz-column-gap: 32px;
column-gap: 14px;
row-gap: 32px;
}
.avatar img {
object-fit: cover;
}
.section-with-cards .course-home-headings {
margin: 0px 0px 1rem;
}
.schedule-container {
padding-bottom: 16px;
}
.schedule-inner-container {
display: grid;
grid-template-columns: 1.2fr 2fr 1fr 0.2fr;
padding: 0 20px 0;
}
.schedule-slot {
font-weight: bolder;
}
.schedule-title {
font-size: 20px;
}
.schedule-info{
padding: 20px;
}
.drop-down-icon {
padding : 5px 0 0 5px;
}
.event-btn {
display: flex;
align-items: center;
justify-content: center;
margin-top: 3rem;
}
.exhibitor-card {
text-align: center;
padding-bottom: 30px;
}
.exhibitor-card .company-name{
font-size: 25px;
margin-top: 30px;
}
.exhibitor-card .company-logo{
height: 158px;
width: 252px;
object-fit: contain;
}
.info-speaker-avatar {
display: flex;
text-align: left;
}
.info-speaker {
margin-left: 1rem;
padding-bottom: 0;
margin-top: 6px;
}
.info-avatar img{
object-fit: contain;
}
.thread-card {
flex-direction: column;
padding: 1.5rem;
@@ -1297,17 +1414,24 @@ textarea.form-control {
}
.certificate-page .common-card-style {
flex-direction: column;
font-family: Inter;
color: black;
font-size: 2rem;
text-align: center;
width: 40%;
margin: 0 auto;
}
.certificate-content {
padding: 5rem;
background-image: url(/assets/community/images/certificate-background.png);
}
.certificate-ribbon {
background-color: var(--primary-color);
margin-right: 2rem;
width: 20%;
}
.certificate-heading {
font-size: 4rem;
font-size: 2rem;
margin-bottom: 3rem;
font-weight: bold;
}
@@ -1316,18 +1440,47 @@ textarea.form-control {
margin-bottom: 3rem;
}
@media (max-width: 768px) {
.certificate-page .common-card-style {
padding: 2rem;
font-size: 1.5rem;
}
.certificate-logo {
height: 20px;
margin-top: 2rem;
}
.certificate-heading {
font-size: 3rem;
@media (max-width: 1024px) {
.certificate-content {
padding: 3rem;
}
}
@media (max-width: 360px) {
@media (max-width: 768px) {
.certificate-page .common-card-style {
width: 50%;
}
.certificate-content {
padding: 2rem;
}
.certificate-ribbon {
margin-right: 1rem;
}
.certificate-heading {
font-size: 2rem;
}
}
@media (max-width: 550px) {
.certificate-page .common-card-style {
width: 60%;
}
}
@media (max-width: 500px) {
.certificate-page .common-card-style {
width: 90%;
}
.certificate-heading {
font-size: 2rem;
}

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M1.646 4.646a.5.5 0 0 1 .708 0L8 10.293l5.646-5.647a.5.5 0 0 1 .708.708l-6 6a.5.5 0 0 1-.708 0l-6-6a.5.5 0 0 1 0-.708z"/>
</svg>

After

Width:  |  Height:  |  Size: 293 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" viewBox="0 0 24 24" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path d="M6 9l6 6 6-6"/>
</svg>

After

Width:  |  Height:  |  Size: 206 B

View File

@@ -0,0 +1,3 @@
<svg xmlns="http://www.w3.org/2000/svg" width="25" height="25" fill="none" stroke="#fff" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
<path fill-rule="evenodd" d="M7.646 4.646a.5.5 0 0 1 .708 0l6 6a.5.5 0 0 1-.708.708L8 5.707l-5.646 5.647a.5.5 0 0 1-.708-.708l6-6z"/>
</svg>

After

Width:  |  Height:  |  Size: 296 B

View File

@@ -1,4 +1,5 @@
<div class="common-card-style">
<div class="certificate-content">
<div class="certificate-heading">
Certificate of Completion
</div>
@@ -7,26 +8,28 @@
<span class="font-weight-bold">{{ course.title }}</span> online course on
<span class="font-weight-bold">{{ frappe.utils.format_date(certificate.issue_date, "medium") }}</span>
</div>
<div style="display: flex; justify-content: space-between;" class="certificate-footer">
<div class="certificate-footer">
<div>
<div class="font-weight-bold">
<span>
Instructor:
</div>
<div>
</span>
<span class="font-weight-bold">
{{ instructor.full_name }}
</span>
</div>
</div>
{% if certificate.expiry_date %}
<div>
<div class="font-weight-bold">
<span>
Expiry Date:
</div>
<div>
</span>
<span class="font-weight-bold">
{{ frappe.utils.format_date(certificate.expiry_date, "medium") }}
</span>
</div>
{% endif %}
</div>
<img src="{{ logo }}" class="certificate-logo">
</div>
<div>
<img src="{{ logo }}" style="height: 50px;">
</div>
<div class="certificate-ribbon"></div>
</div>
<script src="/assets/community/js/html2canvas.js"></script>

View File

@@ -2,7 +2,7 @@
<div class="mb-4">
{% set member = frappe.get_doc("User", message.owner) %}
{{ widgets.Avatar(member=member, avatar_class="avatar-small")}}
<a class="button-links" href="/{{ member.username }}">
<a class="button-links" href="/user/{{ member.username }}">
<span class="message-author">{{ member.full_name }}</span>
</a>
<span class="muted-text pull-right">{{ frappe.utils.format_datetime(message.creation, "dd MMM hh:mm") }}</span>

View File

@@ -26,10 +26,9 @@
<div class="custom-checkbox">
<label class="quiz-label">
<input class="option" value="{{ option | urlencode }}"
data-correct="{{ question['is_correct_' + loop.index | string] }}"
{% if question.multiple %} type="checkbox"
{% else %} type="radio" name="{{ question.question | urlencode }}" {% endif %}>
<img class="empty-checkbox mr-3"/>
data-correct="{{ question['is_correct_' + loop.index | string] }}" {% if question.multiple %}
type="checkbox" {% else %} type="radio" name="{{ question.question | urlencode }}" {% endif %}>
<img class="empty-checkbox mr-3" />
</label>
<span class="label-area">{{ frappe.utils.md_to_html(option) }}</span>
</div>
@@ -51,6 +50,7 @@
<button class="btn btn-primary pull-right" id="check" disabled>Check</button>
<button class="btn btn-primary hide" id="next">Next</button>
<button class="btn btn-primary hide" id="summary">Summary</button>
<small id="submission-message" class="font-weight-bold hide"> Please join the course to submit the Quiz.</small>
</div>
<div class="button is-secondary pull-right hide" id="try-again">Try Again</div>
<h4 class="success-message"></h4>

View File

@@ -29,8 +29,9 @@
{% endif %}
{% set title = lesson.title + " - " + course.title %}
{% set condition = membership or is_instructor %}
{{ widgets.DiscussionMessage(doctype="Lesson", docname=lesson.name,
title=title, condition=membership, button_name="Start Learning",
title=title, condition=condition, button_name="Start Learning",
redirect_to="/courses/" + course.name) }}
</div>
</div>
@@ -39,14 +40,18 @@
{% endblock %}
{% macro LessonContent(lesson) %}
{% set is_instructor = frappe.session.user == course.instructor %}
<div class="lesson-content">
<div class="course-home-headings title {% if membership %} is-member {% endif %}" data-lesson="{{ lesson.name }}"
<div class="course-home-headings title
{% if membership %} is-member {% endif %}
{% if membership or is_instructor %} eligible-for-submission {% endif %}" data-lesson="{{ lesson.name }}"
data-course="{{ course.name }}">
{{ lesson.title }}
<span class="lesson-progress {{hide if course.get_progress(lesson.name) != 'Complete' else ''}}">COMPLETED</span>
</div>
{% if membership or lesson.include_in_preview %}
{% if membership or lesson.include_in_preview or is_instructor %}
<div class="common-card-style lesson-content-card markdown-source">{{ lesson.render_html() }}</div>
{% else %}
<div class="common-card-style lesson-content-card">

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