From a6df3d0d6728b6379cb277b9260ec98df6c303b1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timoth=C3=A9e=20Jaussoin?= Date: Mon, 18 Nov 2024 22:14:20 +0100 Subject: [PATCH] Fix separation dot ASCII character and shorten article dates --- app/Helpers/DateHelper.php | 13 ++++++------- app/Widgets/Blog/blog.tpl | 4 ++-- app/Widgets/Chat/_chat_header.tpl | 2 +- app/Widgets/Chat/_chat_jingle_end.tpl | 2 +- app/Widgets/Chats/_chats_item.tpl | 2 +- .../_communitiesserver_ticket.tpl | 2 +- app/Widgets/CommunityData/_communitydata.tpl | 2 +- app/Widgets/CommunityData/_communitydata_card.tpl | 2 +- app/Widgets/CommunityHeader/_communityheader.tpl | 4 ++-- .../ContactActions/_contactactions_drawer.tpl | 2 +- app/Widgets/ContactHeader/_contactheader.tpl | 2 +- app/Widgets/EmojisConfig/_emojisconfig.tpl | 4 ++-- app/Widgets/Post/_post.tpl | 14 +++++++------- app/Widgets/Post/_post_card.tpl | 12 ++++++------ app/Widgets/Post/_post_ticket.tpl | 10 +++++----- app/Widgets/Publish/_publish_images.tpl | 2 +- app/Widgets/RoomsExplore/_roomsexplore_global.tpl | 2 +- app/Widgets/RoomsExplore/_roomsexplore_local.tpl | 2 +- app/Widgets/Search/_search_results.tpl | 2 +- 19 files changed, 42 insertions(+), 43 deletions(-) diff --git a/app/Helpers/DateHelper.php b/app/Helpers/DateHelper.php index d83615e5a..760259453 100644 --- a/app/Helpers/DateHelper.php +++ b/app/Helpers/DateHelper.php @@ -6,9 +6,9 @@ function getTimezoneOffset(): int { return (new DateTimeZone(defined('TIMEZONE') - ? TIMEZONE - : date_default_timezone_get()) - )->getOffset(new DateTime('now', new DateTimeZone('UTC'))); + ? TIMEZONE + : date_default_timezone_get()) + )->getOffset(new DateTime('now', new DateTimeZone('UTC'))); } /** @@ -19,14 +19,13 @@ function getTimezoneOffset(): int */ function prepareDate(string $datetime = '', bool $hours = true, bool $compact = false, bool $dateOnly = false): string { - $time = strtotime($datetime); $time = $time !== false ? $time : time(); $t = $time + getTimezoneOffset(); $date = ''; - $reldays = -(time() - $t - (time() % 86400)) / 86400; + $reldays = - (time() - $t - (time() % 86400)) / 86400; // if $reldays is within a week if (-7 < $reldays && $reldays <= 2) { @@ -41,10 +40,10 @@ function prepareDate(string $datetime = '', bool $hours = true, bool $compact = } } else { if (!$compact) { - $date .= __('day.'.strtolower(date('l', $t))) . ', '; + $date .= __('day.' . strtolower(date('l', $t))) . ', '; } - $date .= date('j', $t).' '.__('month.'.strtolower(date('F', $t))); + $date .= date('j', $t) . ' ' . __('month.' . strtolower(date('F', $t))); // Over 6 months if (abs($reldays) > 182) { diff --git a/app/Widgets/Blog/blog.tpl b/app/Widgets/Blog/blog.tpl index 9102b52f0..6c0745676 100644 --- a/app/Widgets/Blog/blog.tpl +++ b/app/Widgets/Blog/blog.tpl @@ -98,12 +98,12 @@ {if="$item != null"} {if="$item->description"}

- people {$c->__('communitydata.sub', $item->occupants)} · + people {$c->__('communitydata.sub', $item->occupants)} • {$item->description|stripTags}

{else}

- people {$c->__('communitydata.sub', $item->occupants)} · + people {$c->__('communitydata.sub', $item->occupants)} • {$item->server}

{/if} diff --git a/app/Widgets/Chat/_chat_header.tpl b/app/Widgets/Chat/_chat_header.tpl index 01b11b1da..fc948c45b 100644 --- a/app/Widgets/Chat/_chat_header.tpl +++ b/app/Widgets/Chat/_chat_header.tpl @@ -34,7 +34,7 @@ {if="$conference && $conference->info && $conference->info->related"} {$related = $conference->info->related} diff --git a/app/Widgets/Chat/_chat_jingle_end.tpl b/app/Widgets/Chat/_chat_jingle_end.tpl index 7f3d3fbfb..29d0a145a 100644 --- a/app/Widgets/Chat/_chat_jingle_end.tpl +++ b/app/Widgets/Chat/_chat_jingle_end.tpl @@ -1 +1 @@ -call_end {$c->__('chat.jingle_end')}{if="$diff"} · {if="$diff->h > 0"}{$c->__('chat.jingle_hours', $diff->h, $diff->i)}{elseif="$diff->i > 0"}{$c->__('chat.jingle_minutes', $diff->i, $diff->s)}{else}{$c->__('chat.jingle_seconds', $diff->s)}{/if}{/if} +call_end {$c->__('chat.jingle_end')}{if="$diff"} • {if="$diff->h > 0"}{$c->__('chat.jingle_hours', $diff->h, $diff->i)}{elseif="$diff->i > 0"}{$c->__('chat.jingle_minutes', $diff->i, $diff->s)}{else}{$c->__('chat.jingle_seconds', $diff->s)}{/if}{/if} diff --git a/app/Widgets/Chats/_chats_item.tpl b/app/Widgets/Chats/_chats_item.tpl index 659fe0683..983792fe1 100644 --- a/app/Widgets/Chats/_chats_item.tpl +++ b/app/Widgets/Chats/_chats_item.tpl @@ -13,7 +13,7 @@ {/if} {/if} " - title="{$contact->jid}{if="isset($message)"} · {$message->published|prepareDate}{/if}"> + title="{$contact->jid}{if="isset($message)"} • {$message->published|prepareDate}{/if}"> presence"}status {$roster->presence->presencekey}{/if} {if="$contact->locationDistance"} location{/if} diff --git a/app/Widgets/CommunitiesServer/_communitiesserver_ticket.tpl b/app/Widgets/CommunitiesServer/_communitiesserver_ticket.tpl index 4a8c6ca6a..e046661a4 100644 --- a/app/Widgets/CommunitiesServer/_communitiesserver_ticket.tpl +++ b/app/Widgets/CommunitiesServer/_communitiesserver_ticket.tpl @@ -30,7 +30,7 @@ {$community->node} {if="$community->isGallery()"} grid_view - · + • {/if} {if="$community->occupants > 0"} diff --git a/app/Widgets/CommunityData/_communitydata.tpl b/app/Widgets/CommunityData/_communitydata.tpl index 22149d5c7..2263573d5 100644 --- a/app/Widgets/CommunityData/_communitydata.tpl +++ b/app/Widgets/CommunityData/_communitydata.tpl @@ -25,7 +25,7 @@ {if="$related->occupants > 0"} - {$related->occupants} people · + {$related->occupants} people {/if} {if="$related->description"} diff --git a/app/Widgets/CommunityData/_communitydata_card.tpl b/app/Widgets/CommunityData/_communitydata_card.tpl index e02a8cccf..ce2fec8a1 100644 --- a/app/Widgets/CommunityData/_communitydata_card.tpl +++ b/app/Widgets/CommunityData/_communitydata_card.tpl @@ -35,7 +35,7 @@
article {$c->__('communitydata.num', $num)} - · + • people {$c->__('communitydata.sub', $info->occupants)} diff --git a/app/Widgets/CommunityHeader/_communityheader.tpl b/app/Widgets/CommunityHeader/_communityheader.tpl index bdb619e69..01a58f070 100644 --- a/app/Widgets/CommunityHeader/_communityheader.tpl +++ b/app/Widgets/CommunityHeader/_communityheader.tpl @@ -50,9 +50,9 @@ article {$num} {/if} {if="$info != null"} - · people {$info->occupants} + • people {$info->occupants} {if="$info->description"} - · {$info->description|strip_tags} + • {$info->description|strip_tags} {/if} {else} {$server} diff --git a/app/Widgets/ContactActions/_contactactions_drawer.tpl b/app/Widgets/ContactActions/_contactactions_drawer.tpl index 156221202..864761ece 100644 --- a/app/Widgets/ContactActions/_contactactions_drawer.tpl +++ b/app/Widgets/ContactActions/_contactactions_drawer.tpl @@ -48,7 +48,7 @@

{if="$roster && $roster->name && $roster->name != $contact->truename"} - {$roster->name} · + {$roster->name} • {/if} {$contact->id}

diff --git a/app/Widgets/ContactHeader/_contactheader.tpl b/app/Widgets/ContactHeader/_contactheader.tpl index b93037fe2..efbb97ebe 100644 --- a/app/Widgets/ContactHeader/_contactheader.tpl +++ b/app/Widgets/ContactHeader/_contactheader.tpl @@ -52,7 +52,7 @@

{if="$roster && $roster->name && $roster->name != $contact->truename"} - {$roster->name} · + {$roster->name} • {/if} {$contact->id}

diff --git a/app/Widgets/EmojisConfig/_emojisconfig.tpl b/app/Widgets/EmojisConfig/_emojisconfig.tpl index 58c24317c..e253f86d9 100644 --- a/app/Widgets/EmojisConfig/_emojisconfig.tpl +++ b/app/Widgets/EmojisConfig/_emojisconfig.tpl @@ -27,11 +27,11 @@ {$value->description} {/if} {if="$value->homepage"} - · + • {$c->__('general.website')} {/if} {if="$value->license"} - · + • {$value->license} {/if}

diff --git a/app/Widgets/Post/_post.tpl b/app/Widgets/Post/_post.tpl index c39de99f9..a94656f95 100644 --- a/app/Widgets/Post/_post.tpl +++ b/app/Widgets/Post/_post.tpl @@ -98,7 +98,7 @@ {else}

{/if} -

+

{if="$contact"} {if="!$public"} {if="!$post->isMicroblog()"} @@ -109,9 +109,9 @@ {/if} {$contact->truename} - {if="!$public"}{/if} · + {if="!$public"}{/if} • {elseif="$post->aname"} - {$post->aname} · + {$post->aname} • {/if} {if="!$post->isMicroblog()"} {if="!$public"} @@ -123,20 +123,20 @@ {/if} {$post->node} - {if="!$public"}{/if} · + {if="!$public"}{/if} • {/if} - {$post->published|prepareDate} + {$post->published|prepareDate:true,true} {if="$post->isEdited()"} edit {/if} {if="$post->contentcleaned && readTime($post->contentcleaned)"} - · {$post->contentcleaned|readTime} + • {$post->contentcleaned|readTime} {/if} {$count = $post->user_views_count} {if="$count > 2"} - · {$count} visibility + • {$count} visibility {/if}

{if="$post->isBrief()"} diff --git a/app/Widgets/Post/_post_card.tpl b/app/Widgets/Post/_post_card.tpl index 703c12e76..a1005931b 100644 --- a/app/Widgets/Post/_post_card.tpl +++ b/app/Widgets/Post/_post_card.tpl @@ -38,7 +38,7 @@

{/if} -

+

{if="$post->aid"} {if="!$post->isMicroblog() && $post->contact"} @@ -52,7 +52,7 @@ {/if} > {$post->truename} - · + • {/if} {if="!$post->isMicroblog()"} @@ -65,9 +65,9 @@ {/if} / {$post->node} - · + • {/if} - {$post->published|prepareDate} + {$post->published|prepareDate:true,true} {if="$post->isEdited()"} edit @@ -80,11 +80,11 @@ {/if} {if="$post->contentcleaned && readTime($post->contentcleaned)"} - · {$post->contentcleaned|readTime} + • {$post->contentcleaned|readTime} {/if} {$count = $post->user_views_count} {if="$count > 2"} - · {$count} visibility + • {$count} visibility {/if}

{if="$post->isBrief()"} diff --git a/app/Widgets/Post/_post_ticket.tpl b/app/Widgets/Post/_post_ticket.tpl index 6fd5d7b81..71e3607a2 100644 --- a/app/Widgets/Post/_post_ticket.tpl +++ b/app/Widgets/Post/_post_ticket.tpl @@ -70,7 +70,7 @@ title="{$post->server} / {$post->node}" href="#" onclick="MovimUtils.reload('{$c->route('community', [$post->server, $post->node])}')"> - {if="$post->contact"}·{/if} + {if="$post->contact"}•{/if} {$post->node} {/if} @@ -78,16 +78,16 @@ {$count = $post->pictures->count()} {if="$count > 1"} - {$count} collections · + {$count} collections • {/if} {if="$post->embed"} - movie · + movie • {/if} {$count = $post->user_views_count} {if="$count > 2"} - {$count} visibility · + {$count} visibility • {/if} {$count = $post->likes->count()} @@ -97,7 +97,7 @@ {$count = $post->comments->count()} {if="$count > 0"} - {$count} chat_bubble_outline · + {$count} chat_bubble_outline • {/if} {$post->published|prepareDate:true,true} diff --git a/app/Widgets/Publish/_publish_images.tpl b/app/Widgets/Publish/_publish_images.tpl index 58740607d..09c07c84e 100644 --- a/app/Widgets/Publish/_publish_images.tpl +++ b/app/Widgets/Publish/_publish_images.tpl @@ -7,7 +7,7 @@ onclick="Publish_ajaxHttpSetImageNumber({$embed->draft_id}, {$embed->id}, {$key+1})"> photo - {$value.width} × {$value.height} · {$value.size|humanSize:0} + {$value.width} × {$value.height} • {$value.size|humanSize:0} {/loop} diff --git a/app/Widgets/RoomsExplore/_roomsexplore_global.tpl b/app/Widgets/RoomsExplore/_roomsexplore_global.tpl index beb12637f..932dba1f0 100644 --- a/app/Widgets/RoomsExplore/_roomsexplore_global.tpl +++ b/app/Widgets/RoomsExplore/_roomsexplore_global.tpl @@ -37,7 +37,7 @@ {$value.occupants} people {/if} - {if="$value.occupants > 0 && !empty($value.description)"} · {/if} + {if="$value.occupants > 0 && !empty($value.description)"} • {/if} {$value.description}

diff --git a/app/Widgets/RoomsExplore/_roomsexplore_local.tpl b/app/Widgets/RoomsExplore/_roomsexplore_local.tpl index b9b8abb65..294da6da1 100644 --- a/app/Widgets/RoomsExplore/_roomsexplore_local.tpl +++ b/app/Widgets/RoomsExplore/_roomsexplore_local.tpl @@ -38,7 +38,7 @@ {$value->occupants} people
{/if} - {if="$value->occupants > 0 && !empty($value->description)"} · {/if} + {if="$value->occupants > 0 && !empty($value->description)"} • {/if} {$value->description ?? ''}

diff --git a/app/Widgets/Search/_search_results.tpl b/app/Widgets/Search/_search_results.tpl index c0d7dfb83..c56b0b3a1 100644 --- a/app/Widgets/Search/_search_results.tpl +++ b/app/Widgets/Search/_search_results.tpl @@ -42,7 +42,7 @@

{if="$value->isGallery()"} grid_view - · + • {/if} {$value->server} / {$value->node}