feat: Embedding Cloudflare Stream

This commit is contained in:
safe user
2025-04-25 09:28:44 +00:00
12 changed files with 262 additions and 126 deletions

View File

@@ -9,18 +9,19 @@
"field_order": [
"job_title",
"location",
"disabled",
"country",
"column_break_5",
"type",
"status",
"disabled",
"section_break_6",
"description",
"company_details_section",
"company_name",
"company_website",
"column_break_11",
"column_break_phkm",
"company_logo",
"company_email_address"
"company_email_address",
"company_details_section",
"description"
],
"fields": [
{
@@ -36,7 +37,7 @@
"fieldtype": "Data",
"in_list_view": 1,
"in_standard_filter": 1,
"label": "Location",
"label": "City",
"reqd": 1
},
{
@@ -62,7 +63,8 @@
},
{
"fieldname": "section_break_6",
"fieldtype": "Section Break"
"fieldtype": "Section Break",
"label": "Company Details"
},
{
"fieldname": "description",
@@ -72,8 +74,7 @@
},
{
"fieldname": "company_details_section",
"fieldtype": "Section Break",
"label": "Company Details"
"fieldtype": "Section Break"
},
{
"fieldname": "company_name",
@@ -89,10 +90,6 @@
"label": "Company Website",
"reqd": 1
},
{
"fieldname": "column_break_11",
"fieldtype": "Column Break"
},
{
"fieldname": "company_logo",
"fieldtype": "Attach Image",
@@ -111,13 +108,30 @@
"label": "Company Email Address",
"options": "Email",
"reqd": 1
},
{
"fieldname": "column_break_phkm",
"fieldtype": "Column Break"
},
{
"fieldname": "country",
"fieldtype": "Link",
"label": "Country",
"options": "Country",
"reqd": 1
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"links": [
{
"link_doctype": "LMS Job Application",
"link_fieldname": "job"
}
],
"make_attachments_public": 1,
"modified": "2025-01-17 12:38:57.134919",
"modified_by": "Administrator",
"modified": "2025-04-24 14:34:35.920242",
"modified_by": "sayali@frappe.io",
"module": "Job",
"name": "Job Opportunity",
"owner": "Administrator",
@@ -157,8 +171,9 @@
"write": 1
}
],
"row_format": "Dynamic",
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "job_title"
}
}

View File

@@ -281,6 +281,7 @@ def get_job_details(job):
[
"job_title",
"location",
"country",
"type",
"company_name",
"company_logo",
@@ -306,14 +307,20 @@ def get_job_opportunities(filters=None, orFilters=None):
fields=[
"job_title",
"location",
"country",
"type",
"company_name",
"company_logo",
"name",
"creation",
"description",
],
order_by="creation desc",
)
for job in jobs:
job.description = frappe.utils.strip_html_tags(job.description)
job.applicants = frappe.db.count("LMS Job Application", {"job": job.name})
return jobs

View File

@@ -91,7 +91,7 @@
"fetch_from": "member.username",
"fieldname": "member_username",
"fieldtype": "Data",
"label": "Memeber Username",
"label": "Member Username",
"read_only": 1
},
{
@@ -145,10 +145,11 @@
"options": "LMS Certificate"
}
],
"grid_page_length": 50,
"index_web_pages_for_search": 1,
"links": [],
"modified": "2025-02-21 17:11:37.986157",
"modified_by": "Administrator",
"modified": "2025-04-25 10:06:25.824119",
"modified_by": "sayali@frappe.io",
"module": "LMS",
"name": "LMS Enrollment",
"owner": "Administrator",
@@ -192,10 +193,11 @@
}
],
"quick_entry": 1,
"row_format": "Dynamic",
"show_title_field_in_link": 1,
"sort_field": "modified",
"sort_order": "DESC",
"states": [],
"title_field": "member_name",
"track_changes": 1
}
}

View File

@@ -3,7 +3,7 @@ msgstr ""
"Project-Id-Version: frappe\n"
"Report-Msgid-Bugs-To: jannat@frappe.io\n"
"POT-Creation-Date: 2025-04-18 16:04+0000\n"
"PO-Revision-Date: 2025-04-21 06:38\n"
"PO-Revision-Date: 2025-04-24 08:07\n"
"Last-Translator: jannat@frappe.io\n"
"Language-Team: Chinese Simplified\n"
"MIME-Version: 1.0\n"
@@ -465,7 +465,7 @@ msgstr "作业标题"
#: frontend/src/components/Modals/AssignmentForm.vue:112
msgid "Assignment created successfully"
msgstr ""
msgstr "作业创建成功"
#: lms/lms/doctype/lms_assignment_submission/lms_assignment_submission.py:24
msgid "Assignment for Lesson {0} by {1} already exists."
@@ -473,7 +473,7 @@ msgstr "学员{1}的课时{0}作业已存在。"
#: frontend/src/components/Modals/AssignmentForm.vue:129
msgid "Assignment updated successfully"
msgstr ""
msgstr "作业更新成功"
#. Description of the 'Question' (Small Text) field in DocType 'Course Lesson'
#: lms/lms/doctype/course_lesson/course_lesson.json
@@ -831,7 +831,7 @@ msgstr "已认证"
#: frontend/src/pages/CertifiedParticipants.vue:196
#: frontend/src/pages/CertifiedParticipants.vue:203
msgid "Certified Members"
msgstr ""
msgstr "认证成员"
#. Label of the certified_participants (Check) field in DocType 'LMS Settings'
#: lms/lms/doctype/lms_settings/lms_settings.json lms/www/lms.py:290
@@ -1458,7 +1458,7 @@ msgstr "新建试题"
#: frontend/src/components/Modals/AssignmentForm.vue:7
msgid "Create an Assignment"
msgstr ""
msgstr "创建作业"
#: frontend/src/components/AppSidebar.vue:460
msgid "Create your first batch"
@@ -1754,7 +1754,7 @@ msgstr "编辑"
#: frontend/src/components/Modals/AssignmentForm.vue:8
msgid "Edit Assignment"
msgstr ""
msgstr "编辑作业"
#: frontend/src/components/CourseOutline.vue:52
#: frontend/src/components/Modals/ChapterModal.vue:5
@@ -3584,11 +3584,11 @@ msgstr "无证书"
#: frontend/src/pages/CertifiedParticipants.vue:110
msgid "No certified members"
msgstr ""
msgstr "无认证成员"
#: frontend/src/pages/CertifiedParticipants.vue:114
msgid "No certified members found. Please check again later or get certified yourself."
msgstr ""
msgstr "未找到认证成员,请稍后再试或自行申请认证。"
#: frontend/src/components/BatchCourses.vue:67
msgid "No courses added"
@@ -4077,11 +4077,11 @@ msgstr "请输入答案"
#: lms/lms/doctype/lms_batch/lms_batch.py:58
msgid "Please install the Payments App to create a paid batch. Refer to the documentation for more details. {0}"
msgstr ""
msgstr "请安装支付应用以创建付费班级,详情请参阅文档{0}"
#: lms/lms/doctype/lms_course/lms_course.py:55
msgid "Please install the Payments App to create a paid course. Refer to the documentation for more details. {0}"
msgstr ""
msgstr "请安装支付应用以创建付费课程,详情请参阅文档{0}"
#: frontend/src/pages/Billing.vue:254
msgid "Please let us know where you heard about us from."
@@ -4184,7 +4184,7 @@ msgstr "发布于"
#: frontend/src/components/AppSidebar.vue:92
msgid "Powered by Learning"
msgstr ""
msgstr "技术支持:学习平台"
#. Name of a DocType
#: lms/lms/doctype/preferred_function/preferred_function.json
@@ -5135,7 +5135,7 @@ msgstr "提交列表"
#: frontend/src/components/Modals/AssignmentForm.vue:30
msgid "Submission Type"
msgstr ""
msgstr "提交类型"
#: frontend/src/components/Assignment.vue:13
#: frontend/src/components/Assignment.vue:16
@@ -6139,7 +6139,7 @@ msgstr "证书"
#: frontend/src/pages/CertifiedParticipants.vue:21
msgid "certified members"
msgstr ""
msgstr "认证成员"
#: frontend/src/pages/Lesson.vue:178
msgid "completed"

View File

@@ -101,4 +101,5 @@ lms.patches.v2_0.allow_guest_access #05-02-2025
lms.patches.v2_0.migrate_batch_student_data #10-02-2025
lms.patches.v2_0.delete_old_enrollment_doctypes
lms.patches.v2_0.delete_unused_custom_fields
lms.patches.v2_0.update_certificate_request_status
lms.patches.v2_0.update_certificate_request_status
lms.patches.v2_0.update_job_city_and_country

View File

@@ -0,0 +1,28 @@
import frappe
def execute():
jobs = frappe.get_all("Job Opportunity", fields=["name", "location"])
for job in jobs:
if "," in job.location:
city, country = job.location.split(",", 1)
city = city.strip()
country = country.strip()
save_country(country, job)
frappe.db.set_value("Job Opportunity", job.name, "location", city)
else:
save_country(job.location, job)
def save_country(country, job):
if frappe.db.exists("Country", country):
frappe.db.set_value("Job Opportunity", job.name, "country", country)
else:
country_mapping = {
"US": "United States",
"USA": "United States",
"UAE": "United Arab Emirates",
}
country = country_mapping.get(country, country)
frappe.db.set_value("Job Opportunity", job.name, "country", country)