Browse Source

Improve/fix label management (#6212)

* add the slider

* the styles

* add the title

* improve the column layout
maTh 2 years ago
parent
commit
c18987fae3

+ 2 - 0
app/Controllers/tagController.php

@@ -195,6 +195,8 @@ class FreshRSS_tag_Controller extends FreshRSS_ActionController {
 	}
 
 	public function indexAction(): void {
+		FreshRSS_View::prependTitle(_t('sub.menu.label_management') . ' · ');
+
 		if (!FreshRSS_Auth::hasAccess()) {
 			Minz_Error::error(403);
 		}

+ 22 - 2
app/views/tag/index.phtml

@@ -29,10 +29,30 @@
 
 	<?php if (count($this->tags) > 0): ?>
 	<h2><?= _t('gen.action.manage') ?></h2>
-	<ul>
+	<ul id="tagsList" <?= (count($this->tags) > 11) ? 'class="listInColumns"' : '' ?>>
 	<?php foreach ($this->tags as $tag): ?>
-		<li><a href="<?= _url('tag', 'update', 'id', $tag->id()) ?>"><?= $tag->name() ?></a></li>
+		<li>
+			<a href="<?= _url('tag', 'update', 'id', $tag->id()) ?>" class="configure open-slider" title="<?= _t('gen.action.manage') ?>">
+				<?= _i('configure') ?>
+			</a>
+			<?= $tag->name() ?>
+		</li>
 	<?php endforeach; ?>
 	</ul>
 	<?php endif; ?>
 </main>
+
+<?php $class = isset($this->tag) ? ' active' : ''; ?>
+<aside id="slider" class="<?= $class ?>">
+	<a class="toggle_aside" href="#close"><img class="icon" src="../themes/icons/close.svg" loading="lazy" alt="❌"></a>
+	<div id="slider-content">
+		<?php
+			if (isset($this->tag)) {
+				$this->renderHelper('tag/update');
+			}
+		?>
+	</div>
+</aside>
+<a href="#" id="close-slider">
+	<?= _i('close') ?>
+</a>

+ 16 - 0
p/themes/base-theme/frss.css

@@ -97,6 +97,22 @@ ul, ol, dd {
 	padding: 0;
 }
 
+ul.listInColumns {
+	column-count: 5;
+	column-width: 250px;
+	max-width: 1700px;
+}
+
+ul.listInColumns li {
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
+}
+
+#tagsList {
+	list-style: none;
+}
+
 /*=== Titles */
 h1 {
 	margin: 1rem 0 0.5rem;

+ 16 - 0
p/themes/base-theme/frss.rtl.css

@@ -97,6 +97,22 @@ ul, ol, dd {
 	padding: 0;
 }
 
+ul.listInColumns {
+	column-count: 5;
+	column-width: 250px;
+	max-width: 1700px;
+}
+
+ul.listInColumns li {
+	white-space: nowrap;
+	text-overflow: ellipsis;
+	overflow: hidden;
+}
+
+#tagsList {
+	list-style: none;
+}
+
 /*=== Titles */
 h1 {
 	margin: 1rem 0 0.5rem;