Improved defaults for templates in pages.meet

This commit is contained in:
Niko 2022-02-16 21:41:14 +01:00
parent 5075a218b5
commit e60cfc15db
4 changed files with 19 additions and 6 deletions

View File

@ -138,6 +138,10 @@ main {
.meet.item .status-content .text p {
margin: 0 !important;
}
.meet.item .status-content .text a {
color: #fdc4ff;
text-decoration: none;
}
.meet.item .status .profile { padding: 1em 2em; }
.meet.item .status .date {
width: max-content;

View File

@ -20,17 +20,24 @@ app.pages.meet = {
const dom = document.querySelector('#page-meet #content');
dom.innerHTML = '';
for (var i = 0; i < json.length; i++) {
var tpl = app.template.fill(json[i], app.template.get('meet.item'),
var item = json[i];
if (item.props === undefined)
item.props = { pcolors: {} }
if (item.account.props.age === undefined)
item.account.props.age = '??';
if (item.account.props.gender === undefined)
item.account.props.gender = 'unspecified';
if (item.account.props.place === undefined)
item.account.props.place = app.strings.app.the_fediverse;
if (item.account.props.pcolors === undefined)
item.account.props.pcolors = {};
var tpl = app.template.fill(item, app.template.get('meet.item'),
function (k,v) {
if (k === 'text') return html2text(v);
if (k === 'account.name') return capitalize(v);
if (k === 'date') return dayjs(v).fromNow(true);
});
var item = json[i];
if (item.props === undefined)
item.props = { pcolors: {} }
if (item.account.props.pcolors === undefined)
item.account.props.pcolors = {};
var postFgColor = item.account.props.pcolors.fg
|| app.vars.defaults.meet.item_pcolors.fg;

View File

@ -12,5 +12,6 @@ $strings = [
],
'app' => [
'years_old' => 'y/o',
'the_fediverse' => 'The Fediverse',
],
];

View File

@ -12,5 +12,6 @@ $strings = [
],
'app' => [
'years_old' => 'Años',
'the_fediverse' => 'El Fediverso',
],
];