add.phtml 9.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218
  1. <?php
  2. /** @var FreshRSS_View $this */
  3. $this->partial('aside_subscription');
  4. ?>
  5. <main class="post drop-section">
  6. <div class="link-back-wrapper">
  7. <a class="link-back" href="<?= _url('index', 'index') ?>"><?= _t('gen.action.back_to_rss_feeds') ?></a>
  8. </div>
  9. <h1><?= _t('sub.menu.add') ?></h1>
  10. <h2><?= _t('sub.title.add_category') ?></h2>
  11. <form action="<?= _url('category', 'create') ?>" method="post">
  12. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  13. <div class="form-group">
  14. <label class="group-name" for="new-category"><?= _t('sub.category') ?></label>
  15. <div class="group-controls">
  16. <input id="new-category" name="new-category" type="text" autocomplete="off"/>
  17. </div>
  18. </div>
  19. <div class="form-group form-actions">
  20. <div class="group-controls">
  21. <button type="submit" class="btn btn-important"><?= _t('gen.action.add') ?></button>
  22. </div>
  23. </div>
  24. </form>
  25. <h2><?= _t('sub.title.add_feed') ?></h2>
  26. <form id="add_rss" method="post" action="<?= _url('feed', 'add') ?>" autocomplete="off">
  27. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  28. <div class="form-group">
  29. <label class="group-name" for="url_rss"><?= _t('sub.feed.url') ?></label>
  30. <div class="group-controls">
  31. <input id="url_rss" name="url_rss" type="url" required="required" autocomplete="off" class="long" autofocus="autofocus" />
  32. </div>
  33. </div>
  34. <div class="form-group">
  35. <label class="group-name" for="category"><?= _t('sub.category') ?></label>
  36. <div class="group-controls">
  37. <select name="category" id="category">
  38. <?php foreach ($this->categories as $cat) { ?>
  39. <option value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>>
  40. <?= $cat->name() ?>
  41. </option>
  42. <?php } ?>
  43. </select>
  44. </div>
  45. </div>
  46. <details class="form-advanced">
  47. <summary class="form-advanced-title">
  48. <?= _t('sub.feed.kind') ?>
  49. </summary>
  50. <div class="form-group">
  51. <label class="group-name" for="feed_kind"><?= _t('sub.feed.kind') ?></label>
  52. <div class="group-controls">
  53. <select name="feed_kind" id="feed_kind" class="select-show">
  54. <option value="<?= FreshRSS_Feed::KIND_RSS ?>" selected="selected"><?= _t('sub.feed.kind.rss') ?></option>
  55. <option value="<?= FreshRSS_Feed::KIND_HTML_XPATH ?>" data-show="html_xpath"><?= _t('sub.feed.kind.html_xpath') ?></option>
  56. </select>
  57. </div>
  58. </div>
  59. <fieldset id="html_xpath">
  60. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.help') ?></p>
  61. <div class="form-group">
  62. <label class="group-name" for="xPathFeedTitle"><small><?= _t('sub.feed.kind.html_xpath.xpath') ?></small><br />
  63. <?= _t('sub.feed.kind.html_xpath.feed_title') ?></label>
  64. <div class="group-controls">
  65. <textarea class="valid-xpath" name="xPathFeedTitle" id="xPathFeedTitle" rows="2" cols="64" spellcheck="false"></textarea>
  66. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.feed_title.help') ?></p>
  67. </div>
  68. </div>
  69. <div class="form-group">
  70. <label class="group-name" for="xPathItem"><small><?= _t('sub.feed.kind.html_xpath.xpath') ?></small><br />
  71. <?= _t('sub.feed.kind.html_xpath.item') ?></label>
  72. <div class="group-controls">
  73. <textarea class="valid-xpath" name="xPathItem" id="xPathItem" rows="2" cols="64" spellcheck="false"></textarea>
  74. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item.help') ?></p>
  75. </div>
  76. </div>
  77. <div class="form-group">
  78. <label class="group-name" for="xPathItemTitle"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  79. <?= _t('sub.feed.kind.html_xpath.item_title') ?></label>
  80. <div class="group-controls">
  81. <textarea class="valid-xpath" name="xPathItemTitle" id="xPathItemTitle" rows="2" cols="64" spellcheck="false"></textarea>
  82. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_title.help') ?></p>
  83. </div>
  84. </div>
  85. <div class="form-group">
  86. <label class="group-name" for="xPathItemContent"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  87. <?= _t('sub.feed.kind.html_xpath.item_content') ?></label>
  88. <div class="group-controls">
  89. <textarea class="valid-xpath" name="xPathItemContent" id="xPathItemContent" rows="2" cols="64" spellcheck="false"></textarea>
  90. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_content.help') ?></p>
  91. </div>
  92. </div>
  93. <div class="form-group">
  94. <label class="group-name" for="xPathItemUri"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  95. <?= _t('sub.feed.kind.html_xpath.item_uri') ?></label>
  96. <div class="group-controls">
  97. <textarea class="valid-xpath" name="xPathItemUri" id="xPathItemUri" rows="2" cols="64" spellcheck="false"></textarea>
  98. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_uri.help') ?></p>
  99. </div>
  100. </div>
  101. <div class="form-group">
  102. <label class="group-name" for="xPathItemThumbnail"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  103. <?= _t('sub.feed.kind.html_xpath.item_thumbnail') ?></label>
  104. <div class="group-controls">
  105. <textarea class="valid-xpath" name="xPathItemThumbnail" id="xPathItemThumbnail" rows="2" cols="64" spellcheck="false"></textarea>
  106. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_thumbnail.help') ?></p>
  107. </div>
  108. </div>
  109. <div class="form-group">
  110. <label class="group-name" for="xPathItemAuthor"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  111. <?= _t('sub.feed.kind.html_xpath.item_author') ?></label>
  112. <div class="group-controls">
  113. <textarea class="valid-xpath" name="xPathItemAuthor" id="xPathItemAuthor" rows="2" cols="64" spellcheck="false"></textarea>
  114. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_author.help') ?></p>
  115. </div>
  116. </div>
  117. <div class="form-group">
  118. <label class="group-name" for="xPathItemTimestamp"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  119. <?= _t('sub.feed.kind.html_xpath.item_timestamp') ?></label>
  120. <div class="group-controls">
  121. <textarea class="valid-xpath" name="xPathItemTimestamp" id="xPathItemTimestamp" rows="2" cols="64" spellcheck="false"></textarea>
  122. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.kind.html_xpath.item_timestamp.help') ?></p>
  123. </div>
  124. </div>
  125. <div class="form-group">
  126. <label class="group-name" for="xPathItemCategories"><small><?= _t('sub.feed.kind.html_xpath.relative') ?></small><br />
  127. <?= _t('sub.feed.kind.html_xpath.item_categories') ?></label>
  128. <div class="group-controls">
  129. <textarea class="valid-xpath" name="xPathItemCategories" id="xPathItemCategories" rows="2" cols="64" spellcheck="false"></textarea>
  130. </div>
  131. </div>
  132. </fieldset>
  133. </details>
  134. <details class="form-advanced">
  135. <summary class="form-advanced-title">
  136. <?= _t('sub.feed.advanced') ?>
  137. </summary>
  138. <div class="form-group">
  139. <label class="group-name" for="http_user"><?= _t('sub.feed.auth.username') ?></label>
  140. <div class="group-controls">
  141. <input id="http_user" name="http_user" type="text" autocomplete="off"/>
  142. </div>
  143. </div>
  144. <div class="form-group">
  145. <label class="group-name" for="http_pass"><?= _t('sub.feed.auth.password') ?></label>
  146. <div class="group-controls">
  147. <div class="stick">
  148. <input id="http_pass" name="http_pass" type="password" value="" autocomplete="new-password" />
  149. <button type="button" class="btn toggle-password" data-toggle="http_pass"><?= _i('key') ?></button>
  150. </div>
  151. </div>
  152. </div>
  153. <div class="form-group">
  154. <label class="group-name" for="curl_params_useragent"><?= _t('sub.feed.useragent') ?></label>
  155. <div class="group-controls">
  156. <div class="stick">
  157. <input type="text" name="curl_params_useragent" id="curl_params_useragent" class="extend" value="" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  158. </div>
  159. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.useragent_help') ?></p>
  160. </div>
  161. </div>
  162. <div class="form-group">
  163. <label class="group-name" for="proxy_type"><?= _t('sub.feed.proxy') ?></label>
  164. <div class="group-controls">
  165. <select class="number" name="proxy_type" id="proxy_type"><?php
  166. foreach(['' => '', 3 => 'NONE', 0 => 'HTTP', 2 => 'HTTPS', 4 => 'SOCKS4', 6 => 'SOCKS4A', 5 => 'SOCKS5', 7 => 'SOCKS5H'] as $k => $v) {
  167. echo '<option value="' . $k . '">' . $v . '</option>';
  168. }
  169. ?>
  170. </select>
  171. <div class="stick">
  172. <input type="text" name="curl_params" id="curl_params" class="extend" value="" placeholder="<?= _t('gen.short.blank_to_disable') ?>" />
  173. </div>
  174. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.proxy_help') ?></p>
  175. </div>
  176. </div>
  177. <div class="form-group">
  178. <label class="group-name" for="timeout"><?= _t('sub.feed.timeout') ?></label>
  179. <div class="group-controls">
  180. <input type="number" name="timeout" id="timeout" min="3" max="120" value="" placeholder="<?= _t('gen.short.by_default') ?>" />
  181. </div>
  182. </div>
  183. <div class="form-group">
  184. <label class="group-name" for="ssl_verify"><?= _t('sub.feed.ssl_verify') ?></label>
  185. <div class="group-controls">
  186. <select name="ssl_verify" id="ssl_verify">
  187. <option value=""><?= _t('gen.short.by_default') ?></option>
  188. <option value="0"><?= _t('gen.short.no') ?></option>
  189. <option value="1"><?= _t('gen.short.yes') ?></option>
  190. </select>
  191. </div>
  192. </div>
  193. </details>
  194. <div class="form-group form-actions">
  195. <div class="group-controls">
  196. <button type="submit" class="btn btn-important"><?= _t('gen.action.add') ?></button>
  197. </div>
  198. </div>
  199. </form>
  200. </main>