feat: new tab and other misc fixes

This commit is contained in:
Jannat Patel
2024-04-17 10:36:48 +05:30
parent 255990b022
commit b98f6369ae
10 changed files with 71 additions and 15 deletions

View File

@@ -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>

View File

@@ -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),

View File

@@ -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>