This is an automated email from the ASF dual-hosted git repository.
humbedooh pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-ponymail-foal.git
The following commit(s) were added to refs/heads/master by this push:
new 533bc80 work in upcoming activity stats
533bc80 is described below
commit 533bc806de914bfb1d0b4ff62c361e37445652aa
Author: Daniel Gruno <[email protected]>
AuthorDate: Sat Sep 18 17:48:51 2021 -0500
work in upcoming activity stats
---
webui/js/source/sidebar-calendar.js | 15 ++++++++++++---
1 file changed, 12 insertions(+), 3 deletions(-)
diff --git a/webui/js/source/sidebar-calendar.js
b/webui/js/source/sidebar-calendar.js
index 7dbde37..91c00f1 100644
--- a/webui/js/source/sidebar-calendar.js
+++ b/webui/js/source/sidebar-calendar.js
@@ -21,7 +21,7 @@ var default_end_year = 2100;
var calendar_index = 0;
var calendar_years_shown = 4;
-function renderCalendar(FY, FM, LY, LM) {
+function renderCalendar(FY, FM, LY, LM, activity = null) {
calendar_index = 0;
// Only render if calendar div is present
@@ -75,11 +75,20 @@ function renderCalendar(FY, FM, LY, LM) {
}, mon);
// Mark out-of-bounds segments
+ let ym = '%04u-%02u'.format(Y, i+1);
+ let c_active = true;
+ if (activity && !activity[ym]) {
+ c_active = false;
+ }
if ((Y == SY && i >= LM) || (Y == CY && i > CM)) {
- mdiv.setAttribute("class", "sidebar_calendar_month_nothing");
+ c_active = false;
}
if (Y == FY && ((i + 1) < FM)) {
+ c_active = false;
+ }
+ if (!c_active) {
mdiv.setAttribute("class", "sidebar_calendar_month_nothing");
+ mdiv.setAttribute("onclick", "javascript:void(0);");
}
ydiv.inject(mdiv);
}
@@ -156,4 +165,4 @@ function calendar_click(year, month) {
to: '%s@%s'.format(current_list, current_domain),
update_calendar: false
});
-}
\ No newline at end of file
+}