query.phtml 4.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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="<?= htmlspecialchars($this->query->getSearch(), ENT_COMPAT, 'UTF-8') ?>"/>
  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"
  26. value="<?= FreshRSS_Entry::STATE_READ ?>" <?= FreshRSS_Entry::STATE_READ & $this->query->getState() ? 'checked="checked"' : ''?> />
  27. <?= _t('index.menu.read') ?>
  28. </label>
  29. <label class="checkbox" for="show_not_read">
  30. <input type="checkbox" name="query[state][]" id="show_not_read"
  31. value="<?= FreshRSS_Entry::STATE_NOT_READ ?>" <?= FreshRSS_Entry::STATE_NOT_READ & $this->query->getState() ? 'checked="checked"' : ''?> />
  32. <?= _t('index.menu.unread') ?>
  33. </label>
  34. <label class="checkbox" for="show_favorite">
  35. <input type="checkbox" name="query[state][]" id="show_favorite"
  36. value="<?= FreshRSS_Entry::STATE_FAVORITE ?>" <?= FreshRSS_Entry::STATE_FAVORITE & $this->query->getState() ? 'checked="checked"' : ''?> />
  37. <?= _t('index.menu.starred') ?>
  38. </label>
  39. <label class="checkbox" for="show_not_favorite">
  40. <input type="checkbox" name="query[state][]" id="show_not_favorite"
  41. value="<?= FreshRSS_Entry::STATE_NOT_FAVORITE ?>" <?= FreshRSS_Entry::STATE_NOT_FAVORITE & $this->query->getState() ? 'checked="checked"' : ''?> />
  42. <?= _t('index.menu.non-starred') ?>
  43. </label>
  44. </div>
  45. </div>
  46. <div class="form-group">
  47. <label class="group-name" for="query_get"><?= _t('conf.query.filter.type') ?></label>
  48. <div class="group-controls">
  49. <select name="query[get]" id="query_get" size="10">
  50. <option value=""></option>
  51. <option value="s" <?= 's' === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= _t('conf.query.get_favorite') ?></option>
  52. <optgroup label="<?= _t('conf.query.filter.categories') ?>">
  53. <?php foreach ($this->categories as $category): ?>
  54. <option value="c_<?= $category->id() ?>" <?= "c_{$category->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $category->name() ?></option>
  55. <?php endforeach?>
  56. </optgroup>
  57. <optgroup label="<?= _t('conf.query.filter.feeds') ?>">
  58. <?php foreach ($this->feeds as $feed): ?>
  59. <option value="f_<?= $feed->id() ?>" <?= "f_{$feed->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $feed->name() ?></option>
  60. <?php endforeach?>
  61. </optgroup>
  62. <optgroup label="<?= _t('conf.query.filter.tags') ?>">
  63. <?php foreach ($this->tags as $tag): ?>
  64. <option value="t_<?= $tag->id() ?>" <?= "t_{$tag->id()}" === $this->query->getGet() ? 'selected="selected"' : '' ?>><?= $tag->name() ?></option>
  65. <?php endforeach?>
  66. </optgroup>
  67. </select>
  68. </div>
  69. </div>
  70. <div class="form-group">
  71. <label class="group-name" for=""><?= _t('conf.query.filter.order') ?></label>
  72. <div class="group-controls">
  73. <select name="query[order]" id="query_order">
  74. <option value=""></option>
  75. <option value="ASC" <?= 'ASC' === $this->query->getOrder() ? 'selected="selected"' : '' ?>><?= _t('conf.query.order_asc') ?></option>
  76. <option value="DESC" <?= 'DESC' === $this->query->getOrder() ? 'selected="selected"' : '' ?>><?= _t('conf.query.order_desc') ?></option>
  77. </select>
  78. </div>
  79. </div>
  80. <div class="form-group form-actions">
  81. <div class="group-controls">
  82. <button class="btn btn-important"><?= _t('gen.action.submit') ?></button>
  83. <button class="btn btn-attention confirm"
  84. data-str-confirm="<?= _t('gen.js.confirm_action_feed_cat') ?>"
  85. formaction="<?= _url('configure', 'deleteQuery', 'id', $this->queryId) ?>"
  86. formmethod="post"><?= _t('gen.action.remove') ?></button>
  87. </div>
  88. </div>
  89. </form>
  90. </div>