aside_feed.phtml 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596
  1. <?php
  2. $class = '';
  3. if (FreshRSS_Context::$user_conf->hide_read_feeds &&
  4. FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
  5. !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
  6. $class = ' state_unread';
  7. }
  8. ?>
  9. <div class="aside aside_feed<?php echo $class; ?>" id="aside_feed">
  10. <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a>
  11. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  12. <div class="stick configure-feeds no-mobile">
  13. <a class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.menu.subscription'); ?></a>
  14. <a class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
  15. </div>
  16. <?php } elseif (FreshRSS_Auth::accessNeedsLogin()) { ?>
  17. <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('index.menu.about'); ?></a>
  18. <?php } ?>
  19. <form id="mark-read-aside" method="post">
  20. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  21. <ul class="tree">
  22. <li class="tree-folder category all<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>">
  23. <div class="tree-folder-title">
  24. <?php echo _i('all'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_unread); ?>" href="<?php echo _url('index', 'index'); ?>"><?php echo _t('index.menu.main_stream'); ?></a>
  25. </div>
  26. </li>
  27. <li class="tree-folder category favorites<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>">
  28. <div class="tree-folder-title">
  29. <?php echo _i('bookmark'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_starred['unread']); ?>" href="<?php echo _url('index', 'index', 'get', 's'); ?>"><?php echo _t('index.menu.favorites', format_number(FreshRSS_Context::$total_starred['all'])); ?></a>
  30. </div>
  31. </li>
  32. <?php
  33. foreach ($this->categories as $cat) {
  34. $feeds = $cat->feeds();
  35. if (!empty($feeds)) {
  36. $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id());
  37. $c_show = $c_active && (!FreshRSS_Context::$user_conf->display_categories ||
  38. FreshRSS_Context::$current_get['feed']);
  39. ?>
  40. <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>">
  41. <div class="tree-folder-title">
  42. <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a>
  43. <a class="title<?php echo $cat->hasFeedsWithError() ? ' error' : ''; ?>" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'c_' . $cat->id()); ?>"><?php echo $cat->name(); ?></a>
  44. </div>
  45. <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>">
  46. <?php
  47. foreach ($feeds as $feed) {
  48. $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id());
  49. ?>
  50. <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $f_active ? ' active' : ''; ?><?php echo $feed->inError() ? ' error' : ''; ?><?php echo $feed->nbEntries() <= 0 ? ' empty' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>">
  51. <div class="dropdown no-mobile">
  52. <div class="dropdown-target"></div>
  53. <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a>
  54. <?php /* feed_config_template */ ?>
  55. </div>
  56. <img class="favicon" src="<?php echo $feed->favicon(); ?>" alt="✇" /> <a class="item-title" data-unread="<?php echo format_number($feed->nbNotRead()); ?>" href="<?php echo _url('index', 'index', 'get', 'f_' . $feed->id()); ?>"><?php echo $feed->name(); ?></a>
  57. </li>
  58. <?php } ?>
  59. </ul>
  60. </li>
  61. <?php
  62. }
  63. }
  64. ?>
  65. </ul>
  66. </form>
  67. </div>
  68. <script id="feed_config_template" type="text/html">
  69. <ul class="dropdown-menu">
  70. <li class="dropdown-close"><a href="#close">❌</a></li>
  71. <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li>
  72. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  73. <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li>
  74. <?php } ?>
  75. <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li>
  76. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  77. <li class="separator"></li>
  78. <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li>
  79. <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li>
  80. <li class="item">
  81. <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?>
  82. <button class="read_all as-link <?php echo $confirm; ?>"
  83. form="mark-read-aside"
  84. formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>"
  85. type="submit"><?php echo _t('gen.action.mark_read'); ?></button>
  86. </li>
  87. <?php } ?>
  88. </ul>
  89. </script>