소스 검색

Added: Display option for "My labels" (#5884)

* configs

* Update entry_bottom.phtml

* i18n strings

* fix phpstand found error

* reuse existing i18n string

---------

Co-authored-by: math-gh <>
maTh 2 년 전
부모
커밋
0504fc6766

+ 3 - 1
app/Controllers/configureController.php

@@ -34,7 +34,8 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
 	 *   - display of read action in footer
 	 *   - display of favorite action in footer
 	 *   - display of sharing action in footer
-	 *   - display of tags in footer
+	 *   - display of article tags in footer
+	 *   - display of my Labels in footer
 	 *   - display of date in footer
 	 *   - display of open action in footer
 	 *   - html5 notification timeout (default: 0)
@@ -59,6 +60,7 @@ class FreshRSS_configure_Controller extends FreshRSS_ActionController {
 			FreshRSS_Context::$user_conf->bottomline_favorite = Minz_Request::paramBoolean('bottomline_favorite');
 			FreshRSS_Context::$user_conf->bottomline_sharing = Minz_Request::paramBoolean('bottomline_sharing');
 			FreshRSS_Context::$user_conf->bottomline_tags = Minz_Request::paramBoolean('bottomline_tags');
+			FreshRSS_Context::$user_conf->bottomline_myLabels = Minz_Request::paramBoolean('bottomline_myLabels');
 			FreshRSS_Context::$user_conf->bottomline_date = Minz_Request::paramBoolean('bottomline_date');
 			FreshRSS_Context::$user_conf->bottomline_link = Minz_Request::paramBoolean('bottomline_link');
 			FreshRSS_Context::$user_conf->show_nav_buttons = Minz_Request::paramBoolean('show_nav_buttons');

+ 1 - 0
app/Models/UserConfiguration.php

@@ -13,6 +13,7 @@ declare(strict_types=1);
  * @property bool $bottomline_read
  * @property bool $bottomline_sharing
  * @property bool $bottomline_tags
+ * @property bool $bottomline_myLabels
  * @property string $content_width
  * @property-read int $default_state
  * @property string $default_view

+ 7 - 2
app/views/configure/display.phtml

@@ -188,8 +188,9 @@
 							<th> </th>
 							<th title="<?= _t('conf.shortcut.mark_read') ?>"><?= _i('read') ?></th>
 							<th title="<?= _t('conf.shortcut.mark_favorite') ?>"><?= _i('starred') ?></th>
-							<th><?= _t('conf.display.icon.related_tags') ?></th>
-							<th><?= _t('conf.display.icon.sharing') ?></th>
+							<th title="<?= _t('index.menu.tags') ?>"><?= _i('label') ?></th>
+							<th title="<?= _t('conf.display.icon.related_tags') ?>"><?= _i('tag') ?></th>
+							<th title="<?= _t('conf.display.icon.sharing') ?>"><?= _i('share') ?></th>
 							<th><?= _t('conf.display.icon.summary') ?></th>
 							<th><?= _t('conf.display.icon.display_authors') ?></th>
 							<th><?= _t('conf.display.icon.publication_date') ?></th>
@@ -207,6 +208,7 @@
 								data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_favorite ?>" /></td>
 							<td><input type="checkbox" disabled="disabled" /></td>
 							<td><input type="checkbox" disabled="disabled" /></td>
+							<td><input type="checkbox" disabled="disabled" /></td>
 							<td><input type="checkbox" name="topline_summary" value="1"<?=
 								FreshRSS_Context::$user_conf->topline_summary ? 'checked="checked"' : '' ?>
 								data-leave-validation="<?= FreshRSS_Context::$user_conf->topline_summary ?>" /></td>
@@ -226,6 +228,9 @@
 							<td><input type="checkbox" name="bottomline_favorite" value="1"<?=
 								FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : '' ?>
 								data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_favorite ?>" /></td>
+							<td><input type="checkbox" name="bottomline_myLabels" value="1"<?=
+								FreshRSS_Context::$user_conf->bottomline_myLabels ? ' checked="checked"' : '' ?>
+								data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_myLabels ?>" /></td>
 							<td><input type="checkbox" name="bottomline_tags" value="1"<?=
 								FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : '' ?>
 								data-leave-validation="<?= FreshRSS_Context::$user_conf->bottomline_tags ?>" /></td>

+ 3 - 4
app/views/helpers/index/normal/entry_bottom.phtml

@@ -3,7 +3,7 @@
 	$bottomline_read = FreshRSS_Context::$user_conf->bottomline_read;
 	$bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite;
 	$bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count(FreshRSS_Context::$user_conf->sharing) > 0);
-	$bottomline_labels = true;	//TODO
+	$bottomline_myLabels = FreshRSS_Context::$user_conf->bottomline_myLabels;
 	$bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags;
 	$bottomline_date = FreshRSS_Context::$user_conf->bottomline_date;
 	$bottomline_link = FreshRSS_Context::$user_conf->bottomline_link;
@@ -30,8 +30,7 @@
 			?></li><?php
 		}
 	}
-	// @phpstan-ignore-next-line
-	if ($bottomline_labels) {
+	if ($bottomline_myLabels) {
 	?><li class="item labels">
 		<div class="item-element dropdown dynamictags">
 			<div id="dropdown-labels-<?= $this->entry->id() ?>" class="dropdown-target"></div>
@@ -70,7 +69,7 @@
 	</li><?php
 	}
 	?><li class="item share"><?php
-			if ($bottomline_sharing) {
+		if ($bottomline_sharing) {
 		?><div class="item-element dropdown">
 			<div id="dropdown-share-<?= $this->entry->id() ?>" class="dropdown-target"></div>
 			<a class="dropdown-toggle" href="#dropdown-share-<?= $this->entry->id() ?>">

+ 1 - 0
config-user.default.php

@@ -111,6 +111,7 @@ return array (
 	'bottomline_favorite' => true,
 	'bottomline_sharing' => true,
 	'bottomline_tags' => true,
+	'bottomline_myLabels' => true,
 	'bottomline_date' => true,
 	'bottomline_link' => true,
 	'sharing' => array (