aboutsummaryrefslogtreecommitdiff
path: root/app/views/subscription/index.phtml
blob: 20f72ad66c2db8e9d5d473920276e0018567f4ea (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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
<?php $this->partial('aside_subscription'); ?>

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

	<h2><?php echo _t('sub.title'); ?></h2>

	<form id="add_rss" method="post" action="<?php echo _url('feed', 'add'); ?>" autocomplete="off">
		<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
		<div class="stick">
			<input type="url" name="url_rss" class="long" placeholder="<?php echo _t('sub.feed.add'); ?>" />
			<div class="dropdown">
				<div id="dropdown-cat" class="dropdown-target"></div>

				<a class="dropdown-toggle btn" href="#dropdown-cat"><?php echo _i('down'); ?></a>
				<ul class="dropdown-menu">
					<li class="dropdown-close"><a href="#close">❌</a></li>

					<li class="dropdown-header"><?php echo _t('sub.category'); ?></li>

					<li class="input">
						<select name="category" id="category">
						<?php foreach ($this->categories as $cat) { ?>
						<option value="<?php echo $cat->id(); ?>"<?php echo $cat->id() == 1 ? ' selected="selected"' : ''; ?>>
							<?php echo $cat->name(); ?>
						</option>
						<?php } ?>
						<option value="nc"><?php echo _t('sub.category.new'); ?></option>
						</select>
					</li>

					<li class="input" aria-hidden="true">
						<input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?php echo _t('sub.category.new'); ?>" />
					</li>

					<li class="separator"></li>

					<li class="dropdown-header"><?php echo _t('sub.feed.auth.http'); ?></li>
					<li class="input">
						<input type="text" name="http_user" id="http_user_feed" value=" " autocomplete="off" placeholder="<?php echo _t('sub.feed.auth.username'); ?>" />
					</li>
					<li class="input">
						<input type="password" name="http_pass" id="http_pass_feed" autocomplete="new-password" placeholder="<?php echo _t('sub.feed.auth.password'); ?>" />
					</li>
				</ul>
			</div>
			<button class="btn" type="submit"><?php echo _i('add'); ?></button>
		</div>
	</form>

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

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

	<div class="box">
		<div class="box-title"><label for="new-category"><?php echo _t('sub.category.add'); ?></label></div>

		<ul class="box-content box-content-centered">
			<form action="<?php echo _url('category', 'create'); ?>" method="post">
				<input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
				<li class="item"><input type="text" id="new-category" name="new-category" placeholder="<?php echo _t('sub.category.new'); ?>" /></li>
				<li class="item"><button class="btn btn-important" type="submit"><?php echo _t('gen.action.submit'); ?></button></li>
			</form>
		</ul>
	</div>

	<form id="controller-category" method="post" aria-hidden="true">
		<input type="hidden" name="_csrf" value="<?php echo 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="<?php echo _url('subscription', 'category', 'id', $cat->id()); ?>"><?php echo _i('configure'); ?></a>
			<?php echo $cat->name(); ?>
		</div>
		<ul class="box-content" data-cat-id="<?php echo $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<?php echo $error, $empty, $feed->mute() ? ' mute': ''; ?>"
			    draggable="true"
			    data-feed-id="<?php echo $feed->id(); ?>"
			    dropzone="move">
				<a class="configure open-slider" href="<?php echo _url('subscription', 'feed', 'id', $feed->id()); ?>"><?php echo _i('configure'); ?></a>
				<img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <?php echo $feed->name(); ?>
			</li>
			<?php 	}
				} else {
			?>
			<li class="item disabled" dropzone="move"><?php echo _t('sub.category.empty'); ?></li>
			<?php } ?>
		</ul>
	</div>
	<?php } ?>

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

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