fix: member-list ui

This commit is contained in:
Jannat Patel
2024-09-05 19:59:44 +05:30
parent 5c21a0532a
commit 4979569cf3
10 changed files with 157 additions and 106 deletions

View File

@@ -580,7 +580,7 @@ def get_members(start=0, search=""):
members = frappe.get_all(
"User",
filters=filters,
fields=["name", "full_name", "user_image", "username"],
fields=["name", "full_name", "user_image", "username", "last_active"],
page_length=20,
start=start,
)

View File

@@ -7,11 +7,16 @@
"engine": "InnoDB",
"field_order": [
"course",
"evaluator",
"batch_name",
"course_title",
"column_break_4",
"member",
"member_name",
"section_break_ikne",
"evaluator",
"evaluator_name",
"column_break_sjco",
"batch_name",
"timezone",
"section_break_lifi",
"date",
"day",
@@ -103,11 +108,40 @@
"in_standard_filter": 1,
"label": "Batch",
"options": "LMS Batch"
},
{
"fieldname": "section_break_ikne",
"fieldtype": "Section Break"
},
{
"fieldname": "column_break_sjco",
"fieldtype": "Column Break"
},
{
"fetch_from": "course.title",
"fieldname": "course_title",
"fieldtype": "Data",
"label": "Course Title",
"read_only": 1
},
{
"fetch_from": "evaluator.full_name",
"fieldname": "evaluator_name",
"fieldtype": "Data",
"label": "Evaluator Name",
"read_only": 1
},
{
"fetch_from": "batch_name.timezone",
"fieldname": "timezone",
"fieldtype": "Data",
"label": "Timezone",
"read_only": 1
}
],
"index_web_pages_for_search": 1,
"links": [],
"modified": "2024-04-16 11:01:28.336807",
"modified": "2024-09-05 16:28:54.043488",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Request",

View File

@@ -34,23 +34,24 @@ class LMSCertificateRequest(Document):
self.evaluator = get_evaluator(self.course, self.batch_name)
def validate_unavailability(self):
unavailable = frappe.db.get_value(
"Course Evaluator", self.evaluator, ["unavailable_from", "unavailable_to"], as_dict=1
)
if (
unavailable.unavailable_from
and unavailable.unavailable_to
and getdate(self.date) >= unavailable.unavailable_from
and getdate(self.date) <= unavailable.unavailable_to
):
frappe.throw(
_(
"The evaluator of this course is unavailable from {0} to {1}. Please select a date after {1}"
).format(
format_date(unavailable.unavailable_from, "medium"),
format_date(unavailable.unavailable_to, "medium"),
)
if self.evaluator:
unavailable = frappe.db.get_value(
"Course Evaluator", self.evaluator, ["unavailable_from", "unavailable_to"], as_dict=1
)
if (
unavailable.unavailable_from
and unavailable.unavailable_to
and getdate(self.date) >= unavailable.unavailable_from
and getdate(self.date) <= unavailable.unavailable_to
):
frappe.throw(
_(
"The evaluator of this course is unavailable from {0} to {1}. Please select a date after {1}"
).format(
format_date(unavailable.unavailable_from, "medium"),
format_date(unavailable.unavailable_to, "medium"),
)
)
def validate_slot(self):
if frappe.db.exists(

View File

@@ -1,9 +1,7 @@
{% set title = frappe.db.get_value("LMS Course", doc.course, "title") %}
{% set timezone = frappe.db.get_value("LMS Batch", doc.batch, "timezone") %}
{% set timezone = timezone if timezone else '' %}
{% set evaluator_name = frappe.db.get_value("User", doc.evaluator, "full_name") %}
<p> {{ _("Hey {0}").format(doc.member_name) }} </p>
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(title, frappe.utils.format_date(doc.date, "medium"), frappe.utils.format_time(doc.start_time, "short"), timezone) }}</p>
<p> {{ _("Your evaluator is {0}").format(evaluator_name) }} </p>
<br>
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(doc.course_title, frappe.utils.format_date(doc.date, "medium"), frappe.utils.format_time(doc.start_time, "short"), doc.timezone) }}</p>
<br>
<p> {{ _("{0} is your evaluator").format(doc.evaluator_name) }} </p>
<br>
<p> {{ _("Please prepare well and be on time for the evaluations.") }} </p>

View File

@@ -6,14 +6,14 @@
"docstatus": 0,
"doctype": "Notification",
"document_type": "LMS Certificate Request",
"enabled": 0,
"enabled": 1,
"event": "New",
"idx": 0,
"is_standard": 1,
"message": "{% set title = frappe.db.get_value(\"LMS Course\", doc.course, \"title\") %}\n{% set timezone = frappe.db.get_value(\"LMS Batch\", doc.batch, \"timezone\") %}\n{% set timezone = timezone if timezone else '' %}\n{% set evaluator_name = frappe.db.get_value(\"User\", doc.evaluator, \"full_name\") %}\n\n<p> {{ _(\"Hey {0}\").format(doc.member_name) }} </p>\n<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(title, frappe.utils.format_date(doc.date, \"medium\"), frappe.utils.format_time(doc.start_time, \"short\"), timezone) }}</p>\n<p> {{ _(\"Your evaluator is {0}\").format(evaluator_name) }} </p>\n<p> {{ _(\"Please prepare well and be on time for the evaluations.\") }} </p>\n",
"message": "<p> {{ _(\"Hey {0}\").format(doc.member_name) }} </p>\n<br>\n<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(doc.course_title, frappe.utils.format_date(doc.date, \"medium\"), frappe.utils.format_time(doc.start_time, \"short\"), doc.timezone) }}</p>\n<br>\n<p> {{ _(\"{0} is your evaluator\").format(doc.evaluator_name) }} </p>\n<br>\n<p> {{ _(\"Please prepare well and be on time for the evaluations.\") }} </p>\n",
"message_type": "HTML",
"modified": "2024-08-01 12:17:40.647724",
"modified_by": "jannat@frappe.io",
"modified": "2024-09-05 16:33:01.533349",
"modified_by": "Administrator",
"module": "LMS",
"name": "Certificate Request Creation",
"owner": "Administrator",

View File

@@ -1,8 +1,7 @@
{% set title = frappe.db.get_value("LMS Course", doc.course, "title") %}
{% set timezone = frappe.db.get_value("LMS Batch", doc.batch, "timezone") %}
{% set timezone = timezone if timezone else '' %}
{% set evaluator_name = frappe.db.get_value("User", doc.evaluator, "full_name") %}
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(title, frappe.utils.format_date(doc.date, "medium"), frappe.utils.format_time(doc.start_time, "short"), timezone) }}</p>
<p> {{ _("Your evaluator is {0}").format(evaluator_name) }}
<p> {{ _("Hey {0}").format(doc.member_name) }} </p>
<br>
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(doc.course_title, frappe.utils.format_date(doc.date, "medium"), frappe.utils.format_time(doc.start_time, "short"), doc.timezone) }}</p>
<br>
<p> {{ _("{0} is your evaluator").format(doc.evaluator_name) }} </p>
<br>
<p> {{ _("Please prepare well and be on time for the evaluations.") }} </p>

View File

@@ -11,10 +11,10 @@
"event": "Days Before",
"idx": 0,
"is_standard": 1,
"message": "{% set title = frappe.db.get_value(\"LMS Course\", doc.course, \"title\") %}\n{% set timezone = frappe.db.get_value(\"LMS Batch\", doc.batch, \"timezone\") %}\n{% set timezone = timezone if timezone else '' %}\n{% set evaluator_name = frappe.db.get_value(\"User\", doc.evaluator, \"full_name\") %}\n\n<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(title, frappe.utils.format_date(doc.date, \"medium\"), frappe.utils.format_time(doc.start_time, \"short\"), timezone) }}</p>\n<p> {{ _(\"Your evaluator is {0}\").format(evaluator_name) }}\n<p> {{ _(\"Please prepare well and be on time for the evaluations.\") }} </p>\n",
"message": "<p> {{ _(\"Hey {0}\").format(doc.member_name) }} </p>\n<br>\n<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(doc.course_title, frappe.utils.format_date(doc.date, \"medium\"), frappe.utils.format_time(doc.start_time, \"short\"), doc.timezone) }}</p>\n<br>\n<p> {{ _(\"{0} is your evaluator\").format(doc.evaluator_name) }} </p>\n<br>\n<p> {{ _(\"Please prepare well and be on time for the evaluations.\") }} </p>\n",
"message_type": "HTML",
"modified": "2024-07-10 15:51:33.803704",
"modified_by": "sayali@erpnext.com",
"modified": "2024-09-05 16:33:42.212842",
"modified_by": "Administrator",
"module": "LMS",
"name": "Certificate Request Reminder",
"owner": "Administrator",