From bc65ea96935e0b2116d85d1bb2cce54542bbe48e Mon Sep 17 00:00:00 2001 From: Damian Wajer Date: Wed, 22 Feb 2023 16:27:27 +0100 Subject: [PATCH 1/3] Use available space for post interaction buttons Related: https://github.com/friendica/friendica/issues/12835 --- view/theme/frio/css/style.css | 21 +- view/theme/frio/templates/wall_thread.tpl | 238 +++++++++++----------- 2 files changed, 137 insertions(+), 122 deletions(-) diff --git a/view/theme/frio/css/style.css b/view/theme/frio/css/style.css index b8437e15ff..c7adc2c8a9 100644 --- a/view/theme/frio/css/style.css +++ b/view/theme/frio/css/style.css @@ -1994,6 +1994,18 @@ code > .hl-main { .wall-item-actions-right { display: flex; } +.wall-item-actions-items { + flex-grow: 1; +} +.wall-item-actions-row { + display: flex; +} +.wall-item-actions-row .btn { + width: 100%; +} +.wall-item-actions-row > * { + flex: 1 1 0; +} .wall-item-actions .checkbox { margin: 0 0 0 15px; } @@ -2001,14 +2013,17 @@ code > .hl-main { .wall-item-actions .btn, .wall-item-actions a, .wall-item-actions button { - padding-right: 12px; - padding-left: 12px; + padding-right: 0; + padding-left: 0; } .wall-item-actions .checkbox { margin-top: 8px; + flex: 0 1 auto; } .wall-item-actions .like-rotator { - padding-top: 8px; + position: absolute; + top: 8px; + right: 0; } } .wall-item-actions button:hover { diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index 41738a0e4e..c1a8555cf3 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -436,146 +436,146 @@ as the value of $top_child_total (this is done at the end of this file) -
- {{* Buttons for like and dislike *}} - {{if $item.vote}} - {{if $item.vote.like}} - - {{/if}} - {{if $item.vote.dislike}} - - {{/if}} - {{/if}} - - {{* Button to open the comment text field *}} - {{if $item.comment_html}} - - {{/if}} - - {{if $item.vote.announce OR $item.vote.share}} - - {{/if}} + {{/if}} - {{if $item.browsershare}} - - {{/if}} + {{* Button to open the comment text field *}} + {{if $item.comment_html}} + + {{/if}} - {{* Put additional actions in a dropdown menu *}} - -
+ {{if $item.vote.announce OR $item.vote.share}} + + {{/if}} + + {{if $item.browsershare}} + + {{/if}} + + {{* Put additional actions in a dropdown menu *}} + -
{{* Event attendance buttons *}} - {{if $item.isevent}} + {{if $item.isevent}}
- {{/if}} + {{/if}} - {{if $item.edpost || $item.tagger || $item.filer || $item.pin || $item.star || $item.follow_thread || $item.ignore || ($item.drop && $item.drop.dropping)}} - + {{/if}} - {{if $item.drop && $item.drop.pagedrop}} - - - {{/if}} + {{if $item.drop && $item.drop.pagedrop}} + + + {{/if}} +
From 45571fe6a7d8848e6deafd4acf9f0b23d2c4810e Mon Sep 17 00:00:00 2001 From: Damian Wajer Date: Wed, 1 Mar 2023 18:09:18 +0100 Subject: [PATCH 2/3] [frio] Move "Share via" to the share dropdown --- view/theme/frio/templates/wall_thread.tpl | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/view/theme/frio/templates/wall_thread.tpl b/view/theme/frio/templates/wall_thread.tpl index c1a8555cf3..5fda4d2bca 100644 --- a/view/theme/frio/templates/wall_thread.tpl +++ b/view/theme/frio/templates/wall_thread.tpl @@ -479,14 +479,17 @@ as the value of $top_child_total (this is done at the end of this file) {{/if}} + {{if $item.browsershare}} +
  • + +
  • + {{/if}} {{/if}} - {{if $item.browsershare}} - - {{/if}} - {{* Put additional actions in a dropdown menu *}} From ea3a56ccfacc0c8ea41ff228b17b46a35701f558 Mon Sep 17 00:00:00 2001 From: Michael Date: Thu, 2 Mar 2023 21:07:33 +0000 Subject: [PATCH 3/3] API: Fix dateformat on status --- src/Object/Api/Mastodon/Account.php | 4 ++-- src/Object/Api/Mastodon/Status.php | 4 ++-- src/Object/Api/Mastodon/Status/FriendicaExtension.php | 7 ++++--- 3 files changed, 8 insertions(+), 7 deletions(-) diff --git a/src/Object/Api/Mastodon/Account.php b/src/Object/Api/Mastodon/Account.php index 5a66209777..d8f854d5b7 100644 --- a/src/Object/Api/Mastodon/Account.php +++ b/src/Object/Api/Mastodon/Account.php @@ -116,8 +116,8 @@ class Account extends BaseDataTransferObject $this->following_count = $account['ap-following_count'] ?? $account['diaspora-interacting_count'] ?? 0; $this->statuses_count = $account['ap-statuses_count'] ?? $account['diaspora-post_count'] ?? 0; - $lastItem = $account['last-item'] ?: DBA::NULL_DATETIME; - $this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, 'Y-m-d') : null; + $lastItem = $account['last-item'] ? DateTimeFormat::utc($account['last-item'], 'Y-m-d') : DBA::NULL_DATETIME; + $this->last_status_at = $lastItem != DBA::NULL_DATETIME ? DateTimeFormat::utc($lastItem, DateTimeFormat::JSON) : null; // No custom emojis per account in Friendica $this->emojis = []; diff --git a/src/Object/Api/Mastodon/Status.php b/src/Object/Api/Mastodon/Status.php index 1ce996c5d8..9a077d62dd 100644 --- a/src/Object/Api/Mastodon/Status.php +++ b/src/Object/Api/Mastodon/Status.php @@ -110,8 +110,8 @@ class Status extends BaseDataTransferObject public function __construct(array $item, Account $account, Counts $counts, UserAttributes $userAttributes, bool $sensitive, Application $application, array $mentions, array $tags, Card $card, array $attachments, array $in_reply, array $reblog, FriendicaExtension $friendica, array $quote = null, array $poll = null) { $this->id = (string)$item['uri-id']; - $this->created_at = $item['created']; - $this->edited_at = $item['edited']; + $this->created_at = DateTimeFormat::utc($item['created'], DateTimeFormat::JSON); + $this->edited_at = DateTimeFormat::utc($item['edited'], DateTimeFormat::JSON); if ($item['gravity'] == Item::GRAVITY_COMMENT) { $this->in_reply_to_id = (string)$item['thr-parent-id']; diff --git a/src/Object/Api/Mastodon/Status/FriendicaExtension.php b/src/Object/Api/Mastodon/Status/FriendicaExtension.php index 8e68f3014e..5702c0678d 100644 --- a/src/Object/Api/Mastodon/Status/FriendicaExtension.php +++ b/src/Object/Api/Mastodon/Status/FriendicaExtension.php @@ -22,6 +22,7 @@ namespace Friendica\Object\Api\Mastodon\Status; use Friendica\BaseDataTransferObject; +use Friendica\Util\DateTimeFormat; /** * Class FriendicaExtension @@ -70,9 +71,9 @@ class FriendicaExtension extends BaseDataTransferObject FriendicaDeliveryData $delivery_data ) { $this->title = $title; - $this->changed_at = $changed_at; - $this->commented_at = $commented_at; - $this->received_at = $received_at; + $this->changed_at = $changed_at ? DateTimeFormat::utc($changed_at, DateTimeFormat::JSON) : null; + $this->commented_at = $commented_at ? DateTimeFormat::utc($commented_at, DateTimeFormat::JSON) : null; + $this->received_at = $received_at ? DateTimeFormat::utc($received_at, DateTimeFormat::JSON) : null; $this->delivery_data = $delivery_data; $this->dislikes_count = $dislikes_count; }