feed.phtml 9.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. <?php $this->partial ('aside_feed'); ?>
  2. <?php if ($this->flux) { ?>
  3. <div class="post">
  4. <a href="<?php echo _url ('index', 'index'); ?>"><?php echo Minz_Translate::t ('back_to_rss_feeds'); ?></a> <?php echo Minz_Translate::t ('or'); ?> <a href="<?php echo _url ('index', 'index', 'get', 'f_' . $this->flux->id ()); ?>"><?php echo Minz_Translate::t ('filter'); ?></a>
  5. <h1><?php echo $this->flux->name (); ?></h1>
  6. <?php echo $this->flux->description (); ?>
  7. <?php $nbEntries = $this->flux->nbEntries (); ?>
  8. <?php if ($this->flux->inError ()) { ?>
  9. <p class="alert alert-error"><span class="alert-head"><?php echo Minz_Translate::t ('damn'); ?></span> <?php echo Minz_Translate::t ('feed_in_error'); ?></p>
  10. <?php } elseif ($nbEntries === 0) { ?>
  11. <p class="alert alert-warn"><?php echo Minz_Translate::t ('feed_empty'); ?></p>
  12. <?php } ?>
  13. <form method="post" action="<?php echo _url ('configure', 'feed', 'id', $this->flux->id ()); ?>" autocomplete="off">
  14. <legend><?php echo Minz_Translate::t ('informations'); ?></legend>
  15. <div class="form-group">
  16. <label class="group-name" for="name"><?php echo Minz_Translate::t ('title'); ?></label>
  17. <div class="group-controls">
  18. <input type="text" name="name" id="name" class="extend" value="<?php echo $this->flux->name () ; ?>" />
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="group-name" for="description"><?php echo Minz_Translate::t ('feed_description'); ?></label>
  23. <div class="group-controls">
  24. <textarea name="description" id="description"><?php echo htmlspecialchars($this->flux->description(), ENT_NOQUOTES, 'UTF-8'); ?></textarea>
  25. </div>
  26. </div>
  27. <div class="form-group">
  28. <label class="group-name" for="website"><?php echo Minz_Translate::t ('website_url'); ?></label>
  29. <div class="group-controls">
  30. <div class="stick">
  31. <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" />
  32. <a class="btn" target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  33. </div>
  34. </div>
  35. </div>
  36. <div class="form-group">
  37. <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label>
  38. <div class="group-controls">
  39. <div class="stick">
  40. <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" />
  41. <a class="btn" target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  42. </div>
  43. <a class="btn" target="_blank" href="http://validator.w3.org/feed/check.cgi?url=<?php echo $this->flux->url (); ?>"><?php echo Minz_Translate::t ('feed_validator'); ?></a>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label>
  48. <div class="group-controls">
  49. <select name="category" id="category">
  50. <?php foreach ($this->categories as $cat) { ?>
  51. <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->flux->category () ? ' selected="selected"' : ''; ?>>
  52. <?php echo $cat->name (); ?>
  53. </option>
  54. <?php } ?>
  55. </select>
  56. </div>
  57. </div>
  58. <div class="form-group">
  59. <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label>
  60. <div class="group-controls">
  61. <label class="checkbox" for="priority">
  62. <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> />
  63. <?php echo Minz_Translate::t ('yes'); ?>
  64. </label>
  65. </div>
  66. </div>
  67. <div class="form-group form-actions">
  68. <div class="group-controls">
  69. <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  70. <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'delete', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('delete'); ?></button>
  71. </div>
  72. </div>
  73. <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend>
  74. <div class="form-group">
  75. <label class="group-name"></label>
  76. <div class="group-controls">
  77. <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>">
  78. <?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?>
  79. </a>
  80. </div>
  81. </div>
  82. <div class="form-group">
  83. <label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label>
  84. <div class="group-controls">
  85. <span class="control"><?php echo $nbEntries; ?></span>
  86. </div>
  87. </div>
  88. <div class="form-group">
  89. <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label>
  90. <div class="group-controls">
  91. <select class="number" name="keep_history" id="keep_history" required="required"><?php
  92. foreach (array('' => '', -2 => Minz_Translate::t('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) {
  93. echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  94. }
  95. ?></select>
  96. </div>
  97. </div>
  98. <div class="form-group">
  99. <label class="group-name" for="ttl"><?php echo Minz_Translate::t('ttl'); ?></label>
  100. <div class="group-controls">
  101. <select class="number" name="ttl" id="ttl" required="required"><?php
  102. $found = false;
  103. foreach (array(-2 => Minz_Translate::t('by_default'), 900 => '15min', 1200 => '20min', 1500 => '25min', 1800 => '30min', 2700 => '45min',
  104. 3600 => '1h', 5400 => '1.5h', 7200 => '2h', 10800 => '3h', 14400 => '4h', 18800 => '5h', 21600 => '6h', 25200 => '7h', 28800 => '8h',
  105. 36000 => '10h', 43200 => '12h', 64800 => '18h',
  106. 86400 => '1d', 129600 => '1.5d', 172800 => '2d', 259200 => '3d', 345600 => '4d', 432000 => '5d', 518400 => '6d',
  107. 604800 => '1wk', 1209600 => '2wk', 1814400 => '3wk', 2419200 => '4wk', 2629744 => '1mo', -1 => '∞') as $v => $t) {
  108. echo '<option value="' . $v . ($this->flux->ttl() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  109. if ($this->flux->ttl() == $v) {
  110. $found = true;
  111. }
  112. }
  113. if (!$found) {
  114. echo '<option value="' . intval($this->flux->ttl()) . '" selected="selected">' . intval($this->flux->ttl()) . 's</option>';
  115. }
  116. ?></select>
  117. </div>
  118. </div>
  119. <div class="form-group form-actions">
  120. <div class="group-controls">
  121. <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  122. <button class="btn btn-attention confirm" formmethod="post" formaction="<?php echo Minz_Url::display (array ('c' => 'feed', 'a' => 'truncate', 'params' => array ('id' => $this->flux->id ()))); ?>"><?php echo Minz_Translate::t ('truncate'); ?></button>
  123. </div>
  124. </div>
  125. <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend>
  126. <?php $auth = $this->flux->httpAuth (false); ?>
  127. <div class="form-group">
  128. <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label>
  129. <div class="group-controls">
  130. <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
  131. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?>
  132. </div>
  133. <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label>
  134. <div class="group-controls">
  135. <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
  136. </div>
  137. </div>
  138. <div class="form-group form-actions">
  139. <div class="group-controls">
  140. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  141. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  142. </div>
  143. </div>
  144. <legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
  145. <div class="form-group">
  146. <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label>
  147. <div class="group-controls">
  148. <input type="text" name="path_entries" id="path_entries" class="extend" value="<?php echo $this->flux->pathEntries (); ?>" placeholder="<?php echo Minz_Translate::t ('blank_to_disable'); ?>" />
  149. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?>
  150. </div>
  151. </div>
  152. <div class="form-group form-actions">
  153. <div class="group-controls">
  154. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  155. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  156. </div>
  157. </div>
  158. </form>
  159. </div>
  160. <?php } else { ?>
  161. <div class="alert alert-warn"><span class="alert-head"><?php echo Minz_Translate::t ('no_selected_feed'); ?></span> <?php echo Minz_Translate::t ('think_to_add'); ?></div>
  162. <?php } ?>