aboutsummaryrefslogtreecommitdiff
path: root/app/views/helpers
diff options
context:
space:
mode:
authorGravatar maTh <math-home@web.de> 2022-03-14 23:03:25 +0100
committerGravatar GitHub <noreply@github.com> 2022-03-14 23:03:25 +0100
commit7b962e246bb9f273dda534b340851db799577dfe (patch)
tree009a0640aa5730a9fa3a6273bfed54de64bbc867 /app/views/helpers
parentd4db9c5a091f9217af533fcdfc79cc8bad546e8e (diff)
Improved: Extension manager: new style (#4181)
* new HTML structure. Delete-button moved to slider * Base template * dark templates * fix the position of the circle * fixed HTML * fix for netsurf * Netsurf 2: check if it works * fix phps * Update details.phtml * themes * fix code smell * Update adark.rtl.css * Update dark.rtl.css * fix code smell * fix code smell * fix empty line * readonly mode * Update template.rtl.css * Update details.phtml * Update disabled-light.svg * optimized SVG files * Update app/views/helpers/extension/details.phtml Co-authored-by: Alexandre Alapetite <alexandre@alapetite.fr>
Diffstat (limited to 'app/views/helpers')
-rw-r--r--app/views/helpers/extension/configure.phtml11
-rw-r--r--app/views/helpers/extension/details.phtml44
2 files changed, 34 insertions, 21 deletions
diff --git a/app/views/helpers/extension/configure.phtml b/app/views/helpers/extension/configure.phtml
index ea68287b1..34da8a535 100644
--- a/app/views/helpers/extension/configure.phtml
+++ b/app/views/helpers/extension/configure.phtml
@@ -7,6 +7,17 @@
<p class="alert alert-warn"><?= $this->extension->getDescription() ?> — <?= _t('gen.short.by_author'), ' ', $this->extension->getAuthor() ?></p>
+ <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
+ <form id="form-extension" method="post">
+ <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
+ <div class="form-group form-actions">
+ <div class="group-controls">
+ <button class="btn btn-attention confirm" form="form-extension" formaction="<?= _url('extension', 'remove', 'e', urlencode($this->extension->getName())) ?>"><?= _t('gen.action.remove') ?></button>
+ </div>
+ </div>
+ </form>
+ <?php } ?>
+
<h2><?= _t('gen.action.manage') ?></h2>
<?php
$configure_view = $this->extension->getConfigureView();
diff --git a/app/views/helpers/extension/details.phtml b/app/views/helpers/extension/details.phtml
index f6b361c6f..08226e86c 100644
--- a/app/views/helpers/extension/details.phtml
+++ b/app/views/helpers/extension/details.phtml
@@ -1,22 +1,24 @@
<?php /** @var FreshRSS_View $this */ ?>
-<ul class="horizontal-list">
- <li class="item">
- <?php if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) { ?>
- <?php $name_encoded = urlencode($this->ext_details->getName()); ?>
- <div class="stick">
- <a class="btn open-slider" href="<?= _url('extension', 'configure', 'e', $name_encoded) ?>"><?= _i('configure') ?> <?= _t('gen.action.manage') ?></a>
- <?php if ($this->ext_details->isEnabled()) { ?>
- <button class="btn active" form="form-extension" formaction="<?= _url('extension', 'disable', 'e', $name_encoded) ?>"><?= _t('gen.action.disable') ?></button>
- <?php } else { ?>
- <button class="btn" form="form-extension" formaction="<?= _url('extension', 'enable', 'e', $name_encoded) ?>"><?= _t('gen.action.enable') ?></button>
- <?php } ?>
- <?php if (FreshRSS_Auth::hasAccess('admin')) { ?>
- <button class="btn btn-attention confirm" form="form-extension" formaction="<?= _url('extension', 'remove', 'e', $name_encoded) ?>"><?= _t('gen.action.remove') ?></button>
- <?php } ?>
- </div>
- <?php } else { ?>
- <?= _t('admin.extensions.system.no_rights') ?>
- <?php } ?>
- </li>
- <li class="item"><?= $this->ext_details->getName() ?></li>
-</ul>
+
+<?php
+ $name_encoded = urlencode($this->ext_details->getName());
+ $ext_enabled = $this->ext_details->isEnabled();
+ if ($ext_enabled) {
+ $button_class = ' active';
+ $name_class = '';
+ $action = 'disable';
+ $title = _t('gen.action.disable');
+ } else {
+ $button_class = '';
+ $name_class = ' disabled';
+ $action = 'enable';
+ $title = _t('gen.action.enable');
+ }
+ if ($this->ext_details->getType() === 'user' || FreshRSS_Auth::hasAccess('admin')) {?>
+ <button class="switch<?= $button_class ?>" form="form-extension" formaction="<?= _url('extension', $action, 'e', $name_encoded) ?>" title="<?= _t('gen.action.enable') ?>"></button>
+ <a class="open-slider" title="<?= _t('gen.action.manage') ?>" href="<?= _url('extension', 'configure', 'e', $name_encoded) ?>"><?= _i('configure') ?></a>
+ <span class="ext_name<?= $name_class ?>"><?= $this->ext_details->getName() ?></span>
+<?php } else { ?>
+ <button class="switch<?= $button_class ?>" title="<?= _t('admin.extensions.system.no_rights') ?>" disabled="disabled"></button>
+ <span class="ext_name<?= $name_class ?>"><?= $this->ext_details->getName() ?></span>
+<?php } ?>