Merge branch 'main' of https://github.com/frappe/lms into rename-batch-doctype

This commit is contained in:
Jannat Patel
2023-08-25 18:04:28 +05:30
11 changed files with 104 additions and 42 deletions

View File

@@ -10,7 +10,8 @@
"member_name",
"column_break_3",
"issue_date",
"expiry_date"
"expiry_date",
"class_name"
],
"fields": [
{
@@ -52,11 +53,18 @@
"fieldtype": "Data",
"label": "Member Name",
"read_only": 1
},
{
"fieldname": "class_name",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Class Name",
"options": "LMS Class"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-04-14 12:33:37.839625",
"modified": "2023-08-23 14:48:49.351394",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate",

View File

@@ -8,16 +8,16 @@
"field_order": [
"member",
"member_name",
"column_break_5",
"status",
"course",
"class",
"section_break_6",
"column_break_5",
"date",
"start_time",
"end_time",
"column_break_10",
"class_name",
"section_break_6",
"rating",
"status",
"column_break_10",
"summary"
],
"fields": [
@@ -89,22 +89,24 @@
},
{
"fieldname": "section_break_6",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Evaluation Details"
},
{
"fieldname": "column_break_10",
"fieldtype": "Column Break"
},
{
"fieldname": "class",
"fieldname": "class_name",
"fieldtype": "Link",
"label": "Class",
"in_standard_filter": 1,
"label": "Class Name",
"options": "LMS Class"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-07-13 11:30:53.432076",
"modified": "2023-08-23 14:51:21.947160",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Evaluation",

View File

@@ -8,6 +8,7 @@
"field_order": [
"course",
"evaluator",
"class_name",
"column_break_4",
"member",
"member_name",
@@ -97,11 +98,18 @@
"fieldtype": "Data",
"label": "Google Meet Link",
"read_only": 1
},
{
"fieldname": "class_name",
"fieldtype": "Link",
"in_standard_filter": 1,
"label": "Class Name",
"options": "LMS Class"
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-07-21 16:00:11.795521",
"modified": "2023-08-23 14:50:37.618350",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Request",

View File

@@ -123,6 +123,7 @@ def create_certificate_request(
"day": day,
"start_time": start_time,
"end_time": end_time,
"class_name": class_name,
}
)
eval.save(ignore_permissions=True)

View File

@@ -162,7 +162,7 @@
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2023-08-10 12:54:44.351907",
"modified": "2023-08-23 14:23:07.706539",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Class",
@@ -206,6 +206,7 @@
"write": 1
}
],
"show_title_field_in_link": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],

View File

@@ -175,7 +175,7 @@ def get_tags(course):
def get_instructors(course):
instructor_details = []
instructors = frappe.get_all(
"Course Instructor", {"parent": course}, ["instructor"], order_by="idx"
"Course Instructor", {"parent": course}, order_by="idx", pluck="instructor"
)
if not instructors:
instructors = frappe.db.get_value("LMS Course", course, "owner").split(" ")
@@ -183,7 +183,7 @@ def get_instructors(course):
instructor_details.append(
frappe.db.get_value(
"User",
instructor.instructor,
instructor,
["name", "username", "full_name", "user_image"],
as_dict=True,
)

View File

@@ -8,19 +8,21 @@
"allow_print": 0,
"amount": 0.0,
"amount_based_on_field": 0,
"anonymous": 0,
"apply_document_permissions": 0,
"button_label": "Save",
"creation": "2022-11-23 11:59:33.533053",
"doc_type": "LMS Certificate Evaluation",
"docstatus": 0,
"doctype": "Web Form",
"idx": 0,
"idx": 1,
"introduction_text": "",
"is_standard": 1,
"list_columns": [],
"login_required": 1,
"max_attachment_size": 0,
"modified": "2023-02-23 13:04:00.405266",
"meta_image": "/files/og_image_web_form_evaluation_68ddf18e.png",
"modified": "2023-08-23 14:37:03.086303",
"modified_by": "Administrator",
"module": "LMS",
"name": "evaluation",
@@ -61,12 +63,13 @@
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "summary",
"fieldtype": "Small Text",
"fieldname": "class_name",
"fieldtype": "Link",
"hidden": 0,
"label": "Summary",
"label": "Class Name",
"max_length": 0,
"max_value": 0,
"options": "LMS Class",
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
@@ -120,6 +123,19 @@
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "",
"fieldtype": "Section Break",
"hidden": 0,
"label": "Evaluation Details",
"max_length": 0,
"max_value": 0,
"options": "",
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "rating",
@@ -147,14 +163,26 @@
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "class",
"fieldtype": "Link",
"hidden": 1,
"label": "Class",
"fieldname": "",
"fieldtype": "Column Break",
"hidden": 0,
"label": "",
"max_length": 0,
"max_value": 0,
"options": "LMS Class",
"read_only": 1,
"options": "",
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
},
{
"allow_read_on_all_link_options": 0,
"fieldname": "summary",
"fieldtype": "Small Text",
"hidden": 0,
"label": "Summary",
"max_length": 0,
"max_value": 0,
"read_only": 0,
"reqd": 0,
"show_in_filter": 0
}

View File

@@ -2337,4 +2337,11 @@ select {
.course-list-buttons .btn {
margin-left: 0;
}
}
.slots-parent {
display: grid;
grid-template-columns: 1fr 1fr;
grid-gap: 0.5rem;
margin-bottom: 1rem;
}

View File

@@ -618,7 +618,7 @@
let class_info = {{ class_info | json }};
</script>
{% else %}
{% endif %}
<script>
frappe.boot.user = {
"can_create": [],
@@ -627,7 +627,6 @@
};
let courses = {{ course_list | json }};
</script>
{% endif %}
{{ include_script('controls.bundle.js') }}
{% endblock %}

View File

@@ -614,21 +614,29 @@ const get_slots = () => {
const display_slots = (slots) => {
let slot_html = "";
let day = moment(this.eval_form.get_value("date")).format("dddd");
let slots_available = false;
if (slots.length) {
slot_html = `<div>
<div class="mb-2"> ${__("Select a Slot")} </div>
<div class="slots-parent">`;
let day = moment(this.eval_form.get_value("date")).format("dddd");
slots.forEach((slot) => {
if (slot.day == day) {
slot_html += `<div class="btn btn-sm btn-default slot" data-day="${
slot.day
}"
data-start="${slot.start_time}" data-end="${slot.end_time}">
${moment(slot.start_time, "hh:mm").format("hh:mm a")} -
${moment(slot.end_time, "hh:mm").format("hh:mm a")}
</div>`;
}
});
slots.forEach((slot) => {
if (slot.day == day) {
slots_available = true;
slot_html += `<div class="btn btn-sm btn-default slot" data-day="${
slot.day
}"
data-start="${slot.start_time}" data-end="${slot.end_time}">
${moment(slot.start_time, "hh:mm").format("hh:mm a")} -
${moment(slot.end_time, "hh:mm").format("hh:mm a")}
</div>`;
}
});
slot_html += "</div> </div>";
}
if (!slot_html) {
if (!slots_available) {
slot_html = `<div class="alert alert-danger" role="alert">
No slots available for this date.
</div>`;

View File

@@ -46,7 +46,7 @@
</button>
{% endif %}
{% if is_moderator %}
<a class="btn btn-primary btn-sm btn-evaluate ml-2" href=/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class={{class_info.name}}">
<a class="btn btn-primary btn-sm btn-evaluate ml-2" href="/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class_name={{class_info.name}}">
{{ _("Evaluate") }}
</a>
{% endif %}