forked from GNUsocial/gnu-social
[COMPONENTS][Posting] Form is no longer added to RightPanel if not on a feed|conversation|groups route
This commit is contained in:
parent
9d9abf8afb
commit
5b94973079
@ -19,11 +19,7 @@
|
|||||||
{% if notes is defined %}
|
{% if notes is defined %}
|
||||||
<article>
|
<article>
|
||||||
<header class="feed-header">
|
<header class="feed-header">
|
||||||
{% if page_title is defined %}
|
<h1 class="section-title">{{ 'Notes' | trans }}</h1>
|
||||||
<h1 class="heading-no-margin">{{ page_title | trans }}</h1>
|
|
||||||
{% else %}
|
|
||||||
<h1 class="heading-no-margin">{{ 'Notes' | trans }}</h1>
|
|
||||||
{% endif %}
|
|
||||||
<nav class="feed-actions">
|
<nav class="feed-actions">
|
||||||
<details class="feed-actions-details">
|
<details class="feed-actions-details">
|
||||||
<summary>
|
<summary>
|
||||||
|
@ -73,7 +73,7 @@ class Posting extends Component
|
|||||||
*/
|
*/
|
||||||
public function onAddMainRightPanelBlock(Request $request, array &$res): bool
|
public function onAddMainRightPanelBlock(Request $request, array &$res): bool
|
||||||
{
|
{
|
||||||
if (\is_null($user = Common::user())) {
|
if (\is_null($user = Common::user()) || preg_match('(feed|conversation|group)', $request->get('_route')) === 0) {
|
||||||
return Event::next;
|
return Event::next;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -100,9 +100,9 @@ class Posting extends Component
|
|||||||
$form_params = [];
|
$form_params = [];
|
||||||
if (!empty($in_targets)) { // @phpstan-ignore-line
|
if (!empty($in_targets)) { // @phpstan-ignore-line
|
||||||
// Add "none" option to the first of choices
|
// Add "none" option to the first of choices
|
||||||
$in_targets = array_merge([_m('Public') => 'public'], $in_targets);
|
$in_targets = array_merge([_m('Public') => 'public'], $in_targets);
|
||||||
// Make the context actor the first In target option
|
// Make the context actor the first In target option
|
||||||
if (!is_null($context_actor)) {
|
if (!\is_null($context_actor)) {
|
||||||
foreach ($in_targets as $it_nick => $it_id) {
|
foreach ($in_targets as $it_nick => $it_id) {
|
||||||
if ($it_id === $context_actor->getId()) {
|
if ($it_id === $context_actor->getId()) {
|
||||||
unset($in_targets[$it_nick]);
|
unset($in_targets[$it_nick]);
|
||||||
@ -119,7 +119,7 @@ class Posting extends Component
|
|||||||
_m('Local') => VisibilityScope::LOCAL->value,
|
_m('Local') => VisibilityScope::LOCAL->value,
|
||||||
_m('Addressee') => VisibilityScope::ADDRESSEE->value,
|
_m('Addressee') => VisibilityScope::ADDRESSEE->value,
|
||||||
];
|
];
|
||||||
if (!is_null($context_actor) && $context_actor->isGroup()) {
|
if (!\is_null($context_actor) && $context_actor->isGroup()) {
|
||||||
if ($actor->canModerate($context_actor)) {
|
if ($actor->canModerate($context_actor)) {
|
||||||
if ($context_actor->getRoles() & ActorLocalRoles::PRIVATE_GROUP) {
|
if ($context_actor->getRoles() & ActorLocalRoles::PRIVATE_GROUP) {
|
||||||
$visibility_options = array_merge([_m('Group') => VisibilityScope::GROUP->value], $visibility_options);
|
$visibility_options = array_merge([_m('Group') => VisibilityScope::GROUP->value], $visibility_options);
|
||||||
|
@ -53,7 +53,7 @@
|
|||||||
</summary>
|
</summary>
|
||||||
|
|
||||||
{% for block in extra %}
|
{% for block in extra %}
|
||||||
<section class="frame-section-padding">
|
<section class="posting-extra frame-section-padding">
|
||||||
{{ block | raw }}
|
{{ block | raw }}
|
||||||
</section>
|
</section>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
|
@ -406,6 +406,23 @@ embed header {
|
|||||||
flex: 1;
|
flex: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.posting-extra .h-entry {
|
||||||
|
padding-left: var(--s);
|
||||||
|
padding-right: var(--s);
|
||||||
|
}
|
||||||
|
|
||||||
|
.posting-extra .note-sidebar {
|
||||||
|
all: unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.posting-extra .note-sidebar .avatar {
|
||||||
|
all: unset;
|
||||||
|
max-width: 1em;
|
||||||
|
max-height: 1em;
|
||||||
|
min-width: 1em;
|
||||||
|
margin-right: 4px;
|
||||||
|
}
|
||||||
|
|
||||||
@media only screen and (max-width: 1280px) {
|
@media only screen and (max-width: 1280px) {
|
||||||
.note-sidebar {
|
.note-sidebar {
|
||||||
max-width: min-content !important;
|
max-width: min-content !important;
|
||||||
|
@ -52,17 +52,16 @@
|
|||||||
<article
|
<article
|
||||||
tabindex="0"
|
tabindex="0"
|
||||||
title="{{'A note by actor' | trans}} {{ nickname }}"
|
title="{{'A note by actor' | trans}} {{ nickname }}"
|
||||||
|
id="{{ 'note-compact-anchor-' ~ note.getId() }}"
|
||||||
class="h-entry hentry note"
|
class="h-entry hentry note"
|
||||||
lang={{ note.getLanguageLocale() }}>
|
lang="{{ note.getLanguageLocale() }}">
|
||||||
{{ block('note_sidebar', 'cards/blocks/note.html.twig') }}
|
|
||||||
<div class="note-wrapper">
|
<div class="note-wrapper">
|
||||||
<header class="note-info">
|
<header class="note-info">
|
||||||
<div class="note-info-start">
|
{{ block('note_sidebar', 'cards/blocks/note.html.twig') }}
|
||||||
{{ block('note_author', 'cards/blocks/note.html.twig') }}
|
{{ block('note_author', 'cards/blocks/note.html.twig') }}
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
|
|
||||||
<section role="dialog" class="e-content entry-content note-content">
|
<section class="e-content entry-content note-content" title="{{ 'Note\'s main content' | trans }}">
|
||||||
<small class="note-conversation-info">
|
<small class="note-conversation-info">
|
||||||
<a href="{{ note.getConversationUrl() }}"
|
<a href="{{ note.getConversationUrl() }}"
|
||||||
class="note-conversation-url">{{ 'in conversation' | trans }}</a>
|
class="note-conversation-url">{{ 'in conversation' | trans }}</a>
|
||||||
|
Loading…
Reference in New Issue
Block a user