feat: day view for timetable on mobile
This commit is contained in:
@@ -16,6 +16,7 @@
|
|||||||
"portal_course_creation",
|
"portal_course_creation",
|
||||||
"section_break_szgq",
|
"section_break_szgq",
|
||||||
"send_calendar_invite_for_evaluations",
|
"send_calendar_invite_for_evaluations",
|
||||||
|
"show_day_view",
|
||||||
"allow_student_progress",
|
"allow_student_progress",
|
||||||
"column_break_2",
|
"column_break_2",
|
||||||
"show_dashboard",
|
"show_dashboard",
|
||||||
@@ -341,12 +342,18 @@
|
|||||||
{
|
{
|
||||||
"fieldname": "column_break_uwsp",
|
"fieldname": "column_break_uwsp",
|
||||||
"fieldtype": "Column Break"
|
"fieldtype": "Column Break"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"default": "0",
|
||||||
|
"fieldname": "show_day_view",
|
||||||
|
"fieldtype": "Check",
|
||||||
|
"label": "Show Day View in Timetable"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"index_web_pages_for_search": 1,
|
"index_web_pages_for_search": 1,
|
||||||
"issingle": 1,
|
"issingle": 1,
|
||||||
"links": [],
|
"links": [],
|
||||||
"modified": "2023-11-07 11:23:14.257687",
|
"modified": "2023-12-12 10:32:13.638368",
|
||||||
"modified_by": "Administrator",
|
"modified_by": "Administrator",
|
||||||
"module": "LMS",
|
"module": "LMS",
|
||||||
"name": "LMS Settings",
|
"name": "LMS Settings",
|
||||||
|
|||||||
@@ -2443,13 +2443,23 @@ select {
|
|||||||
}
|
}
|
||||||
|
|
||||||
.calendar-legends {
|
.calendar-legends {
|
||||||
display: flex;
|
display: grid;
|
||||||
align-items: center;
|
grid-template-columns: repeat(4, 1fr);
|
||||||
justify-content: space-between;
|
width: 75%;
|
||||||
width: 50%;
|
|
||||||
margin: 0 auto 1rem;
|
margin: 0 auto 1rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@media (max-width: 767px) {
|
||||||
|
.calendar-legends {
|
||||||
|
grid-template-columns: repeat(2, 1fr);
|
||||||
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.legend-item {
|
||||||
|
margin-bottom: 0.5rem;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.batch-details {
|
.batch-details {
|
||||||
width: 50%;
|
width: 50%;
|
||||||
margin: 2rem 0;
|
margin: 2rem 0;
|
||||||
|
|||||||
@@ -641,6 +641,7 @@
|
|||||||
const allow_future = {{ batch_info.allow_future }};
|
const allow_future = {{ batch_info.allow_future }};
|
||||||
const is_student = "{{ is_student or '' }}";
|
const is_student = "{{ is_student or '' }}";
|
||||||
const evaluation_end_date = "{{ batch_info.evaluation_end_date if batch_info.evaluation_end_date else '' }}"
|
const evaluation_end_date = "{{ batch_info.evaluation_end_date if batch_info.evaluation_end_date else '' }}"
|
||||||
|
const show_day_view = {{ settings.show_day_view }};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<link rel="stylesheet" href="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.css" />
|
<link rel="stylesheet" href="https://uicdn.toast.com/calendar/latest/toastui-calendar.min.css" />
|
||||||
|
|||||||
@@ -672,7 +672,7 @@ const get_calendar_options = (element, calendar_id) => {
|
|||||||
const end_time = element.data("end");
|
const end_time = element.data("end");
|
||||||
|
|
||||||
return {
|
return {
|
||||||
defaultView: "week",
|
defaultView: $(window).width() < 768 || show_day_view ? "day" : "week",
|
||||||
usageStatistics: false,
|
usageStatistics: false,
|
||||||
week: {
|
week: {
|
||||||
narrowWeekend: true,
|
narrowWeekend: true,
|
||||||
@@ -805,22 +805,42 @@ const scroll_to_date = (calendar, events) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
const set_calendar_range = (calendar, events) => {
|
const set_calendar_range = (calendar, events) => {
|
||||||
let week_start = moment(calendar.getDateRangeStart().d.d);
|
let day_view = $(window).width() < 768 || show_day_view ? true : false;
|
||||||
let week_end = moment(calendar.getDateRangeEnd().d.d);
|
if (day_view) {
|
||||||
|
let calendar_date = moment(calendar.getDate().d.d).format(
|
||||||
|
"DD MMMM YYYY"
|
||||||
|
);
|
||||||
|
$(".calendar-range").text(`${calendar_date}`);
|
||||||
|
|
||||||
$(".calendar-range").text(
|
if (moment(events[0].date).isSameOrBefore(moment(calendar)))
|
||||||
`${moment(week_start).format("DD MMMM YYYY")} - ${moment(
|
$("#prev-week").hide();
|
||||||
week_end
|
else $("#prev-week").show();
|
||||||
).format("DD MMMM YYYY")}`
|
|
||||||
);
|
|
||||||
|
|
||||||
if (week_start.diff(moment(events[0].date), "days") <= 0)
|
if (
|
||||||
$("#prev-week").hide();
|
moment(calendar_date).isSameOrAfter(
|
||||||
else $("#prev-week").show();
|
moment(events.slice(-1)[0].date)
|
||||||
|
)
|
||||||
|
)
|
||||||
|
$("#next-week").hide();
|
||||||
|
else $("#next-week").show();
|
||||||
|
} else {
|
||||||
|
let week_start = moment(calendar.getDateRangeStart().d.d);
|
||||||
|
let week_end = moment(calendar.getDateRangeEnd().d.d);
|
||||||
|
|
||||||
if (week_end.diff(moment(events.slice(-1)[0].date), "days") > 0)
|
$(".calendar-range").text(
|
||||||
$("#next-week").hide();
|
`${moment(week_start).format("DD MMMM YYYY")} - ${moment(
|
||||||
else $("#next-week").show();
|
week_end
|
||||||
|
).format("DD MMMM YYYY")}`
|
||||||
|
);
|
||||||
|
|
||||||
|
if (week_start.diff(moment(events[0].date), "days") <= 0)
|
||||||
|
$("#prev-week").hide();
|
||||||
|
else $("#prev-week").show();
|
||||||
|
|
||||||
|
if (week_end.diff(moment(events.slice(-1)[0].date), "days") > 0)
|
||||||
|
$("#next-week").hide();
|
||||||
|
else $("#next-week").show();
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const get_background_color = (doctype) => {
|
const get_background_color = (doctype) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user