aside_feed.phtml 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  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" aria-hidden="true"></form>
  20. <ul class="tree">
  21. <li class="tree-folder category all<?php echo FreshRSS_Context::isCurrentGet('a') ? ' active' : ''; ?>">
  22. <div class="tree-folder-title">
  23. <?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>
  24. </div>
  25. </li>
  26. <li class="tree-folder category favorites<?php echo FreshRSS_Context::isCurrentGet('s') ? ' active' : ''; ?>">
  27. <div class="tree-folder-title">
  28. <?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>
  29. </div>
  30. </li>
  31. <?php
  32. foreach ($this->categories as $cat) {
  33. $feeds = $cat->feeds();
  34. if (!empty($feeds)) {
  35. $c_active = FreshRSS_Context::isCurrentGet('c_' . $cat->id());
  36. $c_show = $c_active && (!FreshRSS_Context::$user_conf->display_categories ||
  37. FreshRSS_Context::$current_get['feed']);
  38. ?>
  39. <li class="tree-folder category<?php echo $c_active ? ' active' : ''; ?>" data-unread="<?php echo $cat->nbNotRead(); ?>">
  40. <div class="tree-folder-title">
  41. <a class="dropdown-toggle" href="#"><?php echo _i($c_show ? 'up' : 'down'); ?></a>
  42. <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>
  43. </div>
  44. <ul class="tree-folder-items<?php echo $c_show ? ' active' : ''; ?>">
  45. <?php
  46. foreach ($feeds as $feed) {
  47. $f_active = FreshRSS_Context::isCurrentGet('f_' . $feed->id());
  48. ?>
  49. <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(); ?>">
  50. <div class="dropdown no-mobile">
  51. <div class="dropdown-target"></div>
  52. <a class="dropdown-toggle" data-fweb="<?php echo $feed->website(); ?>"><?php echo _i('configure'); ?></a>
  53. <?php /* feed_config_template */ ?>
  54. </div>
  55. <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>
  56. </li>
  57. <?php } ?>
  58. </ul>
  59. </li>
  60. <?php
  61. }
  62. }
  63. ?>
  64. </ul>
  65. </div>
  66. <script id="feed_config_template" type="text/html">
  67. <ul class="dropdown-menu">
  68. <li class="dropdown-close"><a href="#close">❌</a></li>
  69. <li class="item"><a href="<?php echo _url('index', 'index', 'get', 'f_------'); ?>"><?php echo _t('gen.action.filter'); ?></a></li>
  70. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  71. <li class="item"><a href="<?php echo _url('stats', 'repartition', 'id', '------'); ?>"><?php echo _t('index.menu.stats'); ?></a></li>
  72. <?php } ?>
  73. <li class="item"><a target="_blank" href="http://example.net/"><?php echo _t('gen.action.see_website'); ?></a></li>
  74. <?php if (FreshRSS_Auth::hasAccess()) { ?>
  75. <li class="separator"></li>
  76. <li class="item"><a href="<?php echo _url('subscription', 'index', 'id', '------'); ?>"><?php echo _t('gen.action.manage'); ?></a></li>
  77. <li class="item"><a href="<?php echo _url('feed', 'actualize', 'id', '------'); ?>"><?php echo _t('gen.action.actualize'); ?></a></li>
  78. <li class="item">
  79. <?php $confirm = FreshRSS_Context::$user_conf->reading_confirm ? 'confirm' : ''; ?>
  80. <button class="read_all as-link <?php echo $confirm; ?>"
  81. form="mark-read-aside"
  82. formaction="<?php echo _url('entry', 'read', 'get', 'f_------'); ?>"
  83. type="submit"><?php echo _t('gen.action.mark_read'); ?></button>
  84. </li>
  85. <?php } ?>
  86. </ul>
  87. </script>