fix: don't show past classes

This commit is contained in:
Jannat Patel
2023-03-13 18:03:03 +05:30
parent 0593a9fb30
commit d96e3f4f9f
3 changed files with 8 additions and 6 deletions

View File

@@ -2013,6 +2013,6 @@ select {
visibility: visible; visibility: visible;
} }
.add-students .text-primary.link-option { .add-students ul li:nth-last-child(-n+2) {
visibility: hidden; display: none;
} }

View File

@@ -245,13 +245,13 @@
<div class="live-class-panel"> <div class="live-class-panel">
{% if class.owner == frappe.session.user %} {% if class.owner == frappe.session.user %}
<a class="btn btn-secondary btn-sm mr-2" href="{{ class.start_url }}"> <a class="btn btn-secondary btn-sm mr-2" target="_blank" href="{{ class.start_url }}">
{{ _("Start") }} {{ _("Start") }}
</a> </a>
{% endif %} {% endif %}
{% if is_student %} {% if is_student %}
<a class="btn btn-secondary btn-sm mt-auto" href="{{ class.join_url }}"> <a class="btn btn-secondary btn-sm mt-auto" target="_blank" href="{{ class.join_url }}">
{{ _("Join Class") }} {{ _("Join Class") }}
</a> </a>
{% endif %} {% endif %}

View File

@@ -1,10 +1,12 @@
import frappe import frappe
from frappe import _ from frappe.utils import getdate
def get_context(context): def get_context(context):
context.no_cache = 1 context.no_cache = 1
context.classes = frappe.get_all( context.classes = frappe.get_all(
"LMS Class", fields=["name", "title", "start_date", "end_date"] "LMS Class", {
"end_date": [">=", getdate()]
}, ["name", "title", "start_date", "end_date"]
) )