query.phtml 4.6 KB

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