feat: meta tags
This commit is contained in:
4
.gitignore
vendored
4
.gitignore
vendored
@@ -9,4 +9,6 @@ __pycache__/
|
||||
*.py[cod]
|
||||
*$py.class
|
||||
node_modules
|
||||
package-lock.json
|
||||
package-lock.json
|
||||
lms/public/frontend
|
||||
lms/www/lms.html
|
||||
@@ -1,17 +1,29 @@
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Frappe UI App</title>
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="modals"></div>
|
||||
<div id="popovers"></div>
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<link rel="icon" href="/favicon.png" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||||
<title>Frappe UI App</title>
|
||||
<meta name="title" content="{{ meta.title }}" />
|
||||
<meta name="image" content="{{ meta.image }}" />
|
||||
<meta name="description" content="{{ meta.description }}" />
|
||||
<meta name="keywords" content="{{ meta.keywords }}" />
|
||||
<meta property="og:title" content="{{ meta.title }}" />
|
||||
<meta property="og:image" content="{{ meta.image }}" />
|
||||
<meta property="og:description" content="{{ meta.description }}" />
|
||||
<meta name="twitter:title" content="{{ meta.title }}" />
|
||||
<meta name="twitter:image" content="{{ meta.image }}" />
|
||||
<meta name="twitter:description" content="{{ meta.description }}" />
|
||||
</head>
|
||||
<body>
|
||||
<div id="app"></div>
|
||||
<div id="modals"></div>
|
||||
<div id="popovers"></div>
|
||||
|
||||
<script> window.csrf_token = '{{ csrf_token }}'; </script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
<script>
|
||||
window.csrf_token = '{{ csrf_token }}'
|
||||
</script>
|
||||
<script type="module" src="/src/main.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"dev": "vite",
|
||||
"serve": "vite preview",
|
||||
"build": "vite build --base=/assets/lms/frontend/ && yarn copy-html-entry",
|
||||
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/learning.html"
|
||||
"copy-html-entry": "cp ../lms/public/frontend/index.html ../lms/www/lms.html"
|
||||
},
|
||||
"dependencies": {
|
||||
"@editorjs/checklist": "^1.6.0",
|
||||
|
||||
@@ -55,7 +55,7 @@ const communications = createListResource({
|
||||
cache: ['batch', props.batch],
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.prose-sm p {
|
||||
margin: 0 0 0.5rem;
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.short-introduction {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
|
||||
@@ -127,7 +127,7 @@ const props = defineProps({
|
||||
},
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.course-image {
|
||||
height: 168px;
|
||||
width: 100%;
|
||||
|
||||
@@ -158,7 +158,7 @@ const getCurrentChapter = () => {
|
||||
return currentChapter.value
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.outline-lesson:has(.router-link-active) {
|
||||
background-color: theme('colors.gray.100');
|
||||
}
|
||||
|
||||
@@ -3,6 +3,7 @@
|
||||
<img
|
||||
:src="job.company_logo"
|
||||
class="w-12 h-12 rounded-lg object-contain mr-4"
|
||||
:alt="job.company_name"
|
||||
/>
|
||||
<div>
|
||||
<div class="text-xl font-semibold mb-2">
|
||||
|
||||
@@ -136,7 +136,7 @@ const breadcrumbs = computed(() => {
|
||||
return items
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.batch-description p {
|
||||
margin-bottom: 1rem;
|
||||
line-height: 1.7;
|
||||
|
||||
@@ -144,7 +144,7 @@ const pageMeta = computed(() => {
|
||||
|
||||
updateDocumentTitle(pageMeta)
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.course-description p {
|
||||
margin-bottom: 1rem;
|
||||
line-height: 1.7;
|
||||
|
||||
@@ -411,7 +411,7 @@ const breadcrumbs = computed(() => {
|
||||
return crumbs
|
||||
})
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.embed-tool__caption {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -56,6 +56,7 @@
|
||||
<img
|
||||
:src="job.data.company_logo"
|
||||
class="w-16 h-16 rounded-lg object-contain mr-4"
|
||||
:alt="job.data.company_name"
|
||||
/>
|
||||
<div>
|
||||
<div class="text-2xl font-semibold mb-2">
|
||||
|
||||
@@ -339,7 +339,7 @@ const allowInstructorContent = () => {
|
||||
return false
|
||||
}
|
||||
</script>
|
||||
<style scoped>
|
||||
<style>
|
||||
.avatar-group {
|
||||
display: inline-flex;
|
||||
align-items: center;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<Breadcrumbs class="h-7" :items="breadcrumbs" />
|
||||
</header>
|
||||
<div v-if="chartDetails.data" class="p-5">
|
||||
<div class="grid grid-cols-2 lg:gridc-cols-5 gap-4">
|
||||
<div class="grid grid-cols-2 lg:grid-cols-5 gap-4">
|
||||
<div class="flex items-center shadow py-2 px-3 rounded-md">
|
||||
<div class="p-2 rounded-md bg-gray-100 mr-3">
|
||||
<BookOpen class="w-18 h-18 stroke-1.5 text-gray-700" />
|
||||
|
||||
@@ -2,11 +2,13 @@ import { createRouter, createWebHistory } from 'vue-router'
|
||||
import { usersStore } from './stores/user'
|
||||
import { sessionStore } from './stores/session'
|
||||
|
||||
let defaultRoute = '/courses'
|
||||
const routes = [
|
||||
{
|
||||
path: '/',
|
||||
name: 'Home',
|
||||
component: () => import('@/pages/Home.vue'),
|
||||
redirect: {
|
||||
name: 'Courses',
|
||||
},
|
||||
},
|
||||
{
|
||||
path: '/courses',
|
||||
@@ -97,7 +99,7 @@ const routes = [
|
||||
]
|
||||
|
||||
let router = createRouter({
|
||||
history: createWebHistory('/learning'),
|
||||
history: createWebHistory('/lms'),
|
||||
routes,
|
||||
})
|
||||
|
||||
|
||||
68
lms/hooks.py
68
lms/hooks.py
@@ -17,7 +17,7 @@ app_license = "AGPL"
|
||||
# app_include_js = "/assets/lms/js/lms.js"
|
||||
|
||||
# include js, css files in header of web template
|
||||
web_include_css = "lms.bundle.css"
|
||||
# web_include_css = "lms.bundle.css"
|
||||
# web_include_css = "/assets/lms/css/lms.css"
|
||||
web_include_js = ["website.bundle.js"]
|
||||
|
||||
@@ -135,71 +135,7 @@ override_whitelisted_methods = {
|
||||
|
||||
# Add all simple route rules here
|
||||
website_route_rules = [
|
||||
{"from_route": "/sketches/<sketch>", "to_route": "sketches/sketch"},
|
||||
{"from_route": "/courses/<course>", "to_route": "courses/course"},
|
||||
{"from_route": "/courses/<course>/edit", "to_route": "courses/create"},
|
||||
{"from_route": "/courses/<course>/outline", "to_route": "courses/outline"},
|
||||
{"from_route": "/courses/<course>/<certificate>", "to_route": "courses/certificate"},
|
||||
{"from_route": "/courses/<course>/learn", "to_route": "batch/learn"},
|
||||
{
|
||||
"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>",
|
||||
"to_route": "batch/learn",
|
||||
},
|
||||
{
|
||||
"from_route": "/courses/<course>/learn/<int:chapter>.<int:lesson>/edit",
|
||||
"to_route": "batch/edit",
|
||||
},
|
||||
{"from_route": "/quizzes", "to_route": "batch/quiz_list"},
|
||||
{"from_route": "/quizzes/<quizname>", "to_route": "batch/quiz"},
|
||||
{"from_route": "/batches/<batchname>", "to_route": "batches/batch"},
|
||||
{"from_route": "/courses/<course>/progress", "to_route": "batch/progress"},
|
||||
{"from_route": "/courses/<course>/join", "to_route": "batch/join"},
|
||||
{"from_route": "/courses/<course>/manage", "to_route": "cohorts"},
|
||||
{"from_route": "/courses/<course>/cohorts/<cohort>", "to_route": "cohorts/cohort"},
|
||||
{
|
||||
"from_route": "/courses/<course>/cohorts/<cohort>/<page>",
|
||||
"to_route": "cohorts/cohort",
|
||||
},
|
||||
{
|
||||
"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>",
|
||||
"to_route": "cohorts/subgroup",
|
||||
},
|
||||
{
|
||||
"from_route": "/courses/<course>/subgroups/<cohort>/<subgroup>/<page>",
|
||||
"to_route": "cohorts/subgroup",
|
||||
},
|
||||
{
|
||||
"from_route": "/courses/<course>/join/<cohort>/<subgroup>/<invite_code>",
|
||||
"to_route": "cohorts/join",
|
||||
},
|
||||
{"from_route": "/users", "to_route": "profiles/profile"},
|
||||
{"from_route": "/job-openings", "to_route": "jobs_openings/index"},
|
||||
{"from_route": "/job-openings/<job>", "to_route": "jobs_openings/job"},
|
||||
{
|
||||
"from_route": "/batches/<batchname>/students/<username>",
|
||||
"to_route": "/batches/progress",
|
||||
},
|
||||
{"from_route": "/assignments/<assignment>", "to_route": "assignments/assignment"},
|
||||
{
|
||||
"from_route": "/assignment-submission/<assignment>/<submission>",
|
||||
"to_route": "assignment_submission/assignment_submission",
|
||||
},
|
||||
{
|
||||
"from_route": "/quiz-submission/<quiz>/<submission>",
|
||||
"to_route": "quiz_submission/quiz_submission",
|
||||
},
|
||||
{
|
||||
"from_route": "/billing/<module>/<modulename>",
|
||||
"to_route": "billing/billing",
|
||||
},
|
||||
{
|
||||
"from_route": "/batches/details/<batchname>",
|
||||
"to_route": "batches/batch_details",
|
||||
},
|
||||
{
|
||||
"from_route": "/certified-participants",
|
||||
"to_route": "certified_participants/certified_participants",
|
||||
},
|
||||
{"from_route": "/lms/<path:app_path>", "to_route": "lms"},
|
||||
]
|
||||
|
||||
website_redirects = [
|
||||
|
||||
@@ -264,7 +264,7 @@ def on_session_creation(login_manager):
|
||||
if frappe.db.get_single_value(
|
||||
"System Settings", "setup_complete"
|
||||
) and frappe.db.get_single_value("LMS Settings", "default_home"):
|
||||
frappe.local.response["home_page"] = "/courses"
|
||||
frappe.local.response["home_page"] = "/lms"
|
||||
|
||||
|
||||
@frappe.whitelist()
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.prose-sm p{margin:0 0 .5rem}
|
||||
@@ -1 +0,0 @@
|
||||
.batch-description p{margin-bottom:1rem;line-height:1.7}.batch-description li{line-height:1.7}.batch-description ol{list-style:auto;margin:revert;padding:revert}.batch-description strong{font-weight:600;color:#171717!important}
|
||||
@@ -1,543 +0,0 @@
|
||||
import {
|
||||
d as x,
|
||||
j as C,
|
||||
x as n,
|
||||
y as h,
|
||||
F as b,
|
||||
G as u,
|
||||
a4 as N,
|
||||
L as s,
|
||||
K as t,
|
||||
a8 as B,
|
||||
M as d,
|
||||
H as e,
|
||||
J as r,
|
||||
a7 as w,
|
||||
W as D,
|
||||
C as H,
|
||||
k as $,
|
||||
Q as S,
|
||||
R as O,
|
||||
a6 as R,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { b as V, B as j, f as M } from "./index-xt-hKVBz.js";
|
||||
import { C as L, a as T } from "./clock-nM1CyeA6.js";
|
||||
import { _ as E } from "./CourseCard-I7Cj-Ne7.js";
|
||||
import "./UserAvatar-3mSOKoKa.js";
|
||||
import "./star-O1ih2gFp.js";
|
||||
const F = { key: 0, class: "shadow rounded-md p-5", style: { width: "300px" } },
|
||||
q = { key: 2, class: "text-lg font-semibold mb-3" },
|
||||
z = { class: "flex items-center mb-3" },
|
||||
A = { class: "flex items-center mb-3" },
|
||||
G = { class: "flex items-center" },
|
||||
I = {
|
||||
__name: "BatchOverlay",
|
||||
props: { batch: { type: Object, default: null } },
|
||||
setup(c) {
|
||||
const f = x("$dayjs"),
|
||||
p = x("$user"),
|
||||
y = c,
|
||||
i = C(() => {
|
||||
var a, v, _, l;
|
||||
return (a = y.batch.data) != null && a.seat_count
|
||||
? ((v = y.batch.data) == null ? void 0 : v.seat_count) -
|
||||
((l =
|
||||
(_ = y.batch.data) == null
|
||||
? void 0
|
||||
: _.students) == null
|
||||
? void 0
|
||||
: l.length)
|
||||
: null;
|
||||
});
|
||||
return (a, v) => {
|
||||
var l, m, o, g;
|
||||
const _ = D("router-link");
|
||||
return c.batch.data
|
||||
? (n(),
|
||||
h("div", F, [
|
||||
c.batch.data.seat_count && i.value > 0
|
||||
? (n(),
|
||||
b(
|
||||
t(B),
|
||||
{
|
||||
key: 0,
|
||||
theme: "green",
|
||||
class: "self-start mb-2 float-right",
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
N(
|
||||
s(i.value) +
|
||||
" " +
|
||||
s(a.__("Seat Left")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: c.batch.data.seat_count && i.value <= 0
|
||||
? (n(),
|
||||
b(
|
||||
t(B),
|
||||
{
|
||||
key: 1,
|
||||
theme: "red",
|
||||
class: "self-start mb-2 float-right",
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
N(s(a.__("Sold Out")), 1),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: d("", !0),
|
||||
c.batch.data.amount
|
||||
? (n(),
|
||||
h(
|
||||
"div",
|
||||
q,
|
||||
s(
|
||||
t(V)(
|
||||
c.batch.data.amount,
|
||||
c.batch.data.currency
|
||||
)
|
||||
),
|
||||
1
|
||||
))
|
||||
: d("", !0),
|
||||
e("div", z, [
|
||||
r(t(j), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(c.batch.data.courses.length) +
|
||||
" " +
|
||||
s(a.__("Courses")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
e("div", A, [
|
||||
r(t(L), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
t(f)(c.batch.data.start_date).format(
|
||||
"DD MMM YYYY"
|
||||
)
|
||||
) +
|
||||
" - " +
|
||||
s(
|
||||
t(f)(c.batch.data.end_date).format(
|
||||
"DD MMM YYYY"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
e("div", G, [
|
||||
r(t(T), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(t(M)(c.batch.data.start_time)) +
|
||||
" - " +
|
||||
s(t(M)(c.batch.data.end_time)),
|
||||
1
|
||||
),
|
||||
]),
|
||||
(m = (l = t(p)) == null ? void 0 : l.data) !=
|
||||
null && m.is_moderator
|
||||
? (n(),
|
||||
b(
|
||||
_,
|
||||
{
|
||||
key: 3,
|
||||
to: {
|
||||
name: "Batch",
|
||||
params: {
|
||||
batchName:
|
||||
c.batch.data.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
r(
|
||||
t(w),
|
||||
{
|
||||
variant: "solid",
|
||||
class: "w-full mt-4",
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
a.__(
|
||||
"Manage Batch"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["to"]
|
||||
))
|
||||
: c.batch.data.paid_batch
|
||||
? (n(),
|
||||
b(
|
||||
_,
|
||||
{
|
||||
key: 4,
|
||||
to: {
|
||||
name: "Billing",
|
||||
params: {
|
||||
type: "batch",
|
||||
name: c.batch.data.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
r(
|
||||
t(w),
|
||||
{
|
||||
class: "w-full mt-4",
|
||||
variant: "solid",
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
a.__(
|
||||
"Register Now"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["to"]
|
||||
))
|
||||
: c.batch.data.allow_self_enrollment
|
||||
? (n(),
|
||||
b(
|
||||
t(w),
|
||||
{
|
||||
key: 5,
|
||||
variant: "solid",
|
||||
class: "w-full mt-2",
|
||||
},
|
||||
{
|
||||
default: u(() => [
|
||||
N(s(a.__("Enroll Now")), 1),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: d("", !0),
|
||||
(g = (o = t(p)) == null ? void 0 : o.data) !=
|
||||
null && g.is_moderator
|
||||
? (n(),
|
||||
b(
|
||||
t(w),
|
||||
{ key: 6, class: "w-full mt-2" },
|
||||
{
|
||||
default: u(() => [
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(a.__("Edit")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: d("", !0),
|
||||
]))
|
||||
: d("", !0);
|
||||
};
|
||||
},
|
||||
},
|
||||
J = { key: 0, class: "h-screen text-base" },
|
||||
K = { class: "sticky top-0 z-10 border-b bg-white px-3 py-2.5 sm:px-5" },
|
||||
Q = { class: "m-5 pb-10" },
|
||||
W = { class: "text-3xl font-semibold" },
|
||||
P = { class: "my-3" },
|
||||
U = { class: "flex items-center justify-between w-1/2" },
|
||||
X = { class: "flex items-center" },
|
||||
Z = { key: 0 },
|
||||
tt = { class: "flex items-center" },
|
||||
at = { key: 1 },
|
||||
et = { class: "flex items-center" },
|
||||
st = { class: "grid grid-cols-[60%,20%] gap-20 mt-10" },
|
||||
ct = { class: "" },
|
||||
nt = ["innerHTML"],
|
||||
lt = { class: "text-2xl font-semibold" },
|
||||
rt = { class: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-8 mt-5" },
|
||||
ot = { key: 0 },
|
||||
dt = ["innerHTML"],
|
||||
ft = {
|
||||
__name: "BatchDetail",
|
||||
props: { batchName: { type: String, required: !0 } },
|
||||
setup(c) {
|
||||
const f = x("$dayjs"),
|
||||
p = x("$user"),
|
||||
y = H(),
|
||||
i = c,
|
||||
a = $({
|
||||
url: "lms.lms.utils.get_batch_details",
|
||||
cache: ["batch", i.batchName],
|
||||
params: { batch: i.batchName },
|
||||
auto: !0,
|
||||
onSuccess(l) {
|
||||
var m, o;
|
||||
(o = l.students) != null &&
|
||||
o.includes(
|
||||
(m = p.data) == null ? void 0 : m.name
|
||||
) &&
|
||||
y.push({
|
||||
name: "Batch",
|
||||
params: { batchName: i.batchName },
|
||||
});
|
||||
},
|
||||
}),
|
||||
v = $({
|
||||
url: "lms.lms.utils.get_batch_courses",
|
||||
params: { batch: i.batchName },
|
||||
cache: ["batchCourses", i.batchName],
|
||||
auto: !0,
|
||||
}),
|
||||
_ = C(() => {
|
||||
var m, o;
|
||||
let l = [
|
||||
{ label: "All Batches", route: { name: "Batches" } },
|
||||
];
|
||||
return (
|
||||
l.push({
|
||||
label:
|
||||
(m = a == null ? void 0 : a.data) == null
|
||||
? void 0
|
||||
: m.title,
|
||||
route: {
|
||||
name: "BatchDetail",
|
||||
params: {
|
||||
batchName:
|
||||
(o = a == null ? void 0 : a.data) ==
|
||||
null
|
||||
? void 0
|
||||
: o.name,
|
||||
},
|
||||
},
|
||||
}),
|
||||
l
|
||||
);
|
||||
});
|
||||
return (l, m) => {
|
||||
var g, Y;
|
||||
const o = D("router-link");
|
||||
return t(a).data
|
||||
? (n(),
|
||||
h("div", J, [
|
||||
e("header", K, [
|
||||
r(t(R), { items: _.value }, null, 8, ["items"]),
|
||||
]),
|
||||
e("div", Q, [
|
||||
e("div", null, [
|
||||
e("div", W, s(t(a).data.title), 1),
|
||||
e("div", P, s(t(a).data.description), 1),
|
||||
e("div", U, [
|
||||
e("div", X, [
|
||||
r(t(j), {
|
||||
class: "h-4 w-4 text-gray-700 mr-2",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
(Y =
|
||||
(g = t(a).data) == null
|
||||
? void 0
|
||||
: g.courses) == null
|
||||
? void 0
|
||||
: Y.length
|
||||
) +
|
||||
" " +
|
||||
s(l.__("Courses")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
t(a).data.courses
|
||||
? (n(), h("span", Z, "·"))
|
||||
: d("", !0),
|
||||
e("div", tt, [
|
||||
r(t(L), {
|
||||
class: "h-4 w-4 text-gray-700 mr-2",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
t(f)(
|
||||
t(a).data.start_date
|
||||
).format("DD MMM YYYY")
|
||||
) +
|
||||
" - " +
|
||||
s(
|
||||
t(f)(
|
||||
t(a).data.end_date
|
||||
).format("DD MMM YYYY")
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
t(a).data.start_date
|
||||
? (n(), h("span", at, "·"))
|
||||
: d("", !0),
|
||||
e("div", et, [
|
||||
r(t(T), {
|
||||
class: "h-4 w-4 text-gray-700 mr-2",
|
||||
}),
|
||||
e(
|
||||
"span",
|
||||
null,
|
||||
s(t(M)(t(a).data.start_time)) +
|
||||
" - " +
|
||||
s(t(M)(t(a).data.end_time)),
|
||||
1
|
||||
),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
e("div", st, [
|
||||
e("div", ct, [
|
||||
e(
|
||||
"div",
|
||||
{
|
||||
innerHTML:
|
||||
t(a).data.batch_details,
|
||||
class: "batch-description",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
nt
|
||||
),
|
||||
]),
|
||||
e("div", null, [
|
||||
r(I, { batch: t(a) }, null, 8, [
|
||||
"batch",
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
e("div", null, [
|
||||
e("div", lt, s(l.__("Courses")), 1),
|
||||
e("div", rt, [
|
||||
t(a).data.courses
|
||||
? (n(!0),
|
||||
h(
|
||||
S,
|
||||
{ key: 0 },
|
||||
O(
|
||||
t(v).data,
|
||||
(k) => (
|
||||
n(),
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
key: k.course,
|
||||
},
|
||||
[
|
||||
r(
|
||||
o,
|
||||
{
|
||||
to: {
|
||||
name: "CourseDetail",
|
||||
params: {
|
||||
courseName:
|
||||
k.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default:
|
||||
u(
|
||||
() => [
|
||||
(n(),
|
||||
b(
|
||||
E,
|
||||
{
|
||||
course: k,
|
||||
key: k.name,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"course",
|
||||
]
|
||||
)),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["to"]
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
),
|
||||
128
|
||||
))
|
||||
: d("", !0),
|
||||
]),
|
||||
t(a).data.batch_details_raw
|
||||
? (n(),
|
||||
h("div", ot, [
|
||||
e(
|
||||
"div",
|
||||
{
|
||||
innerHTML:
|
||||
t(a).data
|
||||
.batch_details_raw,
|
||||
class: "batch-description",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
dt
|
||||
),
|
||||
]))
|
||||
: d("", !0),
|
||||
]),
|
||||
]),
|
||||
]))
|
||||
: d("", !0);
|
||||
};
|
||||
},
|
||||
};
|
||||
export { ft as default };
|
||||
//# sourceMappingURL=BatchDetail-Bb9JTSid.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.short-introduction{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;width:100%;overflow:hidden;margin:.25rem 0 1.25rem;line-height:1.5}
|
||||
@@ -1,444 +0,0 @@
|
||||
import {
|
||||
d as C,
|
||||
x as n,
|
||||
y as u,
|
||||
F as g,
|
||||
G as h,
|
||||
a4 as f,
|
||||
L as t,
|
||||
K as o,
|
||||
a8 as x,
|
||||
M as y,
|
||||
H as a,
|
||||
J as i,
|
||||
k as Y,
|
||||
r as j,
|
||||
j as m,
|
||||
a6 as D,
|
||||
a7 as M,
|
||||
I as $,
|
||||
P as N,
|
||||
Q as V,
|
||||
R as L,
|
||||
a9 as P,
|
||||
W as z,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { B as O, f as B } from "./index-xt-hKVBz.js";
|
||||
import { C as S, a as A } from "./clock-nM1CyeA6.js";
|
||||
import { P as E } from "./plus-w56hNznP.js";
|
||||
const F = {
|
||||
class: "flex flex-col border border-gray-200 rounded-md p-4 h-full",
|
||||
style: { "min-height": "150px" },
|
||||
},
|
||||
I = { class: "text-xl font-semibold mb-1" },
|
||||
R = { class: "short-introduction" },
|
||||
T = { class: "mt-auto" },
|
||||
U = { key: 0, class: "font-semibold text-lg mb-4" },
|
||||
G = { class: "flex items-center mb-3" },
|
||||
H = { class: "flex items-center mb-3" },
|
||||
J = { class: "flex items-center" },
|
||||
K = {
|
||||
__name: "BatchCard",
|
||||
props: { batch: { type: Object, default: null } },
|
||||
setup(s) {
|
||||
const d = C("$dayjs");
|
||||
return (c, v) => (
|
||||
n(),
|
||||
u("div", F, [
|
||||
s.batch.seat_count && s.batch.seats_left > 0
|
||||
? (n(),
|
||||
g(
|
||||
o(x),
|
||||
{
|
||||
key: 0,
|
||||
theme: "green",
|
||||
class: "self-start mb-2",
|
||||
},
|
||||
{
|
||||
default: h(() => [
|
||||
f(
|
||||
t(s.batch.seats_left) +
|
||||
" " +
|
||||
t(c.__("Seat Left")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: s.batch.seat_count && s.batch.seats_left <= 0
|
||||
? (n(),
|
||||
g(
|
||||
o(x),
|
||||
{
|
||||
key: 1,
|
||||
theme: "red",
|
||||
class: "self-start mb-2",
|
||||
},
|
||||
{
|
||||
default: h(() => [
|
||||
f(t(c.__("Sold Out")), 1),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: y("", !0),
|
||||
a("div", I, t(s.batch.title), 1),
|
||||
a("div", R, t(s.batch.description), 1),
|
||||
a("div", T, [
|
||||
s.batch.amount
|
||||
? (n(), u("div", U, t(s.batch.price), 1))
|
||||
: y("", !0),
|
||||
a("div", G, [
|
||||
i(o(O), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
t(s.batch.courses.length) +
|
||||
" " +
|
||||
t(c.__("Courses")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
a("div", H, [
|
||||
i(o(S), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
t(
|
||||
o(d)(s.batch.start_date).format(
|
||||
"DD MMM YYYY"
|
||||
)
|
||||
) +
|
||||
" - " +
|
||||
t(
|
||||
o(d)(s.batch.end_date).format(
|
||||
"DD MMM YYYY"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
a("div", J, [
|
||||
i(o(A), {
|
||||
class: "h-4 w-4 stroke-1.5 mr-2 text-gray-700",
|
||||
}),
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
t(o(B)(s.batch.start_time)) +
|
||||
" - " +
|
||||
t(o(B)(s.batch.end_time)),
|
||||
1
|
||||
),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
);
|
||||
},
|
||||
},
|
||||
Q = { class: "h-screen text-base" },
|
||||
W = {
|
||||
class: "sticky top-0 z-10 flex items-center justify-between border-b bg-white px-3 py-2.5 sm:px-5",
|
||||
},
|
||||
q = { class: "flex" },
|
||||
X = { class: "pb-5" },
|
||||
Z = {
|
||||
key: 0,
|
||||
class: "grid grid-cols-1 sm:grid-cols-3 md:grid-cols-4 gap-5 mt-5 mx-5",
|
||||
},
|
||||
ee = {
|
||||
key: 1,
|
||||
class: "grid flex-1 place-items-center text-xl font-medium text-gray-500",
|
||||
},
|
||||
te = { class: "flex flex-col items-center justify-center mt-4" },
|
||||
ce = {
|
||||
__name: "Batches",
|
||||
setup(s) {
|
||||
var p, k;
|
||||
const d = C("$user"),
|
||||
c = Y({
|
||||
url: "lms.lms.utils.get_batches",
|
||||
cache: [
|
||||
"batches",
|
||||
(p = d == null ? void 0 : d.data) == null
|
||||
? void 0
|
||||
: p.email,
|
||||
],
|
||||
auto: !0,
|
||||
}),
|
||||
v = j(0),
|
||||
_ = [
|
||||
{
|
||||
label: "Upcoming",
|
||||
batches: m(() => {
|
||||
var e;
|
||||
return (
|
||||
((e = c.data) == null ? void 0 : e.upcoming) ||
|
||||
[]
|
||||
);
|
||||
}),
|
||||
count: m(() => {
|
||||
var e, l;
|
||||
return (l =
|
||||
(e = c.data) == null ? void 0 : e.upcoming) ==
|
||||
null
|
||||
? void 0
|
||||
: l.length;
|
||||
}),
|
||||
},
|
||||
];
|
||||
return (
|
||||
(k = d.data) != null &&
|
||||
k.is_moderator &&
|
||||
(_.push({
|
||||
label: "Archived",
|
||||
batches: m(() => {
|
||||
var e;
|
||||
return (e = c.data) == null ? void 0 : e.archived;
|
||||
}),
|
||||
count: m(() => {
|
||||
var e, l;
|
||||
return (l =
|
||||
(e = c.data) == null ? void 0 : e.archived) ==
|
||||
null
|
||||
? void 0
|
||||
: l.length;
|
||||
}),
|
||||
}),
|
||||
_.push({
|
||||
label: "Private",
|
||||
batches: m(() => {
|
||||
var e;
|
||||
return (e = c.data) == null ? void 0 : e.private;
|
||||
}),
|
||||
count: m(() => {
|
||||
var e, l;
|
||||
return (l =
|
||||
(e = c.data) == null ? void 0 : e.private) ==
|
||||
null
|
||||
? void 0
|
||||
: l.length;
|
||||
}),
|
||||
})),
|
||||
d.data &&
|
||||
_.push({
|
||||
label: "Enrolled",
|
||||
batches: m(() => {
|
||||
var e;
|
||||
return (e = c.data) == null ? void 0 : e.enrolled;
|
||||
}),
|
||||
count: m(() => {
|
||||
var e, l;
|
||||
return (l =
|
||||
(e = c.data) == null ? void 0 : e.enrolled) ==
|
||||
null
|
||||
? void 0
|
||||
: l.length;
|
||||
}),
|
||||
}),
|
||||
(e, l) => {
|
||||
const w = z("router-link");
|
||||
return (
|
||||
n(),
|
||||
u("div", Q, [
|
||||
a("header", W, [
|
||||
i(
|
||||
o(D),
|
||||
{
|
||||
class: "h-7",
|
||||
items: [
|
||||
{
|
||||
label: e.__("All Batches"),
|
||||
route: { name: "Batches" },
|
||||
},
|
||||
],
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["items"]
|
||||
),
|
||||
a("div", q, [
|
||||
i(
|
||||
o(M),
|
||||
{ variant: "solid" },
|
||||
{
|
||||
prefix: h(() => [
|
||||
i(o(E), { class: "h-4 w-4" }),
|
||||
]),
|
||||
default: h(() => [
|
||||
f(
|
||||
" " + t(e.__("New Batch")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
]),
|
||||
a("div", X, [
|
||||
i(
|
||||
o(P),
|
||||
{
|
||||
modelValue: v.value,
|
||||
"onUpdate:modelValue":
|
||||
l[0] ||
|
||||
(l[0] = (r) => (v.value = r)),
|
||||
tabs: _,
|
||||
tablistClass: "overflow-x-visible",
|
||||
},
|
||||
{
|
||||
tab: h(({ tab: r, selected: b }) => [
|
||||
a("div", null, [
|
||||
a(
|
||||
"button",
|
||||
{
|
||||
class: $([
|
||||
"group -mb-px flex items-center gap-2 border-b border-transparent py-2.5 text-base text-gray-600 duration-300 ease-in-out hover:border-gray-400 hover:text-gray-900",
|
||||
{
|
||||
"text-gray-900":
|
||||
b,
|
||||
},
|
||||
]),
|
||||
},
|
||||
[
|
||||
r.icon
|
||||
? (n(),
|
||||
g(N(r.icon), {
|
||||
key: 0,
|
||||
class: "h-5",
|
||||
}))
|
||||
: y("", !0),
|
||||
f(
|
||||
" " +
|
||||
t(
|
||||
e.__(
|
||||
r.label
|
||||
)
|
||||
) +
|
||||
" ",
|
||||
1
|
||||
),
|
||||
i(
|
||||
o(x),
|
||||
{
|
||||
class: $(
|
||||
b
|
||||
? "text-gray-800 border border-gray-800"
|
||||
: "border border-gray-500"
|
||||
),
|
||||
variant:
|
||||
"subtle",
|
||||
theme: "gray",
|
||||
size: "sm",
|
||||
},
|
||||
{
|
||||
default: h(
|
||||
() => [
|
||||
f(
|
||||
t(
|
||||
r.count
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["class"]
|
||||
),
|
||||
],
|
||||
2
|
||||
),
|
||||
]),
|
||||
]),
|
||||
default: h(({ tab: r }) => [
|
||||
r.batches && r.batches.value.length
|
||||
? (n(),
|
||||
u("div", Z, [
|
||||
(n(!0),
|
||||
u(
|
||||
V,
|
||||
null,
|
||||
L(
|
||||
r.batches.value,
|
||||
(b) => (
|
||||
n(),
|
||||
g(
|
||||
w,
|
||||
{
|
||||
to: {
|
||||
name: "BatchDetail",
|
||||
params: {
|
||||
batchName:
|
||||
b.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default:
|
||||
h(
|
||||
() => [
|
||||
i(
|
||||
K,
|
||||
{
|
||||
batch: b,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"batch",
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["to"]
|
||||
)
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
]))
|
||||
: (n(),
|
||||
u("div", ee, [
|
||||
a("div", te, [
|
||||
a(
|
||||
"div",
|
||||
null,
|
||||
t(
|
||||
e
|
||||
.__(
|
||||
"No {0} batches found"
|
||||
)
|
||||
.format(
|
||||
r.label.toLowerCase()
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
])),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
])
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
};
|
||||
export { ce as default };
|
||||
//# sourceMappingURL=Batches-CJG8qsGy.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,781 +0,0 @@
|
||||
import {
|
||||
x as c,
|
||||
y as _,
|
||||
H as s,
|
||||
a4 as x,
|
||||
L as o,
|
||||
J as d,
|
||||
G as L,
|
||||
K as n,
|
||||
a7 as P,
|
||||
d as T,
|
||||
s as j,
|
||||
k as f,
|
||||
a as z,
|
||||
I,
|
||||
M as b,
|
||||
ai as u,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { _ as S } from "./Link-xVzNCgtj.js";
|
||||
import { c as V } from "./index-xt-hKVBz.js";
|
||||
import "./plus-w56hNznP.js";
|
||||
const E = { class: "text-base border rounded-md w-1/3 mx-auto my-32" },
|
||||
G = { class: "border-b px-5 py-3 font-medium" },
|
||||
R = s(
|
||||
"span",
|
||||
{
|
||||
class: "inline-flex items-center before:bg-red-600 before:w-2 before:h-2 before:rounded-md before:mr-2",
|
||||
},
|
||||
null,
|
||||
-1
|
||||
),
|
||||
D = { class: "px-5 py-3" },
|
||||
H = { class: "mb-4 leading-6" },
|
||||
C = {
|
||||
__name: "NotPermitted",
|
||||
props: {
|
||||
title: { type: String, default: "Not Permitted" },
|
||||
text: {
|
||||
type: String,
|
||||
default: "You are not permitted to access this page.",
|
||||
},
|
||||
buttonLabel: { type: String, default: "Login" },
|
||||
buttonLink: { type: String, default: "/login" },
|
||||
},
|
||||
setup(m) {
|
||||
const v = m,
|
||||
r = () => {
|
||||
window.location.href = v.buttonLink;
|
||||
};
|
||||
return (p, i) => (
|
||||
c(),
|
||||
_("div", E, [
|
||||
s("div", G, [R, x(" " + o(p.__(m.title)), 1)]),
|
||||
s("div", D, [
|
||||
s("div", H, o(p.__(m.text)), 1),
|
||||
d(
|
||||
n(P),
|
||||
{
|
||||
variant: "solid",
|
||||
class: "w-full",
|
||||
onClick: i[0] || (i[0] = (t) => r()),
|
||||
},
|
||||
{
|
||||
default: L(() => [
|
||||
x(o(p.__(m.buttonLabel)), 1),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
])
|
||||
);
|
||||
},
|
||||
},
|
||||
K = { class: "text-base h-screen" },
|
||||
q = { key: 0, class: "mt-10 w-1/2 mx-auto" },
|
||||
J = { class: "text-3xl font-bold" },
|
||||
O = { class: "text-gray-600 mt-1" },
|
||||
F = { class: "border rounded-md p-5 mt-5" },
|
||||
W = { class: "text-xl font-semibold" },
|
||||
Y = { class: "text-gray-600 mt-1" },
|
||||
Q = { class: "mt-5" },
|
||||
X = { class: "flex items-center justify-between" },
|
||||
Z = { key: 0, class: "flex items-center justify-between mt-2" },
|
||||
ee = { key: 1, class: "flex items-center justify-between mt-2" },
|
||||
te = { class: "font-semibold text-2xl" },
|
||||
se = { class: "text-xl font-semibold mt-10" },
|
||||
ae = { class: "text-gray-600 mt-1" },
|
||||
oe = { class: "grid grid-cols-2 gap-5 mt-4" },
|
||||
ne = { class: "mt-4" },
|
||||
le = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
ie = { class: "mt-4" },
|
||||
de = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
re = { class: "mt-4" },
|
||||
me = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
ue = { class: "mt-4" },
|
||||
ce = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
_e = { class: "mt-4" },
|
||||
pe = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
ye = { class: "mt-4" },
|
||||
he = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
ge = { class: "mt-4" },
|
||||
be = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
ve = { class: "mt-4" },
|
||||
fe = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
xe = { class: "mt-4" },
|
||||
ke = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
Se = { key: 0, class: "mt-4" },
|
||||
Ve = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
Ce = { key: 1, class: "mt-4" },
|
||||
Le = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
Pe = { key: 1 },
|
||||
we = { key: 2 },
|
||||
Ue = {
|
||||
__name: "Billing",
|
||||
props: {
|
||||
type: { type: String, required: !0 },
|
||||
name: { type: String, required: !0 },
|
||||
},
|
||||
setup(m) {
|
||||
const v = T("$user");
|
||||
j(() => {
|
||||
var a;
|
||||
const e = document.createElement("script");
|
||||
(e.src = "https://checkout.razorpay.com/v1/checkout.js"),
|
||||
document.body.appendChild(e),
|
||||
(a = v.data) != null && a.name && p.submit();
|
||||
});
|
||||
const r = m,
|
||||
p = f({
|
||||
url: "lms.lms.api.validate_billing_access",
|
||||
params: { type: r.type, name: r.name },
|
||||
onSuccess(e) {
|
||||
i.submit(), w(e.address);
|
||||
},
|
||||
}),
|
||||
i = f({
|
||||
url: "lms.lms.utils.get_order_summary",
|
||||
makeParams(e) {
|
||||
return {
|
||||
doctype:
|
||||
r.type == "course" ? "LMS Course" : "LMS Batch",
|
||||
docname: r.name,
|
||||
country: t.country,
|
||||
};
|
||||
},
|
||||
onError(e) {
|
||||
k(e);
|
||||
},
|
||||
}),
|
||||
t = z({}),
|
||||
w = (e) => {
|
||||
(t.billing_name = e.billing_name || ""),
|
||||
(t.address_line1 = e.address_line1 || ""),
|
||||
(t.address_line2 = e.address_line2 || ""),
|
||||
(t.city = e.city || ""),
|
||||
(t.state = e.state || ""),
|
||||
(t.country = e.country || ""),
|
||||
(t.pincode = e.pincode || ""),
|
||||
(t.phone = e.phone || ""),
|
||||
(t.source = e.source || ""),
|
||||
(t.gstin = e.gstin || ""),
|
||||
(t.pan = e.pan || "");
|
||||
},
|
||||
M = f({
|
||||
url: "lms.lms.utils.get_payment_options",
|
||||
makeParams(e) {
|
||||
return {
|
||||
doctype:
|
||||
r.type == "course" ? "LMS Course" : "LMS Batch",
|
||||
docname: r.name,
|
||||
phone: t.phone,
|
||||
country: t.country,
|
||||
};
|
||||
},
|
||||
}),
|
||||
B = () => {
|
||||
M.submit(
|
||||
{},
|
||||
{
|
||||
validate(e) {
|
||||
return U();
|
||||
},
|
||||
onSuccess(e) {
|
||||
(e.handler = (y) => {
|
||||
let h =
|
||||
r.type == "course"
|
||||
? "LMS Course"
|
||||
: "LMS Batch",
|
||||
g = r.name;
|
||||
N(y, h, g, e.order_id);
|
||||
}),
|
||||
new Razorpay(e).open();
|
||||
},
|
||||
onError(e) {
|
||||
k(e);
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
$ = f({
|
||||
url: "lms.lms.utils.verify_payment",
|
||||
makeParams(e) {
|
||||
return {
|
||||
response: e.response,
|
||||
doctype:
|
||||
r.type == "course" ? "LMS Course" : "LMS Batch",
|
||||
docname: r.name,
|
||||
address: t,
|
||||
order_id: e.orderId,
|
||||
};
|
||||
},
|
||||
}),
|
||||
N = (e, a, y, h) => {
|
||||
$.submit(
|
||||
{ response: e, orderId: h },
|
||||
{
|
||||
onSuccess(g) {
|
||||
V({
|
||||
title: "Success",
|
||||
text: "Payment Successful",
|
||||
icon: "check",
|
||||
iconClasses:
|
||||
"bg-green-600 text-white rounded-md p-px",
|
||||
}),
|
||||
setTimeout(() => {
|
||||
window.location.href = g;
|
||||
}, 3e3);
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
U = () => {
|
||||
let e = [
|
||||
"billing_name",
|
||||
"address_line1",
|
||||
"city",
|
||||
"pincode",
|
||||
"country",
|
||||
"phone",
|
||||
"source",
|
||||
];
|
||||
for (let y of e)
|
||||
if (!t[y])
|
||||
return (
|
||||
"Please enter a valid " +
|
||||
y
|
||||
.replaceAll("_", " ")
|
||||
.toLowerCase()
|
||||
.replace(/\b\w/g, (h) => h.toUpperCase())
|
||||
);
|
||||
if (t.gstin && !t.pan)
|
||||
return "Please enter a valid pan number.";
|
||||
if (t.country == "India" && !t.state)
|
||||
return "Please enter a valid state with correct spelling and the first letter capitalized.";
|
||||
const a = [
|
||||
"Andhra Pradesh",
|
||||
"Arunachal Pradesh",
|
||||
"Assam",
|
||||
"Bihar",
|
||||
"Chhattisgarh",
|
||||
"Goa",
|
||||
"Gujarat",
|
||||
"Haryana",
|
||||
"Himachal Pradesh",
|
||||
"Jharkhand",
|
||||
"Karnataka",
|
||||
"Kerala",
|
||||
"Madhya Pradesh",
|
||||
"Maharashtra",
|
||||
"Manipur",
|
||||
"Meghalaya",
|
||||
"Mizoram",
|
||||
"Nagaland",
|
||||
"Odisha",
|
||||
"Punjab",
|
||||
"Rajasthan",
|
||||
"Sikkim",
|
||||
"Tamil Nadu",
|
||||
"Telangana",
|
||||
"Tripura",
|
||||
"Uttar Pradesh",
|
||||
"Uttarakhand",
|
||||
"West Bengal",
|
||||
];
|
||||
if (t.country == "India" && !a.includes(t.state))
|
||||
return "Please enter a valid state with correct spelling and the first letter capitalized.";
|
||||
},
|
||||
k = (e) => {
|
||||
var a;
|
||||
V({
|
||||
title: "Error",
|
||||
text: ((a = e.messages) == null ? void 0 : a[0]) || e,
|
||||
icon: "x",
|
||||
iconClasses: "bg-red-600 text-white rounded-md p-px",
|
||||
position: "top-center",
|
||||
timeout: 10,
|
||||
});
|
||||
},
|
||||
A = (e) => {
|
||||
(t.country = e), i.reload();
|
||||
};
|
||||
return (e, a) => {
|
||||
var y, h, g;
|
||||
return (
|
||||
c(),
|
||||
_("div", K, [
|
||||
(y = n(p).data) != null && y.access && n(i).data
|
||||
? (c(),
|
||||
_("div", q, [
|
||||
s("div", J, o(e.__("Billing Details")), 1),
|
||||
s(
|
||||
"div",
|
||||
O,
|
||||
o(
|
||||
e.__(
|
||||
"Enter the billing information to complete the payment."
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
s("div", F, [
|
||||
s("div", W, o(e.__("Summary")), 1),
|
||||
s(
|
||||
"div",
|
||||
Y,
|
||||
o(
|
||||
e.__(
|
||||
"Review the details of your purchase."
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
s("div", Q, [
|
||||
s("div", X, [
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
o(n(i).data.title),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
{
|
||||
class: I({
|
||||
"font-semibold text-xl":
|
||||
!n(i).data
|
||||
.gst_applied,
|
||||
}),
|
||||
},
|
||||
o(
|
||||
n(i).data.gst_applied
|
||||
? n(i).data
|
||||
.original_amount_formatted
|
||||
: n(i).data
|
||||
.total_amount_formatted
|
||||
),
|
||||
3
|
||||
),
|
||||
]),
|
||||
n(i).data.gst_applied
|
||||
? (c(),
|
||||
_("div", Z, [
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
o(
|
||||
e.__(
|
||||
"GST Amount"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
o(
|
||||
n(i).data
|
||||
.gst_amount_formatted
|
||||
),
|
||||
1
|
||||
),
|
||||
]))
|
||||
: b("", !0),
|
||||
n(i).data.gst_applied
|
||||
? (c(),
|
||||
_("div", ee, [
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
o(
|
||||
e.__(
|
||||
"Total Amount"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
te,
|
||||
o(
|
||||
n(i).data
|
||||
.total_amount_formatted
|
||||
),
|
||||
1
|
||||
),
|
||||
]))
|
||||
: b("", !0),
|
||||
]),
|
||||
s("div", se, o(e.__("Address")), 1),
|
||||
s(
|
||||
"div",
|
||||
ae,
|
||||
o(
|
||||
e.__(
|
||||
"Specify your billing address correctly."
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
s("div", oe, [
|
||||
s("div", null, [
|
||||
s("div", ne, [
|
||||
s(
|
||||
"div",
|
||||
le,
|
||||
o(e.__("Billing Name")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.billing_name,
|
||||
"onUpdate:modelValue":
|
||||
a[0] ||
|
||||
(a[0] = (l) =>
|
||||
(t.billing_name =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", ie, [
|
||||
s(
|
||||
"div",
|
||||
de,
|
||||
o(
|
||||
e.__(
|
||||
"Address Line 1"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.address_line1,
|
||||
"onUpdate:modelValue":
|
||||
a[1] ||
|
||||
(a[1] = (l) =>
|
||||
(t.address_line1 =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", re, [
|
||||
s(
|
||||
"div",
|
||||
me,
|
||||
o(
|
||||
e.__(
|
||||
"Address Line 2"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.address_line2,
|
||||
"onUpdate:modelValue":
|
||||
a[2] ||
|
||||
(a[2] = (l) =>
|
||||
(t.address_line2 =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", ue, [
|
||||
s(
|
||||
"div",
|
||||
ce,
|
||||
o(e.__("City")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue: t.city,
|
||||
"onUpdate:modelValue":
|
||||
a[3] ||
|
||||
(a[3] = (l) =>
|
||||
(t.city =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", _e, [
|
||||
s(
|
||||
"div",
|
||||
pe,
|
||||
o(e.__("State")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue: t.state,
|
||||
"onUpdate:modelValue":
|
||||
a[4] ||
|
||||
(a[4] = (l) =>
|
||||
(t.state =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
]),
|
||||
s("div", null, [
|
||||
s("div", ye, [
|
||||
s(
|
||||
"div",
|
||||
he,
|
||||
o(e.__("Country")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
S,
|
||||
{
|
||||
doctype: "Country",
|
||||
value: t.country,
|
||||
onChange:
|
||||
a[5] ||
|
||||
(a[5] = (l) =>
|
||||
A(l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["value"]
|
||||
),
|
||||
]),
|
||||
s("div", ge, [
|
||||
s(
|
||||
"div",
|
||||
be,
|
||||
o(e.__("Postal Code")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.pincode,
|
||||
"onUpdate:modelValue":
|
||||
a[6] ||
|
||||
(a[6] = (l) =>
|
||||
(t.pincode =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", ve, [
|
||||
s(
|
||||
"div",
|
||||
fe,
|
||||
o(e.__("Phone Number")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue: t.phone,
|
||||
"onUpdate:modelValue":
|
||||
a[7] ||
|
||||
(a[7] = (l) =>
|
||||
(t.phone =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", xe, [
|
||||
s(
|
||||
"div",
|
||||
ke,
|
||||
o(e.__("Source")),
|
||||
1
|
||||
),
|
||||
d(
|
||||
S,
|
||||
{
|
||||
doctype:
|
||||
"LMS Source",
|
||||
value: t.source,
|
||||
onChange:
|
||||
a[8] ||
|
||||
(a[8] = (l) =>
|
||||
(t.source =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["value"]
|
||||
),
|
||||
]),
|
||||
t.country == "India"
|
||||
? (c(),
|
||||
_("div", Se, [
|
||||
s(
|
||||
"div",
|
||||
Ve,
|
||||
o(
|
||||
e.__(
|
||||
"GST Number"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.gstin,
|
||||
"onUpdate:modelValue":
|
||||
a[9] ||
|
||||
(a[9] =
|
||||
(
|
||||
l
|
||||
) =>
|
||||
(t.gstin =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]))
|
||||
: b("", !0),
|
||||
t.country == "India"
|
||||
? (c(),
|
||||
_("div", Ce, [
|
||||
s(
|
||||
"div",
|
||||
Le,
|
||||
o(
|
||||
e.__(
|
||||
"Pan Number"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
d(
|
||||
n(u),
|
||||
{
|
||||
type: "text",
|
||||
modelValue:
|
||||
t.pan,
|
||||
"onUpdate:modelValue":
|
||||
a[10] ||
|
||||
(a[10] =
|
||||
(
|
||||
l
|
||||
) =>
|
||||
(t.pan =
|
||||
l)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]))
|
||||
: b("", !0),
|
||||
]),
|
||||
]),
|
||||
d(
|
||||
n(P),
|
||||
{
|
||||
variant: "solid",
|
||||
class: "mt-8",
|
||||
onClick:
|
||||
a[11] ||
|
||||
(a[11] = (l) => B()),
|
||||
},
|
||||
{
|
||||
default: L(() => [
|
||||
x(
|
||||
o(
|
||||
e.__(
|
||||
"Proceed to Payment"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
]))
|
||||
: (h = n(p).data) != null && h.message
|
||||
? (c(),
|
||||
_("div", Pe, [
|
||||
d(
|
||||
C,
|
||||
{
|
||||
text: n(p).data.message,
|
||||
buttonLabel:
|
||||
m.type == "course"
|
||||
? "Checkout Courses"
|
||||
: "Checkout Batches",
|
||||
buttonLink:
|
||||
m.type == "course"
|
||||
? "/courses"
|
||||
: "/batches",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["text", "buttonLabel", "buttonLink"]
|
||||
),
|
||||
]))
|
||||
: (g = n(v).data) != null && g.name
|
||||
? b("", !0)
|
||||
: (c(),
|
||||
_("div", we, [
|
||||
d(
|
||||
C,
|
||||
{
|
||||
text: "Please login to access this page.",
|
||||
buttonLink: `/login?redirect-to=/billing/${m.type}/${m.name}`,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["buttonLink"]
|
||||
),
|
||||
])),
|
||||
])
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
export { Ue as default };
|
||||
//# sourceMappingURL=Billing-kqTZfaAQ.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,366 +0,0 @@
|
||||
import { _ as b } from "./UserAvatar-3mSOKoKa.js";
|
||||
import { s as w, B as _, U as B } from "./index-xt-hKVBz.js";
|
||||
import {
|
||||
x as t,
|
||||
y as a,
|
||||
H as r,
|
||||
Q as h,
|
||||
R as f,
|
||||
F as g,
|
||||
G as n,
|
||||
a4 as v,
|
||||
L as s,
|
||||
K as c,
|
||||
a8 as x,
|
||||
M as o,
|
||||
I as y,
|
||||
U as k,
|
||||
J as l,
|
||||
T as d,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { S } from "./star-O1ih2gFp.js";
|
||||
const C = {
|
||||
key: 0,
|
||||
class: "flex flex-col h-full rounded-md shadow-md text-base overflow-auto",
|
||||
style: { "min-height": "320px" },
|
||||
},
|
||||
U = { class: "flex relative top-4 left-4 w-fit" },
|
||||
z = { key: 0, class: "image-placeholder" },
|
||||
N = { class: "flex flex-col flex-auto p-4" },
|
||||
R = { class: "flex items-center justify-between mb-2" },
|
||||
V = { key: 0 },
|
||||
j = { key: 1 },
|
||||
I = { key: 2 },
|
||||
L = { key: 3 },
|
||||
M = { class: "text-xl font-semibold" },
|
||||
T = { class: "short-introduction" },
|
||||
A = { key: 0, class: "w-full bg-gray-200 rounded-full h-1 mb-2" },
|
||||
E = { key: 1, class: "text-sm mb-4" },
|
||||
F = { class: "flex items-center justify-between mt-auto" },
|
||||
O = { class: "flex avatar-group overlap" },
|
||||
$ = { key: 0 },
|
||||
D = { key: 1 },
|
||||
G = { key: 2 },
|
||||
H = { class: "font-semibold" },
|
||||
W = {
|
||||
__name: "CourseCard",
|
||||
props: { course: { type: Object, default: null } },
|
||||
setup(e) {
|
||||
const { user: m } = w();
|
||||
return (u, J) =>
|
||||
e.course.title
|
||||
? (t(),
|
||||
a("div", C, [
|
||||
r(
|
||||
"div",
|
||||
{
|
||||
class: y([
|
||||
"course-image",
|
||||
{ "default-image": !e.course.image },
|
||||
]),
|
||||
style: k({
|
||||
backgroundImage:
|
||||
"url(" +
|
||||
encodeURI(e.course.image) +
|
||||
")",
|
||||
}),
|
||||
},
|
||||
[
|
||||
r("div", U, [
|
||||
(t(!0),
|
||||
a(
|
||||
h,
|
||||
null,
|
||||
f(
|
||||
e.course.tags,
|
||||
(i) => (
|
||||
t(),
|
||||
g(
|
||||
c(x),
|
||||
{
|
||||
theme: "gray",
|
||||
size: "lg",
|
||||
class: "mr-2",
|
||||
},
|
||||
{
|
||||
default: n(() => [
|
||||
v(s(i), 1),
|
||||
]),
|
||||
_: 2,
|
||||
},
|
||||
1024
|
||||
)
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
]),
|
||||
e.course.image
|
||||
? o("", !0)
|
||||
: (t(),
|
||||
a("div", z, s(e.course.title[0]), 1)),
|
||||
],
|
||||
6
|
||||
),
|
||||
r("div", N, [
|
||||
r("div", R, [
|
||||
e.course.lesson_count
|
||||
? (t(),
|
||||
a("div", V, [
|
||||
l(
|
||||
c(d),
|
||||
{
|
||||
text: u.__("Lessons"),
|
||||
class: "flex items-center space-x-1 py-1",
|
||||
},
|
||||
{
|
||||
default: n(() => [
|
||||
l(c(_), {
|
||||
class: "h-4 w-4 stroke-1.5 text-gray-700",
|
||||
}),
|
||||
r(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
e.course
|
||||
.lesson_count
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["text"]
|
||||
),
|
||||
]))
|
||||
: o("", !0),
|
||||
e.course.enrollment_count
|
||||
? (t(),
|
||||
a("div", j, [
|
||||
l(
|
||||
c(d),
|
||||
{
|
||||
text: u.__(
|
||||
"Enrolled Students"
|
||||
),
|
||||
class: "flex items-center space-x-1 py-1",
|
||||
},
|
||||
{
|
||||
default: n(() => [
|
||||
l(c(B), {
|
||||
class: "h-4 w-4 stroke-1.5 text-gray-700",
|
||||
}),
|
||||
r(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
e.course
|
||||
.enrollment_count
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["text"]
|
||||
),
|
||||
]))
|
||||
: o("", !0),
|
||||
e.course.avg_rating
|
||||
? (t(),
|
||||
a("div", I, [
|
||||
l(
|
||||
c(d),
|
||||
{
|
||||
text: u.__(
|
||||
"Average Rating"
|
||||
),
|
||||
class: "flex items-center space-x-1 py-1",
|
||||
},
|
||||
{
|
||||
default: n(() => [
|
||||
l(c(S), {
|
||||
class: "h-4 w-4 stroke-1.5 text-gray-700",
|
||||
}),
|
||||
r(
|
||||
"span",
|
||||
null,
|
||||
s(
|
||||
e.course
|
||||
.avg_rating
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["text"]
|
||||
),
|
||||
]))
|
||||
: o("", !0),
|
||||
e.course.status != "Approved"
|
||||
? (t(),
|
||||
a("div", L, [
|
||||
l(
|
||||
c(x),
|
||||
{
|
||||
variant: "solid",
|
||||
theme:
|
||||
e.course.status ===
|
||||
"Under Review"
|
||||
? "orange"
|
||||
: "blue",
|
||||
size: "sm",
|
||||
},
|
||||
{
|
||||
default: n(() => [
|
||||
v(
|
||||
s(
|
||||
e.course
|
||||
.status
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["theme"]
|
||||
),
|
||||
]))
|
||||
: o("", !0),
|
||||
]),
|
||||
r("div", M, s(e.course.title), 1),
|
||||
r("div", T, s(e.course.short_introduction), 1),
|
||||
c(m) && e.course.membership
|
||||
? (t(),
|
||||
a("div", A, [
|
||||
r(
|
||||
"div",
|
||||
{
|
||||
class: "bg-gray-900 h-1 rounded-full",
|
||||
style: k({
|
||||
width:
|
||||
Math.ceil(
|
||||
e.course
|
||||
.membership
|
||||
.progress
|
||||
) + "%",
|
||||
}),
|
||||
},
|
||||
null,
|
||||
4
|
||||
),
|
||||
]))
|
||||
: o("", !0),
|
||||
c(m) && e.course.membership
|
||||
? (t(),
|
||||
a(
|
||||
"div",
|
||||
E,
|
||||
s(
|
||||
Math.ceil(
|
||||
e.course.membership.progress
|
||||
)
|
||||
) + "% completed ",
|
||||
1
|
||||
))
|
||||
: o("", !0),
|
||||
r("div", F, [
|
||||
r("div", O, [
|
||||
r(
|
||||
"div",
|
||||
{
|
||||
class: y([
|
||||
"mr-1",
|
||||
{
|
||||
"avatar-group overlap":
|
||||
e.course.instructors
|
||||
.length > 1,
|
||||
},
|
||||
]),
|
||||
},
|
||||
[
|
||||
(t(!0),
|
||||
a(
|
||||
h,
|
||||
null,
|
||||
f(
|
||||
e.course.instructors,
|
||||
(i) => (
|
||||
t(),
|
||||
g(
|
||||
b,
|
||||
{ user: i },
|
||||
null,
|
||||
8,
|
||||
["user"]
|
||||
)
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
],
|
||||
2
|
||||
),
|
||||
e.course.instructors.length == 1
|
||||
? (t(),
|
||||
a(
|
||||
"span",
|
||||
$,
|
||||
s(
|
||||
e.course.instructors[0]
|
||||
.full_name
|
||||
),
|
||||
1
|
||||
))
|
||||
: o("", !0),
|
||||
e.course.instructors.length == 2
|
||||
? (t(),
|
||||
a(
|
||||
"span",
|
||||
D,
|
||||
s(
|
||||
e.course.instructors[0]
|
||||
.first_name
|
||||
) +
|
||||
" and " +
|
||||
s(
|
||||
e.course
|
||||
.instructors[1]
|
||||
.first_name
|
||||
),
|
||||
1
|
||||
))
|
||||
: o("", !0),
|
||||
e.course.instructors.length > 2
|
||||
? (t(),
|
||||
a(
|
||||
"span",
|
||||
G,
|
||||
s(
|
||||
e.course.instructors[0]
|
||||
.first_name
|
||||
) +
|
||||
" and " +
|
||||
s(
|
||||
e.course.instructors
|
||||
.length - 1
|
||||
) +
|
||||
" others ",
|
||||
1
|
||||
))
|
||||
: o("", !0),
|
||||
]),
|
||||
r("div", H, s(e.course.price), 1),
|
||||
]),
|
||||
]),
|
||||
]))
|
||||
: o("", !0);
|
||||
},
|
||||
};
|
||||
export { W as _ };
|
||||
//# sourceMappingURL=CourseCard-I7Cj-Ne7.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.course-image{height:168px;width:100%;background-size:cover;background-position:center;background-repeat:no-repeat}.course-card-pills{background:#fff;margin-left:0;margin-right:.5rem;padding:3.5px 8px;font-size:11px;text-align:center;letter-spacing:.011em;text-transform:uppercase;font-weight:600;width:-moz-fit-content;width:fit-content}.default-image{display:flex;flex-direction:column;align-items:center;background-color:#fff1e7;color:#d45a08}.avatar-group{display:inline-flex;align-items:center}.avatar-group .avatar{transition:margin .1s ease-in-out}.image-placeholder{display:flex;align-items:center;flex:1;font-size:5rem;color:#525252;font-weight:600}.avatar-group.overlap .avatar+.avatar{margin-left:-8px}.short-introduction{display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;text-overflow:ellipsis;width:100%;overflow:hidden;margin:.25rem 0 1.25rem;line-height:1.5}
|
||||
@@ -1 +0,0 @@
|
||||
.course-description p{margin-bottom:1rem;line-height:1.7}.course-description li{line-height:1.7}.course-description ol{list-style:auto;margin:revert;padding:revert}.avatar-group{display:inline-flex;align-items:center}.avatar-group .avatar{transition:margin .1s ease-in-out}
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because one or more lines are too long
@@ -1,430 +0,0 @@
|
||||
import {
|
||||
aa as V,
|
||||
ab as B,
|
||||
x as t,
|
||||
F as c,
|
||||
G as d,
|
||||
a4 as k,
|
||||
K as e,
|
||||
D as I,
|
||||
af as O,
|
||||
r as R,
|
||||
k as q,
|
||||
y as h,
|
||||
H as l,
|
||||
L as i,
|
||||
a7 as A,
|
||||
M as f,
|
||||
I as C,
|
||||
Q as _,
|
||||
R as b,
|
||||
J as p,
|
||||
aA as E,
|
||||
aB as F,
|
||||
aC as L,
|
||||
W as S,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { a as g } from "./index-xt-hKVBz.js";
|
||||
import { F as z } from "./file-text-dAqD9clk.js";
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const D = g("ChevronRightIcon", [
|
||||
["path", { d: "m9 18 6-6-6-6", key: "mthhwq" }],
|
||||
]);
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const H = g("HelpCircleIcon", [
|
||||
["circle", { cx: "12", cy: "12", r: "10", key: "1mglay" }],
|
||||
["path", { d: "M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3", key: "1u773s" }],
|
||||
["path", { d: "M12 17h.01", key: "p32p05" }],
|
||||
]);
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const j = g("MonitorPlayIcon", [
|
||||
["path", { d: "m10 7 5 3-5 3Z", key: "29ljg6" }],
|
||||
[
|
||||
"rect",
|
||||
{
|
||||
width: "20",
|
||||
height: "14",
|
||||
x: "2",
|
||||
y: "3",
|
||||
rx: "2",
|
||||
key: "48i651",
|
||||
},
|
||||
],
|
||||
["path", { d: "M12 17v4", key: "1riwvh" }],
|
||||
["path", { d: "M8 21h8", key: "1ev6f3" }],
|
||||
]),
|
||||
J = {
|
||||
__name: "ChapterModal",
|
||||
props: V(
|
||||
{ course: { type: String, required: !0 } },
|
||||
{ modelValue: {}, modelModifiers: {} }
|
||||
),
|
||||
emits: ["update:modelValue"],
|
||||
setup(a) {
|
||||
const y = B(a, "modelValue");
|
||||
return (r, n) => (
|
||||
t(),
|
||||
c(
|
||||
e(I),
|
||||
{
|
||||
modelValue: y.value,
|
||||
"onUpdate:modelValue":
|
||||
n[0] || (n[0] = (m) => (y.value = m)),
|
||||
options: {
|
||||
title: r.__("Add Chapter"),
|
||||
size: "lg",
|
||||
actions: [
|
||||
{
|
||||
label: r.__("Add"),
|
||||
variant: "solid",
|
||||
onClick: (m) => r.addChapter(m),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{ "body-content": d(() => [k(" Jannat ")]), _: 1 },
|
||||
8,
|
||||
["modelValue", "options"]
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
P = { class: "text-base" },
|
||||
Q = { key: 0, class: "flex items-center justify-between mb-4" },
|
||||
T = { class: "text-lg font-semibold" },
|
||||
$ = { class: "text-base text-left font-medium" },
|
||||
G = { class: "ml-auto text-sm" },
|
||||
K = { class: "outline-lesson py-2 pl-8" },
|
||||
U = { class: "flex items-center text-sm" },
|
||||
ee = {
|
||||
__name: "CourseOutline",
|
||||
props: {
|
||||
courseName: { type: String, required: !0 },
|
||||
showOutline: { type: Boolean, default: !1 },
|
||||
title: { type: String, default: "" },
|
||||
allowEdit: { type: Boolean, default: !1 },
|
||||
},
|
||||
setup(a) {
|
||||
const y = O();
|
||||
R(!0);
|
||||
const r = a,
|
||||
n = q({
|
||||
url: "lms.lms.utils.get_course_outline",
|
||||
cache: ["course_outline", r.courseName],
|
||||
params: { course: r.courseName },
|
||||
auto: !0,
|
||||
}),
|
||||
m = (s) => s == y.params.chapterNumber || s == 1;
|
||||
return (s, W) => {
|
||||
var v, x;
|
||||
const N = S("router-link");
|
||||
return (
|
||||
t(),
|
||||
h(
|
||||
_,
|
||||
null,
|
||||
[
|
||||
l("div", P, [
|
||||
a.title &&
|
||||
(((v = e(n).data) != null && v.length) ||
|
||||
a.allowEdit)
|
||||
? (t(),
|
||||
h("div", Q, [
|
||||
l("div", T, i(s.__(a.title)), 1),
|
||||
a.allowEdit
|
||||
? (t(),
|
||||
c(
|
||||
e(A),
|
||||
{ key: 0 },
|
||||
{
|
||||
default: d(() => [
|
||||
k(
|
||||
i(
|
||||
s.__(
|
||||
"Add Chapter"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: f("", !0),
|
||||
]))
|
||||
: f("", !0),
|
||||
l(
|
||||
"div",
|
||||
{
|
||||
class: C({
|
||||
"shadow rounded-md pt-2 px-2":
|
||||
a.showOutline &&
|
||||
((x = e(n).data) == null
|
||||
? void 0
|
||||
: x.length),
|
||||
}),
|
||||
},
|
||||
[
|
||||
(t(!0),
|
||||
h(
|
||||
_,
|
||||
null,
|
||||
b(
|
||||
e(n).data,
|
||||
(u, M) => (
|
||||
t(),
|
||||
c(
|
||||
e(L),
|
||||
{
|
||||
key: u.name,
|
||||
defaultOpen: m(
|
||||
u.idx
|
||||
),
|
||||
},
|
||||
{
|
||||
default: d(
|
||||
({
|
||||
open: w,
|
||||
}) => [
|
||||
p(
|
||||
e(E),
|
||||
{
|
||||
ref_for:
|
||||
!0,
|
||||
ref: "",
|
||||
class: "flex w-full px-2 py-4",
|
||||
},
|
||||
{
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
p(
|
||||
e(
|
||||
D
|
||||
),
|
||||
{
|
||||
class: C(
|
||||
[
|
||||
{
|
||||
"rotate-90 transform duration-200":
|
||||
w,
|
||||
"duration-200":
|
||||
!w,
|
||||
open:
|
||||
M ==
|
||||
1,
|
||||
},
|
||||
"h-4 w-4 text-gray-900 stroke-1 mr-2",
|
||||
]
|
||||
),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"class",
|
||||
]
|
||||
),
|
||||
l(
|
||||
"div",
|
||||
$,
|
||||
i(
|
||||
u.title
|
||||
),
|
||||
1
|
||||
),
|
||||
l(
|
||||
"div",
|
||||
G,
|
||||
i(
|
||||
u
|
||||
.lessons
|
||||
.length
|
||||
) +
|
||||
" " +
|
||||
i(
|
||||
u
|
||||
.lessons
|
||||
.length ==
|
||||
1
|
||||
? s.__(
|
||||
"lesson"
|
||||
)
|
||||
: s.__(
|
||||
"lessons"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1536
|
||||
),
|
||||
p(
|
||||
e(F),
|
||||
{
|
||||
class: "pb-2",
|
||||
},
|
||||
{
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
(t(
|
||||
!0
|
||||
),
|
||||
h(
|
||||
_,
|
||||
null,
|
||||
b(
|
||||
u.lessons,
|
||||
(
|
||||
o
|
||||
) => (
|
||||
t(),
|
||||
h(
|
||||
"div",
|
||||
{
|
||||
key: o.name,
|
||||
},
|
||||
[
|
||||
l(
|
||||
"div",
|
||||
K,
|
||||
[
|
||||
p(
|
||||
N,
|
||||
{
|
||||
to: {
|
||||
name: "Lesson",
|
||||
params: {
|
||||
courseName:
|
||||
a.courseName,
|
||||
chapterNumber:
|
||||
o.number.split(
|
||||
"."
|
||||
)[0],
|
||||
lessonNumber:
|
||||
o.number.split(
|
||||
"."
|
||||
)[1],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
l(
|
||||
"div",
|
||||
U,
|
||||
[
|
||||
o.icon ===
|
||||
"icon-youtube"
|
||||
? (t(),
|
||||
c(
|
||||
e(
|
||||
j
|
||||
),
|
||||
{
|
||||
key: 0,
|
||||
class: "h-4 w-4 text-gray-900 stroke-1 mr-2",
|
||||
}
|
||||
))
|
||||
: o.icon ===
|
||||
"icon-quiz"
|
||||
? (t(),
|
||||
c(
|
||||
e(
|
||||
H
|
||||
),
|
||||
{
|
||||
key: 1,
|
||||
class: "h-4 w-4 text-gray-900 stroke-1 mr-2",
|
||||
}
|
||||
))
|
||||
: o.icon ===
|
||||
"icon-list"
|
||||
? (t(),
|
||||
c(
|
||||
e(
|
||||
z
|
||||
),
|
||||
{
|
||||
key: 2,
|
||||
class: "h-4 w-4 text-gray-900 stroke-1 mr-2",
|
||||
}
|
||||
))
|
||||
: f(
|
||||
"",
|
||||
!0
|
||||
),
|
||||
k(
|
||||
" " +
|
||||
i(
|
||||
o.title
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
[
|
||||
"to",
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
)
|
||||
)
|
||||
),
|
||||
128
|
||||
)),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1024
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["defaultOpen"]
|
||||
)
|
||||
)
|
||||
),
|
||||
128
|
||||
)),
|
||||
],
|
||||
2
|
||||
),
|
||||
]),
|
||||
p(J, { course: a.courseName }, null, 8, ["course"]),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
export { D as C, ee as _ };
|
||||
//# sourceMappingURL=CourseOutline-mDbSZeRP.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1 +0,0 @@
|
||||
.outline-lesson:has(.router-link-active){background-color:#f3f3f3}
|
||||
@@ -1,490 +0,0 @@
|
||||
import {
|
||||
d as k,
|
||||
a5 as w,
|
||||
r as L,
|
||||
j as o,
|
||||
y as u,
|
||||
H as c,
|
||||
J as m,
|
||||
K as n,
|
||||
G as d,
|
||||
F as p,
|
||||
M as g,
|
||||
Q as N,
|
||||
W as V,
|
||||
x as l,
|
||||
a6 as $,
|
||||
a4 as h,
|
||||
L as f,
|
||||
a7 as j,
|
||||
I as B,
|
||||
P as D,
|
||||
a8 as P,
|
||||
R,
|
||||
a9 as U,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { _ as z } from "./CourseCard-I7Cj-Ne7.js";
|
||||
import { P as E } from "./plus-w56hNznP.js";
|
||||
import "./UserAvatar-3mSOKoKa.js";
|
||||
import "./index-xt-hKVBz.js";
|
||||
import "./star-O1ih2gFp.js";
|
||||
const F = {
|
||||
class: "sticky top-0 z-10 flex items-center justify-between border-b bg-white px-3 py-2.5 sm:px-5",
|
||||
},
|
||||
I = { class: "flex" },
|
||||
M = { key: 0 },
|
||||
S = { key: 0, class: "p-5 text-base text-gray-700" },
|
||||
A = {
|
||||
key: 0,
|
||||
class: "grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-5 my-5 mx-5",
|
||||
},
|
||||
G = {
|
||||
key: 1,
|
||||
class: "grid flex-1 place-items-center text-xl font-medium text-gray-500",
|
||||
},
|
||||
H = { class: "flex flex-col items-center justify-center mt-4" },
|
||||
X = {
|
||||
__name: "Courses",
|
||||
setup(J) {
|
||||
var v, y, x;
|
||||
const i = k("$user"),
|
||||
a = w({
|
||||
type: "list",
|
||||
doctype: "LMS Course",
|
||||
cache: [
|
||||
"courses",
|
||||
(v = i == null ? void 0 : i.data) == null
|
||||
? void 0
|
||||
: v.email,
|
||||
],
|
||||
url: "lms.lms.utils.get_courses",
|
||||
auto: !0,
|
||||
}),
|
||||
b = L(0),
|
||||
_ = [
|
||||
{
|
||||
label: "Live",
|
||||
courses: o(() => {
|
||||
var e;
|
||||
return (
|
||||
((e = a.data) == null ? void 0 : e.live) || []
|
||||
);
|
||||
}),
|
||||
count: o(() => {
|
||||
var e, s;
|
||||
return (s =
|
||||
(e = a.data) == null ? void 0 : e.live) == null
|
||||
? void 0
|
||||
: s.length;
|
||||
}),
|
||||
},
|
||||
{
|
||||
label: "Upcoming",
|
||||
courses: o(() => {
|
||||
var e;
|
||||
return (e = a.data) == null ? void 0 : e.upcoming;
|
||||
}),
|
||||
count: o(() => {
|
||||
var e, s;
|
||||
return (s =
|
||||
(e = a.data) == null ? void 0 : e.upcoming) ==
|
||||
null
|
||||
? void 0
|
||||
: s.length;
|
||||
}),
|
||||
},
|
||||
];
|
||||
return (
|
||||
i.data &&
|
||||
(_.push({
|
||||
label: "Enrolled",
|
||||
courses: o(() => {
|
||||
var e;
|
||||
return (e = a.data) == null ? void 0 : e.enrolled;
|
||||
}),
|
||||
count: o(() => {
|
||||
var e, s;
|
||||
return (s =
|
||||
(e = a.data) == null ? void 0 : e.enrolled) ==
|
||||
null
|
||||
? void 0
|
||||
: s.length;
|
||||
}),
|
||||
}),
|
||||
(i.data.is_moderator ||
|
||||
i.data.is_instructor ||
|
||||
((x = (y = a.data) == null ? void 0 : y.created) !=
|
||||
null &&
|
||||
x.length)) &&
|
||||
_.push({
|
||||
label: "Created",
|
||||
courses: o(() => {
|
||||
var e;
|
||||
return (e = a.data) == null
|
||||
? void 0
|
||||
: e.created;
|
||||
}),
|
||||
count: o(() => {
|
||||
var e, s;
|
||||
return (s =
|
||||
(e = a.data) == null
|
||||
? void 0
|
||||
: e.created) == null
|
||||
? void 0
|
||||
: s.length;
|
||||
}),
|
||||
}),
|
||||
i.data.is_moderator &&
|
||||
_.push({
|
||||
label: "Under Review",
|
||||
courses: o(() => {
|
||||
var e;
|
||||
return (e = a.data) == null
|
||||
? void 0
|
||||
: e.under_review;
|
||||
}),
|
||||
count: o(() => {
|
||||
var e, s;
|
||||
return (s =
|
||||
(e = a.data) == null
|
||||
? void 0
|
||||
: e.under_review) == null
|
||||
? void 0
|
||||
: s.length;
|
||||
}),
|
||||
})),
|
||||
(e, s) => {
|
||||
const C = V("router-link");
|
||||
return (
|
||||
l(),
|
||||
u(
|
||||
N,
|
||||
null,
|
||||
[
|
||||
c("header", F, [
|
||||
m(
|
||||
n($),
|
||||
{
|
||||
class: "h-7",
|
||||
items: [
|
||||
{
|
||||
label: e.__("All Courses"),
|
||||
route: { name: "Courses" },
|
||||
},
|
||||
],
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["items"]
|
||||
),
|
||||
c("div", I, [
|
||||
m(
|
||||
C,
|
||||
{
|
||||
to: {
|
||||
name: "CreateCourse",
|
||||
params: {
|
||||
courseName: "new",
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default: d(() => {
|
||||
var t;
|
||||
return [
|
||||
(t = n(i).data) !=
|
||||
null &&
|
||||
t.is_moderator
|
||||
? (l(),
|
||||
p(
|
||||
n(j),
|
||||
{
|
||||
key: 0,
|
||||
variant:
|
||||
"solid",
|
||||
},
|
||||
{
|
||||
prefix: d(
|
||||
() => [
|
||||
m(
|
||||
n(
|
||||
E
|
||||
),
|
||||
{
|
||||
class: "h-4 w-4",
|
||||
}
|
||||
),
|
||||
]
|
||||
),
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
h(
|
||||
" " +
|
||||
f(
|
||||
e.__(
|
||||
"New Course"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 1,
|
||||
}
|
||||
))
|
||||
: g("", !0),
|
||||
];
|
||||
}),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
]),
|
||||
n(a).data
|
||||
? (l(),
|
||||
u("div", M, [
|
||||
n(a).data.length == 0 &&
|
||||
n(a).list.loading
|
||||
? (l(),
|
||||
u(
|
||||
"div",
|
||||
S,
|
||||
" Loading Courses... "
|
||||
))
|
||||
: (l(),
|
||||
p(
|
||||
n(U),
|
||||
{
|
||||
key: 1,
|
||||
modelValue: b.value,
|
||||
"onUpdate:modelValue":
|
||||
s[0] ||
|
||||
(s[0] = (t) =>
|
||||
(b.value =
|
||||
t)),
|
||||
tabs: _,
|
||||
tablistClass:
|
||||
"overflow-x-visible",
|
||||
},
|
||||
{
|
||||
tab: d(
|
||||
({
|
||||
tab: t,
|
||||
selected: r,
|
||||
}) => [
|
||||
c(
|
||||
"div",
|
||||
null,
|
||||
[
|
||||
c(
|
||||
"button",
|
||||
{
|
||||
class: B(
|
||||
[
|
||||
"group -mb-px flex items-center gap-2 overflow-hidden border-b border-transparent py-2.5 text-base text-gray-600 duration-300 ease-in-out hover:border-gray-400 hover:text-gray-900",
|
||||
{
|
||||
"text-gray-900":
|
||||
r,
|
||||
},
|
||||
]
|
||||
),
|
||||
},
|
||||
[
|
||||
t.icon
|
||||
? (l(),
|
||||
p(
|
||||
D(
|
||||
t.icon
|
||||
),
|
||||
{
|
||||
key: 0,
|
||||
class: "h-5",
|
||||
}
|
||||
))
|
||||
: g(
|
||||
"",
|
||||
!0
|
||||
),
|
||||
h(
|
||||
" " +
|
||||
f(
|
||||
e.__(
|
||||
t.label
|
||||
)
|
||||
) +
|
||||
" ",
|
||||
1
|
||||
),
|
||||
m(
|
||||
n(
|
||||
P
|
||||
),
|
||||
{
|
||||
theme: "gray",
|
||||
},
|
||||
{
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
h(
|
||||
f(
|
||||
t.count
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1024
|
||||
),
|
||||
],
|
||||
2
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
default: d(
|
||||
({
|
||||
tab: t,
|
||||
}) => [
|
||||
t.courses &&
|
||||
t.courses
|
||||
.value
|
||||
.length
|
||||
? (l(),
|
||||
u(
|
||||
"div",
|
||||
A,
|
||||
[
|
||||
(l(
|
||||
!0
|
||||
),
|
||||
u(
|
||||
N,
|
||||
null,
|
||||
R(
|
||||
t
|
||||
.courses
|
||||
.value,
|
||||
(
|
||||
r
|
||||
) => (
|
||||
l(),
|
||||
p(
|
||||
C,
|
||||
{
|
||||
to:
|
||||
r.membership &&
|
||||
r.current_lesson
|
||||
? {
|
||||
name: "Lesson",
|
||||
params: {
|
||||
courseName:
|
||||
r.name,
|
||||
chapterNumber:
|
||||
r.current_lesson.split(
|
||||
"."
|
||||
)[0],
|
||||
lessonNumber:
|
||||
r.current_lesson.split(
|
||||
"."
|
||||
)[1],
|
||||
},
|
||||
}
|
||||
: r.membership
|
||||
? {
|
||||
name: "Lesson",
|
||||
params: {
|
||||
courseName:
|
||||
r.name,
|
||||
chapterNumber: 1,
|
||||
lessonNumber: 1,
|
||||
},
|
||||
}
|
||||
: {
|
||||
name: "CourseDetail",
|
||||
params: {
|
||||
courseName:
|
||||
r.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default:
|
||||
d(
|
||||
() => [
|
||||
m(
|
||||
z,
|
||||
{
|
||||
course: r,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"course",
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
[
|
||||
"to",
|
||||
]
|
||||
)
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
]
|
||||
))
|
||||
: (l(),
|
||||
u(
|
||||
"div",
|
||||
G,
|
||||
[
|
||||
c(
|
||||
"div",
|
||||
H,
|
||||
[
|
||||
c(
|
||||
"div",
|
||||
null,
|
||||
f(
|
||||
e
|
||||
.__(
|
||||
"No {0} courses found"
|
||||
)
|
||||
.format(
|
||||
t.label.toLowerCase()
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
)),
|
||||
]
|
||||
),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["modelValue"]
|
||||
)),
|
||||
]))
|
||||
: g("", !0),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
}
|
||||
);
|
||||
},
|
||||
};
|
||||
export { X as default };
|
||||
//# sourceMappingURL=Courses-ysBRUCIO.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,761 +0,0 @@
|
||||
var A = Object.defineProperty;
|
||||
var P = Object.getOwnPropertySymbols;
|
||||
var Y = Object.prototype.hasOwnProperty,
|
||||
Z = Object.prototype.propertyIsEnumerable;
|
||||
var M = (c, u, r) =>
|
||||
u in c
|
||||
? A(c, u, {
|
||||
enumerable: !0,
|
||||
configurable: !0,
|
||||
writable: !0,
|
||||
value: r,
|
||||
})
|
||||
: (c[u] = r),
|
||||
k = (c, u) => {
|
||||
for (var r in u || (u = {})) Y.call(u, r) && M(c, r, u[r]);
|
||||
if (P) for (var r of P(u)) Z.call(u, r) && M(c, r, u[r]);
|
||||
return c;
|
||||
};
|
||||
import {
|
||||
d as ee,
|
||||
r as x,
|
||||
j as w,
|
||||
ad as le,
|
||||
k as R,
|
||||
s as se,
|
||||
y as h,
|
||||
H as a,
|
||||
J as n,
|
||||
K as i,
|
||||
F as N,
|
||||
G as C,
|
||||
M as z,
|
||||
L as d,
|
||||
Q as oe,
|
||||
R as ae,
|
||||
ay as te,
|
||||
W as ie,
|
||||
x as b,
|
||||
a6 as re,
|
||||
a7 as T,
|
||||
az as _,
|
||||
aq as ne,
|
||||
a4 as B,
|
||||
ax as ue,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { e as de, c as ce, d as me } from "./index-xt-hKVBz.js";
|
||||
import { _ as _e, X as I } from "./Link-xVzNCgtj.js";
|
||||
import { _ as pe } from "./CourseOutline-mDbSZeRP.js";
|
||||
import { F as ve } from "./file-text-dAqD9clk.js";
|
||||
import "./plus-w56hNznP.js";
|
||||
const be = { class: "h-screen text-base" },
|
||||
fe = { class: "grid grid-cols-[70%,30%] h-full" },
|
||||
ge = {
|
||||
class: "sticky top-0 z-10 flex items-center justify-between border-b bg-white px-3 py-2.5 sm:px-5",
|
||||
},
|
||||
ye = { class: "flex items-center" },
|
||||
Ce = { class: "mt-5 mb-10" },
|
||||
Ve = { class: "container mb-5" },
|
||||
he = { class: "text-lg font-semibold mb-4" },
|
||||
ke = { class: "mb-4" },
|
||||
xe = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
we = { class: "mb-4" },
|
||||
Ne = { key: 1, class: "mb-4" },
|
||||
Te = { class: "text-xs text-gray-600 mb-1" },
|
||||
Ue = { class: "flex items-center" },
|
||||
$e = { class: "border rounded-md p-2 mr-2" },
|
||||
Se = { class: "flex flex-col" },
|
||||
je = { class: "text-sm text-gray-500 mt-1" },
|
||||
Fe = { class: "mb-1.5 text-sm text-gray-700" },
|
||||
Ee = { class: "flex items-center" },
|
||||
De = { class: "flex items-center bg-gray-100 p-2 rounded-md mr-2" },
|
||||
Le = { class: "container border-t" },
|
||||
Pe = { class: "text-lg font-semibold mt-5 mb-4" },
|
||||
Me = { class: "flex items-center justify-between mb-5" },
|
||||
Re = { class: "container border-t" },
|
||||
ze = { class: "text-lg font-semibold mt-5 mb-4" },
|
||||
Be = { class: "mb-4" },
|
||||
Ie = { class: "border-l px-5 pt-5" },
|
||||
We = {
|
||||
__name: "CreateCourse",
|
||||
props: { courseName: { type: String } },
|
||||
setup(c) {
|
||||
const u = ee("$user"),
|
||||
r = x(""),
|
||||
p = x(""),
|
||||
m = x(null),
|
||||
f = c,
|
||||
K = w(() => {
|
||||
var e;
|
||||
let l = [{ label: "Courses", route: { name: "Courses" } }];
|
||||
return (
|
||||
t.doc &&
|
||||
l.push({
|
||||
label: (e = t.doc) == null ? void 0 : e.title,
|
||||
route: {
|
||||
name: "CourseDetail",
|
||||
params: { courseName: f.courseName },
|
||||
},
|
||||
}),
|
||||
l.push({
|
||||
label:
|
||||
f.courseName == "new"
|
||||
? "New Course"
|
||||
: "Edit Course",
|
||||
route: {
|
||||
name: "CreateCourse",
|
||||
params: { courseName: f.courseName },
|
||||
},
|
||||
}),
|
||||
l
|
||||
);
|
||||
}),
|
||||
t = le({
|
||||
doctype: "LMS Course",
|
||||
name: f.courseName,
|
||||
auto: !1,
|
||||
onSuccess(l) {
|
||||
(r.value = l.tags),
|
||||
O.reload({ image: l.image }),
|
||||
Object.assign(o, l),
|
||||
(o.published = !!l.published),
|
||||
(o.upcoming = !!l.upcoming),
|
||||
(o.disable_self_learning =
|
||||
!!l.disable_self_learning),
|
||||
(o.paid_course = !!l.paid_course);
|
||||
},
|
||||
}),
|
||||
O = R({
|
||||
url: "lms.lms.api.get_file_info",
|
||||
makeParams(l) {
|
||||
return { file_url: l.image };
|
||||
},
|
||||
auto: !1,
|
||||
onSuccess(l) {
|
||||
m.value = l;
|
||||
},
|
||||
});
|
||||
se(() => {
|
||||
var l, e;
|
||||
(!((l = u.data) != null && l.is_moderator) ||
|
||||
!((e = u.data) != null && e.is_instructor)) &&
|
||||
(window.location.href = "/login"),
|
||||
f.courseName !== "new" && t.reload();
|
||||
});
|
||||
const o = w(() => {
|
||||
var l, e, v, s, g, y, V, S, j, F, E, D, L;
|
||||
return {
|
||||
title: ((l = t.doc) == null ? void 0 : l.title) || "",
|
||||
short_introduction:
|
||||
((e = t.doc) == null
|
||||
? void 0
|
||||
: e.short_introduction) || "",
|
||||
description:
|
||||
((v = t.doc) == null ? void 0 : v.description) ||
|
||||
"",
|
||||
video_link:
|
||||
((s = t.doc) == null ? void 0 : s.video_link) || "",
|
||||
course_image:
|
||||
((g = t.doc) == null ? void 0 : g.image) || null,
|
||||
tags: ((y = t.doc) == null ? void 0 : y.tags) || "",
|
||||
published: !!((V = t.doc) != null && V.published),
|
||||
upcoming: !!((S = t.doc) != null && S.upcoming),
|
||||
disable_self_learning: !!(
|
||||
(j = t.doc) != null && j.disable_self_learning
|
||||
),
|
||||
course_image: m.value,
|
||||
paid_course: !!((F = t.doc) != null && F.paid_course),
|
||||
course_price:
|
||||
((E = t.doc) == null ? void 0 : E.course_price) ||
|
||||
"",
|
||||
currency:
|
||||
((D = t.doc) == null ? void 0 : D.currency) || "",
|
||||
image: ((L = t.doc) == null ? void 0 : L.image) || null,
|
||||
};
|
||||
}),
|
||||
q = w(() => {
|
||||
var l, e;
|
||||
return (l = t.doc) != null && l.tags
|
||||
? t.doc.tags.split(", ")
|
||||
: (e = r.value) == null
|
||||
? void 0
|
||||
: e.split(", ");
|
||||
}),
|
||||
G = R({
|
||||
url: "frappe.client.insert",
|
||||
makeParams(l) {
|
||||
return {
|
||||
doc: k(
|
||||
{
|
||||
doctype: "LMS Course",
|
||||
image: m.value.file_url,
|
||||
},
|
||||
l
|
||||
),
|
||||
};
|
||||
},
|
||||
}),
|
||||
H = () => {
|
||||
var l;
|
||||
t.doc
|
||||
? t.setValue.submit(
|
||||
k(
|
||||
{
|
||||
image:
|
||||
((l = m.value) == null
|
||||
? void 0
|
||||
: l.file_url) || null,
|
||||
},
|
||||
o.value
|
||||
),
|
||||
{
|
||||
validate() {
|
||||
return U();
|
||||
},
|
||||
onError(e) {
|
||||
$(e);
|
||||
},
|
||||
}
|
||||
)
|
||||
: G.submit(o.value, {
|
||||
validate() {
|
||||
return U();
|
||||
},
|
||||
onError(e) {
|
||||
$(e);
|
||||
},
|
||||
});
|
||||
},
|
||||
U = () => {
|
||||
const l = [
|
||||
"title",
|
||||
"short_introduction",
|
||||
"description",
|
||||
"video_link",
|
||||
"course_image",
|
||||
];
|
||||
for (const e of l)
|
||||
if (!o.value[e])
|
||||
return `${de(e.split("_").join(" "))} is mandatory`;
|
||||
if (
|
||||
o.value.paid_course &&
|
||||
(!o.value.course_price || !o.value.currency)
|
||||
)
|
||||
return "Course price and currency are mandatory for paid courses";
|
||||
},
|
||||
J = (l) => {
|
||||
let e = l.name.split(".").pop().toLowerCase();
|
||||
if (!["jpg", "jpeg", "png"].includes(e))
|
||||
return "Only image file is allowed.";
|
||||
},
|
||||
Q = () => {
|
||||
p.value &&
|
||||
((r.value = r.value
|
||||
? `${r.value}, ${p.value}`
|
||||
: p.value),
|
||||
(p.value = ""));
|
||||
},
|
||||
W = (l) => {
|
||||
var e;
|
||||
(r.value =
|
||||
(e = r.value) == null
|
||||
? void 0
|
||||
: e
|
||||
.split(", ")
|
||||
.filter((v) => v !== l)
|
||||
.join(", ")),
|
||||
(p.value = "");
|
||||
},
|
||||
$ = (l) => {
|
||||
var e;
|
||||
ce({
|
||||
title: "Error",
|
||||
text: ((e = l.messages) == null ? void 0 : e[0]) || l,
|
||||
icon: "x",
|
||||
iconClasses: "bg-red-600 text-white rounded-md p-px",
|
||||
position: "top-center",
|
||||
timeout: 10,
|
||||
});
|
||||
},
|
||||
X = () => {
|
||||
(m.value = null), (o.value.course_image = null);
|
||||
};
|
||||
return (l, e) => {
|
||||
const v = ie("router-link");
|
||||
return (
|
||||
b(),
|
||||
h("div", be, [
|
||||
a("div", fe, [
|
||||
a("div", null, [
|
||||
a("header", ge, [
|
||||
n(
|
||||
i(re),
|
||||
{ class: "h-7", items: K.value },
|
||||
null,
|
||||
8,
|
||||
["items"]
|
||||
),
|
||||
a("div", ye, [
|
||||
i(t).doc
|
||||
? (b(),
|
||||
N(
|
||||
v,
|
||||
{
|
||||
key: 0,
|
||||
to: {
|
||||
name: "CourseDetail",
|
||||
params: {
|
||||
courseName:
|
||||
i(t).doc
|
||||
.name,
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
default: C(() => [
|
||||
n(i(T), null, {
|
||||
default: C(
|
||||
() => [
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
d(
|
||||
l.__(
|
||||
"View Course"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 1,
|
||||
}),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["to"]
|
||||
))
|
||||
: z("", !0),
|
||||
n(
|
||||
i(T),
|
||||
{
|
||||
variant: "solid",
|
||||
onClick:
|
||||
e[0] || (e[0] = (s) => H()),
|
||||
class: "ml-2",
|
||||
},
|
||||
{
|
||||
default: C(() => [
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
d(l.__("Save")),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
]),
|
||||
a("div", Ce, [
|
||||
a("div", Ve, [
|
||||
a(
|
||||
"div",
|
||||
he,
|
||||
d(l.__("Course Details")),
|
||||
1
|
||||
),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
modelValue: o.value.title,
|
||||
"onUpdate:modelValue":
|
||||
e[1] ||
|
||||
(e[1] = (s) =>
|
||||
(o.value.title = s)),
|
||||
label: l.__("Title"),
|
||||
class: "mb-4",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
modelValue:
|
||||
o.value.short_introduction,
|
||||
"onUpdate:modelValue":
|
||||
e[2] ||
|
||||
(e[2] = (s) =>
|
||||
(o.value.short_introduction =
|
||||
s)),
|
||||
label: l.__(
|
||||
"Short Introduction"
|
||||
),
|
||||
class: "mb-4",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
a("div", ke, [
|
||||
a(
|
||||
"div",
|
||||
xe,
|
||||
d(l.__("Course Description")),
|
||||
1
|
||||
),
|
||||
n(
|
||||
i(ne),
|
||||
{
|
||||
content:
|
||||
o.value.description,
|
||||
onChange:
|
||||
e[3] ||
|
||||
(e[3] = (s) =>
|
||||
(o.value.description =
|
||||
s)),
|
||||
editable: !0,
|
||||
fixedMenu: !0,
|
||||
editorClass:
|
||||
"prose-sm max-w-none border-b border-x bg-gray-100 rounded-b-md py-1 px-2 min-h-[7rem]",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["content"]
|
||||
),
|
||||
]),
|
||||
m.value
|
||||
? (b(),
|
||||
h("div", Ne, [
|
||||
a(
|
||||
"div",
|
||||
Te,
|
||||
d(l.__("Course Image")),
|
||||
1
|
||||
),
|
||||
a("div", Ue, [
|
||||
a("div", $e, [
|
||||
n(i(ve), {
|
||||
class: "h-5 w-5 stroke-1.5 text-gray-700",
|
||||
}),
|
||||
]),
|
||||
a("div", Se, [
|
||||
a(
|
||||
"span",
|
||||
null,
|
||||
d(
|
||||
m.value
|
||||
.file_name
|
||||
),
|
||||
1
|
||||
),
|
||||
a(
|
||||
"span",
|
||||
je,
|
||||
d(
|
||||
i(me)(
|
||||
m.value
|
||||
.file_size
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
n(i(I), {
|
||||
onClick:
|
||||
e[5] ||
|
||||
(e[5] = (s) =>
|
||||
X()),
|
||||
class: "bg-gray-200 rounded-md cursor-pointer stroke-1.5 w-5 h-5 p-1 ml-4",
|
||||
}),
|
||||
]),
|
||||
]))
|
||||
: (b(),
|
||||
N(
|
||||
i(ue),
|
||||
{
|
||||
key: 0,
|
||||
fileTypes: ["image/*"],
|
||||
validateFile: J,
|
||||
onSuccess:
|
||||
e[4] ||
|
||||
(e[4] = (s) => {
|
||||
m.value = s;
|
||||
}),
|
||||
},
|
||||
{
|
||||
default: C(
|
||||
({
|
||||
file: s,
|
||||
progress: g,
|
||||
uploading: y,
|
||||
openFileSelector:
|
||||
V,
|
||||
}) => [
|
||||
a("div", we, [
|
||||
n(
|
||||
i(T),
|
||||
{
|
||||
onClick:
|
||||
V,
|
||||
loading:
|
||||
y,
|
||||
},
|
||||
{
|
||||
default:
|
||||
C(
|
||||
() => [
|
||||
B(
|
||||
d(
|
||||
y
|
||||
? `Uploading ${g}%`
|
||||
: "Upload an image"
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
[
|
||||
"onClick",
|
||||
"loading",
|
||||
]
|
||||
),
|
||||
]),
|
||||
]
|
||||
),
|
||||
_: 1,
|
||||
}
|
||||
)),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
modelValue: o.value.video_link,
|
||||
"onUpdate:modelValue":
|
||||
e[6] ||
|
||||
(e[6] = (s) =>
|
||||
(o.value.video_link =
|
||||
s)),
|
||||
label: l.__("Preview Video"),
|
||||
class: "mb-4",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
a("div", null, [
|
||||
a("div", Fe, d(l.__("Tags")), 1),
|
||||
a("div", Ee, [
|
||||
(b(!0),
|
||||
h(
|
||||
oe,
|
||||
null,
|
||||
ae(
|
||||
q.value,
|
||||
(s) => (
|
||||
b(),
|
||||
h("div", De, [
|
||||
B(
|
||||
d(s) + " ",
|
||||
1
|
||||
),
|
||||
n(
|
||||
i(I),
|
||||
{
|
||||
class: "stroke-1.5 w-3 h-3 ml-2 cursor-pointer",
|
||||
onClick:
|
||||
(
|
||||
g
|
||||
) =>
|
||||
W(
|
||||
s
|
||||
),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["onClick"]
|
||||
),
|
||||
])
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
modelValue: p.value,
|
||||
"onUpdate:modelValue":
|
||||
e[7] ||
|
||||
(e[7] = (s) =>
|
||||
(p.value = s)),
|
||||
onKeyup:
|
||||
e[8] ||
|
||||
(e[8] = te(
|
||||
(s) => Q(),
|
||||
["enter"]
|
||||
)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
a("div", Le, [
|
||||
a(
|
||||
"div",
|
||||
Pe,
|
||||
d(l.__("Course Settings")),
|
||||
1
|
||||
),
|
||||
a("div", Me, [
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
type: "checkbox",
|
||||
modelValue:
|
||||
o.value.published,
|
||||
"onUpdate:modelValue":
|
||||
e[9] ||
|
||||
(e[9] = (s) =>
|
||||
(o.value.published =
|
||||
s)),
|
||||
label: l.__("Published"),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
type: "checkbox",
|
||||
modelValue:
|
||||
o.value.upcoming,
|
||||
"onUpdate:modelValue":
|
||||
e[10] ||
|
||||
(e[10] = (s) =>
|
||||
(o.value.upcoming =
|
||||
s)),
|
||||
label: l.__("Upcoming"),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
type: "checkbox",
|
||||
modelValue:
|
||||
o.value
|
||||
.disable_self_learning,
|
||||
"onUpdate:modelValue":
|
||||
e[11] ||
|
||||
(e[11] = (s) =>
|
||||
(o.value.disable_self_learning =
|
||||
s)),
|
||||
label: l.__(
|
||||
"Disable Self Enrollment"
|
||||
),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
]),
|
||||
]),
|
||||
a("div", Re, [
|
||||
a(
|
||||
"div",
|
||||
ze,
|
||||
d(l.__("Course Pricing")),
|
||||
1
|
||||
),
|
||||
a("div", Be, [
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
type: "checkbox",
|
||||
modelValue:
|
||||
o.value.paid_course,
|
||||
"onUpdate:modelValue":
|
||||
e[12] ||
|
||||
(e[12] = (s) =>
|
||||
(o.value.paid_course =
|
||||
s)),
|
||||
label: l.__("Paid Course"),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
]),
|
||||
n(
|
||||
i(_),
|
||||
{
|
||||
modelValue:
|
||||
o.value.course_price,
|
||||
"onUpdate:modelValue":
|
||||
e[13] ||
|
||||
(e[13] = (s) =>
|
||||
(o.value.course_price =
|
||||
s)),
|
||||
label: l.__("Course Price"),
|
||||
class: "mb-4",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
n(
|
||||
_e,
|
||||
{
|
||||
doctype: "Currency",
|
||||
modelValue: o.value.currency,
|
||||
"onUpdate:modelValue":
|
||||
e[14] ||
|
||||
(e[14] = (s) =>
|
||||
(o.value.currency = s)),
|
||||
filters: { enabled: 1 },
|
||||
label: l.__("Currency"),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue", "label"]
|
||||
),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
a("div", Ie, [
|
||||
i(t).doc
|
||||
? (b(),
|
||||
N(
|
||||
pe,
|
||||
{
|
||||
key: 0,
|
||||
courseName: i(t).doc.name,
|
||||
title: i(t).doc.title,
|
||||
allowEdit: !0,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["courseName", "title"]
|
||||
))
|
||||
: z("", !0),
|
||||
]),
|
||||
]),
|
||||
])
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
export { We as default };
|
||||
//# sourceMappingURL=CreateCourse-PkCZOpbW.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,838 +0,0 @@
|
||||
import {
|
||||
aa as N,
|
||||
ab as B,
|
||||
r as $,
|
||||
d as S,
|
||||
s as j,
|
||||
k,
|
||||
x as i,
|
||||
y,
|
||||
J as n,
|
||||
G as x,
|
||||
K as t,
|
||||
a7 as T,
|
||||
H as s,
|
||||
L as d,
|
||||
M as R,
|
||||
Q as M,
|
||||
R as E,
|
||||
F as V,
|
||||
N as F,
|
||||
a4 as D,
|
||||
aq as P,
|
||||
I,
|
||||
a as A,
|
||||
ai as G,
|
||||
D as J,
|
||||
b as K,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
import { _ as L } from "./UserAvatar-3mSOKoKa.js";
|
||||
import { a as q, t as H, c as O } from "./index-xt-hKVBz.js";
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const Q = q("ChevronLeftIcon", [
|
||||
["path", { d: "m15 18-6-6 6-6", key: "1wnfg3" }],
|
||||
]);
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const W = q("MessageSquareIcon", [
|
||||
[
|
||||
"path",
|
||||
{
|
||||
d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",
|
||||
key: "1lielz",
|
||||
},
|
||||
],
|
||||
]);
|
||||
/**
|
||||
* @license lucide-vue-next v0.309.0 - ISC
|
||||
*
|
||||
* This source code is licensed under the ISC license.
|
||||
* See the LICENSE file in the root directory of this source tree.
|
||||
*/ const X = q("MoreHorizontalIcon", [
|
||||
["circle", { cx: "12", cy: "12", r: "1", key: "41hilf" }],
|
||||
["circle", { cx: "19", cy: "12", r: "1", key: "1wjl8i" }],
|
||||
["circle", { cx: "5", cy: "12", r: "1", key: "1pcz8c" }],
|
||||
]),
|
||||
Y = { class: "mt-6" },
|
||||
Z = { key: 0, class: "flex items-center mb-5" },
|
||||
ee = { class: "text-lg font-semibold ml-2" },
|
||||
te = { class: "flex items-center justify-between mb-2" },
|
||||
se = { class: "flex items-center" },
|
||||
oe = { class: "text-sm ml-2" },
|
||||
ae = { key: 1 },
|
||||
le = { class: "flex justify-between mt-2" },
|
||||
re = s("span", null, null, -1),
|
||||
z = {
|
||||
__name: "DiscussionReplies",
|
||||
props: N(
|
||||
{
|
||||
topic: { type: Object, required: !0 },
|
||||
singleThread: { type: Boolean, default: !1 },
|
||||
},
|
||||
{ showTopics: {}, showTopicsModifiers: {} }
|
||||
),
|
||||
emits: ["update:showTopics"],
|
||||
setup(l) {
|
||||
const g = B(l, "showTopics"),
|
||||
m = $(""),
|
||||
c = S("$socket"),
|
||||
_ = S("$user"),
|
||||
p = l;
|
||||
j(() => {
|
||||
c.on("publish_message", (e) => {
|
||||
o.reload();
|
||||
}),
|
||||
c.on("update_message", (e) => {
|
||||
o.reload();
|
||||
}),
|
||||
c.on("delete_message", (e) => {
|
||||
o.reload();
|
||||
});
|
||||
});
|
||||
const o = k({
|
||||
url: "lms.lms.utils.get_discussion_replies",
|
||||
cache: ["replies", p.topic],
|
||||
makeParams(e) {
|
||||
return { topic: p.topic.name };
|
||||
},
|
||||
auto: !0,
|
||||
}),
|
||||
f = k({
|
||||
url: "frappe.client.insert",
|
||||
makeParams(e) {
|
||||
return {
|
||||
doc: {
|
||||
doctype: "Discussion Reply",
|
||||
reply: m.value,
|
||||
topic: p.topic.name,
|
||||
},
|
||||
};
|
||||
},
|
||||
}),
|
||||
h = () => {
|
||||
f.submit(
|
||||
{},
|
||||
{
|
||||
validate() {
|
||||
if (!m.value) return "Reply cannot be empty";
|
||||
},
|
||||
onSuccess() {
|
||||
(m.value = ""), o.reload();
|
||||
},
|
||||
onError(e) {
|
||||
var v;
|
||||
O({
|
||||
title: "Error",
|
||||
text:
|
||||
((v = e.messages) == null
|
||||
? void 0
|
||||
: v[0]) || e,
|
||||
icon: "x",
|
||||
iconClasses:
|
||||
"bg-red-600 text-white rounded-md p-px",
|
||||
position: "top-center",
|
||||
timeout: 10,
|
||||
});
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
r = k({
|
||||
url: "frappe.client.set_value",
|
||||
makeParams(e) {
|
||||
return {
|
||||
doctype: "Discussion Reply",
|
||||
name: e.name,
|
||||
fieldname: "reply",
|
||||
value: e.reply,
|
||||
};
|
||||
},
|
||||
}),
|
||||
b = (e) => {
|
||||
r.submit(
|
||||
{ name: e.name, reply: e.reply },
|
||||
{
|
||||
validate() {
|
||||
if (!e.reply) return "Reply cannot be empty";
|
||||
},
|
||||
onSuccess() {
|
||||
(e.editable = !1), o.reload();
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
w = k({
|
||||
url: "frappe.client.delete",
|
||||
makeParams(e) {
|
||||
return { doctype: "Discussion Reply", name: e.name };
|
||||
},
|
||||
}),
|
||||
u = (e) => {
|
||||
w.submit(
|
||||
{ name: e.name },
|
||||
{
|
||||
onSuccess() {
|
||||
o.reload();
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
return (e, v) => (
|
||||
i(),
|
||||
y("div", Y, [
|
||||
l.singleThread
|
||||
? R("", !0)
|
||||
: (i(),
|
||||
y("div", Z, [
|
||||
n(
|
||||
t(T),
|
||||
{
|
||||
variant: "outline",
|
||||
onClick:
|
||||
v[0] ||
|
||||
(v[0] = (a) => (g.value = !0)),
|
||||
},
|
||||
{
|
||||
icon: x(() => [
|
||||
n(t(Q), {
|
||||
class: "w-5 h-5 stroke-1.5 text-gray-700",
|
||||
}),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
s("span", ee, d(l.topic.title), 1),
|
||||
])),
|
||||
(i(!0),
|
||||
y(
|
||||
M,
|
||||
null,
|
||||
E(
|
||||
t(o).data,
|
||||
(a, U) => (
|
||||
i(),
|
||||
y("div", null, [
|
||||
s(
|
||||
"div",
|
||||
{
|
||||
class: I([
|
||||
"py-3",
|
||||
{
|
||||
"border-b":
|
||||
U + 1 !=
|
||||
t(o).data.length,
|
||||
},
|
||||
]),
|
||||
},
|
||||
[
|
||||
s("div", te, [
|
||||
s("div", se, [
|
||||
n(
|
||||
L,
|
||||
{
|
||||
user: a.user,
|
||||
class: "mr-2",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["user"]
|
||||
),
|
||||
s(
|
||||
"span",
|
||||
null,
|
||||
d(a.user.full_name),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"span",
|
||||
oe,
|
||||
d(t(H)(a.creation)),
|
||||
1
|
||||
),
|
||||
]),
|
||||
t(_).data.name == a.owner &&
|
||||
!a.editable
|
||||
? (i(),
|
||||
V(
|
||||
t(F),
|
||||
{
|
||||
key: 0,
|
||||
options: [
|
||||
{
|
||||
label: "Edit",
|
||||
onClick() {
|
||||
a.editable =
|
||||
!0;
|
||||
},
|
||||
},
|
||||
{
|
||||
label: "Delete",
|
||||
onClick() {
|
||||
u(
|
||||
a
|
||||
);
|
||||
},
|
||||
},
|
||||
],
|
||||
},
|
||||
{
|
||||
default: x(
|
||||
({
|
||||
open: C,
|
||||
}) => [
|
||||
n(
|
||||
t(
|
||||
X
|
||||
),
|
||||
{
|
||||
class: "w-4 h-4 stroke-1.5 cursor-pointer",
|
||||
}
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["options"]
|
||||
))
|
||||
: R("", !0),
|
||||
a.editable
|
||||
? (i(),
|
||||
y("div", ae, [
|
||||
n(
|
||||
t(T),
|
||||
{
|
||||
variant:
|
||||
"ghost",
|
||||
onClick: (
|
||||
C
|
||||
) => b(a),
|
||||
},
|
||||
{
|
||||
default: x(
|
||||
() => [
|
||||
D(
|
||||
d(
|
||||
e.__(
|
||||
"Post"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["onClick"]
|
||||
),
|
||||
n(
|
||||
t(T),
|
||||
{
|
||||
variant:
|
||||
"ghost",
|
||||
onClick: (
|
||||
C
|
||||
) =>
|
||||
(a.editable =
|
||||
!1),
|
||||
},
|
||||
{
|
||||
default: x(
|
||||
() => [
|
||||
D(
|
||||
d(
|
||||
e.__(
|
||||
"Discard"
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["onClick"]
|
||||
),
|
||||
]))
|
||||
: R("", !0),
|
||||
]),
|
||||
n(
|
||||
t(P),
|
||||
{
|
||||
content: a.reply,
|
||||
onChange: (C) =>
|
||||
(a.reply = C),
|
||||
editable: a.editable || !1,
|
||||
fixedMenu: a.editable || !1,
|
||||
editorClass: a.editable
|
||||
? "ProseMirror prose prose-table:table-fixed prose-td:p-2 prose-th:p-2 prose-td:border prose-th:border prose-td:border-gray-300 prose-th:border-gray-300 prose-td:relative prose-th:relative prose-th:bg-gray-100 prose-sm max-w-none"
|
||||
: "prose-sm",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"content",
|
||||
"onChange",
|
||||
"editable",
|
||||
"fixedMenu",
|
||||
"editorClass",
|
||||
]
|
||||
),
|
||||
],
|
||||
2
|
||||
),
|
||||
])
|
||||
)
|
||||
),
|
||||
256
|
||||
)),
|
||||
n(
|
||||
t(P),
|
||||
{
|
||||
class: "mt-5",
|
||||
content: m.value,
|
||||
onChange: v[1] || (v[1] = (a) => (m.value = a)),
|
||||
placeholder: "Type your reply here...",
|
||||
fixedMenu: !0,
|
||||
editorClass:
|
||||
"ProseMirror prose prose-table:table-fixed prose-td:p-2 prose-th:p-2 prose-td:border prose-th:border prose-td:border-gray-300 prose-th:border-gray-300 prose-td:relative prose-th:relative prose-th:bg-gray-100 prose-sm max-w-none border border-gray-300 rounded-b-md min-h-[7rem] py-1 px-2",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["content"]
|
||||
),
|
||||
s("div", le, [
|
||||
re,
|
||||
n(
|
||||
t(T),
|
||||
{ onClick: v[2] || (v[2] = (a) => h()) },
|
||||
{
|
||||
default: x(() => [
|
||||
s("span", null, d(e.__("Post")), 1),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
]),
|
||||
])
|
||||
);
|
||||
},
|
||||
},
|
||||
ne = { class: "flex flex-col gap-4" },
|
||||
ie = { class: "mb-1.5 text-sm text-gray-600" },
|
||||
de = { class: "mb-1.5 text-sm text-gray-600" },
|
||||
ce = {
|
||||
__name: "DiscussionModal",
|
||||
props: N(
|
||||
{
|
||||
title: { type: String, required: !0 },
|
||||
doctype: { type: String, required: !0 },
|
||||
docname: { type: String, required: !0 },
|
||||
},
|
||||
{ reloadTopics: {}, reloadTopicsModifiers: {} }
|
||||
),
|
||||
emits: ["update:reloadTopics"],
|
||||
setup(l) {
|
||||
const g = B(l, "reloadTopics"),
|
||||
m = l,
|
||||
c = A({ title: "", reply: "" }),
|
||||
_ = k({
|
||||
url: "frappe.client.insert",
|
||||
makeParams(f) {
|
||||
return {
|
||||
doc: {
|
||||
doctype: "Discussion Topic",
|
||||
reference_doctype: m.doctype,
|
||||
reference_docname: m.docname,
|
||||
title: c.title,
|
||||
},
|
||||
};
|
||||
},
|
||||
}),
|
||||
p = k({
|
||||
url: "frappe.client.insert",
|
||||
makeParams(f) {
|
||||
return {
|
||||
doc: {
|
||||
doctype: "Discussion Reply",
|
||||
topic: f.topic,
|
||||
reply: c.reply,
|
||||
},
|
||||
};
|
||||
},
|
||||
}),
|
||||
o = (f) => {
|
||||
_.submit(
|
||||
{},
|
||||
{
|
||||
onSuccess(h) {
|
||||
p.submit(
|
||||
{ topic: h.name },
|
||||
{
|
||||
onSuccess() {
|
||||
(c.title = ""),
|
||||
(c.reply = ""),
|
||||
g.value.reload(),
|
||||
f();
|
||||
},
|
||||
}
|
||||
);
|
||||
},
|
||||
}
|
||||
);
|
||||
};
|
||||
return (f, h) => (
|
||||
i(),
|
||||
V(
|
||||
t(J),
|
||||
{
|
||||
options: {
|
||||
title: m.title,
|
||||
size: "2xl",
|
||||
actions: [
|
||||
{
|
||||
label: "Submit",
|
||||
variant: "solid",
|
||||
onClick: (r) => o(r),
|
||||
},
|
||||
],
|
||||
},
|
||||
},
|
||||
{
|
||||
"body-content": x(() => [
|
||||
s("div", ne, [
|
||||
s("div", null, [
|
||||
s("div", ie, d(f.__("Title")), 1),
|
||||
n(
|
||||
t(G),
|
||||
{
|
||||
type: "text",
|
||||
modelValue: c.title,
|
||||
"onUpdate:modelValue":
|
||||
h[0] ||
|
||||
(h[0] = (r) => (c.title = r)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
s("div", null, [
|
||||
s("div", de, d(f.__("Details")), 1),
|
||||
n(
|
||||
t(P),
|
||||
{
|
||||
content: c.reply,
|
||||
onChange:
|
||||
h[1] ||
|
||||
(h[1] = (r) => (c.reply = r)),
|
||||
editable: !0,
|
||||
fixedMenu: !0,
|
||||
editorClass:
|
||||
"prose-sm max-w-none border-b border-x bg-gray-100 rounded-b-md py-1 px-2 min-h-[7rem]",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["content"]
|
||||
),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["options"]
|
||||
)
|
||||
);
|
||||
},
|
||||
},
|
||||
ue = { class: "text-xl font-semibold" },
|
||||
pe = { key: 0 },
|
||||
me = ["onClick"],
|
||||
ye = { class: "text-lg font-semibold mb-1" },
|
||||
fe = { class: "flex items-center" },
|
||||
he = { class: "text-sm ml-2" },
|
||||
be = { key: 1 },
|
||||
ve = { key: 1 },
|
||||
ge = { key: 2, class: "flex justify-center border mt-5 p-5 rounded-md" },
|
||||
_e = { class: "text-xl font-semibold mb-2" },
|
||||
we = {
|
||||
__name: "Discussions",
|
||||
props: {
|
||||
title: { type: String, required: !0 },
|
||||
doctype: { type: String, required: !0 },
|
||||
docname: { type: String, required: !0 },
|
||||
emptyStateTitle: { type: String, default: "No topics yet" },
|
||||
emptyStateText: {
|
||||
type: String,
|
||||
default: "Be the first to start a discussion",
|
||||
},
|
||||
singleThread: { type: Boolean, default: !1 },
|
||||
},
|
||||
setup(l) {
|
||||
const g = $(!0),
|
||||
m = $(null),
|
||||
c = S("$socket"),
|
||||
_ = $(!1),
|
||||
p = l;
|
||||
j(() => {
|
||||
c.on("new_discussion_topic", (r) => {
|
||||
o.refresh();
|
||||
});
|
||||
});
|
||||
const o = k({
|
||||
url: "lms.lms.utils.get_discussion_topics",
|
||||
cache: ["topics", p.doctype, p.docname],
|
||||
makeParams() {
|
||||
return {
|
||||
doctype: p.doctype,
|
||||
docname: p.docname,
|
||||
single_thread: p.singleThread,
|
||||
};
|
||||
},
|
||||
auto: !0,
|
||||
}),
|
||||
f = (r) => {
|
||||
(g.value = !1), (m.value = r);
|
||||
},
|
||||
h = () => {
|
||||
_.value = !0;
|
||||
};
|
||||
return (r, b) => {
|
||||
var w;
|
||||
return (
|
||||
i(),
|
||||
y(
|
||||
M,
|
||||
null,
|
||||
[
|
||||
s("div", null, [
|
||||
l.singleThread
|
||||
? R("", !0)
|
||||
: (i(),
|
||||
V(
|
||||
t(T),
|
||||
{
|
||||
key: 0,
|
||||
class: "float-right",
|
||||
onClick:
|
||||
b[0] || (b[0] = (u) => h()),
|
||||
},
|
||||
{
|
||||
default: x(() => [
|
||||
D(
|
||||
d(
|
||||
r
|
||||
.__("New {0}")
|
||||
.format(l.title)
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
}
|
||||
)),
|
||||
s("div", ue, d(r.__(l.title)), 1),
|
||||
]),
|
||||
(w = t(o).data) != null &&
|
||||
w.length &&
|
||||
!l.singleThread
|
||||
? (i(),
|
||||
y("div", pe, [
|
||||
g.value
|
||||
? (i(!0),
|
||||
y(
|
||||
M,
|
||||
{ key: 0 },
|
||||
E(
|
||||
t(o).data,
|
||||
(u, e) => (
|
||||
i(),
|
||||
y("div", null, [
|
||||
s(
|
||||
"div",
|
||||
{
|
||||
onClick:
|
||||
(
|
||||
v
|
||||
) =>
|
||||
f(
|
||||
u
|
||||
),
|
||||
class: I(
|
||||
[
|
||||
"flex items-center cursor-pointer py-5",
|
||||
{
|
||||
"border-b":
|
||||
e +
|
||||
1 !=
|
||||
t(
|
||||
o
|
||||
)
|
||||
.data
|
||||
.length,
|
||||
},
|
||||
]
|
||||
),
|
||||
},
|
||||
[
|
||||
n(
|
||||
L,
|
||||
{
|
||||
user: u.user,
|
||||
size: "2xl",
|
||||
class: "mr-4",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"user",
|
||||
]
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
[
|
||||
s(
|
||||
"div",
|
||||
ye,
|
||||
d(
|
||||
u.title
|
||||
),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
fe,
|
||||
[
|
||||
s(
|
||||
"span",
|
||||
null,
|
||||
d(
|
||||
u
|
||||
.user
|
||||
.full_name
|
||||
),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"span",
|
||||
he,
|
||||
d(
|
||||
t(
|
||||
H
|
||||
)(
|
||||
u.creation
|
||||
)
|
||||
),
|
||||
1
|
||||
),
|
||||
]
|
||||
),
|
||||
]
|
||||
),
|
||||
],
|
||||
10,
|
||||
me
|
||||
),
|
||||
])
|
||||
)
|
||||
),
|
||||
256
|
||||
))
|
||||
: (i(),
|
||||
y("div", be, [
|
||||
n(
|
||||
z,
|
||||
{
|
||||
topic: m.value,
|
||||
showTopics: g.value,
|
||||
"onUpdate:showTopics":
|
||||
b[1] ||
|
||||
(b[1] = (u) =>
|
||||
(g.value =
|
||||
u)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["topic", "showTopics"]
|
||||
),
|
||||
])),
|
||||
]))
|
||||
: l.singleThread && t(o).data
|
||||
? (i(),
|
||||
y("div", ve, [
|
||||
n(
|
||||
z,
|
||||
{
|
||||
topic: t(o).data,
|
||||
singleThread: l.singleThread,
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["topic", "singleThread"]
|
||||
),
|
||||
]))
|
||||
: (i(),
|
||||
y("div", ge, [
|
||||
n(t(W), {
|
||||
class: "w-10 h-10 stroke-1.5 text-gray-800 mr-2",
|
||||
}),
|
||||
s("div", null, [
|
||||
s(
|
||||
"div",
|
||||
_e,
|
||||
d(r.__(l.emptyStateTitle)),
|
||||
1
|
||||
),
|
||||
s(
|
||||
"div",
|
||||
null,
|
||||
d(r.__(l.emptyStateText)),
|
||||
1
|
||||
),
|
||||
]),
|
||||
])),
|
||||
n(
|
||||
ce,
|
||||
{
|
||||
modelValue: _.value,
|
||||
"onUpdate:modelValue":
|
||||
b[2] || (b[2] = (u) => (_.value = u)),
|
||||
title: r.__("New {0}").format(l.title),
|
||||
doctype: p.doctype,
|
||||
docname: p.docname,
|
||||
reloadTopics: t(o),
|
||||
"onUpdate:reloadTopics":
|
||||
b[3] ||
|
||||
(b[3] = (u) =>
|
||||
K(o) ? (o.value = u) : null),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
[
|
||||
"modelValue",
|
||||
"title",
|
||||
"doctype",
|
||||
"docname",
|
||||
"reloadTopics",
|
||||
]
|
||||
),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
};
|
||||
},
|
||||
};
|
||||
export { Q as C, we as _ };
|
||||
//# sourceMappingURL=Discussions-MQ_bdV9n.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,207 +0,0 @@
|
||||
import {
|
||||
v as f,
|
||||
aF as g,
|
||||
T as _,
|
||||
W as c,
|
||||
x as o,
|
||||
F as l,
|
||||
G as r,
|
||||
O as p,
|
||||
aG as C,
|
||||
aH as k,
|
||||
H as a,
|
||||
y as d,
|
||||
Q as u,
|
||||
R as m,
|
||||
U as h,
|
||||
I as b,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
const v = {
|
||||
name: "FontColor",
|
||||
props: ["editor"],
|
||||
components: { Popover: g, Tooltip: _ },
|
||||
methods: {
|
||||
setBackgroundColor(t) {
|
||||
t.name != "Default"
|
||||
? this.editor
|
||||
.chain()
|
||||
.focus()
|
||||
.toggleHighlight({ color: t.hex })
|
||||
.run()
|
||||
: this.editor.chain().focus().unsetHighlight().run();
|
||||
},
|
||||
setForegroundColor(t) {
|
||||
t.name != "Default"
|
||||
? this.editor.chain().focus().setColor(t.hex).run()
|
||||
: this.editor.chain().focus().unsetColor().run();
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
foregroundColors() {
|
||||
return [
|
||||
{ name: "Default", hex: "#1F272E" },
|
||||
{ name: "Yellow", hex: "#ca8a04" },
|
||||
{ name: "Orange", hex: "#ea580c" },
|
||||
{ name: "Red", hex: "#dc2626" },
|
||||
{ name: "Green", hex: "#16a34a" },
|
||||
{ name: "Blue", hex: "#1579D0" },
|
||||
{ name: "Purple", hex: "#9333ea" },
|
||||
{ name: "Pink", hex: "#db2777" },
|
||||
];
|
||||
},
|
||||
backgroundColors() {
|
||||
return [
|
||||
{ name: "Default", hex: null },
|
||||
{ name: "Yellow", hex: "#fef9c3" },
|
||||
{ name: "Orange", hex: "#ffedd5" },
|
||||
{ name: "Red", hex: "#fee2e2" },
|
||||
{ name: "Green", hex: "#dcfce7" },
|
||||
{ name: "Blue", hex: "#D3E9FC" },
|
||||
{ name: "Purple", hex: "#f3e8ff" },
|
||||
{ name: "Pink", hex: "#fce7f3" },
|
||||
];
|
||||
},
|
||||
},
|
||||
},
|
||||
y = { class: "p-2" },
|
||||
B = a("div", { class: "text-sm text-gray-700" }, "Text Color", -1),
|
||||
F = { class: "mt-1 grid grid-cols-8 gap-1" },
|
||||
P = ["aria-label", "onClick"],
|
||||
D = a(
|
||||
"div",
|
||||
{ class: "mt-2 text-sm text-gray-700" },
|
||||
"Background Color",
|
||||
-1
|
||||
),
|
||||
w = { class: "mt-1 grid grid-cols-8 gap-1" },
|
||||
T = ["aria-label", "onClick"];
|
||||
function G(t, H, R, z, A, n) {
|
||||
const i = c("Tooltip"),
|
||||
x = c("Popover");
|
||||
return (
|
||||
o(),
|
||||
l(
|
||||
x,
|
||||
{ transition: "default" },
|
||||
{
|
||||
target: r(({ togglePopover: e, isOpen: s }) => [
|
||||
p(
|
||||
t.$slots,
|
||||
"default",
|
||||
C(k({ onClick: () => e(), isActive: s }))
|
||||
),
|
||||
]),
|
||||
"body-main": r(() => [
|
||||
a("div", y, [
|
||||
B,
|
||||
a("div", F, [
|
||||
(o(!0),
|
||||
d(
|
||||
u,
|
||||
null,
|
||||
m(
|
||||
n.foregroundColors,
|
||||
(e) => (
|
||||
o(),
|
||||
l(
|
||||
i,
|
||||
{
|
||||
class: "flex",
|
||||
key: e.name,
|
||||
text: e.name,
|
||||
},
|
||||
{
|
||||
default: r(() => [
|
||||
a(
|
||||
"button",
|
||||
{
|
||||
"aria-label":
|
||||
e.name,
|
||||
class: "flex h-5 w-5 items-center justify-center rounded border text-base",
|
||||
style: h({
|
||||
color: e.hex,
|
||||
}),
|
||||
onClick: (s) =>
|
||||
n.setForegroundColor(
|
||||
e
|
||||
),
|
||||
},
|
||||
" A ",
|
||||
12,
|
||||
P
|
||||
),
|
||||
]),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["text"]
|
||||
)
|
||||
)
|
||||
),
|
||||
128
|
||||
)),
|
||||
]),
|
||||
D,
|
||||
a("div", w, [
|
||||
(o(!0),
|
||||
d(
|
||||
u,
|
||||
null,
|
||||
m(
|
||||
n.backgroundColors,
|
||||
(e) => (
|
||||
o(),
|
||||
l(
|
||||
i,
|
||||
{
|
||||
class: "flex",
|
||||
key: e.name,
|
||||
text: e.name,
|
||||
},
|
||||
{
|
||||
default: r(() => [
|
||||
a(
|
||||
"button",
|
||||
{
|
||||
"aria-label":
|
||||
e.name,
|
||||
class: b([
|
||||
"flex h-5 w-5 items-center justify-center rounded border text-base text-gray-900",
|
||||
e.hex
|
||||
? "border-transparent"
|
||||
: "border-gray-200",
|
||||
]),
|
||||
style: h({
|
||||
backgroundColor:
|
||||
e.hex,
|
||||
}),
|
||||
onClick: (s) =>
|
||||
n.setBackgroundColor(
|
||||
e
|
||||
),
|
||||
},
|
||||
" A ",
|
||||
14,
|
||||
T
|
||||
),
|
||||
]),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["text"]
|
||||
)
|
||||
)
|
||||
),
|
||||
128
|
||||
)),
|
||||
]),
|
||||
]),
|
||||
]),
|
||||
_: 3,
|
||||
}
|
||||
)
|
||||
);
|
||||
}
|
||||
const O = f(v, [["render", G]]);
|
||||
export { O as default };
|
||||
//# sourceMappingURL=FontColor-NRf-JuEv.js.map
|
||||
File diff suppressed because one or more lines are too long
@@ -1,66 +0,0 @@
|
||||
import {
|
||||
v as d,
|
||||
D as g,
|
||||
y as m,
|
||||
J as s,
|
||||
G as t,
|
||||
H as r,
|
||||
L as p,
|
||||
W as u,
|
||||
x as f,
|
||||
a4 as l,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
const D = {
|
||||
name: "Home",
|
||||
data() {
|
||||
return { showDialog: !1 };
|
||||
},
|
||||
resources: { ping: { url: "ping" } },
|
||||
components: { Dialog: g },
|
||||
},
|
||||
_ = { class: "max-w-3xl py-12 mx-auto" };
|
||||
function k(e, o, w, C, n, V) {
|
||||
const a = u("Button"),
|
||||
c = u("Dialog");
|
||||
return (
|
||||
f(),
|
||||
m("div", _, [
|
||||
s(
|
||||
a,
|
||||
{
|
||||
"icon-left": "code",
|
||||
onClick: e.$resources.ping.fetch,
|
||||
loading: e.$resources.ping.loading,
|
||||
},
|
||||
{
|
||||
default: t(() => [l(" Click to send 'ping' request ")]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["onClick", "loading"]
|
||||
),
|
||||
r("div", null, p(e.$resources.ping.data), 1),
|
||||
r("pre", null, p(e.$resources.ping), 1),
|
||||
s(
|
||||
a,
|
||||
{ onClick: o[0] || (o[0] = (i) => (n.showDialog = !0)) },
|
||||
{ default: t(() => [l("Open Dialog")]), _: 1 }
|
||||
),
|
||||
s(
|
||||
c,
|
||||
{
|
||||
title: "Title",
|
||||
modelValue: n.showDialog,
|
||||
"onUpdate:modelValue":
|
||||
o[1] || (o[1] = (i) => (n.showDialog = i)),
|
||||
},
|
||||
{ default: t(() => [l(" Dialog content ")]), _: 1 },
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
])
|
||||
);
|
||||
}
|
||||
const v = d(D, [["render", k]]);
|
||||
export { v as default };
|
||||
//# sourceMappingURL=Home-dYmUETrl.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"Home-dYmUETrl.js","sources":["../../../../frontend/src/pages/Home.vue"],"sourcesContent":["<template>\n <div class=\"max-w-3xl py-12 mx-auto\">\n <Button\n icon-left=\"code\"\n @click=\"$resources.ping.fetch\"\n :loading=\"$resources.ping.loading\"\n >\n Click to send 'ping' request\n </Button>\n <div>\n {{ $resources.ping.data }}\n </div>\n <pre>{{ $resources.ping }}</pre>\n\n <Button @click=\"showDialog = true\">Open Dialog</Button>\n <Dialog title=\"Title\" v-model=\"showDialog\"> Dialog content </Dialog>\n </div>\n</template>\n\n<script>\nimport { Dialog } from 'frappe-ui'\n\nexport default {\n name: 'Home',\n data() {\n return {\n showDialog: false,\n }\n },\n resources: {\n ping: {\n url: 'ping',\n },\n },\n components: {\n Dialog,\n },\n}\n</script>\n"],"names":["_sfc_main","Dialog","_hoisted_1","_openBlock","_createElementBlock","_createVNode","_component_Button","_ctx","_withCtx","_createTextVNode","_createElementVNode","_toDisplayString","$data","_component_Dialog","_cache","$event"],"mappings":"4GAsBA,MAAKA,EAAU,CACb,KAAM,OACN,MAAO,CACL,MAAO,CACL,WAAY,EACd,CACD,EACD,UAAW,CACT,KAAM,CACJ,IAAK,MACN,CACF,EACD,WAAY,CACV,OAAAC,CACD,CACH,EApCOC,EAAA,CAAA,MAAM,yBAAyB,4DAApC,OAAAC,EAAA,EAAAC,EAeM,MAfNF,EAeM,CAdJG,EAMSC,EAAA,CALP,YAAU,OACT,QAAOC,EAAA,WAAW,KAAK,MACvB,QAASA,EAAA,WAAW,KAAK,UALhC,QAAAC,EAMK,IAED,CARJC,EAMK,gCAED,IARJ,EAAA,4BASIC,EAEM,MADD,KAAAC,EAAAJ,EAAA,WAAW,KAAK,IAAI,EAAA,CAAA,EAEzBG,EAAgC,MAAA,KAAAC,EAAxBJ,EAAU,WAAC,IAAI,EAAA,CAAA,EAEvBF,EAAuDC,EAAA,CAA9C,uBAAOM,EAAU,WAAA,MAd9B,QAAAJ,EAcuC,IAAW,CAdlDC,EAcuC,aAAW,IAdlD,EAAA,IAeIJ,EAAoEQ,EAAA,CAA5D,MAAM,QAflB,WAemCD,EAAU,WAf7C,sBAAAE,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAemCH,EAAU,WAAAG,KAf7C,QAAAP,EAe+C,IAAgB,CAf/DC,EAe+C,kBAAgB,IAf/D,EAAA"}
|
||||
@@ -1,152 +0,0 @@
|
||||
import {
|
||||
v as f,
|
||||
a7 as I,
|
||||
D,
|
||||
aQ as h,
|
||||
W as d,
|
||||
x as m,
|
||||
y as c,
|
||||
O as _,
|
||||
aG as y,
|
||||
aH as v,
|
||||
J as n,
|
||||
G as s,
|
||||
H as i,
|
||||
L as C,
|
||||
M as w,
|
||||
a4 as u,
|
||||
Q as x,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
const b = {
|
||||
name: "InsertImage",
|
||||
props: ["editor"],
|
||||
expose: ["openDialog"],
|
||||
data() {
|
||||
return { addImageDialog: { url: "", file: null, show: !1 } };
|
||||
},
|
||||
components: { Button: I, Dialog: D },
|
||||
methods: {
|
||||
openDialog() {
|
||||
this.addImageDialog.show = !0;
|
||||
},
|
||||
onImageSelect(t) {
|
||||
let e = t.target.files[0];
|
||||
e &&
|
||||
((this.addImageDialog.file = e),
|
||||
h(e).then((r) => {
|
||||
this.addImageDialog.url = r;
|
||||
}));
|
||||
},
|
||||
addImage(t) {
|
||||
this.editor.chain().focus().setImage({ src: t }).run(),
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.addImageDialog = this.$options.data().addImageDialog;
|
||||
},
|
||||
},
|
||||
},
|
||||
k = {
|
||||
class: "relative cursor-pointer rounded-lg bg-gray-100 py-1 focus-within:bg-gray-200 hover:bg-gray-200",
|
||||
},
|
||||
B = { class: "absolute inset-0 select-none px-2 py-1 text-base" },
|
||||
S = ["src"];
|
||||
function V(t, e, r, N, a, o) {
|
||||
const g = d("Button"),
|
||||
p = d("Dialog");
|
||||
return (
|
||||
m(),
|
||||
c(
|
||||
x,
|
||||
null,
|
||||
[
|
||||
_(t.$slots, "default", y(v({ onClick: o.openDialog }))),
|
||||
n(
|
||||
p,
|
||||
{
|
||||
options: { title: "Add Image" },
|
||||
modelValue: a.addImageDialog.show,
|
||||
"onUpdate:modelValue":
|
||||
e[2] || (e[2] = (l) => (a.addImageDialog.show = l)),
|
||||
onAfterLeave: o.reset,
|
||||
},
|
||||
{
|
||||
"body-content": s(() => [
|
||||
i("label", k, [
|
||||
i(
|
||||
"input",
|
||||
{
|
||||
type: "file",
|
||||
class: "w-full opacity-0",
|
||||
onChange:
|
||||
e[0] ||
|
||||
(e[0] = (...l) =>
|
||||
o.onImageSelect &&
|
||||
o.onImageSelect(...l)),
|
||||
accept: "image/*",
|
||||
},
|
||||
null,
|
||||
32
|
||||
),
|
||||
i(
|
||||
"span",
|
||||
B,
|
||||
C(
|
||||
a.addImageDialog.file
|
||||
? "Select another image"
|
||||
: "Select an image"
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
a.addImageDialog.url
|
||||
? (m(),
|
||||
c(
|
||||
"img",
|
||||
{
|
||||
key: 0,
|
||||
src: a.addImageDialog.url,
|
||||
class: "mt-2 w-full rounded-lg",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
S
|
||||
))
|
||||
: w("", !0),
|
||||
]),
|
||||
actions: s(() => [
|
||||
n(
|
||||
g,
|
||||
{
|
||||
variant: "solid",
|
||||
onClick:
|
||||
e[1] ||
|
||||
(e[1] = (l) =>
|
||||
o.addImage(a.addImageDialog.url)),
|
||||
},
|
||||
{
|
||||
default: s(() => [u(" Insert Image ")]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
n(
|
||||
g,
|
||||
{ onClick: o.reset },
|
||||
{ default: s(() => [u(" Cancel ")]), _: 1 },
|
||||
8,
|
||||
["onClick"]
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["modelValue", "onAfterLeave"]
|
||||
),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
}
|
||||
const L = f(b, [["render", V]]);
|
||||
export { L as default };
|
||||
//# sourceMappingURL=InsertImage-CtNAKsXz.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"InsertImage-CtNAKsXz.js","sources":["../../../../frappe-ui/src/components/TextEditor/InsertImage.vue"],"sourcesContent":["<template>\n <slot v-bind=\"{ onClick: openDialog }\"></slot>\n <Dialog\n :options=\"{ title: 'Add Image' }\"\n v-model=\"addImageDialog.show\"\n @after-leave=\"reset\"\n >\n <template #body-content>\n <label\n class=\"relative cursor-pointer rounded-lg bg-gray-100 py-1 focus-within:bg-gray-200 hover:bg-gray-200\"\n >\n <input\n type=\"file\"\n class=\"w-full opacity-0\"\n @change=\"onImageSelect\"\n accept=\"image/*\"\n />\n <span class=\"absolute inset-0 select-none px-2 py-1 text-base\">\n {{ addImageDialog.file ? 'Select another image' : 'Select an image' }}\n </span>\n </label>\n <img\n v-if=\"addImageDialog.url\"\n :src=\"addImageDialog.url\"\n class=\"mt-2 w-full rounded-lg\"\n />\n </template>\n <template #actions>\n <Button variant=\"solid\" @click=\"addImage(addImageDialog.url)\">\n Insert Image\n </Button>\n <Button @click=\"reset\"> Cancel </Button>\n </template>\n </Dialog>\n</template>\n<script>\nimport fileToBase64 from '../../utils/file-to-base64'\nimport Dialog from '../Dialog.vue'\nimport Button from '../Button.vue'\n\nexport default {\n name: 'InsertImage',\n props: ['editor'],\n expose: ['openDialog'],\n data() {\n return {\n addImageDialog: { url: '', file: null, show: false },\n }\n },\n components: { Button, Dialog },\n methods: {\n openDialog() {\n this.addImageDialog.show = true\n },\n onImageSelect(e) {\n let file = e.target.files[0]\n if (!file) {\n return\n }\n this.addImageDialog.file = file\n fileToBase64(file).then((base64) => {\n this.addImageDialog.url = base64\n })\n },\n addImage(src) {\n this.editor.chain().focus().setImage({ src }).run()\n this.reset()\n },\n reset() {\n this.addImageDialog = this.$options.data().addImageDialog\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Button","Dialog","e","file","fileToBase64","base64","src","_hoisted_1","_hoisted_2","_hoisted_3","_openBlock","_createElementBlock","_Fragment","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","$options","_createVNode","_component_Dialog","$data","_cache","$event","_createElementVNode","args","_toDisplayString","_createCommentVNode","_component_Button","_withCtx","_createTextVNode"],"mappings":"4JAwCA,MAAKA,EAAU,CACb,KAAM,cACN,MAAO,CAAC,QAAQ,EAChB,OAAQ,CAAC,YAAY,EACrB,MAAO,CACL,MAAO,CACL,eAAgB,CAAE,IAAK,GAAI,KAAM,KAAM,KAAM,EAAO,CACtD,CACD,EACD,WAAY,CAAA,OAAEC,EAAQ,OAAAC,CAAQ,EAC9B,QAAS,CACP,YAAa,CACX,KAAK,eAAe,KAAO,EAC5B,EACD,cAAcC,EAAG,CACf,IAAIC,EAAOD,EAAE,OAAO,MAAM,CAAC,EACtBC,IAGL,KAAK,eAAe,KAAOA,EAC3BC,EAAaD,CAAI,EAAE,KAAME,GAAW,CAClC,KAAK,eAAe,IAAMA,EAC3B,EACF,EACD,SAASC,EAAK,CACZ,KAAK,OAAO,MAAK,EAAG,MAAK,EAAG,SAAS,CAAE,IAAAA,EAAK,EAAE,IAAI,EAClD,KAAK,MAAM,CACZ,EACD,OAAQ,CACN,KAAK,eAAiB,KAAK,SAAS,KAAM,EAAC,cAC5C,CACF,CACH,EA/DQC,EAAA,CAAA,MAAM,gGAAgG,EAQhGC,EAAA,CAAA,MAAM,kDAAkD,EAjBtEC,EAAA,CAAA,KAAA,4DAAA,OAAAC,EAAA,EAAAC,EAAAC,EAAA,KAAA,CACEC,EAA8CC,EAAA,OAAA,UADhDC,EAAAC,EAAA,CAAA,QAC2BC,EAAU,UAAA,CAAA,CAAA,CAAA,EACnCC,EA+BSC,EAAA,CA9BN,QAAS,CAAsB,MAAA,WAAA,EAHpC,WAIaC,EAAA,eAAe,KAJ5B,sBAIaC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAF,EAAA,eAAe,KAAIE,GAC3B,aAAaL,EAAK,QAER,iBACT,IAYQ,CAZRM,EAYQ,QAZRhB,EAYQ,CATNgB,EAKE,QAAA,CAJA,KAAK,OACL,MAAM,mBACL,6BAAQN,EAAa,eAAAA,EAAA,cAAA,GAAAO,CAAA,GACtB,OAAO,oBAETD,EAEO,OAFPf,EACKiB,EAAAL,EAAA,eAAe,KAAI,uBAAA,iBAAA,EAAA,CAAA,IAIlBA,EAAA,eAAe,SADvBT,EAIE,MAAA,CAzBR,IAAA,EAuBS,IAAKS,EAAc,eAAC,IACrB,MAAM,wBAxBd,EAAA,KAAA,EAAAX,CAAA,GAAAiB,EAAA,GAAA,EAAA,IA2Be,UACT,IAES,CAFTR,EAESS,EAAA,CAFD,QAAQ,QAAS,QAAON,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAL,EAAA,SAASG,EAAA,eAAe,GAAG,KA5BjE,QAAAQ,EA4BoE,IAE9D,CA9BNC,EA4BoE,gBAE9D,IA9BN,EAAA,IA+BMX,EAAwCS,EAAA,CAA/B,QAAOV,EAAK,KAAA,EAAA,CA/B3B,QAAAW,EA+B6B,IAAQ,CA/BrCC,EA+B6B,UAAQ,IA/BrC,EAAA,oBAAA,EAAA"}
|
||||
@@ -1,121 +0,0 @@
|
||||
import {
|
||||
v as d,
|
||||
a7 as g,
|
||||
ai as L,
|
||||
D as m,
|
||||
W as i,
|
||||
x as p,
|
||||
y as f,
|
||||
O as D,
|
||||
aG as c,
|
||||
aH as h,
|
||||
J as a,
|
||||
G as l,
|
||||
ay as v,
|
||||
a4 as x,
|
||||
Q as _,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
const w = {
|
||||
name: "InsertLink",
|
||||
props: ["editor"],
|
||||
components: { Button: g, Input: L, Dialog: m },
|
||||
data() {
|
||||
return { setLinkDialog: { url: "", show: !1 } };
|
||||
},
|
||||
methods: {
|
||||
openDialog() {
|
||||
let t = this.editor.getAttributes("link").href;
|
||||
t && (this.setLinkDialog.url = t), (this.setLinkDialog.show = !0);
|
||||
},
|
||||
setLink(t) {
|
||||
t === ""
|
||||
? this.editor
|
||||
.chain()
|
||||
.focus()
|
||||
.extendMarkRange("link")
|
||||
.unsetLink()
|
||||
.run()
|
||||
: this.editor
|
||||
.chain()
|
||||
.focus()
|
||||
.extendMarkRange("link")
|
||||
.setLink({ href: t })
|
||||
.run(),
|
||||
(this.setLinkDialog.show = !1),
|
||||
(this.setLinkDialog.url = "");
|
||||
},
|
||||
reset() {
|
||||
this.setLinkDialog = this.$options.data().setLinkDialog;
|
||||
},
|
||||
},
|
||||
};
|
||||
function V(t, e, y, C, n, s) {
|
||||
const r = i("FormControl"),
|
||||
u = i("Button"),
|
||||
k = i("Dialog");
|
||||
return (
|
||||
p(),
|
||||
f(
|
||||
_,
|
||||
null,
|
||||
[
|
||||
D(t.$slots, "default", c(h({ onClick: s.openDialog }))),
|
||||
a(
|
||||
k,
|
||||
{
|
||||
options: { title: "Set Link" },
|
||||
modelValue: n.setLinkDialog.show,
|
||||
"onUpdate:modelValue":
|
||||
e[3] || (e[3] = (o) => (n.setLinkDialog.show = o)),
|
||||
onAfterLeave: s.reset,
|
||||
},
|
||||
{
|
||||
"body-content": l(() => [
|
||||
a(
|
||||
r,
|
||||
{
|
||||
type: "text",
|
||||
label: "URL",
|
||||
modelValue: n.setLinkDialog.url,
|
||||
"onUpdate:modelValue":
|
||||
e[0] ||
|
||||
(e[0] = (o) =>
|
||||
(n.setLinkDialog.url = o)),
|
||||
onKeydown:
|
||||
e[1] ||
|
||||
(e[1] = v(
|
||||
(o) => s.setLink(o.target.value),
|
||||
["enter"]
|
||||
)),
|
||||
},
|
||||
null,
|
||||
8,
|
||||
["modelValue"]
|
||||
),
|
||||
]),
|
||||
actions: l(() => [
|
||||
a(
|
||||
u,
|
||||
{
|
||||
variant: "solid",
|
||||
onClick:
|
||||
e[2] ||
|
||||
(e[2] = (o) =>
|
||||
s.setLink(n.setLinkDialog.url)),
|
||||
},
|
||||
{ default: l(() => [x(" Save ")]), _: 1 }
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["modelValue", "onAfterLeave"]
|
||||
),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
}
|
||||
const R = d(w, [["render", V]]);
|
||||
export { R as default };
|
||||
//# sourceMappingURL=InsertLink-3qvgmeYz.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"InsertLink-3qvgmeYz.js","sources":["../../../../frappe-ui/src/components/TextEditor/InsertLink.vue"],"sourcesContent":["<template>\n <slot v-bind=\"{ onClick: openDialog }\"></slot>\n <Dialog\n :options=\"{ title: 'Set Link' }\"\n v-model=\"setLinkDialog.show\"\n @after-leave=\"reset\"\n >\n <template #body-content>\n <FormControl\n type=\"text\"\n label=\"URL\"\n v-model=\"setLinkDialog.url\"\n @keydown.enter=\"(e) => setLink(e.target.value)\"\n />\n </template>\n <template #actions>\n <Button variant=\"solid\" @click=\"setLink(setLinkDialog.url)\">\n Save\n </Button>\n </template>\n </Dialog>\n</template>\n<script>\nimport Dialog from '../Dialog.vue'\nimport Button from '../Button.vue'\nimport Input from '../Input.vue'\n\nexport default {\n name: 'InsertLink',\n props: ['editor'],\n components: { Button, Input, Dialog },\n data() {\n return {\n setLinkDialog: { url: '', show: false },\n }\n },\n methods: {\n openDialog() {\n let existingURL = this.editor.getAttributes('link').href\n if (existingURL) {\n this.setLinkDialog.url = existingURL\n }\n this.setLinkDialog.show = true\n },\n setLink(url) {\n // empty\n if (url === '') {\n this.editor.chain().focus().extendMarkRange('link').unsetLink().run()\n } else {\n // update link\n this.editor\n .chain()\n .focus()\n .extendMarkRange('link')\n .setLink({ href: url })\n .run()\n }\n\n this.setLinkDialog.show = false\n this.setLinkDialog.url = ''\n },\n reset() {\n this.setLinkDialog = this.$options.data().setLinkDialog\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Button","Input","Dialog","existingURL","url","_openBlock","_createElementBlock","_Fragment","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","$options","_createVNode","_component_Dialog","$data","_cache","$event","_component_FormControl","_withKeys","e","_component_Button","_withCtx","_createTextVNode"],"mappings":"oJA2BA,MAAKA,EAAU,CACb,KAAM,aACN,MAAO,CAAC,QAAQ,EAChB,WAAY,CAAEC,OAAAA,EAAQ,MAAAC,EAAO,OAAAC,CAAQ,EACrC,MAAO,CACL,MAAO,CACL,cAAe,CAAE,IAAK,GAAI,KAAM,EAAO,CACzC,CACD,EACD,QAAS,CACP,YAAa,CACX,IAAIC,EAAc,KAAK,OAAO,cAAc,MAAM,EAAE,KAChDA,IACF,KAAK,cAAc,IAAMA,GAE3B,KAAK,cAAc,KAAO,EAC3B,EACD,QAAQC,EAAK,CAEPA,IAAQ,GACV,KAAK,OAAO,MAAK,EAAG,MAAK,EAAG,gBAAgB,MAAM,EAAE,UAAW,EAAC,IAAI,EAGpE,KAAK,OACF,MAAM,EACN,MAAM,EACN,gBAAgB,MAAM,EACtB,QAAQ,CAAE,KAAMA,EAAK,EACrB,IAAI,EAGT,KAAK,cAAc,KAAO,GAC1B,KAAK,cAAc,IAAM,EAC1B,EACD,OAAQ,CACN,KAAK,cAAgB,KAAK,SAAS,KAAM,EAAC,aAC3C,CACF,CACH,+EAjEA,OAAAC,EAAA,EAAAC,EAAAC,EAAA,KAAA,CACEC,EAA8CC,EAAA,OAAA,UADhDC,EAAAC,EAAA,CAAA,QAC2BC,EAAU,UAAA,CAAA,CAAA,CAAA,EACnCC,EAkBSC,EAAA,CAjBN,QAAS,CAAqB,MAAA,UAAA,EAHnC,WAIaC,EAAA,cAAc,KAJ3B,sBAIaC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAF,EAAA,cAAc,KAAIE,GAC1B,aAAaL,EAAK,QAER,iBACT,IAKE,CALFC,EAKEK,EAAA,CAJA,KAAK,OACL,MAAM,MAVd,WAWiBH,EAAA,cAAc,IAX/B,sBAWiBC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAF,EAAA,cAAc,IAAGE,GACzB,UAAOD,EAAA,CAAA,IAAAA,EAAA,CAAA,EAZhBG,EAYyBC,GAAMR,EAAA,QAAQQ,EAAE,OAAO,KAAK,EAAA,CAAA,OAAA,CAAA,6BAGtC,UACT,IAES,CAFTP,EAESQ,EAAA,CAFD,QAAQ,QAAS,QAAOL,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAL,EAAA,QAAQG,EAAA,cAAc,GAAG,KAhB/D,QAAAO,EAgBkE,IAE5D,CAlBNC,EAgBkE,QAE5D,IAlBN,EAAA,MAAA,EAAA"}
|
||||
@@ -1,201 +0,0 @@
|
||||
import {
|
||||
v as _,
|
||||
a7 as v,
|
||||
D as C,
|
||||
ax as k,
|
||||
W as r,
|
||||
x as u,
|
||||
y as c,
|
||||
O as h,
|
||||
aG as x,
|
||||
aH as y,
|
||||
J as a,
|
||||
G as l,
|
||||
H as B,
|
||||
a4 as n,
|
||||
L as w,
|
||||
F as U,
|
||||
M as p,
|
||||
Q as F,
|
||||
} from "./frappe-ui-n1bXVQkV.js";
|
||||
const I = {
|
||||
name: "InsertImage",
|
||||
props: ["editor"],
|
||||
expose: ["openDialog"],
|
||||
data() {
|
||||
return { addVideoDialog: { url: "", file: null, show: !1 } };
|
||||
},
|
||||
components: { Button: v, Dialog: C, FileUploader: k },
|
||||
methods: {
|
||||
openDialog() {
|
||||
this.addVideoDialog.show = !0;
|
||||
},
|
||||
onVideoSelect(i) {
|
||||
let o = i.target.files[0];
|
||||
o && (this.addVideoDialog.file = o);
|
||||
},
|
||||
addVideo(i) {
|
||||
this.editor
|
||||
.chain()
|
||||
.focus()
|
||||
.insertContent(`<video src="${i}"></video>`)
|
||||
.run(),
|
||||
this.reset();
|
||||
},
|
||||
reset() {
|
||||
this.addVideoDialog = this.$options.data().addVideoDialog;
|
||||
},
|
||||
},
|
||||
},
|
||||
N = { class: "flex items-center space-x-2" },
|
||||
S = ["src"];
|
||||
function A(i, o, L, G, e, t) {
|
||||
const s = r("Button"),
|
||||
V = r("FileUploader"),
|
||||
g = r("Dialog");
|
||||
return (
|
||||
u(),
|
||||
c(
|
||||
F,
|
||||
null,
|
||||
[
|
||||
h(i.$slots, "default", x(y({ onClick: t.openDialog }))),
|
||||
a(
|
||||
g,
|
||||
{
|
||||
options: { title: "Add Video" },
|
||||
modelValue: e.addVideoDialog.show,
|
||||
"onUpdate:modelValue":
|
||||
o[2] || (o[2] = (d) => (e.addVideoDialog.show = d)),
|
||||
onAfterLeave: t.reset,
|
||||
},
|
||||
{
|
||||
"body-content": l(() => [
|
||||
a(
|
||||
V,
|
||||
{
|
||||
"file-types": "video/*",
|
||||
onSuccess:
|
||||
o[0] ||
|
||||
(o[0] = (d) =>
|
||||
(e.addVideoDialog.url =
|
||||
d.file_url)),
|
||||
},
|
||||
{
|
||||
default: l(
|
||||
({
|
||||
file: d,
|
||||
progress: f,
|
||||
uploading: m,
|
||||
openFileSelector: D,
|
||||
}) => [
|
||||
B("div", N, [
|
||||
a(
|
||||
s,
|
||||
{ onClick: D },
|
||||
{
|
||||
default: l(() => [
|
||||
n(
|
||||
w(
|
||||
m
|
||||
? `Uploading ${f}%`
|
||||
: e
|
||||
.addVideoDialog
|
||||
.url
|
||||
? "Change Video"
|
||||
: "Upload Video"
|
||||
),
|
||||
1
|
||||
),
|
||||
]),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["onClick"]
|
||||
),
|
||||
e.addVideoDialog.url
|
||||
? (u(),
|
||||
U(
|
||||
s,
|
||||
{
|
||||
key: 0,
|
||||
onClick: () => {
|
||||
(e.addVideoDialog.url =
|
||||
null),
|
||||
(e.addVideoDialog.file =
|
||||
null);
|
||||
},
|
||||
},
|
||||
{
|
||||
default: l(
|
||||
() => [
|
||||
n(
|
||||
" Remove "
|
||||
),
|
||||
]
|
||||
),
|
||||
_: 2,
|
||||
},
|
||||
1032,
|
||||
["onClick"]
|
||||
))
|
||||
: p("", !0),
|
||||
]),
|
||||
]
|
||||
),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
e.addVideoDialog.url
|
||||
? (u(),
|
||||
c(
|
||||
"video",
|
||||
{
|
||||
key: 0,
|
||||
src: e.addVideoDialog.url,
|
||||
class: "mt-2 w-full rounded-lg",
|
||||
type: "video/mp4",
|
||||
controls: "",
|
||||
},
|
||||
null,
|
||||
8,
|
||||
S
|
||||
))
|
||||
: p("", !0),
|
||||
]),
|
||||
actions: l(() => [
|
||||
a(
|
||||
s,
|
||||
{
|
||||
variant: "solid",
|
||||
onClick:
|
||||
o[1] ||
|
||||
(o[1] = (d) =>
|
||||
t.addVideo(e.addVideoDialog.url)),
|
||||
},
|
||||
{
|
||||
default: l(() => [n(" Insert Video ")]),
|
||||
_: 1,
|
||||
}
|
||||
),
|
||||
a(
|
||||
s,
|
||||
{ onClick: t.reset },
|
||||
{ default: l(() => [n("Cancel")]), _: 1 },
|
||||
8,
|
||||
["onClick"]
|
||||
),
|
||||
]),
|
||||
_: 1,
|
||||
},
|
||||
8,
|
||||
["modelValue", "onAfterLeave"]
|
||||
),
|
||||
],
|
||||
64
|
||||
)
|
||||
);
|
||||
}
|
||||
const P = _(I, [["render", A]]);
|
||||
export { P as default };
|
||||
//# sourceMappingURL=InsertVideo-BLJom6bq.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"InsertVideo-BLJom6bq.js","sources":["../../../../frappe-ui/src/components/TextEditor/InsertVideo.vue"],"sourcesContent":["<template>\n <slot v-bind=\"{ onClick: openDialog }\"></slot>\n <Dialog\n :options=\"{ title: 'Add Video' }\"\n v-model=\"addVideoDialog.show\"\n @after-leave=\"reset\"\n >\n <template #body-content>\n <FileUploader\n file-types=\"video/*\"\n @success=\"(file) => (addVideoDialog.url = file.file_url)\"\n >\n <template v-slot=\"{ file, progress, uploading, openFileSelector }\">\n <div class=\"flex items-center space-x-2\">\n <Button @click=\"openFileSelector\">\n {{\n uploading\n ? `Uploading ${progress}%`\n : addVideoDialog.url\n ? 'Change Video'\n : 'Upload Video'\n }}\n </Button>\n <Button\n v-if=\"addVideoDialog.url\"\n @click=\"\n () => {\n addVideoDialog.url = null\n addVideoDialog.file = null\n }\n \"\n >\n Remove\n </Button>\n </div>\n </template>\n </FileUploader>\n <video\n v-if=\"addVideoDialog.url\"\n :src=\"addVideoDialog.url\"\n class=\"mt-2 w-full rounded-lg\"\n type=\"video/mp4\"\n controls\n />\n </template>\n <template #actions>\n <Button variant=\"solid\" @click=\"addVideo(addVideoDialog.url)\">\n Insert Video\n </Button>\n <Button @click=\"reset\">Cancel</Button>\n </template>\n </Dialog>\n</template>\n<script>\nimport Button from '../Button.vue'\nimport Dialog from '../Dialog.vue'\nimport FileUploader from '../FileUploader.vue'\n\nexport default {\n name: 'InsertImage',\n props: ['editor'],\n expose: ['openDialog'],\n data() {\n return {\n addVideoDialog: { url: '', file: null, show: false },\n }\n },\n components: { Button, Dialog, FileUploader },\n methods: {\n openDialog() {\n this.addVideoDialog.show = true\n },\n onVideoSelect(e) {\n let file = e.target.files[0]\n if (!file) {\n return\n }\n this.addVideoDialog.file = file\n },\n\n addVideo(src) {\n this.editor\n .chain()\n .focus()\n .insertContent(`<video src=\"${src}\"></video>`)\n .run()\n this.reset()\n },\n reset() {\n this.addVideoDialog = this.$options.data().addVideoDialog\n },\n },\n}\n</script>\n"],"names":["_sfc_main","Button","Dialog","FileUploader","e","file","src","_hoisted_1","_hoisted_2","_openBlock","_createElementBlock","_Fragment","_renderSlot","_ctx","_normalizeProps","_guardReactiveProps","$options","_createVNode","_component_Dialog","$data","_cache","$event","_component_FileUploader","_withCtx","progress","uploading","openFileSelector","_createElementVNode","_component_Button","_createTextVNode","_toDisplayString","_createBlock","_createCommentVNode"],"mappings":"wKA0DA,MAAKA,EAAU,CACb,KAAM,cACN,MAAO,CAAC,QAAQ,EAChB,OAAQ,CAAC,YAAY,EACrB,MAAO,CACL,MAAO,CACL,eAAgB,CAAE,IAAK,GAAI,KAAM,KAAM,KAAM,EAAO,CACtD,CACD,EACD,WAAY,CAAEC,OAAAA,EAAQ,OAAAC,EAAQ,aAAAC,CAAc,EAC5C,QAAS,CACP,YAAa,CACX,KAAK,eAAe,KAAO,EAC5B,EACD,cAAcC,EAAG,CACf,IAAIC,EAAOD,EAAE,OAAO,MAAM,CAAC,EACtBC,IAGL,KAAK,eAAe,KAAOA,EAC5B,EAED,SAASC,EAAK,CACZ,KAAK,OACF,MAAM,EACN,MAAM,EACN,cAAc,eAAeA,CAAG,YAAY,EAC5C,IAAI,EACP,KAAK,MAAM,CACZ,EACD,OAAQ,CACN,KAAK,eAAiB,KAAK,SAAS,KAAM,EAAC,cAC5C,CACF,CACH,EA/EeC,EAAA,CAAA,MAAM,6BAA6B,EAblDC,EAAA,CAAA,KAAA,gFAAA,OAAAC,EAAA,EAAAC,EAAAC,EAAA,KAAA,CACEC,EAA8CC,EAAA,OAAA,UADhDC,EAAAC,EAAA,CAAA,QAC2BC,EAAU,UAAA,CAAA,CAAA,CAAA,EACnCC,EAiDSC,EAAA,CAhDN,QAAS,CAAsB,MAAA,WAAA,EAHpC,WAIaC,EAAA,eAAe,KAJ5B,sBAIaC,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAF,EAAA,eAAe,KAAIE,GAC3B,aAAaL,EAAK,QAER,iBACT,IA4Be,CA5BfC,EA4BeK,EAAA,CA3Bb,aAAW,UACV,UAAOF,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAGf,GAAUc,EAAA,eAAe,IAAMd,EAAK,YAVvD,QAaUkB,EAAA,CAqBM,CAtBY,KAAAlB,EAAM,SAAAmB,EAAU,UAAAC,EAAW,iBAAAC,KAAgB,CAC7DC,EAqBM,MArBNpB,EAqBM,CApBJU,EAQSW,EAAA,CARA,QAAOF,CAAgB,EAAA,CAd5C,QAAAH,EAec,IAME,CArBhBM,EAAAC,EAgBgBL,eAA2CD,CAAQ,IAAwBL,EAAA,eAAe,wCAhB1G,EAAA,qBAwBoBA,EAAA,eAAe,SADvBY,EAUSH,EAAA,CAjCrB,IAAA,EAyBe,aAAkDT,EAAA,eAAe,IAAG,KAA0BA,EAAA,eAAe,KAAI,QAzBhI,QAAAI,EA+Ba,IAED,CAjCZM,EA+Ba,UAED,IAjCZ,EAAA,sBAAAG,EAAA,GAAA,EAAA,MAAA,EAAA,IAsCcb,EAAA,eAAe,SADvBT,EAME,QAAA,CA3CR,IAAA,EAuCS,IAAKS,EAAc,eAAC,IACrB,MAAM,yBACN,KAAK,YACL,SAAA,EA1CR,EAAA,KAAA,EAAAX,CAAA,GAAAwB,EAAA,GAAA,EAAA,IA6Ce,UACT,IAES,CAFTf,EAESW,EAAA,CAFD,QAAQ,QAAS,QAAOR,EAAA,CAAA,IAAAA,EAAA,CAAA,EAAAC,GAAAL,EAAA,SAASG,EAAA,eAAe,GAAG,KA9CjE,QAAAI,EA8CoE,IAE9D,CAhDNM,EA8CoE,gBAE9D,IAhDN,EAAA,IAiDMZ,EAAsCW,EAAA,CAA7B,QAAOZ,EAAK,KAAA,EAAA,CAjD3B,QAAAO,EAiD6B,IAAM,CAjDnCM,EAiD6B,QAAM,IAjDnC,EAAA,oBAAA,EAAA"}
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user