query.phtml 4.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091
  1. <div class="post">
  2. <h1><?= $this->query->getName() ?></h1>
  3. <div>
  4. <a href="<?= $this->query->getUrl() ?>"><?= _i('link') ?> <?= _t('gen.action.filter') ?></a>
  5. </div>
  6. <form method="post" action="<?= _url('configure', 'query', 'id', $this->queryId) ?>" autocomplete="off">
  7. <input type="hidden" name="_csrf" value="<?= FreshRSS_Auth::csrfToken() ?>" />
  8. <div class="form-group">
  9. <label class="group-name" for="name"><?= _t('conf.query.name') ?></label>
  10. <div class="group-controls">
  11. <input type="text" name="name" id="name" class="extend" value="<?= $this->query->getName() ?>" />
  12. </div>
  13. </div>
  14. <legend><?= _t('conf.query.filter') ?></legend>
  15. <div class="form-group">
  16. <label class="group-name" for=""><?= _t('conf.query.filter.search') ?></label>
  17. <div class="group-controls">
  18. <input type="text" id="query_search" name="query[search]" class="extend" value="<?= urldecode($this->query->getSearch()) ?>"/>
  19. </div>
  20. </div>
  21. <div class="form-group">
  22. <label class="group-name" for=""><?= _t('conf.query.filter.state') ?></label>
  23. <div class="group-controls">
  24. <label class="checkbox" for="show_read">
  25. <input type="checkbox" name="query[state][]" id="show_read" value="<?= FreshRSS_Entry::STATE_READ ?>" <?= FreshRSS_Entry::STATE_READ & $this->query->getState() ? 'checked="checked"' : ''?> />
  26. <?= _t('index.menu.read') ?>
  27. </label>
  28. <label class="checkbox" for="show_not_read">
  29. <input type="checkbox" name="query[state][]" id="show_not_read" value="<?= FreshRSS_Entry::STATE_NOT_READ ?>" <?= FreshRSS_Entry::STATE_NOT_READ & $this->query->getState() ? 'checked="checked"' : ''?> />
  30. <?= _t('index.menu.unread') ?>
  31. </label>
  32. <label class="checkbox" for="show_favorite">
  33. <input type="checkbox" name="query[state][]" id="show_favorite" value="<?= FreshRSS_Entry::STATE_FAVORITE ?>" <?= FreshRSS_Entry::STATE_FAVORITE & $this->query->getState() ? 'checked="checked"' : ''?> />
  34. <?= _t('index.menu.starred') ?>
  35. </label>
  36. <label class="checkbox" for="show_not_favorite">
  37. <input type="checkbox" name="query[state][]" id="show_not_favorite" value="<?= FreshRSS_Entry::STATE_NOT_FAVORITE ?>" <?= FreshRSS_Entry::STATE_NOT_FAVORITE & $this->query->getState() ? 'checked="checked"' : ''?> />
  38. <?= _t('index.menu.non-starred') ?>
  39. </label>
  40. </div>
  41. </div>
  42. <div class="form-group">
  43. <label class="group-name" for="query_get"><?= _t('conf.query.filter.type') ?></label>
  44. <div class="group-controls">
  45. <select name="query[get]" id="query_get" size="10">
  46. <option value=""></option>
  47. <option value="s" <?= 's' === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= _t('conf.query.get_favorite') ?></option>
  48. <optgroup label="<?= _t('conf.query.filter.categories') ?>">
  49. <?php foreach ($this->categories as $category): ?>
  50. <option value="c_<?= $category->id() ?>" <?= "c_{$category->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $category->name() ?></option>
  51. <?php endforeach?>
  52. </optgroup>
  53. <optgroup label="<?= _t('conf.query.filter.feeds') ?>">
  54. <?php foreach ($this->feeds as $feed): ?>
  55. <option value="f_<?= $feed->id() ?>" <?= "f_{$feed->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $feed->name() ?></option>
  56. <?php endforeach?>
  57. </optgroup>
  58. <optgroup label="<?= _t('conf.query.filter.tags') ?>">
  59. <?php foreach ($this->tags as $tag): ?>
  60. <option value="t_<?= $tag->id() ?>" <?= "t_{$tag->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $tag->name() ?></option>
  61. <?php endforeach?>
  62. </optgroup>
  63. </select>
  64. </div>
  65. </div>
  66. <div class="form-group">
  67. <label class="group-name" for=""><?= _t('conf.query.filter.order') ?></label>
  68. <div class="group-controls">
  69. <select name="query[order]" id="query_order">
  70. <option value=""></option>
  71. <option value="ASC" <?= 'ASC' === $this->query->getOrder() ? 'selected="selected"' : '' ?>><?= _t('conf.query.order_asc') ?></option>
  72. <option value="DESC" <?= 'DESC' === $this->query->getOrder() ? 'selected="selected"' : '' ?>><?= _t('conf.query.order_desc') ?></option>
  73. </select>
  74. </div>
  75. </div>
  76. <div class="form-group form-actions">
  77. <div class="group-controls">
  78. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  79. <button class="btn btn-attention confirm"
  80. data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>"
  81. formaction="<?= _url('configure', 'deleteQuery', 'id', $this->queryId) ?>"
  82. formmethod="post"><?= _t('gen.action.remove') ?></button>
  83. </div>
  84. </div>
  85. </form>
  86. </div>