aboutsummaryrefslogtreecommitdiff
path: root/app/views/subscription/index.phtml
blob: 7b36a02c1a375a149333b06a39829950edb3b3bc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
<?php $this->partial('aside_subscription'); ?>

<div class="post drop-section">
	<a href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>

	<h2><?= _t('sub.title') ?></h2>

	<p class="alert alert-warn">
		<?= _t('sub.feed.moved_category_deleted', $this->default_category->name()) ?>
	</p>

	<p class="alert alert-warn">
		<?= _t('sub.add', _url('subscription', 'add')) ?>
	</p>

	<?php if ($this->onlyFeedsWithError): ?>
	<p class="alert alert-warn">
		<?= _t('sub.feed.showing.error') ?>
	</p>
	<?php endif; ?>

	<form id="controller-category" method="post" aria-hidden="true">
		<input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
	</form>

	<?php
		foreach ($this->categories as $cat) {
			$feeds = $cat->feeds();
	?>
	<div class="box">
		<div class="box-title">
			<a class="configure open-slider" href="<?= _url('subscription', 'category', 'id', $cat->id()) ?>"><?= _i('configure') ?></a>
			<?= $cat->name() ?>
		</div>
		<ul class="box-content" data-cat-id="<?= $cat->id() ?>">
			<?php if (!empty($feeds)) { ?>
			<?php
					foreach ($feeds as $feed) {
						if ($this->onlyFeedsWithError && !$feed->inError()) {
							continue;
						}
						$error = $feed->inError() ? ' error' : '';
						$empty = $feed->nbEntries() == 0 ? ' empty' : '';
			?>
			<li class="item feed<?= $error, $empty, $feed->mute() ? ' mute' : '' ?>"
				draggable="true"
				data-feed-id="<?= $feed->id() ?>"
				dropzone="move">
				<a class="configure open-slider" href="<?= _url('subscription', 'feed', 'id', $feed->id()) ?>"><?= _i('configure') ?></a>
				<?php if (FreshRSS_Context::$user_conf->show_favicons): ?><img class="favicon" src="<?= $feed->favicon() ?>" alt="✇" loading="lazy" /><?php endif; ?>
				<?= $feed->name() ?>
			</li>
			<?php 	}
				} else {
			?>
			<li class="item disabled" dropzone="move"><?= _t('sub.category.empty') ?></li>
			<?php } ?>
		</ul>
	</div>
	<?php } ?>

	<ul>
		<?php if ($this->onlyFeedsWithError): ?>
		<li><a href="<?= _url('subscription', 'index') ?>"><?= _t('sub.feed.show.all') ?></a></li>
		<?php else: ?>
		<li><a href="<?= _url('subscription', 'index', 'error', 1) ?>"><?= _t('sub.feed.show.error') ?></a></li>
		<?php endif; ?>
	</ul>
</div>

<?php $class = $this->displaySlider ? ' class="active"' : ''; ?>
<a href="#" id="close-slider"<?= $class ?>>
	<?= _i('close') ?>
</a>
<div id="slider"<?= $class ?>>
<?php
	if (isset($this->feed)) {
		$this->renderHelper('feed/update');
	} elseif (isset($this->category)) {
		$this->renderHelper('category/update');
	}
?>
</div>