v0.3.1: split Unscheduled into to-dos and notes
- The Unscheduled section now shows two labeled sub-sections — 'Unscheduled to-dos' (first) then 'Unscheduled notes' — so actionable items stay visually separate from reference notes. - A sub-section is omitted entirely when empty (no lonely '(0)' headers). - Webview-only change (uses the existing isTodo flag); data layer and tests unchanged. - Version 0.3.1; README updated.
This commit is contained in:
parent
d3c0f0ee7f
commit
a3d7acde7f
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "joplin-plugin-gtd-calendar",
|
"name": "joplin-plugin-gtd-calendar",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"test": "jest",
|
"test": "jest",
|
||||||
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
|
"dist": "webpack --env joplin-plugin-config=buildMain && webpack --env joplin-plugin-config=buildExtraScripts && webpack --env joplin-plugin-config=createArchive",
|
||||||
|
|||||||
@ -355,3 +355,8 @@
|
|||||||
.gtd-kanban-card-hover:hover .gtd-kanban-card-detail {
|
.gtd-kanban-card-hover:hover .gtd-kanban-card-detail {
|
||||||
display: block;
|
display: block;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Unscheduled sub-sections (todos / notes split) */
|
||||||
|
.gtd-unscheduled-group + .gtd-unscheduled-group {
|
||||||
|
margin-top: 0.5em;
|
||||||
|
}
|
||||||
|
|||||||
@ -374,10 +374,45 @@
|
|||||||
const section = document.createElement("div");
|
const section = document.createElement("div");
|
||||||
section.className = "gtd-unscheduled";
|
section.className = "gtd-unscheduled";
|
||||||
|
|
||||||
|
const todos = events.filter(function (e) {
|
||||||
|
return e.isTodo;
|
||||||
|
});
|
||||||
|
const notes = events.filter(function (e) {
|
||||||
|
return !e.isTodo;
|
||||||
|
});
|
||||||
|
|
||||||
|
// To-dos first (actionable), notes second (reference). Each
|
||||||
|
// sub-section is omitted entirely when it has no items.
|
||||||
|
if (todos.length > 0) {
|
||||||
|
section.appendChild(
|
||||||
|
renderUnscheduledGroup(
|
||||||
|
"Unscheduled to-dos",
|
||||||
|
todos,
|
||||||
|
contentScriptId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
if (notes.length > 0) {
|
||||||
|
section.appendChild(
|
||||||
|
renderUnscheduledGroup(
|
||||||
|
"Unscheduled notes",
|
||||||
|
notes,
|
||||||
|
contentScriptId
|
||||||
|
)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
return section;
|
||||||
|
}
|
||||||
|
|
||||||
|
function renderUnscheduledGroup(label, events, contentScriptId) {
|
||||||
|
const group = document.createElement("div");
|
||||||
|
group.className = "gtd-unscheduled-group";
|
||||||
|
|
||||||
const heading = document.createElement("h4");
|
const heading = document.createElement("h4");
|
||||||
heading.className = "gtd-unscheduled-title";
|
heading.className = "gtd-unscheduled-title";
|
||||||
heading.textContent = "Unscheduled (" + events.length + ")";
|
heading.textContent = label + " (" + events.length + ")";
|
||||||
section.appendChild(heading);
|
group.appendChild(heading);
|
||||||
|
|
||||||
const list = document.createElement("ul");
|
const list = document.createElement("ul");
|
||||||
list.className = "gtd-unscheduled-list";
|
list.className = "gtd-unscheduled-list";
|
||||||
@ -400,8 +435,8 @@
|
|||||||
list.appendChild(item);
|
list.appendChild(item);
|
||||||
});
|
});
|
||||||
|
|
||||||
section.appendChild(list);
|
group.appendChild(list);
|
||||||
return section;
|
return group;
|
||||||
}
|
}
|
||||||
|
|
||||||
// ------------------------------------------------------------------
|
// ------------------------------------------------------------------
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
"manifest_version": 1,
|
"manifest_version": 1,
|
||||||
"id": "com.victorwiebe.joplin.plugin.gtd-calendar",
|
"id": "com.victorwiebe.joplin.plugin.gtd-calendar",
|
||||||
"app_min_version": "2.7",
|
"app_min_version": "2.7",
|
||||||
"version": "0.3.0",
|
"version": "0.3.1",
|
||||||
"name": "GTD Calendar",
|
"name": "GTD Calendar",
|
||||||
"description": "Day, week, and month calendars populated by your notes and to-dos, with click-through to the source note. Configure with simple YAML blocks. A GTD-friendly fork of Event Calendar by Franco Speziali.",
|
"description": "Day, week, and month calendars populated by your notes and to-dos, with click-through to the source note. Configure with simple YAML blocks. A GTD-friendly fork of Event Calendar by Franco Speziali.",
|
||||||
"author": "Victor Wiebe",
|
"author": "Victor Wiebe",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user