add.phtml 3.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <?php /** @var FreshRSS_View $this */ ?>
  2. <?php if ($this->feed) { ?>
  3. <main class="post">
  4. <h1><?= _t('sub.feed.add') ?></h1>
  5. <?php if (!$this->load_ok) { ?>
  6. <p class="alert alert-error"><span class="alert-head"><?= _t('gen.short.damn') ?></span> <?= _t('feedback.sub.feed.internal_problem', _url('index', 'logs')) ?></p>
  7. <?php } ?>
  8. <form method="post" action="<?= _url('feed', 'add') ?>" autocomplete="off">
  9. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  10. <legend><?= _t('sub.feed.information') ?></legend>
  11. <?php if ($this->load_ok) { ?>
  12. <div class="form-group">
  13. <label class="group-name"><?= _t('sub.feed.title') ?></label>
  14. <div class="group-controls">
  15. <label><?= $this->feed->name() ?></label>
  16. </div>
  17. </div>
  18. <?php $desc = $this->feed->description(); if ($desc != '') { ?>
  19. <div class="form-group">
  20. <label class="group-name"><?= _t('sub.feed.description') ?></label>
  21. <div class="group-controls">
  22. <label><?= htmlspecialchars($desc, ENT_NOQUOTES, 'UTF-8') ?></label>
  23. </div>
  24. </div>
  25. <?php } ?>
  26. <div class="form-group">
  27. <label class="group-name"><?= _t('sub.feed.website') ?></label>
  28. <div class="group-controls">
  29. <?= $this->feed->website() ?>
  30. <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>"><?= _i('link') ?></a>
  31. </div>
  32. </div>
  33. <?php } ?>
  34. <div class="form-group">
  35. <label class="group-name" for="url"><?= _t('sub.feed.url') ?></label>
  36. <div class="group-controls">
  37. <div class="stick">
  38. <input type="text" name="url_rss" id="url" class="extend" value="<?= $this->feed->url() ?>" />
  39. <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>"><?= _i('link') ?></a>
  40. </div>
  41. <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?= $this->feed->url() ?>"><?= _t('sub.feed.validator') ?></a>
  42. </div>
  43. </div>
  44. <div class="form-group">
  45. <label class="group-name" for="category"><?= _t('sub.category') ?></label>
  46. <div class="group-controls">
  47. <select name="category" id="category">
  48. <?php foreach ($this->categories as $cat) { ?>
  49. <option value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>>
  50. <?= $cat->name() ?>
  51. </option>
  52. <?php } ?>
  53. <option value="nc"><?= _t('sub.category.new') ?></option>
  54. </select>
  55. <span aria-hidden="true">
  56. <input type="text" name="new_category[name]" id="new_category_name" autocomplete="off" placeholder="<?= _t('sub.category.new') ?>" />
  57. </span>
  58. </div>
  59. </div>
  60. <legend><?= _t('sub.feed.auth.http') ?></legend>
  61. <?php $auth = $this->feed->httpAuth(false); ?>
  62. <div class="form-group">
  63. <label class="group-name" for="http_user"><?= _t('sub.feed.auth.username') ?></label>
  64. <div class="group-controls">
  65. <input type="text" name="http_user" id="http_user" class="extend" value="<?= $auth['username'] ?>" autocomplete="off" />
  66. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.auth.help') ?></p>
  67. </div>
  68. <label class="group-name" for="http_pass"><?= _t('sub.feed.auth.password') ?></label>
  69. <div class="group-controls">
  70. <div class="stick">
  71. <input type="password" name="http_pass" id="http_pass" class="extend" value="<?= $auth['password'] ?>" autocomplete="new-password" />
  72. <button type="button" class="btn toggle-password" data-toggle="http_user"><?= _i('key') ?></button>
  73. </div>
  74. </div>
  75. </div>
  76. <div class="form-group form-actions">
  77. <div class="group-controls">
  78. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  79. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  80. </div>
  81. </div>
  82. </form>
  83. </main>
  84. <?php } ?>