mirror of
https://github.com/frappe/lms.git
synced 2026-05-02 13:39:31 +03:00
@@ -29,14 +29,12 @@
|
|||||||
:label="__('Date')"
|
:label="__('Date')"
|
||||||
:required="true"
|
:required="true"
|
||||||
/>
|
/>
|
||||||
<Tooltip :text="__('Duration of the live class in minutes')">
|
<FormControl
|
||||||
<FormControl
|
type="number"
|
||||||
type="number"
|
v-model="liveClass.duration"
|
||||||
v-model="liveClass.duration"
|
:label="__('Duration (in minutes)')"
|
||||||
:label="__('Duration')"
|
:required="true"
|
||||||
:required="true"
|
/>
|
||||||
/>
|
|
||||||
</Tooltip>
|
|
||||||
</div>
|
</div>
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<Tooltip
|
<Tooltip
|
||||||
@@ -186,6 +184,7 @@ const submitLiveClass = (close) => {
|
|||||||
},
|
},
|
||||||
onError(err) {
|
onError(err) {
|
||||||
toast.error(err.messages?.[0] || err)
|
toast.error(err.messages?.[0] || err)
|
||||||
|
console.error(err)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -64,13 +64,13 @@
|
|||||||
</template>
|
</template>
|
||||||
</Dropdown>
|
</Dropdown>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center mb-3">
|
<div class="flex items-center mb-2">
|
||||||
<Calendar class="w-4 h-4 stroke-1.5" />
|
<Calendar class="w-4 h-4 stroke-1.5" />
|
||||||
<span class="ml-2">
|
<span class="ml-2">
|
||||||
{{ dayjs(evl.date).format('DD MMMM YYYY') }}
|
{{ dayjs(evl.date).format('DD MMMM YYYY') }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="flex items-center mb-3">
|
<div class="flex items-center mb-2">
|
||||||
<Clock class="w-4 h-4 stroke-1.5" />
|
<Clock class="w-4 h-4 stroke-1.5" />
|
||||||
<span class="ml-2">
|
<span class="ml-2">
|
||||||
{{ formatTime(evl.start_time) }}
|
{{ formatTime(evl.start_time) }}
|
||||||
|
|||||||
@@ -419,9 +419,16 @@ watch(
|
|||||||
() => batchDetail.doc,
|
() => batchDetail.doc,
|
||||||
() => {
|
() => {
|
||||||
if (!batchDetail.doc) return
|
if (!batchDetail.doc) return
|
||||||
getMetaInfo('batches', batchDetail.doc?.name, meta)
|
|
||||||
|
if (originalDoc.value) {
|
||||||
|
isDirty.value =
|
||||||
|
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
|
||||||
|
}
|
||||||
|
|
||||||
updateBatchData()
|
updateBatchData()
|
||||||
}
|
getMetaInfo('batches', batchDetail.doc?.name, meta)
|
||||||
|
},
|
||||||
|
{ deep: true }
|
||||||
)
|
)
|
||||||
|
|
||||||
const updateBatchData = () => {
|
const updateBatchData = () => {
|
||||||
@@ -499,17 +506,6 @@ const updateBatch = () => {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
watch(
|
|
||||||
() => batchDetail.doc,
|
|
||||||
() => {
|
|
||||||
if (originalDoc.value) {
|
|
||||||
isDirty.value =
|
|
||||||
JSON.stringify(batchDetail.doc) !== JSON.stringify(originalDoc.value)
|
|
||||||
}
|
|
||||||
},
|
|
||||||
{ deep: true }
|
|
||||||
)
|
|
||||||
|
|
||||||
const deleteBatch = () => {
|
const deleteBatch = () => {
|
||||||
$dialog({
|
$dialog({
|
||||||
title: __('Confirm your action to delete'),
|
title: __('Confirm your action to delete'),
|
||||||
|
|||||||
@@ -180,10 +180,12 @@ const onInstructorCreated = (user: any) => {
|
|||||||
|
|
||||||
const validateFields = () => {
|
const validateFields = () => {
|
||||||
batch.value.description = sanitizeHTML(batch.value.description)
|
batch.value.description = sanitizeHTML(batch.value.description)
|
||||||
|
batch.value.batch_details = sanitizeHTML(batch.value.batch_details)
|
||||||
|
|
||||||
Object.keys(batch.value).forEach((key) => {
|
Object.keys(batch.value).forEach((key) => {
|
||||||
if (
|
if (
|
||||||
key != 'description' &&
|
key != 'description' &&
|
||||||
|
key != 'batch_details' &&
|
||||||
typeof batch.value[key as keyof Batch] === 'string'
|
typeof batch.value[key as keyof Batch] === 'string'
|
||||||
) {
|
) {
|
||||||
batch.value[key as keyof Batch] = escapeHTML(
|
batch.value[key as keyof Batch] = escapeHTML(
|
||||||
|
|||||||
@@ -149,6 +149,7 @@ import {
|
|||||||
createResource,
|
createResource,
|
||||||
TabButtons,
|
TabButtons,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
toast,
|
||||||
usePageMeta,
|
usePageMeta,
|
||||||
} from 'frappe-ui'
|
} from 'frappe-ui'
|
||||||
import { computed, inject, watch, ref, onMounted, watchEffect } from 'vue'
|
import { computed, inject, watch, ref, onMounted, watchEffect } from 'vue'
|
||||||
@@ -279,11 +280,17 @@ const getTabButtons = () => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const reloadUser = () => {
|
const reloadUser = () => {
|
||||||
call('frappe.sessions.clear').then(() => {
|
call('frappe.sessions.clear')
|
||||||
$user.reload().then(() => {
|
.then(() => {
|
||||||
profile.reload()
|
$user.reload().then(() => {
|
||||||
|
profile.reload()
|
||||||
|
toast.success(__('Session refreshed successfully'))
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
toast.error(__('Failed to refresh session'))
|
||||||
|
console.error(err)
|
||||||
})
|
})
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const navigateTo = (url) => {
|
const navigateTo = (url) => {
|
||||||
|
|||||||
+19
-3
@@ -7,6 +7,7 @@ def after_install():
|
|||||||
create_batch_source()
|
create_batch_source()
|
||||||
give_discussions_permission()
|
give_discussions_permission()
|
||||||
give_user_list_permission()
|
give_user_list_permission()
|
||||||
|
give_event_permission()
|
||||||
|
|
||||||
|
|
||||||
def after_sync():
|
def after_sync():
|
||||||
@@ -189,8 +190,22 @@ def give_user_list_permission():
|
|||||||
create_role(doctype, "System Manager", 1)
|
create_role(doctype, "System Manager", 1)
|
||||||
|
|
||||||
|
|
||||||
def create_role(doctype, role, permlevel):
|
def give_event_permission():
|
||||||
|
doctype = "Event"
|
||||||
|
roles = ["Moderator", "Batch Evaluator"]
|
||||||
|
for role in roles:
|
||||||
|
permlevel = 0
|
||||||
|
create_role(doctype, role, permlevel, 1, 1)
|
||||||
|
create_role(doctype, "System Manager", 0, 1, 1)
|
||||||
|
|
||||||
|
|
||||||
|
def create_role(doctype, role, permlevel, write=0, create=0):
|
||||||
if not frappe.db.exists("Custom DocPerm", {"parent": doctype, "role": role, "permlevel": permlevel}):
|
if not frappe.db.exists("Custom DocPerm", {"parent": doctype, "role": role, "permlevel": permlevel}):
|
||||||
|
if not write and not create:
|
||||||
|
if role in ["Moderator", "System Manager"]:
|
||||||
|
write = 1
|
||||||
|
if role == "Moderator":
|
||||||
|
create = 1
|
||||||
doc = frappe.new_doc("Custom DocPerm")
|
doc = frappe.new_doc("Custom DocPerm")
|
||||||
doc.update(
|
doc.update(
|
||||||
{
|
{
|
||||||
@@ -198,8 +213,9 @@ def create_role(doctype, role, permlevel):
|
|||||||
"parent": doctype,
|
"parent": doctype,
|
||||||
"role": role,
|
"role": role,
|
||||||
"read": 1,
|
"read": 1,
|
||||||
"write": 1 if role in ["Moderator", "System Manager"] else 0,
|
"select": 1,
|
||||||
"create": 1 if role == "Moderator" else 0,
|
"write": write,
|
||||||
|
"create": create,
|
||||||
"permlevel": permlevel,
|
"permlevel": permlevel,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -445,7 +445,7 @@
|
|||||||
"label": "Contact Us URL"
|
"label": "Contact Us URL"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"default": "0",
|
"default": "1",
|
||||||
"fieldname": "certifications",
|
"fieldname": "certifications",
|
||||||
"fieldtype": "Check",
|
"fieldtype": "Check",
|
||||||
"label": "Certifications"
|
"label": "Certifications"
|
||||||
@@ -512,7 +512,7 @@
|
|||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2026-03-10 18:18:51.733955",
|
"modified": "2026-03-18 15:32:56.259783",
|
||||||
"modified_by": "sayali@frappe.io",
|
"modified_by": "sayali@frappe.io",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Settings",
|
"name": "LMS Settings",
|
||||||
|
|||||||
+2
-1
@@ -121,4 +121,5 @@ lms.patches.v2_0.give_user_list_permission #11-02-2026
|
|||||||
lms.patches.v2_0.rename_badge_assignment_event
|
lms.patches.v2_0.rename_badge_assignment_event
|
||||||
lms.patches.v2_0.enable_allow_job_posting
|
lms.patches.v2_0.enable_allow_job_posting
|
||||||
lms.patches.v2_0.set_conferencing_provider_for_zoom
|
lms.patches.v2_0.set_conferencing_provider_for_zoom
|
||||||
lms.patches.v2_0.sync_evaluator_roles
|
lms.patches.v2_0.sync_evaluator_roles
|
||||||
|
lms.patches.v2_0.give_event_permission #10-03-2026
|
||||||
@@ -0,0 +1,5 @@
|
|||||||
|
from lms.install import give_event_permission
|
||||||
|
|
||||||
|
|
||||||
|
def execute():
|
||||||
|
give_event_permission()
|
||||||
Reference in New Issue
Block a user