fix: batch ui and ux

This commit is contained in:
Jannat Patel
2023-08-29 09:55:40 +05:30
parent cd82527ef3
commit b940ddca25
33 changed files with 341 additions and 222 deletions

View File

@@ -29,8 +29,8 @@
{% endif %}
</div>
<div class="vertically-center small">
<a class="dark-links" href="/classes">
{{ _("All Classes") }}
<a class="dark-links" href="/batches">
{{ _("All Batches") }}
</a>
<img class="icon icon-sm mr-0" src="/assets/lms/icons/chevron-right.svg">
<span class="breadcrumb-destination">{{ _("Assignment Submission") }}</span>
@@ -51,13 +51,18 @@
{% macro SubmissionForm(assignment) %}
<article class="field-parent">
{% if submission.name and is_moderator %}
<div class="field-group">
<div class="field-label">
{{ _("Student Name") }}
{% if submission.name %}
<div class="alert alert-info">
{{ _("You've successfully submitted the assignment. Once the moderator grades your submission, you'll find the details here. Feel free to make edits to your submission if needed.") }}
</div>
{{ submission.member_name }}
</div>
{% if is_moderator %}
<div class="field-group">
<div class="field-label">
{{ _("Student Name") }}
</div>
{{ submission.member_name }}
</div>
{% endif %}
{% endif %}
<div class="field-group">
@@ -79,14 +84,15 @@
<div class="btn btn-default btn-sm btn-upload mt-2 {% if submission.assignment_attachment %} hide {% endif %}" data-type="{{ assignment.type }}">
{{ _("Browse").format(assignment.type) }}
</div>
<div class="field-input flex justify-between align-center {% if not submission.assignment_attachment %} hide {% endif %}" id="assignment-preview">
<div class="field-input flex justify-between align-center overflow-auto
{% if not submission.assignment_attachment %} hide {% endif %}" id="assignment-preview">
<a class="clickable" {% if submission.assignment_attachment %} href="{{ submission.assignment_attachment }}" {% endif %}>
{% if submission.assignment_attachment %} {{ submission.assignment_attachment }} {% endif %}
</a>
<span class="btn btn-default btn-sm btn-close {% if not submission %} hide {% endif %}">
{{ _("Clear") }}
</span>
</div>
<span class="btn btn-default btn-sm btn-close {% if not submission %} hide {% endif %} mt-2">
{{ _("Clear") }}
</span>
</div>
{% if is_moderator %}

View File

@@ -61,10 +61,10 @@
<div class="breadcrumb">
{% if class_info %}
<a class="dark-links" href="/courses">
{{ _("All Classes") }}
{{ _("All Batches") }}
</a>
<img class="ml-1 mr-1" src="/assets/lms/icons/chevron-right.svg">
<a class="dark-links" href="/classes/{{ class_info.name }}">
<a class="dark-links" href="/batches/{{ class_info.name }}">
{{ class_info.title }}
</a>
<img class="ml-1 mr-1" src="/assets/lms/icons/chevron-right.svg">

View File

@@ -22,6 +22,8 @@
<div class="breadcrumb">
<a class="dark-links" href="/batches">{{ _("All Batches") }}</a>
<img class="ml-1 mr-1" src="/assets/lms/icons/chevron-right.svg">
<a class="dark-links" href="/batches/details/{{ batch_info.name }}">{{ _("Batch Details") }}</a>
<img class="ml-1 mr-1" src="/assets/lms/icons/chevron-right.svg">
<span class="breadcrumb-destination">{{ batch_info.title }}</span>
</div>
{% endmacro %}
@@ -239,11 +241,6 @@
<div class="bold-heading">
{{ _("Courses") }}
</div>
{% if is_moderator %}
<button class="btn btn-default btn-sm btn-add-course">
{{ _("Add Courses") }}
</button>
{% endif %}
</div>
</header>
@@ -252,11 +249,6 @@
{% for course in batch_courses %}
<div class="h-100">
{{ widgets.CourseCard(course=course, read_only=False) }}
<button class="btn icon-btn btn-default btn-block btn-remove-course" data-course="{{ course.name }}">
<svg class="icon icon-sm">
<use href="#icon-delete"></use>
</svg>
</button>
</div>
{% endfor %}
@@ -320,7 +312,7 @@
{% set allow_progress = is_moderator or is_evaluator %}
<div class="grid-row">
<div class="data-row row">
<a class="col grid-static-col button-links {% if allow_progress %} clickable {% endif %}" {% if allow_progress %} href="/classes/{{ batch_info.name }}/students/{{ student.username }}" {% endif %}>
<a class="col grid-static-col button-links {% if allow_progress %} clickable {% endif %}" {% if allow_progress %} href="/batches/{{ batch_info.name }}/students/{{ student.username }}" {% endif %}>
{{ student.student_name }}
</a>
<div class="col grid-static-col col-xs-2 text-right">

View File

@@ -25,13 +25,6 @@ frappe.ready(() => {
create_live_class(e);
});
$(".btn-add-course").click((e) => {
show_course_modal(e);
});
$(".btn-remove-course").click((e) => {
remove_course(e);
});
$(".btn-remove-assessment").click((e) => {
remove_assessment(e);
});
@@ -55,11 +48,11 @@ frappe.ready(() => {
});
const create_live_class = (e) => {
let class_name = $(".class-details").data("batch");
let batch_name = $(".class-details").data("batch");
frappe.call({
method: "lms.lms.doctype.lms_class.lms_class.create_live_class",
method: "lms.lms.doctype.lms_batch.lms_batch.create_live_class",
args: {
class_name: class_name,
batch_name: batch_name,
title: $("input[data-fieldname='meeting_title']").val(),
duration: $("input[data-fieldname='meeting_duration']").val(),
date: $("input[data-fieldname='meeting_date']").val(),
@@ -300,85 +293,6 @@ const get_timezones = () => {
];
};
const show_course_modal = () => {
let course_modal = new frappe.ui.Dialog({
title: "Add Course",
fields: [
{
fieldtype: "Link",
options: "LMS Course",
label: __("Course"),
fieldname: "course",
reqd: 1,
only_select: 1,
},
{
fieldtype: "Link",
options: "Course Evaluator",
label: __("Course Evaluator"),
fieldname: "evaluator",
only_select: 1,
},
],
primary_action_label: __("Add"),
primary_action(values) {
add_course(values);
course_modal.hide();
},
});
course_modal.show();
setTimeout(() => {
$(".modal-body").css("min-height", "200px");
}, 1000);
};
const add_course = (values) => {
frappe.call({
method: "frappe.client.insert",
args: {
doc: {
doctype: "Batch Course",
course: values.course,
parenttype: "LMS Batch",
parentfield: "courses",
parent: $(".class-details").data("batch"),
},
},
callback(r) {
frappe.show_alert(
{
message: __("Course Added"),
indicator: "green",
},
2000
);
window.location.reload();
},
});
};
const remove_course = (e) => {
frappe.confirm("Are you sure you want to remove this course?", () => {
frappe.call({
method: "lms.lms.doctype.lms_class.lms_class.remove_course",
args: {
course: $(e.currentTarget).data("course"),
parent: $(".class-details").data("batch"),
},
callback(r) {
frappe.show_alert(
{
message: __("Course Removed"),
indicator: "green",
},
2000
);
window.location.reload();
},
});
});
};
const show_student_modal = () => {
let student_modal = new frappe.ui.Dialog({
title: "Add Student",
@@ -435,13 +349,13 @@ const add_student = (values) => {
const remove_student = (e) => {
frappe.confirm(
"Are you sure you want to remove this student from the class?",
"Are you sure you want to remove this student from the batch?",
() => {
frappe.call({
method: "lms.lms.doctype.lms_class.lms_class.remove_student",
method: "lms.lms.doctype.lms_batch.lms_batch.remove_student",
args: {
student: $(e.currentTarget).data("student"),
class_name: $(".class-details").data("batch"),
batch_name: $(".class-details").data("batch"),
},
callback: (data) => {
frappe.show_alert(
@@ -547,7 +461,7 @@ const add_addessment = (values) => {
const remove_assessment = (e) => {
frappe.confirm("Are you sure you want to remove this assessment?", () => {
frappe.call({
method: "lms.lms.doctype.lms_class.lms_class.remove_assessment",
method: "lms.lms.doctype.lms_batch.lms_batch.remove_assessment",
args: {
assessment: $(e.currentTarget).data("assessment"),
parent: $(".class-details").data("batch"),
@@ -580,6 +494,7 @@ const open_evaluation_form = (e) => {
name: ["in", courses],
},
filter_description: " ",
only_select: 1,
},
{
fieldtype: "Date",
@@ -615,7 +530,7 @@ const get_slots = () => {
args: {
course: this.eval_form.get_value("course"),
date: this.eval_form.get_value("date"),
class_name: $(".class-details").data("batch"),
batch_name: $(".class-details").data("batch"),
},
callback: (r) => {
if (r.message) {
@@ -677,7 +592,7 @@ const submit_evaluation_form = (values) => {
start_time: this.current_slot.data("start"),
end_time: this.current_slot.data("end"),
day: this.current_slot.data("day"),
class_name: $(".class-details").data("batch"),
batch_name: $(".class-details").data("batch"),
},
callback: (r) => {
this.eval_form.hide();

View File

@@ -36,7 +36,7 @@ def get_context(context):
"start_time",
"end_time",
"category",
"paid_class",
"paid_batch",
"amount",
"currency",
"batch_details",

View File

@@ -173,7 +173,12 @@
{% macro CourseList(courses) %}
<div>
<div class="batch-course-list">
{% if is_moderator %}
<button class="btn btn-default btn-sm btn-add-course pull-right">
{{ _("Add Courses") }}
</button>
{% endif %}
<div class="page-title">
{{ _("Courses") }}
</div>
@@ -182,13 +187,23 @@
{% for course in courses %}
<div class="h-100">
{{ widgets.CourseCard(course=course, read_only=False) }}
<button class="btn icon-btn btn-default btn-block btn-remove-course" data-course="{{ course.name }}">
<svg class="icon icon-sm">
<use href="#icon-delete"></use>
</svg>
</button>
{% if is_moderator %}
<div class="flex my-2 pull-right">
<button class="btn icon-btn btn-default btn-edit-course"
data-name="{{ course.batch_course }}" data-course="{{ course.name }}"
{% if course.evaluator %} data-evaluator="{{ course.evaluator }}" {% endif %}>
<svg class="icon icon-sm">
<use href="#icon-edit"></use>
</svg>
</button>
<button class="btn icon-btn btn-default btn-remove-course ml-2" data-course="{{ course.name }}">
<svg class="icon icon-sm">
<use href="#icon-delete"></use>
</svg>
</button>
</div>
{% endif %}
</div>
{% endfor %}
</div>
{% else %}

View File

@@ -1,3 +1,97 @@
frappe.ready(() => {
frappe.require("controls.bundle.js");
$(".btn-add-course").click((e) => {
show_course_modal(e);
});
$(".btn-edit-course").click((e) => {
show_course_modal(e);
});
$(".btn-remove-course").click((e) => {
remove_course(e);
});
});
const show_course_modal = (e) => {
const target = $(e.currentTarget);
const course = target.data("course");
const evaluator = target.data("evaluator");
const course_name = target.data("name");
let course_modal = new frappe.ui.Dialog({
title: "Add Course",
fields: [
{
fieldtype: "Link",
options: "LMS Course",
label: __("Course"),
fieldname: "course",
reqd: 1,
only_select: 1,
default: course || "",
},
{
fieldtype: "Link",
options: "Course Evaluator",
label: __("Course Evaluator"),
fieldname: "evaluator",
only_select: 1,
default: evaluator || "",
},
],
primary_action_label: __("Add"),
primary_action(values) {
add_course(values, course_name);
course_modal.hide();
},
});
course_modal.show();
};
const add_course = (values, course_name) => {
frappe.call({
method: "lms.lms.doctype.lms_batch.lms_batch.add_course",
args: {
course: values.course,
evaluator: values.evaluator,
parent: $(".class-details").data("batch"),
name: course_name || "",
},
callback(r) {
frappe.show_alert(
{
message: course_name
? __("Course Updated")
: __("Course Added"),
indicator: "green",
},
2000
);
window.location.reload();
},
});
};
const remove_course = (e) => {
frappe.confirm("Are you sure you want to remove this course?", () => {
frappe.call({
method: "lms.lms.doctype.lms_batch.lms_batch.remove_course",
args: {
course: $(e.currentTarget).data("course"),
parent: $(".class-details").data("batch"),
},
callback(r) {
frappe.show_alert(
{
message: __("Course Removed"),
indicator: "green",
},
2000
);
window.location.reload();
},
});
});
};

View File

@@ -30,7 +30,7 @@ def get_context(context):
context.courses = frappe.get_all(
"Batch Course",
{"parent": batch_name},
["name", "course", "title"],
["name as batch_course", "course", "title", "evaluator"],
order_by="creation desc",
)

View File

@@ -68,18 +68,18 @@
<div class="tab-content">
<div class="tab-pane active" id="upcoming" role="tabpanel" aria-labelledby="upcoming">
{{ BatchCard(upcoming_batches, show_price=True) }}
{{ BatchCard(upcoming_batches, show_price=True, label="Upcoming") }}
</div>
{% if is_moderator %}
<div class="tab-pane" id="past" role="tabpanel" aria-labelledby="past">
{{ BatchCard(past_batches, show_price=False) }}
{{ BatchCard(past_batches, show_price=False, label="Archived") }}
</div>
{% endif %}
{% if frappe.session.user != "Guest" %}
<div class="tab-pane" id="my-batch" role="tabpanel" aria-labelledby="my-batches">
{{ BatchCard(my_batches, show_price=False) }}
{{ BatchCard(my_batches, show_price=False, label="Enrolled") }}
</div>
{% endif %}
@@ -87,7 +87,8 @@
</article>
{% endmacro %}
{% macro BatchCard(batches, show_price=False) %}
{% macro BatchCard(batches, show_price=False, label="") %}
{% if batches | length %}
<div class="lms-card-parent">
{% for batch in batches %}
@@ -148,6 +149,11 @@
</div>
{% endfor %}
</div>
{% else %}
<p class="text-muted mt-3">
{{ _("No {0} batches").format(label|lower) }}
</p>
{% endif %}
{% endmacro %}
{% macro EmptyState() %}

View File

@@ -8,7 +8,7 @@
<div class="common-page-style">
{{ Header() }}
<div class="container">
{{ Progress(class_info, student) }}
{{ Progress(batch, student) }}
</div>
</div>
{% endblock %}
@@ -22,12 +22,12 @@
{{ _("{0}").format(student.full_name) }}
</div>
<div class="vertically-center">
<a class="dark-links" href="/classes">
{{ _("All Classes") }}
<a class="dark-links" href="/batches">
{{ _("All Batches") }}
</a>
<img class="icon icon-sm mr-0" src="/assets/lms/icons/chevron-right.svg">
<a class="dark-links" href="/classes/{{ class_info.name }}">
{{ class_info.name }}
<a class="dark-links" href="/batches/{{ batch.name }}">
{{ batch.name }}
</a>
<img class="icon icon-sm mr-0" src="/assets/lms/icons/chevron-right.svg">
<span class="breadcrumb-destination">
@@ -46,7 +46,7 @@
</button>
{% endif %}
{% if is_moderator %}
<a class="btn btn-primary btn-sm btn-evaluate ml-2" href="/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class_name={{class_info.name}}">
<a class="btn btn-primary btn-sm btn-evaluate ml-2" href="/evaluation/new?member={{student.name}}&date={{frappe.utils.getdate()}}&class_name={{batch.name}}">
{{ _("Evaluate") }}
</a>
{% endif %}
@@ -57,9 +57,9 @@
{% endmacro %}
{% macro Progress(class_info, student) %}
{% macro Progress(batch, student) %}
{{ UpcomingEvals(upcoming_evals) }}
{{ Assessments(class_info, student) }}
{{ Assessments(batch, student) }}
{% endmacro %}
{% macro UpcomingEvals(upcoming_evals) %}
@@ -68,7 +68,7 @@
</div>
{% endmacro %}
{% macro Assessments(class_info, student) %}
{% macro Assessments(batch, student) %}
<div class="mb-8">
{% include "lms/templates/assessments.html" %}
</div>
@@ -84,7 +84,7 @@
"can_read": ["LMS Course"]
};
let courses = {{ courses | json }};
let class_name = "{{ class_info.name }}";
let batch_name = "{{ batch.name }}";
</script>
{{ include_script('controls.bundle.js') }}
{% endblock %}

View File

@@ -12,7 +12,7 @@ def get_context(context):
context.no_cache = 1
student = frappe.form_dict["username"]
class_name = frappe.form_dict["classname"]
batch_name = frappe.form_dict["batchname"]
context.is_moderator = has_course_moderator_role()
context.is_evaluator = has_course_evaluator_role()
@@ -29,13 +29,11 @@ def get_context(context):
):
raise frappe.PermissionError(_("You don't have permission to access this page."))
context.class_info = frappe.db.get_value(
"LMS Batch", class_name, ["name"], as_dict=True
)
context.batch = frappe.db.get_value("LMS Batch", batch_name, ["name"], as_dict=True)
context.courses = frappe.get_all(
"Batch Course", {"parent": class_name}, pluck="course"
"Batch Course", {"parent": batch_name}, pluck="course"
)
context.assessments = get_assessments(class_name, context.student.name)
context.assessments = get_assessments(batch_name, context.student.name)
context.upcoming_evals = get_upcoming_evals(context.student.name, context.courses)

View File

@@ -30,7 +30,7 @@
<div class="">
<div class="flex mb-2">
<div class="field-label">
{% set label = "Course Name" if module == "course" else "Class Name" %}
{% set label = "Course Name" if module == "course" else "Batch Name" %}
{{ _(label) }} : {{ title }}
</div>
</div>

View File

@@ -9,7 +9,7 @@ def get_context(context):
if frappe.session.user == "Guest":
raise frappe.PermissionError(_("You are not allowed to access this page."))
if module not in ["course", "class"]:
if module not in ["course", "batch"]:
raise ValueError(_("Module is incorrect."))
doctype = "LMS Course" if module == "course" else "LMS Batch"
@@ -32,7 +32,7 @@ def get_context(context):
"Batch Student", {"student": frappe.session.user, "parent": docname}
)
if membership:
raise frappe.PermissionError(_("You are already enrolled for this class"))
raise frappe.PermissionError(_("You are already enrolled for this batch."))
if doctype == "LMS Course":
course = frappe.db.get_value(
@@ -50,18 +50,18 @@ def get_context(context):
context.currency = course.currency
else:
class_info = frappe.db.get_value(
batch = frappe.db.get_value(
"LMS Batch",
docname,
["title", "name", "paid_class", "amount", "currency"],
["title", "name", "paid_batch", "amount", "currency"],
as_dict=True,
)
if not class_info.paid_class:
if not batch.paid_batch:
raise frappe.PermissionError(
_("To join this class, please contact the Administrator.")
_("To join this batch, please contact the Administrator.")
)
context.title = class_info.title
context.amount = class_info.amount
context.currency = class_info.currency
context.title = batch.title
context.amount = batch.amount
context.currency = batch.currency

View File

@@ -0,0 +1,35 @@
{% extends "lms/templates/lms_base.html" %}
{% block title %}
{{ _("Certified Participants") }}
{% endblock %}
{% block page_content %}
<main class="common-page-style">
<div class="container">
<header>
<div class="page-title">
{{ _("Certified Participants") }}
</div>
</header>
{{ ParticipantsList() }}
</div>
</main>
{% endblock %}
{% macro ParticipantsList() %}
<article class="member-parent">
{% for participant in participants %}
<div class="common-card-style column-card align-center">
{{ widgets.Avatar(member=participant, avatar_class="avatar-large") }}
<div class="bold-heading">
{{ participant.full_name }}
</div>
{% for course in participant.courses %}
<div>
{{ course }}
</div>
{% endfor %}
</div>
{% endfor %}
</article>
{% endmacro %}

View File

@@ -0,0 +1,22 @@
import frappe
def get_context(context):
context.no_cache = 1
context.members = frappe.get_all(
"LMS Certificate", pluck="member", order_by="creation desc", distinct=1
)
participants = []
for member in context.members:
details = frappe.db.get_value(
"User", member, ["name", "full_name", "user_image", "username", "enabled"], as_dict=1
)
courses = frappe.get_all("LMS Certificate", {"member": member}, pluck="course")
details.courses = []
for course in courses:
details.courses.append(frappe.db.get_value("LMS Course", course, "title"))
if details.enabled:
participants.append(details)
context.participants = participants

View File

@@ -48,15 +48,15 @@
</a>
{% endif %}
{% if show_creators_section %}
<a class="btn btn-default btn-sm" href="/courses/new-course/edit">
{{ _("Create a Course") }}
</a>
{% endif %}
<a class="btn btn-default btn-sm" id="open-search">
{{ _("Search") }} (Ctrl + k)
</a>
{% if show_creators_section %}
<a class="btn btn-primary btn-sm" href="/courses/new-course/edit">
{{ _("Create a Course") }}
</a>
{% endif %}
</div>
</div>

View File

@@ -65,8 +65,8 @@
<div class="tab-pane active" id="profile" role="tabpanel" aria-labelledby="profile">
<div class="">
{{ About(member) }}
{{ EducationDetails(member) }}
{{ WorkDetails(member) }}
{{ EducationDetails(member) }}
{{ ExternalCertification(member) }}
{{ Contact(member) }}
{{ Skills(member) }}
@@ -171,7 +171,7 @@
{% macro CoursesMentored(member, read_only) %}
{% if member.get_mentored_courses() | length %}
<div class="profile-courses">
<div class="course-home-headings"> {{ _("Courses Mentored") }} </div>
<div class="page-title"> {{ _("Courses Mentored") }} </div>
<div class="cards-parent">
{% for course in member.get_mentored_courses() %}
{{ widgets.CourseCard(course=course, read_only=read_only) }}
@@ -202,7 +202,7 @@
{% if has_course_moderator_role() %}
<div class="">
<div class="">
<div class="course-home-headings"> {{ _("Role Settings") }} </div>
<div class="page-title mb-2"> {{ _("Role Settings") }} </div>
<div class="d-flex">
<label class="role">
<input type="checkbox" id="course-creator" data-role="Course Creator"
@@ -223,7 +223,6 @@
<!-- About Section -->
{% macro About(member) %}
<div class="course-home-headings"> {{ _("About") }} </div>
<div class="description">
{% if member.bio %}
{{ member.bio }}
@@ -236,7 +235,7 @@
<!-- Work Preference -->
{% macro WorkPreference(member) %}
<div class="course-home-headings mt-10"> {{ _("Work Preference") }} </div>
<div class="page-title mt-10"> {{ _("Work Preference") }} </div>
<div> {{ member.attire }} </div>
<div> {{ member.collaboration }} </div>
<div> {{ member.role }} </div>
@@ -249,7 +248,7 @@
<!-- Career Preference -->
{% macro CareerPreference(member) %}
{% if member.preferred_functions or member.preferred_industries or member.preferred_location or member.dream_companies %}
<div class="course-home-headings mt-10">
<div class="page-title mt-10">
{{ _("Career Preference") }}
</div>
<div class="profile-column-grid">
@@ -294,7 +293,7 @@
<!-- Contact Section -->
{% macro Contact(member) %}
{% if member.linkedin or member.medium or member.github %}
<div class="course-home-headings mt-10"> {{ _("Contact") }} </div>
<div class="page-title mt-10"> {{ _("Contact") }} </div>
<div class="profile-column-grid">
{% if member.linkedin %}
{% set linkedin = member.linkedin[:-1] if member.linkedin[-1] == "/" else member.linkedin %}
@@ -323,7 +322,7 @@
<!-- Skills -->
{% macro Skills(member) %}
{% if member.skill | length %}
<div class="course-home-headings mt-10"> {{ _("Skills")}} </div>
<div class="page-title mt-10"> {{ _("Skills")}} </div>
<div class="profile-column-grid">
{% for skill in member.skill %}
<div class="description"> {{ skill.skill_name }} </div>
@@ -336,11 +335,11 @@
<!-- Education Details -->
{% macro EducationDetails(member) %}
{% if member.education %}
<div class="course-home-headings mt-10"> {{ _("Education") }} </div>
<div class="page-title mt-10 mb-2"> {{ _("Education") }} </div>
<div class="profile-grid-card">
{% for edu in member.education %}
<div class="column-card-row">
<div class="bold-title"> {{ edu.institution_name }} </div>
<div class="bold-heading"> {{ edu.institution_name }} </div>
<div class="profile-item"> {{ edu.degree_type }} <span></span> {{ edu.major }}
{% if not member.hide_private %}
<!-- {% if edu.grade_type %} {{ edu.grade_type }} {% endif %} -->
@@ -362,17 +361,16 @@
{% endmacro %}
<!-- Work Details -->
{% macro WorkDetails(member) %}
{% set work_details = member.work_experience + member.internship %}
{% if work_details | length %}
<div class="course-home-headings mt-10"> {{ _("Work Experience") }} </div>
<div class="page-title mt-10 mb-2"> {{ _("Work Experience") }} </div>
<div class="profile-grid-card">
{% for work in work_details %}
<div class="">
<div class="bold-title"> {{ work.title }} </div>
<div class="bold-heading"> {{ work.title }} </div>
<div class="profile-item"> {{ work.company }} </div>
<div class="description">
{{ frappe.utils.format_date(work.from_date, "MMM YYYY") }} -
@@ -398,7 +396,7 @@
<!-- Certifications -->
{% macro ExternalCertification(member) %}
{% if member.certification %}
<div class="course-home-headings mt-10"> {{ _("External Certification") }} </div>
<div class="page-title mt-10"> {{ _("External Certification") }} </div>
<div class="profile-grid-card">
{% for cert in member.certification %}
<div class="">

View File

@@ -23,8 +23,8 @@
</div>
</div>
<div class="vertically-center small">
<a class="dark-links" href="/classes">
{{ _("All Classes") }}
<a class="dark-links" href="/batches">
{{ _("All Batches") }}
</a>
<img class="icon icon-sm mr-0" src="/assets/lms/icons/chevron-right.svg">
<span class="breadcrumb-destination">{{ _("Quiz Submission") }}</span>

View File

@@ -61,13 +61,13 @@ def get_current_lesson_details(lesson_number, context, is_edit=False):
return lesson_info
def get_assessments(class_name, member=None):
def get_assessments(batch, member=None):
if not member:
member = frappe.session.user
assessments = frappe.get_all(
"LMS Assessment",
{"parent": class_name},
{"parent": batch},
["name", "assessment_type", "assessment_name"],
)
@@ -132,7 +132,7 @@ def get_quiz_details(assessment, member):
assessment.url = f"/quiz-submission/{assessment.assessment_name}/{submission_name}"
def is_student(class_name, member=None):
def is_student(batch, member=None):
if not member:
member = frappe.session.user
@@ -140,6 +140,6 @@ def is_student(class_name, member=None):
"Batch Student",
{
"student": member,
"parent": class_name,
"parent": batch,
},
)