Revert "chore: merge 'develop' into 'main'"

This commit is contained in:
Jannat Patel
2024-09-11 11:10:34 +05:30
committed by GitHub
parent de8c907c51
commit 7cdd155f75
16 changed files with 175 additions and 200 deletions

View File

@@ -1,13 +1,13 @@
<template>
<div class="flex min-h-0 flex-col text-base">
<div class="text-base p-4">
<div class="flex items-center justify-between">
<div>
<div class="text-xl font-semibold mb-1">
<div class="font-semibold mb-1">
{{ __(label) }}
</div>
<!-- <div class="text-xs text-gray-600">
<div class="text-xs text-gray-600">
{{ __(description) }}
</div> -->
</div>
</div>
<div class="flex item-center space-x-2">
<FormControl
@@ -16,93 +16,74 @@
type="text"
:debounce="300"
/>
<Button @click="() => (showForm = !showForm)">
<Button @click="() => (showForm = true)">
<template #icon>
<Plus v-if="!showForm" class="h-3 w-3 stroke-1.5" />
<X v-else class="h-3 w-3 stroke-1.5" />
<Plus class="h-3 w-3 stroke-1.5" />
</template>
</Button>
</div>
</div>
<div class="my-4">
<!-- Form to add new member -->
<div v-if="showForm" class="flex items-center space-x-2 mb-4">
<FormControl
v-model="member.email"
:placeholder="__('Email')"
type="email"
class="w-full"
/>
<FormControl
v-model="member.first_name"
:placeholder="__('First Name')"
type="test"
class="w-full"
/>
<Button @click="addMember()" variant="subtle">
{{ __('Add') }}
</Button>
</div>
<!-- Form to add new member -->
<div v-if="showForm" class="flex items-center space-x-2 my-4">
<FormControl
v-model="member.email"
:placeholder="__('Email')"
type="email"
class="w-full"
/>
<FormControl
v-model="member.first_name"
:placeholder="__('First Name')"
type="test"
class="w-full"
/>
<Button @click="addMember()" variant="subtle">
{{ __('Add') }}
</Button>
</div>
<div class="mt-2 pb-10 overflow-auto">
<!-- Member list -->
<div class="overflow-y-scroll">
<ul class="divide-y">
<li
v-for="member in memberList"
class="grid grid-cols-3 gap-10 py-2 cursor-pointer"
>
<div
@click="openProfile(member.username)"
class="flex items-center space-x-3 col-span-2"
>
<Avatar
:image="member.user_image"
:label="member.full_name"
size="lg"
/>
<div class="space-y-1">
<div class="flex">
<div class="text-gray-900">
{{ member.full_name }}
</div>
<div v-if="getRole(member)">
{{ getRole(member) }}
</div>
</div>
<div class="text-sm text-gray-700">
{{ member.name }}
</div>
</div>
</div>
<div class="flex items-center justify-center text-gray-700 text-sm">
<div v-if="member.last_active">
{{ dayjs(member.last_active).format('DD MMM, YYYY HH:mm a') }}
</div>
<div v-else>-</div>
</div>
</li>
</ul>
</div>
<div
v-if="memberList.length && hasNextPage"
class="flex justify-center mt-4"
v-for="member in memberList"
class="grid grid-cols-5 grid-flow-row py-2 cursor-pointer"
>
<Button @click="members.reload()">
<template #prefix>
<RefreshCw class="h-3 w-3 stroke-1.5" />
</template>
{{ __('Load More') }}
</Button>
<div
@click="openProfile(member.username)"
class="flex items-center space-x-2 col-span-2"
>
<Avatar
:image="member.user_image"
:label="member.full_name"
size="sm"
/>
<div>
{{ member.full_name }}
</div>
</div>
<div class="text-sm text-gray-700 col-span-2">
{{ member.name }}
</div>
<div class="text-sm text-gray-700 justify-self-end">
{{ getRole(member.role) }}
</div>
</div>
</div>
<div v-if="hasNextPage" class="flex justify-center">
<Button variant="solid" @click="members.reload()">
<template #prefix>
<RefreshCw class="h-3 w-3 stroke-1.5" />
</template>
{{ __('Load More') }}
</Button>
</div>
</div>
</template>
<script setup lang="ts">
import { createResource, Avatar, Button, FormControl } from 'frappe-ui'
import { useRouter } from 'vue-router'
import { ref, watch, reactive, inject } from 'vue'
import { RefreshCw, Plus, X } from 'lucide-vue-next'
import { ref, watch, reactive } from 'vue'
import { RefreshCw, Plus } from 'lucide-vue-next'
const router = useRouter()
const show = defineModel('show')
@@ -111,7 +92,6 @@ const start = ref(0)
const memberList = ref([])
const hasNextPage = ref(false)
const showForm = ref(false)
const dayjs = inject('$dayjs')
const member = reactive({
email: '',

View File

@@ -1,5 +1,5 @@
<template>
<Dialog v-model="show" :options="{ size: '4xl' }">
<Dialog v-model="show" :options="{ size: '3xl' }">
<template #body>
<div class="flex h-[calc(100vh_-_8rem)]">
<div class="flex w-52 shrink-0 flex-col bg-gray-50 p-2">
@@ -30,7 +30,7 @@
</div>
<div
v-if="activeTab && data.doc"
class="flex flex-1 flex-col px-10 pt-8"
class="flex flex-1 flex-col overflow-y-auto"
>
<Members
v-if="activeTab.label === 'Members'"
@@ -131,7 +131,7 @@ const tabs = computed(() => {
{
label: 'Sidebar',
icon: 'PanelLeftIcon',
description: 'Choose the items you want to show in the sidebar',
description: 'Customize the sidebar as per your needs',
fields: [
{
label: 'Courses',

View File

@@ -1,5 +1,5 @@
<template>
<div class="flex flex-col justify-between h-full">
<div class="flex flex-col justify-between h-full p-4">
<div>
<div class="font-semibold mb-1">
{{ __(label) }}
@@ -8,9 +8,9 @@
{{ __(description) }}
</div>
</div>
<div class="flex justify-between my-5">
<div class="flex space-x-8 my-5">
<div v-for="(column, index) in columns" :key="index">
<div class="flex flex-col space-y-5 w-72">
<div class="flex flex-col space-y-4 w-60">
<div v-for="field in column">
<Link
v-if="field.type == 'Link'"

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", "last_active"],
fields=["name", "full_name", "user_image", "username"],
page_length=20,
start=start,
)

View File

@@ -7,16 +7,11 @@
"engine": "InnoDB",
"field_order": [
"course",
"course_title",
"evaluator",
"batch_name",
"column_break_4",
"member",
"member_name",
"section_break_ikne",
"evaluator",
"evaluator_name",
"column_break_sjco",
"batch_name",
"timezone",
"section_break_lifi",
"date",
"day",
@@ -108,40 +103,11 @@
"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-09-05 16:28:54.043488",
"modified": "2024-04-16 11:01:28.336807",
"modified_by": "Administrator",
"module": "LMS",
"name": "LMS Certificate Request",

View File

@@ -34,27 +34,23 @@ class LMSCertificateRequest(Document):
self.evaluator = get_evaluator(self.course, self.batch_name)
def validate_unavailability(self):
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"),
)
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(
@@ -124,12 +120,14 @@ class LMSCertificateRequest(Document):
template = "certificate_request_notification"
args = {
"course": self.course_title,
"timezone": self.timezone if self.batch_name else "",
"course": frappe.db.get_value("LMS Course", self.course, "title"),
"timezone": frappe.db.get_value("LMS Batch", self.batch_name, "timezone")
if self.batch_name
else "",
"date": format_date(self.date, "medium"),
"member_name": self.member_name,
"start_time": format_time(self.start_time, "short"),
"evaluator": self.evaluator_name,
"evaluator": frappe.db.get_value("User", self.evaluator, "full_name"),
}
frappe.sendmail(

View File

@@ -0,0 +1,9 @@
{% 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>
<p> {{ _("Please prepare well and be on time for the evaluations.") }} </p>

View File

@@ -0,0 +1,34 @@
{
"attach_print": 0,
"channel": "Email",
"creation": "2022-06-03 11:02:34.579145",
"days_in_advance": 0,
"docstatus": 0,
"doctype": "Notification",
"document_type": "LMS Certificate Request",
"enabled": 0,
"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_type": "HTML",
"modified": "2024-08-01 12:17:40.647724",
"modified_by": "jannat@frappe.io",
"module": "LMS",
"name": "Certificate Request Creation",
"owner": "Administrator",
"recipients": [
{
"receiver_by_document_field": "member"
},
{
"receiver_by_document_field": "evaluator"
},
{
"receiver_by_role": "Frappe School Admin"
}
],
"send_system_notification": 0,
"send_to_all_assignees": 0,
"subject": "Your evaluation slot has been booked"
}

View File

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

View File

@@ -1,7 +1,8 @@
<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>
{% 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> {{ _("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": "<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": "{% 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_type": "HTML",
"modified": "2024-09-05 16:33:42.212842",
"modified_by": "Administrator",
"modified": "2024-07-10 15:51:33.803704",
"modified_by": "sayali@erpnext.com",
"module": "LMS",
"name": "Certificate Request Reminder",
"owner": "Administrator",

View File

@@ -7,8 +7,8 @@ msgid ""
msgstr ""
"Project-Id-Version: Frappe LMS VERSION\n"
"Report-Msgid-Bugs-To: jannat@frappe.io\n"
"POT-Creation-Date: 2024-09-06 16:03+0000\n"
"PO-Revision-Date: 2024-09-06 16:03+0000\n"
"POT-Creation-Date: 2024-08-23 16:04+0000\n"
"PO-Revision-Date: 2024-08-23 16:04+0000\n"
"Last-Translator: jannat@frappe.io\n"
"Language-Team: jannat@frappe.io\n"
"MIME-Version: 1.0\n"
@@ -138,7 +138,7 @@ msgstr ""
msgid "Allow accessing future dates"
msgstr ""
#: overrides/user.py:199
#: overrides/user.py:198
msgid "Already Registered"
msgstr ""
@@ -936,10 +936,8 @@ msgstr ""
#. Label of the title (Data) field in DocType 'Batch Course'
#. Label of the course_title (Data) field in DocType 'LMS Certificate'
#. Label of the course_title (Data) field in DocType 'LMS Certificate Request'
#: lms/doctype/batch_course/batch_course.json
#: lms/doctype/lms_certificate/lms_certificate.json
#: lms/doctype/lms_certificate_request/lms_certificate_request.json
msgid "Course Title"
msgstr ""
@@ -1308,12 +1306,6 @@ msgstr ""
msgid "Evaluator"
msgstr ""
#. Label of the evaluator_name (Data) field in DocType 'LMS Certificate
#. Request'
#: lms/doctype/lms_certificate_request/lms_certificate_request.json
msgid "Evaluator Name"
msgstr ""
#. Name of a DocType
#: lms/doctype/evaluator_schedule/evaluator_schedule.json
msgid "Evaluator Schedule"
@@ -1556,7 +1548,7 @@ msgstr ""
msgid "Here are a few courses we recommend for you to get started with {0}"
msgstr ""
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:1
#: lms/notification/certificate_request_creation/certificate_request_creation.html:6
#: templates/emails/certificate_request_notification.html:1
msgid "Hey {0}"
msgstr ""
@@ -2497,7 +2489,7 @@ msgstr ""
msgid "No."
msgstr ""
#: overrides/user.py:194
#: overrides/user.py:193
msgid "Not Allowed"
msgstr ""
@@ -2762,11 +2754,11 @@ msgstr ""
msgid "Please add <a href='{0}'>{1}</a> for <a href='{2}'>{3}</a> to send calendar invites for evaluations."
msgstr ""
#: overrides/user.py:240
#: overrides/user.py:239
msgid "Please ask your administrator to verify your sign-up"
msgstr ""
#: overrides/user.py:238
#: overrides/user.py:237
msgid "Please check your email for verification"
msgstr ""
@@ -2795,8 +2787,9 @@ msgstr ""
msgid "Please login to continue with payment."
msgstr ""
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:7
#: templates/emails/certificate_request_notification.html:7
#: lms/notification/certificate_request_creation/certificate_request_creation.html:9
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:8
#: templates/emails/certificate_request_notification.html:4
msgid "Please prepare well and be on time for the evaluations."
msgstr ""
@@ -3066,7 +3059,7 @@ msgstr ""
msgid "Registered"
msgstr ""
#: overrides/user.py:201
#: overrides/user.py:200
msgid "Registered but disabled"
msgstr ""
@@ -3302,7 +3295,7 @@ msgstr ""
msgid "Sidebar Items"
msgstr ""
#: overrides/user.py:194
#: overrides/user.py:193
msgid "Sign Up is disabled"
msgstr ""
@@ -3346,7 +3339,7 @@ msgstr ""
msgid "Skills"
msgstr ""
#: overrides/user.py:42
#: overrides/user.py:41
msgid "Skills must be unique"
msgstr ""
@@ -3638,7 +3631,7 @@ msgstr ""
msgid "Template"
msgstr ""
#: overrides/user.py:205
#: overrides/user.py:204
msgid "Temporarily Disabled"
msgstr ""
@@ -3683,7 +3676,7 @@ msgstr ""
msgid "The course {0} is now available on {1}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:51
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:47
msgid "The evaluator of this course is unavailable from {0} to {1}. Please select a date after {1}"
msgstr ""
@@ -3691,7 +3684,7 @@ msgstr ""
msgid "The quiz has a time limit. For each question you will be given {0} seconds."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:69
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:65
msgid "The slot is already booked by another participant."
msgstr ""
@@ -3777,10 +3770,8 @@ msgid "Timetable Template"
msgstr ""
#. Label of the timezone (Data) field in DocType 'LMS Batch'
#. Label of the timezone (Data) field in DocType 'LMS Certificate Request'
#. Label of the timezone (Data) field in DocType 'LMS Live Class'
#: lms/doctype/lms_batch/lms_batch.json
#: lms/doctype/lms_certificate_request/lms_certificate_request.json
#: lms/doctype/lms_live_class/lms_live_class.json
msgid "Timezone"
msgstr ""
@@ -3842,7 +3833,7 @@ msgstr ""
msgid "To join this batch, please contact the Administrator."
msgstr ""
#: overrides/user.py:206
#: overrides/user.py:205
msgid "Too many users signed up recently, so the registration is disabled. Please try back in an hour"
msgstr ""
@@ -4092,7 +4083,7 @@ msgstr ""
msgid "Write a review"
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:93
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:89
msgid "You already have an evaluation on {0} at {1} for the course {2}."
msgstr ""
@@ -4125,11 +4116,11 @@ msgstr ""
msgid "You can find their resume attached to this email."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:113
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:109
msgid "You cannot schedule evaluations after {0}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:102
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:98
msgid "You cannot schedule evaluations for past slots."
msgstr ""
@@ -4189,16 +4180,19 @@ msgstr ""
msgid "Your Account has been successfully created!"
msgstr ""
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:3
#: templates/emails/certificate_request_notification.html:3
#: lms/notification/certificate_request_creation/certificate_request_creation.html:7
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:6
#: templates/emails/certificate_request_notification.html:2
msgid "Your evaluation for the course {0} has been scheduled on {1} at {2} {3}."
msgstr ""
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:123
#: lms/doctype/lms_certificate_request/lms_certificate_request.py:119
msgid "Your evaluation slot has been booked"
msgstr ""
#: templates/emails/certificate_request_notification.html:5
#: lms/notification/certificate_request_creation/certificate_request_creation.html:8
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:7
#: templates/emails/certificate_request_notification.html:3
msgid "Your evaluator is {0}"
msgstr ""
@@ -4279,10 +4273,6 @@ msgstr ""
msgid "{0} is already certified for the course {1}"
msgstr ""
#: lms/notification/certificate_request_reminder/certificate_request_reminder.html:5
msgid "{0} is your evaluator"
msgstr ""
#: lms/utils.py:689
msgid "{0} mentioned you in a comment"
msgstr ""

View File

@@ -89,5 +89,4 @@ lms.patches.v1_0.change_navbar_urls
lms.patches.v1_0.set_published_on
lms.patches.v2_0.fix_progress_percentage
lms.patches.v2_0.add_discussion_topic_titles
lms.patches.v2_0.sidebar_settings
lms.patches.v2_0.delete_certificate_request_notification
lms.patches.v2_0.sidebar_settings

View File

@@ -1,5 +0,0 @@
import frappe
def execute():
frappe.db.delete("Notification", "Certificate Request Creation")

View File

@@ -1,7 +1,4 @@
<p> {{ _("Hey {0}").format(member_name) }} </p>
<br>
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(course, date, start_time, timezone) }}</p>
<br>
<p> {{ _('Your evaluation for the course {0} has been scheduled on {1} at {2} {3}.').format(title, date, start_time, timezone) }}</p>
<p> {{ _("Your evaluator is {0}").format(evaluator) }} </p>
<br>
<p> {{ _("Please prepare well and be on time for the evaluations.") }} </p>