aside_feed.phtml 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. <?php
  2. $actual_view = Minz_Request::actionName();
  3. $class = '';
  4. if (FreshRSS_Context::$user_conf->hide_read_feeds &&
  5. FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_NOT_READ) &&
  6. !FreshRSS_Context::isStateEnabled(FreshRSS_Entry::STATE_READ)) {
  7. $class = ' state_unread';
  8. }
  9. ?>
  10. <div class="aside aside_feed<?php echo $class; ?>" id="aside_feed">
  11. <a class="toggle_aside" href="#close"><?php echo _i('close'); ?></a>
  12. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  13. <div class="stick configure-feeds no-mobile">
  14. <a id="btn-subscription" class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.menu.subscription'); ?></a>
  15. <a id="btn-importExport" class="btn btn-important" href="<?php echo _url('importExport', 'index'); ?>"><?php echo _i('import'); ?></a>
  16. </div>
  17. <?php } elseif (FreshRSS_Auth::accessNeedsLogin()) { ?>
  18. <a href="<?php echo _url('index', 'about'); ?>"><?php echo _t('index.menu.about'); ?></a>
  19. <?php } ?>
  20. <form id="mark-read-aside" method="post">
  21. <input type="hidden" name="_csrf" value="<?php echo FreshRSS_Auth::csrfToken(); ?>" />
  22. <ul id="sidebar" class="tree">
  23. <li class="tree-folder category all<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>">
  24. <div class="tree-folder-title">
  25. <?php echo _i('all'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_unread); ?>" href="<?php echo _url('index', $actual_view); ?>"><?php echo _t('index.menu.main_stream'); ?></a>
  26. </div>
  27. </li>
  28. <li class="tree-folder category favorites<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>">
  29. <div class="tree-folder-title">
  30. <?php echo _i('bookmark'); ?> <a class="title" data-unread="<?php echo format_number(FreshRSS_Context::$total_starred['unread']); ?>" href="<?php echo _url('index', $actual_view, 'get', 's'); ?>"><?php echo _t('index.menu.favorites', format_number(FreshRSS_Context::$total_starred['all'])); ?></a>
  31. </div>
  32. </li>
  33. <?php
  34. $t_active = FreshRSS_Context::isCurrentGet('T');
  35. $t_show = $t_active || FreshRSS_Context::$user_conf->display_categories;
  36. ?>
  37. <li class="tree-folder category tags<?php echo $t_active ? ' active' : ''; ?>">
  38. <div class="tree-folder-title">
  39. <a class="dropdown-toggle" href="#"><?php echo _i($t_active ? 'up' : 'down'); ?></a>
  40. <a class="title" data-unread="<?php echo format_number($this->nbUnreadTags); ?>" href="<?php echo _url('index', $actual_view, 'get', 'T'); ?>"><?php echo _t('index.menu.tags'); ?></a>
  41. </div>
  42. <ul class="tree-folder-items<?php echo $t_show ? ' active' : ''; ?>">
  43. <?php
  44. foreach ($this->tags as $tag):
  45. ?>
  46. <li id="t_<?php echo $tag->id(); ?>" class="item feed<?php echo FreshRSS_Context::isCurrentGet('t_' . $tag->id()) ? ' active' : ''; ?>" data-unread="<?php echo $tag->nbUnread(); ?>">
  47. <div class="dropdown no-mobile">
  48. <div class="dropdown-target"></div>
  49. <a class="dropdown-toggle"><?php echo _i('configure'); ?></a>
  50. <?php /* tag_config_template */ ?>
  51. </div>
  52. <?php echo FreshRSS_Themes::alt('label'); ?> <a class="item-title" data-unread="<?php echo format_number($tag->nbUnread()); ?>" href="<?php echo _url('index', $actual_view, 'get', 't_' . $tag->id()); ?>"><?php echo $tag->name(); ?></a>
  53. </li>
  54. <?php endforeach; ?>
  55. </ul>
  56. </li>
  57. <?php
  58. foreach ($this->categories as $cat) {
  59. $feeds = $cat->feeds();
  60. if (!empty($feeds)) {
  61. $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id());
  62. $c_show = $c_active || FreshRSS_Context::$user_conf->display_categories;
  63. ?>
  64. <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>">
  65. <div class="tree-folder-title">
  66. <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a>
  67. <a class="title<?php echo $cat->hasFeedsWithError() ? ' error' : ''; ?>" data-unread="<?php echo format_number($cat->nbNotRead()); ?>" href="<?php echo _url('index', $actual_view, 'get', 'c_' . $cat->id()); ?>"><?php echo $cat->name(); ?></a>
  68. </div>
  69. <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>">
  70. <?php
  71. foreach ($feeds as $feed) {
  72. $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id());
  73. ?>
  74. <li id="f_<?php echo $feed->id(); ?>" class="item feed<?php echo $f_active ? ' active' : '', $feed->mute() ? ' mute' : ''; ?><?php echo $feed->inError() ? ' error' : ''; ?><?php echo $feed->nbEntries() <= 0 ? ' empty' : ''; ?>" data-unread="<?php echo $feed->nbNotRead(); ?>" data-priority="<?php echo $feed->priority(); ?>">
  75. <div class="dropdown no-mobile">
  76. <div class="dropdown-target"></div>
  77. <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a>
  78. <?php /* feed_config_template */ ?>
  79. </div>
  80. <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', $actual_view, 'get', 'f_' . $feed->id()); ?>"><?php echo $feed->name(); ?></a>
  81. </li>
  82. <?php } ?>
  83. </ul>
  84. </li>
  85. <?php
  86. }
  87. }
  88. ?>
  89. <li class="tree-bottom"></li>
  90. </ul>
  91. </form>
  92. </div>
  93. <script id="tag_config_template" type="text/html">
  94. <ul class="dropdown-menu">
  95. <li class="dropdown-close"><a href="#close">❌</a></li>
  96. <li class="item">
  97. <button class="as-link confirm" disabled="disabled"
  98. form="mark-read-aside" formaction="<?php echo _url('tag', 'delete', 'id_tag', '------'); ?>"
  99. type="submit"><?php echo _t('gen.action.remove'); ?></button>
  100. </li>
  101. </ul>
  102. </script>
  103. <script id="feed_config_template" type="text/html">
  104. <ul class="dropdown-menu">
  105. <li class="dropdown-close"><a href="#close">❌</a></li>
  106. <li class="item"><a href="<?php echo _url('index', $actual_view, 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li>
  107. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  108. <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li>
  109. <?php } ?>
  110. <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li>
  111. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  112. <li class="separator"></li>
  113. <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li>
  114. <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li>
  115. <li class="item">
  116. <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?>
  117. <button class="read_all as-link <?php echo $confirm; ?>"
  118. form="mark-read-aside"
  119. formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>"
  120. type="submit"><?php echo _t('gen.action.mark_read'); ?></button>
  121. </li>
  122. <?php } ?>
  123. </ul>
  124. </script>