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">
|
||||
<NotPermitted
|
||||
text="Please login to access this page."
|
||||
:buttonLink="`/login?redirect-to=/billing/${type}/${name}`"
|
||||
:buttonLink="`/login?redirect-to=/lms/billing/${type}/${name}`"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -126,6 +126,11 @@ const tabs = [
|
||||
courses: computed(() => courses.data?.live || []),
|
||||
count: computed(() => courses.data?.live?.length),
|
||||
},
|
||||
{
|
||||
label: 'New',
|
||||
courses: computed(() => courses.data?.new),
|
||||
count: computed(() => courses.data?.new?.length),
|
||||
},
|
||||
{
|
||||
label: 'Upcoming',
|
||||
courses: computed(() => courses.data?.upcoming),
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
v-for="certificate in certificates.data"
|
||||
:key="certificate.name"
|
||||
class="bg-white shadow rounded-lg p-3 cursor-pointer"
|
||||
@click="openCertificate(certificate)"
|
||||
>
|
||||
<div class="font-medium leading-5">
|
||||
{{ certificate.course_title }}
|
||||
@@ -36,11 +37,19 @@ const certificates = createResource({
|
||||
url: 'frappe.client.get_list',
|
||||
params: {
|
||||
doctype: 'LMS Certificate',
|
||||
fields: ['name', 'course', 'course_title', 'issue_date'],
|
||||
fields: ['name', 'course', 'course_title', 'issue_date', 'template'],
|
||||
filters: {
|
||||
member: props.profile.data.name,
|
||||
},
|
||||
},
|
||||
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>
|
||||
|
||||
Reference in New Issue
Block a user