Compare commits

...

2 commits

Author SHA1 Message Date
Christian Fraß eaa5e53f4c [mod] modell:event:tags hinzugefügt [mod] targets:tags anzeigen 2025-05-06 20:12:02 +00:00
Christian Fraß f4f2d99a9e [mod] Lizenz-Köpfe hinzugefügt 2025-05-06 19:26:30 +00:00
4 changed files with 67 additions and 5 deletions

View file

@ -1,3 +1,23 @@
/*
This file is part of »munin«.
Copyright 2025 'Fenris Wolf' <fenris@folksprak.org>
»munin« is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
»munin« is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with »munin«. If not, see <http://www.gnu.org/licenses/>.
*/
namespace _munin.sources.ical_feed namespace _munin.sources.ical_feed
{ {
@ -91,6 +111,7 @@ namespace _munin.sources.ical_feed
"begin": begin, "begin": begin,
"end": end, "end": end,
"location": (vevent.location ?? null), "location": (vevent.location ?? null),
"tags": vevent.categories,
}; };
return event; return event;
} }

View file

@ -55,18 +55,31 @@ namespace _munin.targets.email
parameters.sender, parameters.sender,
parameters.receivers, parameters.receivers,
lib_plankton.string.coin( lib_plankton.string.coin(
"[{{head}}] {{date}} : {{title}}", "[{{head}}] {{date}} : {{macro_tags}}{{title}}",
{ {
"head": labels.head, "head": labels.head,
"date": lib_plankton.pit.date_format(event.begin.date), "date": lib_plankton.pit.date_format(event.begin.date),
"macro_tags": (
(event.tags === null)
?
""
:
(event.tags.map(tag => ("{" + tag + "}")).join(" ") + " ")
),
"title": event.title, "title": event.title,
} }
), ),
lib_plankton.string.coin( lib_plankton.string.coin(
"*{{head}}*\n\n\{{title_label}} | {{title_value}}\n{{time_label}} | {{time_value}}{{macro_location}}", "{{title_label}} | {{macro_tags}}{{title_value}}\n{{time_label}} | {{time_value}}{{macro_location}}",
{ {
"head": labels.head,
"title_label": labels.title.toUpperCase(), "title_label": labels.title.toUpperCase(),
"macro_tags": (
(event.tags === null)
?
""
:
(event.tags.map(tag => ("{" + tag + "}")).join(" ") + " ")
),
"title_value": event.title, "title_value": event.title,
"time_label": labels.time.toUpperCase(), "time_label": labels.time.toUpperCase(),
"time_value": lib_plankton.pit.timespan_format(event.begin, event.end), "time_value": lib_plankton.pit.timespan_format(event.begin, event.end),

View file

@ -42,9 +42,16 @@ namespace _munin.targets.telegram_bot
parameters.bot_token, parameters.bot_token,
parameters.chat_id, parameters.chat_id,
lib_plankton.string.coin( lib_plankton.string.coin(
"*{{head}}*\n\n\{{title_label}} | {{title_value}}\n{{time_label}} | {{time_value}}{{macro_location}}", "*{{head}}*\n\n\{{title_label}} | {{macro_tags}}{{title_value}}\n{{time_label}} | {{time_value}}{{macro_location}}",
{ {
"head": labels.head, "head": labels.head,
"macro_tags": (
(event.tags === null)
?
""
:
(event.tags.map(tag => ("{" + tag + "}")).join(" ") + " ")
),
"title_label": labels.title.toUpperCase(), "title_label": labels.title.toUpperCase(),
"title_value": event.title, "title_value": event.title,
"time_label": labels.time.toUpperCase(), "time_label": labels.time.toUpperCase(),
@ -65,7 +72,7 @@ namespace _munin.targets.telegram_bot
} }
), ),
{ {
"parse_mode": "markdown", "parse_mode": "Markdown",
} }
); );
} }

View file

@ -1,3 +1,23 @@
/*
This file is part of »munin«.
Copyright 2025 'Fenris Wolf' <fenris@folksprak.org>
»munin« is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
»munin« is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License
along with »munin«. If not, see <http://www.gnu.org/licenses/>.
*/
namespace _munin namespace _munin
{ {
@ -18,6 +38,7 @@ namespace _munin
begin : lib_plankton.pit.type_datetime, begin : lib_plankton.pit.type_datetime,
end : (null | lib_plankton.pit.type_datetime), end : (null | lib_plankton.pit.type_datetime),
location : (null | string); location : (null | string);
tags : (null | Array<string>);
}; };