update.phtml 9.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183
  1. <div class="post">
  2. <h1><?php echo $this->feed->name(); ?></h1>
  3. <div>
  4. <a href="<?php echo _url('index', 'index', 'get', 'f_' . $this->feed->id()); ?>"><?php echo _i('link'); ?> <?php echo _t('gen.action.filter'); ?></a>
  5. <?php echo _t('gen.short.or'); ?>
  6. <a href="<?php echo _url('stats', 'repartition', 'id', $this->feed->id()); ?>"><?php echo _i('stats'); ?> <?php echo _t('sub.feed.stats'); ?></a>
  7. </div>
  8. <p><?php echo $this->feed->description(); ?></p>
  9. <?php $nbEntries = $this->feed->nbEntries(); ?>
  10. <?php if ($this->feed->inError()) { ?>
  11. <p class="alert alert-error"><span class="alert-head"><?php echo _t('gen.short.damn'); ?></span> <?php echo _t('sub.feed.error'); ?></p>
  12. <?php } elseif ($nbEntries === 0) { ?>
  13. <p class="alert alert-warn"><?php echo _t('sub.feed.empty'); ?></p>
  14. <?php } ?>
  15. <form method="post" action="<?php echo _url('subscription', 'feed', 'id', $this->feed->id()); ?>" autocomplete="off">
  16. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  17. <legend><?php echo _t('sub.feed.informations'); ?></legend>
  18. <div class="form-group">
  19. <label class="group-name" for="name"><?php echo _t('sub.feed.title'); ?></label>
  20. <div class="group-controls">
  21. <input type="text" name="name" id="name" class="extend" value="<?php echo $this->feed->name() ; ?>" />
  22. </div>
  23. </div>
  24. <div class="form-group">
  25. <label class="group-name" for="description"><?php echo _t('sub.feed.description'); ?></label>
  26. <div class="group-controls">
  27. <textarea name="description" id="description"><?php echo htmlspecialchars($this->feed->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea>
  28. </div>
  29. </div>
  30. <div class="form-group">
  31. <label class="group-name" for="website"><?php echo _t('sub.feed.website'); ?></label>
  32. <div class="group-controls">
  33. <div class="stick">
  34. <input type="text" name="website" id="website" class="extend" value="<?php echo $this->feed->website(); ?>" />
  35. <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->website(); ?>"><?php echo _i('link'); ?></a>
  36. </div>
  37. </div>
  38. </div>
  39. <div class="form-group">
  40. <label class="group-name" for="url"><?php echo _t('sub.feed.url'); ?></label>
  41. <div class="group-controls">
  42. <div class="stick">
  43. <input type="text" name="url" id="url" class="extend" value="<?php echo $this->feed->url(); ?>" />
  44. <a class="btn" target="_blank" rel="noreferrer" href="<?php echo $this->feed->url(); ?>"><?php echo _i('link'); ?></a>
  45. </div>
  46. <a class="btn" target="_blank" rel="noreferrer" href="http://validator.w3.org/feed/check.cgi?url=<?php echo rawurlencode(htmlspecialchars_decode($this->feed->url(), ENT_QUOTES)); ?>"><?php echo _t('sub.feed.validator'); ?></a>
  47. </div>
  48. </div>
  49. <div class="form-group">
  50. <label class="group-name" for="category"><?php echo _t('sub.category'); ?></label>
  51. <div class="group-controls">
  52. <select name="category" id="category">
  53. <?php foreach ($this->categories as $cat) { ?>
  54. <option value="<?php echo $cat->id(); ?>"<?php echo $cat->id()== $this->feed->category() ? ' selected="selected"' : ''; ?>>
  55. <?php echo $cat->name(); ?>
  56. </option>
  57. <?php } ?>
  58. </select>
  59. </div>
  60. </div>
  61. <div class="form-group">
  62. <label class="group-name" for="priority"><?php echo _t('sub.feed.in_main_stream'); ?></label>
  63. <div class="group-controls">
  64. <label class="checkbox" for="priority">
  65. <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->feed->priority() > 0 ? ' checked="checked"' : ''; ?> />
  66. <?php echo _t('gen.short.yes'); ?>
  67. </label>
  68. </div>
  69. </div>
  70. <div class="form-group form-actions">
  71. <div class="group-controls">
  72. <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  73. <button class="btn btn-attention confirm"
  74. data-str-confirm="<?php echo _t('gen.js.confirm_action_feed_cat'); ?>"
  75. formaction="<?php echo _url('feed', 'delete', 'id', $this->feed->id()); ?>"
  76. formmethod="post"><?php echo _t('gen.action.remove'); ?></button>
  77. </div>
  78. </div>
  79. <legend><?php echo _t('sub.feed.archiving'); ?></legend>
  80. <div class="form-group">
  81. <div class="group-controls">
  82. <div class="stick">
  83. <input type="text" value="<?php echo _t('sub.feed.number_entries', $nbEntries); ?>" disabled="disabled" />
  84. <a class="btn" href="<?php echo _url('feed', 'actualize', 'id', $this->feed->id()); ?>">
  85. <?php echo _i('refresh'); ?> <?php echo _t('gen.action.actualize'); ?>
  86. </a>
  87. </div>
  88. </div>
  89. </div>
  90. <div class="form-group">
  91. <label class="group-name" for="keep_history"><?php echo _t('sub.feed.keep_history'); ?></label>
  92. <div class="group-controls">
  93. <select class="number" name="keep_history" id="keep_history" required="required"><?php
  94. foreach (array('' => '', -2 => _t('gen.short.by_default'), 0 => '0', 10 => '10', 50 => '50', 100 => '100', 500 => '500', 1000 => '1 000', 5000 => '5 000', 10000 => '10 000', -1 => '∞') as $v => $t) {
  95. echo '<option value="' . $v . ($this->feed->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  96. }
  97. ?></select>
  98. </div>
  99. </div>
  100. <div class="form-group">
  101. <label class="group-name" for="ttl"><?php echo _t('sub.feed.ttl'); ?></label>
  102. <div class="group-controls">
  103. <select class="number" name="ttl" id="ttl" required="required"><?php
  104. $found = false;
  105. foreach (array(-2 => _t('gen.short.by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  106. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  107. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  108. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  109. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) {
  110. echo '<option value="' . $v . ($this->feed->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  111. if ($this->feed->ttl() == $v) {
  112. $found = true;
  113. }
  114. }
  115. if (!$found) {
  116. echo '<option value="' . intval($this->feed->ttl()) . '" selected="selected">' . intval($this->feed->ttl()) . 's</option>';
  117. }
  118. ?></select>
  119. </div>
  120. </div>
  121. <div class="form-group">
  122. <label class="group-name" for="pubsubhubbub"><?php echo _t('sub.feed.pubsubhubbub'); ?></label>
  123. <div class="group-controls">
  124. <label class="checkbox" for="pubsubhubbub">
  125. <input type="checkbox" name="pubsubhubbub" id="pubsubhubbub" disabled="disabled" value="1"<?php echo $this->feed->pubSubHubbubEnabled() ? ' checked="checked"' : ''; ?> />
  126. </label>
  127. </div>
  128. </div>
  129. <div class="form-group form-actions">
  130. <div class="group-controls">
  131. <button class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  132. <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo _url('feed', 'truncate', 'id', $this->feed->id()); ?>"><?php echo _t('gen.action.truncate'); ?></button>
  133. </div>
  134. </div>
  135. <legend><?php echo _t('sub.feed.auth.configuration'); ?></legend>
  136. <?php $auth = $this->feed->httpAuth(false); ?>
  137. <div class="form-group">
  138. <label class="group-name" for="http_user_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.username'); ?></label>
  139. <div class="group-controls">
  140. <input type="text" name="http_user_feed<?php echo $this->feed->id(); ?>" id="http_user_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo empty($auth['username']) ? ' ' : $auth['username']; ?>" autocomplete="off" />
  141. <?php echo _i('help'); ?> <?php echo _t('sub.feed.auth.help'); ?>
  142. </div>
  143. <label class="group-name" for="http_pass_feed<?php echo $this->feed->id(); ?>"><?php echo _t('sub.feed.auth.password'); ?></label>
  144. <div class="group-controls">
  145. <input type="password" name="http_pass_feed<?php echo $this->feed->id(); ?>" id="http_pass_feed<?php echo $this->feed->id(); ?>" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
  146. </div>
  147. </div>
  148. <div class="form-group form-actions">
  149. <div class="group-controls">
  150. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  151. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  152. </div>
  153. </div>
  154. <legend><?php echo _t('sub.feed.advanced'); ?></legend>
  155. <div class="form-group">
  156. <label class="group-name" for="path_entries"><?php echo _t('sub.feed.css_path'); ?></label>
  157. <div class="group-controls">
  158. <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->feed->pathEntries(); ?>" placeholder="<?php echo _t('gen.short.blank_to_disable'); ?>" />
  159. <?php echo _i('help'); ?> <?php echo _t('sub.feed.css_help'); ?>
  160. </div>
  161. </div>
  162. <div class="form-group form-actions">
  163. <div class="group-controls">
  164. <button type="submit" class="btn btn-important"><?php echo _t('gen.action.submit'); ?></button>
  165. <button type="reset" class="btn"><?php echo _t('gen.action.cancel'); ?></button>
  166. </div>
  167. </div>
  168. </form>
  169. </div>