feed.phtml 7.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  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. <input type="text" name="website" id="website" class="extend" value="<?php echo $this->flux->website (); ?>" />
  31. <a target="_blank" href="<?php echo $this->flux->website (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="group-name" for="url"><?php echo Minz_Translate::t ('feed_url'); ?></label>
  36. <div class="group-controls">
  37. <input type="text" name="url" id="url" class="extend" value="<?php echo $this->flux->url (); ?>" />
  38. <a target="_blank" href="<?php echo $this->flux->url (); ?>"><?php echo FreshRSS_Themes::icon('link'); ?></a>
  39.   <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>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="group-name" for="category"><?php echo Minz_Translate::t ('category'); ?></label>
  44. <div class="group-controls">
  45. <select name="category" id="category">
  46. <?php foreach ($this->categories as $cat) { ?>
  47. <option value="<?php echo $cat->id (); ?>"<?php echo $cat->id ()== $this->flux->category () ? ' selected="selected"' : ''; ?>>
  48. <?php echo $cat->name (); ?>
  49. </option>
  50. <?php } ?>
  51. </select>
  52. </div>
  53. </div>
  54. <div class="form-group">
  55. <label class="group-name" for="priority"><?php echo Minz_Translate::t ('show_in_all_flux'); ?></label>
  56. <div class="group-controls">
  57. <label class="checkbox" for="priority">
  58. <input type="checkbox" name="priority" id="priority" value="10"<?php echo $this->flux->priority () > 0 ? ' checked="checked"' : ''; ?> />
  59. <?php echo Minz_Translate::t ('yes'); ?>
  60. </label>
  61. </div>
  62. </div>
  63. <div class="form-group form-actions">
  64. <div class="group-controls">
  65. <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  66. <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>
  67. </div>
  68. </div>
  69. <legend><?php echo Minz_Translate::t ('archiving_configuration'); ?></legend>
  70. <div class="form-group">
  71. <label class="group-name"></label>
  72. <div class="group-controls">
  73. <a class="btn" href="<?php echo _url ('feed', 'actualize', 'id', $this->flux->id ()); ?>">
  74. <?php echo FreshRSS_Themes::icon('refresh'); ?> <?php echo Minz_Translate::t('actualize'); ?>
  75. </a>
  76. </div>
  77. </div>
  78. <div class="form-group">
  79. <label class="group-name"><?php echo Minz_Translate::t ('number_articles'); ?></label>
  80. <div class="group-controls">
  81. <span class="control"><?php echo $nbEntries; ?></span>
  82. </div>
  83. </div>
  84. <div class="form-group">
  85. <label class="group-name" for="keep_history"><?php echo Minz_Translate::t ('keep_history'); ?></label>
  86. <div class="group-controls">
  87. <select class="number" name="keep_history" id="keep_history" required="required"><?php
  88. 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) {
  89. echo '<option value="' . $v . ($this->flux->keepHistory() === $v ? '" selected="selected' : '') . '">' . $t . '</option>';
  90. }
  91. ?></select>
  92. </div>
  93. </div>
  94. <div class="form-group form-actions">
  95. <div class="group-controls">
  96. <button class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  97. <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>
  98. </div>
  99. </div>
  100. <legend><?php echo Minz_Translate::t ('login_configuration'); ?></legend>
  101. <?php $auth = $this->flux->httpAuth (false); ?>
  102. <div class="form-group">
  103. <label class="group-name" for="http_user"><?php echo Minz_Translate::t ('http_username'); ?></label>
  104. <div class="group-controls">
  105. <input type="text" name="http_user" id="http_user" class="extend" value="<?php echo $auth['username']; ?>" autocomplete="off" />
  106. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('access_protected_feeds'); ?>
  107. </div>
  108. <label class="group-name" for="http_pass"><?php echo Minz_Translate::t ('http_password'); ?></label>
  109. <div class="group-controls">
  110. <input type="password" name="http_pass" id="http_pass" class="extend" value="<?php echo $auth['password']; ?>" autocomplete="off" />
  111. </div>
  112. </div>
  113. <div class="form-group form-actions">
  114. <div class="group-controls">
  115. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  116. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  117. </div>
  118. </div>
  119. <legend><?php echo Minz_Translate::t ('advanced'); ?></legend>
  120. <div class="form-group">
  121. <label class="group-name" for="path_entries"><?php echo Minz_Translate::t ('css_path_on_website'); ?></label>
  122. <div class="group-controls">
  123. <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'); ?>" />
  124. <?php echo FreshRSS_Themes::icon('help'); ?> <?php echo Minz_Translate::t ('retrieve_truncated_feeds'); ?>
  125. </div>
  126. </div>
  127. <div class="form-group form-actions">
  128. <div class="group-controls">
  129. <button type="submit" class="btn btn-important"><?php echo Minz_Translate::t ('save'); ?></button>
  130. <button type="reset" class="btn"><?php echo Minz_Translate::t ('cancel'); ?></button>
  131. </div>
  132. </div>
  133. </form>
  134. </div>
  135. <?php } else { ?>
  136. <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>
  137. <?php } ?>