add.phtml 3.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  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. <div class="stick">
  30. <input type="text" value="<?= $this->feed->website() ?>" disabled="disabled" />
  31. <a class="btn" target="_blank" rel="noreferrer" href="<?= $this->feed->website() ?>"><?= _i('link') ?></a>
  32. </div>
  33. </div>
  34. </div>
  35. <?php } ?>
  36. <div class="form-group">
  37. <label class="group-name" for="url"><?= _t('sub.feed.url') ?></label>
  38. <div class="group-controls">
  39. <div class="stick">
  40. <input type="text" name="url_rss" id="url" value="<?= $this->feed->url() ?>" />
  41. <a class="btn open-url" target="_blank" rel="noreferrer" href="<?= $this->feed->url() ?>" data-input="url" title="<?= _t('gen.action.open_url') ?>"><?= _i('link') ?></a>
  42. </div>
  43. <br />
  44. <a class="btn" target="_blank" rel="noreferrer" href="https://validator.w3.org/feed/check.cgi?url=<?= $this->feed->url() ?>"><?= _t('sub.feed.validator') ?></a>
  45. </div>
  46. </div>
  47. <div class="form-group">
  48. <label class="group-name" for="category"><?= _t('sub.category') ?></label>
  49. <div class="group-controls">
  50. <select name="category" id="category">
  51. <?php foreach ($this->categories as $cat) { ?>
  52. <option value="<?= $cat->id() ?>"<?= $cat->id() == 1 ? ' selected="selected"' : '' ?>>
  53. <?= $cat->name() ?>
  54. </option>
  55. <?php } ?>
  56. </select>
  57. </div>
  58. </div>
  59. <legend><?= _t('sub.feed.auth.http') ?></legend>
  60. <?php $auth = $this->feed->httpAuth(false); ?>
  61. <div class="form-group">
  62. <label class="group-name" for="http_user"><?= _t('sub.feed.auth.username') ?></label>
  63. <div class="group-controls">
  64. <input type="text" name="http_user" id="http_user" value="<?= $auth['username'] ?>" autocomplete="off" />
  65. <p class="help"><?= _i('help') ?> <?= _t('sub.feed.auth.help') ?></p>
  66. </div>
  67. <label class="group-name" for="http_pass"><?= _t('sub.feed.auth.password') ?></label>
  68. <div class="group-controls">
  69. <div class="stick">
  70. <input type="password" name="http_pass" id="http_pass" value="<?= $auth['password'] ?>" autocomplete="new-password" />
  71. <button type="button" class="btn toggle-password" data-toggle="http_pass"><?= _i('key') ?></button>
  72. </div>
  73. </div>
  74. </div>
  75. <div class="form-group form-actions">
  76. <div class="group-controls">
  77. <button type="submit" class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  78. <button type="reset" class="btn"><?= _t('gen.action.cancel') ?></button>
  79. </div>
  80. </div>
  81. </form>
  82. </main>
  83. <?php } ?>