Merge pull request #778 from pateljannat/new-bill-job
feat: new tab and other misc fixes
This commit is contained in:
@@ -161,7 +161,7 @@
|
|||||||
<div v-else-if="!user.data?.name">
|
<div v-else-if="!user.data?.name">
|
||||||
<NotPermitted
|
<NotPermitted
|
||||||
text="Please login to access this page."
|
text="Please login to access this page."
|
||||||
:buttonLink="`/login?redirect-to=/billing/${type}/${name}`"
|
:buttonLink="`/login?redirect-to=/lms/billing/${type}/${name}`"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -126,6 +126,11 @@ const tabs = [
|
|||||||
courses: computed(() => courses.data?.live || []),
|
courses: computed(() => courses.data?.live || []),
|
||||||
count: computed(() => courses.data?.live?.length),
|
count: computed(() => courses.data?.live?.length),
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: 'New',
|
||||||
|
courses: computed(() => courses.data?.new),
|
||||||
|
count: computed(() => courses.data?.new?.length),
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: 'Upcoming',
|
label: 'Upcoming',
|
||||||
courses: computed(() => courses.data?.upcoming),
|
courses: computed(() => courses.data?.upcoming),
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
v-for="certificate in certificates.data"
|
v-for="certificate in certificates.data"
|
||||||
:key="certificate.name"
|
:key="certificate.name"
|
||||||
class="bg-white shadow rounded-lg p-3 cursor-pointer"
|
class="bg-white shadow rounded-lg p-3 cursor-pointer"
|
||||||
|
@click="openCertificate(certificate)"
|
||||||
>
|
>
|
||||||
<div class="font-medium leading-5">
|
<div class="font-medium leading-5">
|
||||||
{{ certificate.course_title }}
|
{{ certificate.course_title }}
|
||||||
@@ -36,11 +37,19 @@ const certificates = createResource({
|
|||||||
url: 'frappe.client.get_list',
|
url: 'frappe.client.get_list',
|
||||||
params: {
|
params: {
|
||||||
doctype: 'LMS Certificate',
|
doctype: 'LMS Certificate',
|
||||||
fields: ['name', 'course', 'course_title', 'issue_date'],
|
fields: ['name', 'course', 'course_title', 'issue_date', 'template'],
|
||||||
filters: {
|
filters: {
|
||||||
member: props.profile.data.name,
|
member: props.profile.data.name,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
auto: true,
|
auto: true,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const openCertificate = (certificate) => {
|
||||||
|
window.open(
|
||||||
|
`/api/method/frappe.utils.print_format.download_pdf?doctype=LMS+Certificate&name=${
|
||||||
|
certificate.name
|
||||||
|
}&format=${encodeURIComponent(certificate.template)}`
|
||||||
|
)
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -30,13 +30,23 @@ class LMSJobApplication(Document):
|
|||||||
"full_name": frappe.db.get_value("User", self.user, "full_name"),
|
"full_name": frappe.db.get_value("User", self.user, "full_name"),
|
||||||
"job_title": self.job_title,
|
"job_title": self.job_title,
|
||||||
}
|
}
|
||||||
|
resume = frappe.get_doc(
|
||||||
|
"File",
|
||||||
|
{
|
||||||
|
"file_name": self.resume,
|
||||||
|
},
|
||||||
|
)
|
||||||
frappe.sendmail(
|
frappe.sendmail(
|
||||||
recipients=company_email,
|
recipients=company_email,
|
||||||
subject=subject,
|
subject=subject,
|
||||||
template="job_application",
|
template="job_application",
|
||||||
args=args,
|
args=args,
|
||||||
attachments=[self.resume],
|
attachments=[
|
||||||
|
{
|
||||||
|
"fname": resume.file_name,
|
||||||
|
"fcontent": resume.get_content(),
|
||||||
|
}
|
||||||
|
],
|
||||||
header=[subject, "green"],
|
header=[subject, "green"],
|
||||||
retry=3,
|
retry=3,
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -304,7 +304,7 @@
|
|||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2024-01-22 10:42:42.872995",
|
"modified": "2024-04-17 10:35:21.957961",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Batch",
|
"name": "LMS Batch",
|
||||||
@@ -334,6 +334,18 @@
|
|||||||
"role": "Moderator",
|
"role": "Moderator",
|
||||||
"share": 1,
|
"share": 1,
|
||||||
"write": 1
|
"write": 1
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"create": 1,
|
||||||
|
"delete": 1,
|
||||||
|
"email": 1,
|
||||||
|
"export": 1,
|
||||||
|
"print": 1,
|
||||||
|
"read": 1,
|
||||||
|
"report": 1,
|
||||||
|
"role": "Batch Evaluator",
|
||||||
|
"share": 1,
|
||||||
|
"write": 1
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"show_title_field_in_link": 1,
|
"show_title_field_in_link": 1,
|
||||||
|
|||||||
@@ -23,6 +23,7 @@
|
|||||||
"status",
|
"status",
|
||||||
"section_break_7",
|
"section_break_7",
|
||||||
"published",
|
"published",
|
||||||
|
"published_on",
|
||||||
"column_break_10",
|
"column_break_10",
|
||||||
"upcoming",
|
"upcoming",
|
||||||
"column_break_12",
|
"column_break_12",
|
||||||
@@ -242,6 +243,11 @@
|
|||||||
"fieldname": "amount_usd",
|
"fieldname": "amount_usd",
|
||||||
"fieldtype": "Currency",
|
"fieldtype": "Currency",
|
||||||
"label": "Amount (USD)"
|
"label": "Amount (USD)"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"fieldname": "published_on",
|
||||||
|
"fieldtype": "Date",
|
||||||
|
"label": "Published On"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"is_published_field": "published",
|
"is_published_field": "published",
|
||||||
@@ -268,7 +274,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"make_attachments_public": 1,
|
"make_attachments_public": 1,
|
||||||
"modified": "2024-02-28 11:20:47.700649",
|
"modified": "2024-04-16 17:40:50.899368",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Course",
|
"name": "LMS Course",
|
||||||
|
|||||||
@@ -1208,6 +1208,7 @@ def get_course_details(course):
|
|||||||
"short_introduction",
|
"short_introduction",
|
||||||
"published",
|
"published",
|
||||||
"upcoming",
|
"upcoming",
|
||||||
|
"published_on",
|
||||||
"status",
|
"status",
|
||||||
"paid_course",
|
"paid_course",
|
||||||
"course_price",
|
"course_price",
|
||||||
@@ -1261,7 +1262,7 @@ def get_course_details(course):
|
|||||||
|
|
||||||
|
|
||||||
def get_categorized_courses(courses):
|
def get_categorized_courses(courses):
|
||||||
live, upcoming, enrolled, created, under_review = [], [], [], [], []
|
live, upcoming, new, enrolled, created, under_review = [], [], [], [], [], []
|
||||||
|
|
||||||
for course in courses:
|
for course in courses:
|
||||||
if course.status == "Under Review":
|
if course.status == "Under Review":
|
||||||
@@ -1271,6 +1272,13 @@ def get_categorized_courses(courses):
|
|||||||
elif course.published:
|
elif course.published:
|
||||||
live.append(course)
|
live.append(course)
|
||||||
|
|
||||||
|
if (
|
||||||
|
course.published
|
||||||
|
and not course.upcoming
|
||||||
|
and course.published_on > add_months(getdate(), -3)
|
||||||
|
):
|
||||||
|
new.append(course)
|
||||||
|
|
||||||
if course.membership and course.published:
|
if course.membership and course.published:
|
||||||
enrolled.append(course)
|
enrolled.append(course)
|
||||||
elif course.is_instructor:
|
elif course.is_instructor:
|
||||||
@@ -1282,6 +1290,7 @@ def get_categorized_courses(courses):
|
|||||||
|
|
||||||
return {
|
return {
|
||||||
"live": live,
|
"live": live,
|
||||||
|
"new": new,
|
||||||
"upcoming": upcoming,
|
"upcoming": upcoming,
|
||||||
"enrolled": enrolled,
|
"enrolled": enrolled,
|
||||||
"created": created,
|
"created": created,
|
||||||
|
|||||||
@@ -86,3 +86,4 @@ lms.patches.v1_0.change_jobs_url #19-01-2024
|
|||||||
lms.patches.v1_0.custom_perm_for_discussions #14-01-2024
|
lms.patches.v1_0.custom_perm_for_discussions #14-01-2024
|
||||||
lms.patches.v1_0.rename_evaluator_role
|
lms.patches.v1_0.rename_evaluator_role
|
||||||
lms.patches.v1_0.change_navbar_urls
|
lms.patches.v1_0.change_navbar_urls
|
||||||
|
lms.patches.v1_0.set_published_on
|
||||||
10
lms/patches/v1_0/set_published_on.py
Normal file
10
lms/patches/v1_0/set_published_on.py
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
import frappe
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
courses = frappe.get_all(
|
||||||
|
"LMS Course", filters={"published": 1}, fields=["name", "creation"]
|
||||||
|
)
|
||||||
|
|
||||||
|
for course in courses:
|
||||||
|
frappe.db.set_value("LMS Course", course.name, "published_on", course.creation)
|
||||||
@@ -1,14 +1,8 @@
|
|||||||
<h3>
|
|
||||||
{{ _("New Job Applicant") }}
|
|
||||||
</h3>
|
|
||||||
<br>
|
|
||||||
<p>
|
<p>
|
||||||
{{ _("{0} has applied for the job position {1}").format(full_name, job_title) }}
|
{{ _("{0} has applied for the job position {1}").format(full_name, job_title) }}
|
||||||
</p>
|
</p>
|
||||||
<br>
|
<br>
|
||||||
<p>
|
<p>
|
||||||
<b>
|
|
||||||
{{ _("You can find their resume attached to this email.") }}
|
{{ _("You can find their resume attached to this email.") }}
|
||||||
</b>
|
|
||||||
</p>
|
</p>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user