summaryrefslogtreecommitdiffstats
path: root/templates/part.listfeed.php
diff options
context:
space:
mode:
authorBernhard Posselt <nukeawhale@gmail.com>2013-01-27 04:15:53 +0100
committerBernhard Posselt <nukeawhale@gmail.com>2013-01-27 04:15:53 +0100
commitae7393db3d99a7ac223ae917129cccd9f49888e3 (patch)
tree7f54b72b0d01c38afd1378365a67e4f192922423 /templates/part.listfeed.php
parent483784caa38bd6131405ac474347a215584e30a5 (diff)
merged the angularjs branch
Diffstat (limited to 'templates/part.listfeed.php')
-rw-r--r--templates/part.listfeed.php60
1 files changed, 24 insertions, 36 deletions
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php
index 5db86d975..e462d7683 100644
--- a/templates/part.listfeed.php
+++ b/templates/part.listfeed.php
@@ -1,36 +1,24 @@
-<?php
-
-require_once \OC_App::getAppPath('news') . '/lib/feedtypes.php';
-
-
-$l = new OC_l10n('news');
-
-
-$feed = isset($_['feed']) ? $_['feed'] : null;
-
-$feedTitle = $feed->getTitle();
-$feedId = $feed->getId();
-$unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null;
-$favicon = $feed->getFavicon();
-
-if ($favicon == null) {
- $favicon = OCP\Util::imagePath('core', 'actions/public.svg');
-}
-
-$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null;
-$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null;
-
-if ($lastViewedFeedType == OCA\News\FeedType::FEED && $lastViewedFeedId == $feedId){
- $activeClass = 'active';
-} else {
- $activeClass = '';
-}
-
-echo '<li class="feed ' . $activeClass . '" data-id="' . $feedId . '">';
- echo '<a style="background-image: url(' . $favicon . ');" href="#" class="title">' . $feedTitle .'</a>';
- echo '<span class="unread_items_counter">' . $unreadItemsCount . '</span>';
- echo '<span class="buttons">';
- echo '<button class="svg action feeds_delete" title="' . $l->t('Delete feed') . '"></button>';
- echo '<button class="svg action feeds_markread" title="' . $l->t('Mark all read') . '"></button>';
- echo '</span>';
-echo '</li>';
+<li ng-class="{active: isFeedActive(feedType.Feed, feed.id), all_read: feed.unreadCount==0}"
+ ng-repeat="feed in feeds|feedInFolder:<?php p($_['folderId']); ?>"
+ ng-show="feed.show"
+ data-id="{{feed.id}}"
+ class="feed"
+ draggable>
+ <a ng-style="{backgroundImage: feed.icon}"
+ href="#"
+ class="title"
+ ng-click="loadFeed(feedType.Feed, feed.id)">
+ {{feed.name}}
+ </a>
+ <span class="unread_items_counter">
+ {{ getUnreadCount(feedType.Feed, feed.id) }}
+ </span>
+ <span class="buttons">
+ <button ng-click="delete(feedType.Feed, feed.id)"
+ class="svg action feeds_delete"
+ title="<?php p($l->t('Delete feed')); ?>"></button>
+ <button class="svg action feeds_markread"
+ ng-click="markAllRead(feedType.Feed, feed.id)"
+ title="<?php p($l->t('Mark all read')); ?>"></button>
+ </span>
+</li> \ No newline at end of file