Merge pull request #14977 from mf-fx/settings_fixes_addons_connected_apps

Settings: Better handling of no content in addons and connected apps
This commit is contained in:
Michael Vogel 2025-07-03 17:35:23 +02:00 committed by GitHub
commit 01bb6963bf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 76 additions and 62 deletions

View file

@ -60,7 +60,7 @@ class Addons extends BaseSettings
'$addon' => $data['addon'],
'$title' => $data['title'],
'$open' => ($this->parameters['addon'] ?? '') === $data['addon'],
'$html' => $data['html'] ?? '',
'$html' => $data['html'] ?? '',
'$submit' => $data['submit'] ?? $this->t('Save Settings'),
]);
}
@ -68,10 +68,10 @@ class Addons extends BaseSettings
$tpl = Renderer::getMarkupTemplate('settings/addons.tpl');
return Renderer::replaceMacros($tpl, [
'$form_security_token' => BaseSettings::getFormSecurityToken('settings_addon'),
'$title' => $this->t('Addon Settings'),
'$no_addons_settings_configured' => $this->t('No Addon settings configured'),
'$addon_settings_forms' => $addon_settings_forms,
'$form_security_token' => BaseSettings::getFormSecurityToken('settings_addon'),
'$title' => $this->t('Addon Settings'),
'$no_addon_settings_configured' => $this->t('None of the addons installed on this server have any settings.'),
'$addon_settings_forms' => $addon_settings_forms,
]);
}
}

View file

@ -59,6 +59,7 @@ class OAuth extends BaseSettings
'$website' => $this->t('Home Page'),
'$created_at' => $this->t('Created'),
'$delete' => $this->t('Remove authorization'),
'$no_connected_apps' => $this->t('You have no connected apps.'),
'$apps' => $applications,
]);
}

View file

@ -8,7 +8,7 @@ msgid ""
msgstr ""
"Project-Id-Version: 2025.07-rc\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2025-06-21 13:03+0200\n"
"POT-Creation-Date: 2025-06-21 14:32+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -9545,7 +9545,7 @@ msgid "Addon Settings"
msgstr ""
#: src/Module/Settings/Addons.php:73
msgid "No Addon settings configured"
msgid "None of the addons installed on this server have any settings."
msgstr ""
#: src/Module/Settings/Channels.php:134
@ -10180,6 +10180,10 @@ msgstr ""
msgid "Remove authorization"
msgstr ""
#: src/Module/Settings/OAuth.php:62
msgid "You have no connected apps."
msgstr ""
#: src/Module/Settings/Profile/Index.php:126
msgid "Display Name is required."
msgstr ""

View file

@ -6,31 +6,35 @@
*}}
<div class="generic-page-wrapper">
<h1>{{$title}}</h1>
<form action="settings/oauth" method="post" autocomplete="off">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id='application-block' class='table table-condensed table-striped'>
<thead>
<tr>
<th>{{$name}}</th>
<th>{{$website}}</th>
<th>{{$created_at}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $apps as $app}}
<tr>
<td>{{$app.name}}</td>
<td>{{$app.website}}</td>
<td>{{$app.created_at}}</td>
<td>
<button type="submit" class="btn" title="{{$delete}}" name="delete" value="{{$app.id}}">
<i class="icon s22 delete" aria-hidden="true"></i>
</button>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</form>
{{if !$apps}}
{{$no_connected_apps}}
{{else}}
<form action="settings/oauth" method="post" autocomplete="off">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id='application-block' class='table table-condensed table-striped'>
<thead>
<tr>
<th>{{$name}}</th>
<th>{{$website}}</th>
<th>{{$created_at}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $apps as $app}}
<tr>
<td>{{$app.name}}</td>
<td>{{$app.website}}</td>
<td>{{$app.created_at}}</td>
<td>
<button type="submit" class="btn" title="{{$delete}}" name="delete" value="{{$app.id}}">
<i class="icon s22 delete" aria-hidden="true"></i>
</button>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</form>
{{/if}}
</div>

View file

@ -15,7 +15,7 @@
{{$addon_settings_form nofilter}}
</form>
{{foreachelse}}
<div class="alert alert-info" role="alert">{{$no_addon_settings_configured}}</div>
{{$no_addon_settings_configured}}
{{/foreach}}
</div>

View file

@ -7,31 +7,36 @@
<div class="generic-page-wrapper">
{{* include the title template for the settings title *}}
{{include file="section_title.tpl" title=$title}}
<form action="settings/oauth" method="post" autocomplete="off">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id='application-block' class='table table-condensed table-striped'>
<thead>
<tr>
<th>{{$name}}</th>
<th>{{$website}}</th>
<th>{{$created_at}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $apps as $app}}
<tr>
<td>{{$app.name}}</td>
<td>{{$app.website}}</td>
<td>{{$app.created_at}}</td>
<td>
<button type="submit" class="btn" title="{{$delete}}" name="delete" value="{{$app.id}}">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</form>
{{if !$apps}}
{{$no_connected_apps}}
{{else}}
<form action="settings/oauth" method="post" autocomplete="off">
<input type="hidden" name="form_security_token" value="{{$form_security_token}}">
<table id='application-block' class='table table-condensed table-striped'>
<thead>
<tr>
<th>{{$name}}</th>
<th>{{$website}}</th>
<th>{{$created_at}}</th>
<th></th>
</tr>
</thead>
<tbody>
{{foreach $apps as $app}}
<tr>
<td>{{$app.name}}</td>
<td>{{$app.website}}</td>
<td>{{$app.created_at}}</td>
<td>
<button type="submit" class="btn" title="{{$delete}}" name="delete" value="{{$app.id}}">
<i class="fa fa-trash" aria-hidden="true"></i>
</button>
</td>
</tr>
{{/foreach}}
</tbody>
</table>
</form>
{{/if}}
</div>