add.phtml 3.8 KB

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