Mobil-Ansicht #4

Merged
fenris merged 7 commits from task-419 into main 2025-10-28 11:41:18 +01:00
11 changed files with 122 additions and 98 deletions
Showing only changes of commit 63504f4e70 - Show all commits

View file

@ -14,6 +14,18 @@
"common.weekday.friday": "Fr", "common.weekday.friday": "Fr",
"common.weekday.saturday": "Sa", "common.weekday.saturday": "Sa",
"common.weekday.sunday": "So", "common.weekday.sunday": "So",
"common.monthname.january": "Jan",
"common.monthname.february": "Feb",
"common.monthname.march": "Mär",
"common.monthname.april": "Apr",
"common.monthname.may": "Mai",
"common.monthname.june": "Jun",
"common.monthname.july": "Jul",
"common.monthname.august": "Aug",
"common.monthname.september": "Sep",
"common.monthname.october": "Okt",
"common.monthname.november": "Nov",
"common.monthname.december": "Dez",
"common.open": "öffnen", "common.open": "öffnen",
"common.edit": "bearbeiten", "common.edit": "bearbeiten",
"common.show": "zeigen", "common.show": "zeigen",

View file

@ -14,6 +14,18 @@
"common.weekday.friday": "Fri", "common.weekday.friday": "Fri",
"common.weekday.saturday": "Sat", "common.weekday.saturday": "Sat",
"common.weekday.sunday": "Sun", "common.weekday.sunday": "Sun",
"common.monthname.january": "jan",
"common.monthname.february": "feb",
"common.monthname.march": "mar",
"common.monthname.april": "apr",
"common.monthname.may": "may",
"common.monthname.june": "jun",
"common.monthname.july": "jul",
"common.monthname.august": "aug",
"common.monthname.september": "sep",
"common.monthname.october": "oct",
"common.monthname.november": "nov",
"common.monthname.december": "dec",
"common.open": "open", "common.open": "open",
"common.edit": "edit", "common.edit": "edit",
"common.show": "show", "common.show": "show",

View file

@ -283,4 +283,29 @@ namespace _dali.helpers
); );
} }
/**
*/
export function month_name(
month : int
)
: string
{
const keys : Array<string> = [
"common.monthname.january",
"common.monthname.february",
"common.monthname.march",
"common.monthname.april",
"common.monthname.may",
"common.monthname.june",
"common.monthname.july",
"common.monthname.august",
"common.monthname.september",
"common.monthname.october",
"common.monthname.november",
"common.monthname.december",
];
return lib_plankton.translate.get(keys[month-1]);
}
} }

View file

@ -40,21 +40,6 @@ namespace _dali
} }
/**
* @todo reload page when switching to "logged_out"
*/
async function update(
)
: Promise<void>
{
lib_plankton.log.debug(
"dali.update"
);
const logged_in : boolean = _dali.is_logged_in();
lib_plankton.zoo_page.nav_set_groups(nav_groups(logged_in));
// lib_plankton.zoo_page.reload();
}
/** /**
*/ */
@ -196,16 +181,7 @@ namespace _dali
} }
); );
} }
await update();
await _dali.overlay.initialize(); await _dali.overlay.initialize();
/*
lib_plankton.call.loop(
() => {
update();
},
_dali.conf.get().misc.update_interval
);
*/
// check if logged_in // check if logged_in
{ {

View file

@ -73,14 +73,15 @@ namespace _dali.conf
"default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}" "default": "http://localhost:8888/#oidc_finish,session_key={{session_key}}"
}, },
"use_central_europe_specific_datetime_inputs": { "use_central_europe_specific_datetime_inputs": {
"nullable": true, "nullable": false,
"type": "boolean", "type": "boolean",
"default": false "default": false
}, },
"update_interval": { "weekview_cell_day_format": {
"nullable": false, "nullable": false,
"type": "integer", "type": "string",
"default": 60 "default": "d.b",
"description": "available placeholders: Y,m,b,d,W,w (as in UNIX command 'date')"
}, },
}, },
"required": [ "required": [
@ -98,7 +99,25 @@ namespace _dali.conf
/** /**
*/ */
var _data : (null | any) = null; type type_data = {
version : string;
backend : {
scheme : string;
host : string;
port : int;
path : string;
};
misc : {
oidc_redirect_uri_template : string;
use_central_europe_specific_datetime_inputs : string;
weekview_cell_day_format : string;
};
};
/**
*/
var _data : (null | type_data) = null;
/** /**
@ -113,7 +132,7 @@ namespace _dali.conf
/** /**
*/ */
export function get( export function get(
) : any ) : type_data
{ {
if (_data === null) if (_data === null)
{ {
@ -131,10 +150,7 @@ namespace _dali.conf
path : string path : string
) : Promise<void> ) : Promise<void>
{ {
_data = await lib_plankton.conf.load( _data = ((await lib_plankton.conf.load(_schema, path)) as type_data);
_schema,
path
);
return Promise.resolve<void>(undefined); return Promise.resolve<void>(undefined);
} }

View file

@ -66,7 +66,7 @@ namespace _dali.widgets.menu
entry_data_list : Array<type_entry_data>, entry_data_list : Array<type_entry_data>,
{ {
"initial_groups": initial_groups = [], "initial_groups": initial_groups = [],
"initial_label": initial_label = "=", "initial_label": initial_label = "",
} }
: :
{ {
@ -115,10 +115,10 @@ namespace _dali.widgets.menu
: void : void
{ {
this.label = label; this.label = label;
this.container.querySelector(".widget-menu-button").textContent = ( this.container.querySelector(".widget-menu-button").innerHTML = (
(this.label === null) (this.label === null)
? ?
"[=]" ("[" + "=" + "]")
: :
("[" + this.label + "]") ("[" + this.label + "]")
); );

View file

@ -47,6 +47,24 @@
list-style-type: none; list-style-type: none;
} }
.widget-menu-entry
{
margin: 12px 8px;
text-transform: capitalize;
background-color: hsl(var(--hue), 0%, 25%);
color: hsl(var(--hue), 0%, 100%);
border-bottom: 2px solid hsl(0, 0%, 25%);
}
.widget-menu-entry:hover
{
color: hsl(var(--hue), 0%, 100%);
border-bottom: 2px solid hsl(0, 0%, 100%);
transition: 1s ease color;
}
/*
.widget-menu-entry .widget-menu-entry
{ {
margin: 8px; margin: 8px;
@ -58,15 +76,7 @@
background-color: hsl(var(--hue), 0%, 25%); background-color: hsl(var(--hue), 0%, 25%);
color: hsl(var(--hue), 0%, 100%); color: hsl(var(--hue), 0%, 100%);
} }
.widget-menu-entry:hover::before
{
content: "» ";
/*
background-color: hsl(var(--hue), 0%, 50%);
color: hsl(var(--hue), 0%, 100%);
*/ */
}
.widget-menu-entry.widget-menu-entry-hidden .widget-menu-entry.widget-menu-entry-hidden
{ {

View file

@ -121,7 +121,7 @@ namespace _dali.widgets.weekview
"vertical": vertical = false, "vertical": vertical = false,
"initial_year": initial_year = null, "initial_year": initial_year = null,
"initial_week": initial_week = null, "initial_week": initial_week = null,
"initial_count": initial_count = 4, "initial_count": initial_count = 5,
} }
: :
{ {
@ -386,13 +386,6 @@ namespace _dali.widgets.weekview
"tableview-cell-entry", "tableview-cell-entry",
{ {
"color": _dali.helpers.event_color(entry.hue), "color": _dali.helpers.event_color(entry.hue),
/*
"title": class_widget_weekview.event_generate_tooltip(
entry.calendar_name,
entry.event_object
),
*/
"title": "",
"name": entry.event_object.name, "name": entry.event_object.name,
"rel": entry.key, "rel": entry.key,
"additional_classes": lib_plankton.string.coin( "additional_classes": lib_plankton.string.coin(
@ -763,6 +756,8 @@ namespace _dali.widgets.weekview
today_begin_pit, today_begin_pit,
today_end_pit today_end_pit
); );
const day_as_date : lib_plankton.pit.type_date = lib_plankton.pit.to_datetime_ce(day_pit).date;
const day_as_ywd : lib_plankton.pit.type_ywd = lib_plankton.pit.to_ywd(day_pit);
return _dali.helpers.template_coin( return _dali.helpers.template_coin(
"widget-weekview", "widget-weekview",
"tableview-cell", "tableview-cell",
@ -772,48 +767,23 @@ namespace _dali.widgets.weekview
.concat(is_today ? ["weekview-cell-today"] : []) .concat(is_today ? ["weekview-cell-today"] : [])
.join(" ") .join(" ")
), ),
"title": lib_plankton.call.convey( "day": (
day_pit, _dali.conf.get().misc.weekview_cell_day_format
[ .replace(new RegExp("Y", "g"), day_as_date.year.toFixed(0).padStart(4, "0"))
lib_plankton.pit.to_datetime_ce, .replace(new RegExp("m", "g"), day_as_date.month.toFixed(0).padStart(2, "0"))
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin( .replace(new RegExp("b", "g"), _dali.helpers.month_name(day_as_date.month))
.replace(new RegExp("d", "g"), day_as_date.day.toFixed(0).padStart(2, "0"))
.replace(new RegExp("W", "g"), day_as_ywd.week.toFixed(0).padStart(2, "0"))
.replace(new RegExp("w", "g"), day_as_ywd.day.toFixed(0).padStart(1, "0"))
),
"rel": lib_plankton.string.coin(
"{{year}}-{{month}}-{{day}}", "{{year}}-{{month}}-{{day}}",
{ {
"year": x.date.year.toFixed(0).padStart(4, "0"), "year": day_as_date.year.toFixed(0).padStart(4, "0"),
"month": x.date.month.toFixed(0).padStart(2, "0"), "month": day_as_date.month.toFixed(0).padStart(2, "0"),
"day": x.date.day.toFixed(0).padStart(2, "0"), "day": day_as_date.day.toFixed(0).padStart(2, "0"),
} }
), ),
]
),
"day": lib_plankton.call.convey(
day_pit,
[
lib_plankton.pit.to_datetime_ce,
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
"{{year}}-{{month}}-{{day}}",
{
"year": x.date.year.toFixed(0).padStart(4, "0"),
"month": x.date.month.toFixed(0).padStart(2, "0"),
"day": x.date.day.toFixed(0).padStart(2, "0"),
}
),
]
),
"rel": lib_plankton.call.convey(
day_pit,
[
lib_plankton.pit.to_datetime_ce,
(x : lib_plankton.pit.type_datetime) => lib_plankton.string.coin(
"{{year}}-{{month}}-{{day}}",
{
"year": x.date.year.toFixed(0).padStart(4, "0"),
"month": x.date.month.toFixed(0).padStart(2, "0"),
"day": x.date.day.toFixed(0).padStart(2, "0"),
}
)
]
),
"entries": "" "entries": ""
} }
); );
@ -835,7 +805,11 @@ namespace _dali.widgets.weekview
element.addEventListener( element.addEventListener(
"click", "click",
(event) => { (event) => {
if (! (element === event.target)) if (
(! (element === event.target))
&&
(! (event.target as HTMLElement).classList.contains("weekview-day"))
)
{ {
// do nothing // do nothing
} }

View file

@ -87,7 +87,6 @@
.weekview-day .weekview-day
{ {
font-size: 0.75em; font-size: 0.75em;
cursor: help;
} }
.weekview-events .weekview-events

View file

@ -1,3 +1,3 @@
<li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" title="{{title}}" rel="{{rel}}"> <li class="weekview-event_entry{{additional_classes}}" style="background-color: {{color}};" rel="{{rel}}">
{{name}} {{name}}
</li> </li>

View file

@ -1,5 +1,5 @@
<td class="weekview-cell weekview-cell-regular{{extra_classes}}" rel="{{rel}}"> <td class="weekview-cell weekview-cell-regular{{extra_classes}}" rel="{{rel}}">
<span class="weekview-day" title="{{title}}"> <span class="weekview-day">
{{day}} {{day}}
</span> </span>
<ul class="weekview-events"> <ul class="weekview-events">