4
0

aside_feed.phtml 6.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  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 id="btn-subscription" class="btn btn-important" href="<?php echo _url('subscription', 'index'); ?>"><?php echo _t('index.menu.subscription'); ?></a>
  14. <a id="btn-importExport" 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. $t_active = FreshRSS_Context::isCurrentGet('T');
  34. ?>
  35. <li class="tree-folder category tags<?php echo $t_active ? ' active' : ''; ?>">
  36. <div class="tree-folder-title">
  37. <a class="dropdown-toggle" href="#"><?php echo _i($t_active ? 'up' : 'down'); ?></a>
  38. <a class="title" data-unread="<?php echo format_number($this->nbUnreadTags); ?>" href="<?php echo _url('index', 'index', 'get', 'T'); ?>"><?php echo _t('index.menu.tags'); ?></a>
  39. </div>
  40. <ul class="tree-folder-items<?php echo $t_active ? ' active' : ''; ?>">
  41. <?php
  42. foreach ($this->tags as $tag):
  43. ?>
  44. <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(); ?>">
  45. <div class="dropdown no-mobile">
  46. <div class="dropdown-target"></div>
  47. <a class="dropdown-toggle"><?php echo _i('configure'); ?></a>
  48. <?php /* tag_config_template */ ?>
  49. </div>
  50. <?php echo FreshRSS_Themes::alt('label'); ?> <a class="item-title" data-unread="<?php echo format_number($tag->nbUnread()); ?>" href="<?php echo _url('index', 'index', 'get', 't_' . $tag->id()); ?>"><?php echo $tag->name(); ?></a>
  51. </li>
  52. <?php endforeach; ?>
  53. </ul>
  54. </li>
  55. <?php
  56. foreach ($this->categories as $cat) {
  57. $feeds = $cat->feeds();
  58. if (!empty($feeds)) {
  59. $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id());
  60. $c_show = $c_active && (!FreshRSS_Context::$user_conf->display_categories ||
  61. FreshRSS_Context::$current_get['feed']);
  62. ?>
  63. <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>">
  64. <div class="tree-folder-title">
  65. <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a>
  66. <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>
  67. </div>
  68. <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>">
  69. <?php
  70. foreach ($feeds as $feed) {
  71. $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id());
  72. ?>
  73. <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(); ?>">
  74. <div class="dropdown no-mobile">
  75. <div class="dropdown-target"></div>
  76. <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a>
  77. <?php /* feed_config_template */ ?>
  78. </div>
  79. <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>
  80. </li>
  81. <?php } ?>
  82. </ul>
  83. </li>
  84. <?php
  85. }
  86. }
  87. ?>
  88. </ul>
  89. </form>
  90. </div>
  91. <script id="tag_config_template" type="text/html">
  92. <ul class="dropdown-menu">
  93. <li class="dropdown-close"><a href="#close">❌</a></li>
  94. <li class="item">
  95. <button class="as-link confirm" disabled="disabled"
  96. form="mark-read-aside" formaction="<?php echo _url('tag', 'delete', 'id_tag', '------'); ?>"
  97. type="submit"><?php echo _t('gen.action.remove'); ?></button>
  98. </li>
  99. </ul>
  100. </script>
  101. <script id="feed_config_template" type="text/html">
  102. <ul class="dropdown-menu">
  103. <li class="dropdown-close"><a href="#close">❌</a></li>
  104. <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li>
  105. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  106. <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li>
  107. <?php } ?>
  108. <li class="item"><a target="_blank" rel="noreferrer" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li>
  109. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  110. <li class="separator"></li>
  111. <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li>
  112. <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li>
  113. <li class="item">
  114. <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm" disabled="disabled' : ''; ?>
  115. <button class="read_all as-link <?php echo $confirm; ?>"
  116. form="mark-read-aside"
  117. formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>"
  118. type="submit"><?php echo _t('gen.action.mark_read'); ?></button>
  119. </li>
  120. <?php } ?>
  121. </ul>
  122. </script>