diff --git a/lms/www/batches/batch_details.html b/lms/www/batches/batch_details.html index bf24e971..41ed8a3a 100644 --- a/lms/www/batches/batch_details.html +++ b/lms/www/batches/batch_details.html @@ -1,246 +1,214 @@ -{% extends "lms/templates/lms_base.html" %} -{% block title %} - {{ _(batch_info.title) }} -{% endblock %} - - -{% block page_content %} +{% extends "lms/templates/lms_base.html" %} {% block title %} {{ +_(batch_info.title) }} {% endblock %} {% block page_content %}
- {{ BatchHeader(batch_info) }} + {{ BatchHeader(batch_info) }}
- {{ BatchOverlay(batch_info, courses, students) }} -
- {{ BatchDetails(batch_info) }} - {{ CourseList(courses) }} -
+ {{ BatchOverlay(batch_info, courses, students) }} +
+ {{ BatchDetails(batch_info) }} {{ CourseList(courses) }} +
- {{ BatchDetailsRaw() }} + {{ BatchDetailsRaw() }}
-{% endblock %} - -{% macro BatchHeader(batch_info) %} +{% endblock %} {% macro BatchHeader(batch_info) %}
-
-
- {{ BreadCrumb(batch_info) }} - {{ BatchHeaderDetails(batch_info, courses, students) }} -
-
+
+
+ {{ BreadCrumb(batch_info) }} {{ BatchHeaderDetails(batch_info, + courses, students) }} +
+
-{% endmacro %} - -{% macro BreadCrumb(batch_info) %} +{% endmacro %} {% macro BreadCrumb(batch_info) %}
- - {{ _("All Batches") }} - - - - {{ _("Batch Details") }} - + {{ _("All Batches") }} + + {{ _("Batch Details") }}
-{% endmacro %} +{% endmacro %} {% macro BatchHeaderDetails(batch_info, courses, students) %} +
+
{{ batch_info.title }}
-{% macro BatchHeaderDetails(batch_info, courses, students) %} -
+
{{ batch_info.description }}
-
- {{ batch_info.title }} -
+
+ + + + + {{ frappe.utils.format_date(batch_info.start_date, "long") }} + + {% if batch_info.start_date != batch_info.end_date %} + + - {{ frappe.utils.format_date(batch_info.end_date, "long") }} + + {% endif %} +
-
- {{ batch_info.description }} -
- -
- - - - - {{ frappe.utils.format_date(batch_info.start_date, "long") }} - - {% if batch_info.start_date != batch_info.end_date %} - - - {{ frappe.utils.format_date(batch_info.end_date, "long") }} - - {% endif %} -
- - {% if batch_info.start_time and batch_info.end_time %} -
- - - - - {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - - - - {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} - -
- {% endif %} -
-{% endmacro %} - -{% macro BatchOverlay(batch_info, courses, students) %} + {% if batch_info.start_time and batch_info.end_time %} +
+ + + + + {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - + + + {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} + +
+ {% endif %} +
+{% endmacro %} {% macro BatchOverlay(batch_info, courses, students) %}
+
+ {% if batch_info.seat_count %} {% if seats_left %} +
+ {{ _("Seats Available") }}: {{ seats_left }} +
+ {% else %} +
+ {{ _("No seats left") }} +
+ {% endif %} {% endif %} {% if batch_info.paid_batch %} +
+ {{ frappe.utils.fmt_money(batch_info.amount, 0, batch_info.currency) + }} +
+ {% endif %} -
+
+ + + + {{ courses | length }} {{ _("Courses") }} +
- {% if batch_info.seat_count %} - {% if seats_left %} -
- {{ _("Seats Available") }}: {{ seats_left }} -
- {% else %} -
- {{ _("No seats left") }} -
- {% endif %} - {% endif %} - - {% if batch_info.paid_batch %} -
- {{ frappe.utils.fmt_money(batch_info.amount, 0, batch_info.currency) }} -
- {% endif %} - -
- - - - {{ courses | length }} {{ _("Courses") }} -
- -
- - - - - {{ frappe.utils.format_date(batch_info.start_date, "long") }} - +
+ + + + + {{ frappe.utils.format_date(batch_info.start_date, "long") }} + {% if batch_info.start_date != batch_info.end_date %} - {{ frappe.utils.format_date(batch_info.end_date, "long") }} {% endif %} -
+
- {% if batch_info.start_time and batch_info.end_time %} -
- - - - - {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} - - - - {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} - -
- {% endif %} + {% if batch_info.start_time and batch_info.end_time %} +
+ + + + + {{ frappe.utils.format_time(batch_info.start_time, "hh:mm a") }} + - + + + {{ frappe.utils.format_time(batch_info.end_time, "hh:mm a") }} + +
+ {% endif %} -
- {% if is_moderator or is_evaluator %} - - {{ _("Manage Batch") }} - - {% elif batch_info.paid_batch %} - - {{ _("Register Now") }} - - {% elif batch_info.allow_self_enrollment and batch_info.seat_count and seats_left %} - - {% else %} -
- {{ _("To join this batch, please contact the Administrator.") }} -
- {% endif %} -
- {% if is_moderator %} -
-
- {{ _("Edit") }} -
-
- {% endif %} -
+
+ {% if is_moderator or is_evaluator %} + + {{ _("Manage Batch") }} + + {% elif batch_info.paid_batch and batch_info.start_date > + frappe.utils.getdate() %} + + {{ _("Register Now") }} + + {% elif batch_info.allow_self_enrollment and batch_info.seat_count + and seats_left and batch_info.start_date > frappe.utils.getdate() %} + + {% else %} +
+ {{ _("To join this batch, please contact the Administrator.") }} +
+ {% endif %} +
+ {% if is_moderator %} +
+
+ {{ _("Edit") }} +
+
+ {% endif %} +
-{% endmacro %} - - -{% macro BatchDetails(batch_info) %} -
- {{ batch_info.batch_details }} -
-{% endmacro %} - - -{% macro CourseList(courses) %} -{% if courses | length or is_moderator %} +{% endmacro %} {% macro BatchDetails(batch_info) %} +
{{ batch_info.batch_details }}
+{% endmacro %} {% macro CourseList(courses) %} {% if courses | length or +is_moderator %}
+
+
{{ _("Courses") }}
+ {% if is_moderator %} + + {% endif %} +
-
-
- {{ _("Courses") }} -
- {% if is_moderator %} - - {% endif %} -
- - {% if courses | length %} + {% if courses | length %}
{% for course in courses %}
- {% if is_moderator %} -
- - -
- {% endif %} - {{ widgets.CourseCard(course=course, read_only=False) }} + {% if is_moderator %} +
+ + +
+ {% endif %} {{ widgets.CourseCard(course=course, read_only=False) }}
{% endfor %}
{% else %} -
- {{ _("No courses") }} -
+
{{ _("No courses") }}
{% endif %}
-{% endif %} -{% endmacro %} - - -{% macro BatchDetailsRaw() %} - {% if batch_info.batch_details_raw %} -
- {{ batch_info.batch_details_raw }} -
- {% endif %} -{% endmacro %} - -{%- block script %} - {{ super() }} - {% if is_moderator %} - - {% endif %} -{% endblock %} +{% endif %} {% endmacro %} {% macro BatchDetailsRaw() %} {% if +batch_info.batch_details_raw %} +
{{ batch_info.batch_details_raw }}
+{% endif %} {% endmacro %} {%- block script %} {{ super() }} {% if is_moderator +%} + +{% endif %} {% endblock %}