add.phtml 9.9 KB

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