]> git.mxchange.org Git - friendica.git/commitdiff
open channel settings when empty
authorMichael <heluecht@pirati.ca>
Sun, 17 Dec 2023 06:41:19 +0000 (06:41 +0000)
committerMichael <heluecht@pirati.ca>
Sun, 17 Dec 2023 06:41:19 +0000 (06:41 +0000)
src/Module/Settings/Channels.php
view/theme/frio/templates/settings/channels.tpl

index 557283fef30b4708926ebd857b6914091531e30f..5e45b2cbb4cf4ec7a8274cc2136c83c717da9919 100644 (file)
@@ -152,6 +152,7 @@ class Channels extends BaseSettings
 
                $t = Renderer::getMarkupTemplate('settings/channels.tpl');
                return Renderer::replaceMacros($t, [
+                       'open'         => count($channels) == 0,
                        'label'        => ["new_label", $this->t('Label'), '', $this->t('Short name for the channel. It is displayed on the channels widget.'), $this->t('Required')],
                        'description'  => ["new_description", $this->t("Description"), '', $this->t('This should describe the content of the channel in a few word.')],
                        'access_key'   => ["new_access_key", $this->t("Access Key"), '', $this->t('When you want to access this channel via an access key, you can define it here. Pay attention to not use an already used one.')],
index be11966842c30ca32e6aa216719284d8a3e5530c..7ed2b1cc5d1d44b30ea779b4df32962676aeab0e 100644 (file)
@@ -5,12 +5,12 @@
                <form class="panel" action="{{$baseurl}}/settings/channels" method="post">
                        <div class="section-subtitle-wrapper panel-heading" role="tab" id="add-settings-title">
                                <h2>
-                                       <button class="btn-link accordion-toggle collapsed" data-toggle="collapse" data-parent="#settings-channels" href="#add-settings-content" aria-expanded="false" aria-controls="add-settings-content">
+                                       <button class="btn-link accordion-toggle{{if !$open}} collapsed{{/if}}" data-toggle="collapse" data-parent="#settings-channels" href="#add-settings-content" aria-expanded="false" aria-controls="add-settings-content">
                                                {{$l10n.addtitle}}
                                        </button>
                                </h2>
                        </div>
-                       <div id="add-settings-content" class="panel-collapse collapse" role="tabpanel" aria-labelledby="add-settings-title">
+                       <div id="add-settings-content" class="panel-collapse collapse{{if $open}} in{{/if}}" role="tabpanel" aria-labelledby="add-settings-title">
                                <input type="hidden" name="form_security_token" value="{{$form_security_token}}">
                                {{include file="field_input.tpl" field=$label}}
                                {{include file="field_input.tpl" field=$description}}