summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBernhard Posselt <dev@bernhard-posselt.com>2014-05-31 01:12:20 +0200
committerBernhard Posselt <dev@bernhard-posselt.com>2014-05-31 01:12:20 +0200
commit82f0a877a001ead0bd0cdd76d96fe46a071535d8 (patch)
treea37f50a00c77c5e6afd1790ccde75ab3639c6c96
parent32f2759945521129e00a7cd4933682ff63d9440f (diff)
add active and unread stuff
-rw-r--r--CHANGELOG.md2
-rw-r--r--js/build/app.js86
-rw-r--r--js/controller/NavigationController.js92
-rw-r--r--js/filter/UnreadCountFormatter.js19
-rw-r--r--js/service/FeedResource.js2
-rw-r--r--js/service/ItemResource.js1
-rw-r--r--js/tests/unit/controller/NavigationControllerSpec.js156
-rw-r--r--js/tests/unit/filter/UnreadCountFormatterSpec.js27
-rw-r--r--js/tests/unit/service/FeedResourceSpec.js2
-rw-r--r--templates/main.php4
-rw-r--r--templates/part.addnew.php122
-rw-r--r--templates/part.feed.starred.php16
-rw-r--r--templates/part.feed.unread.php16
-rw-r--r--templates/part.listfeed.php38
-rw-r--r--templates/part.listfolder.php131
15 files changed, 516 insertions, 198 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index c37f54191..6c0359a5d 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -11,6 +11,8 @@ owncloud-news (3.001)
* Port clientside code to JavaScript (ES6)
* Removed pull to refresh
* Push API to 1.4
+* Slim down appstore build
+* Make interface faster
owncloud-news (2.003)
* Use correct url for folder and feed api update methods
diff --git a/js/build/app.js b/js/build/app.js
index c482c3fb4..9d544268f 100644
--- a/js/build/app.js
+++ b/js/build/app.js
@@ -293,11 +293,13 @@ var $__build_47_app__ = function () {
}
]);
app.controller('NavigationController', [
+ '$route',
+ 'FEED_TYPE',
'FeedResource',
'FolderResource',
'ItemResource',
'SettingsResource',
- function (FeedResource, FolderResource, ItemResource, SettingsResource) {
+ function ($route, FEED_TYPE, FeedResource, FolderResource, ItemResource, SettingsResource) {
'use strict';
this.feedError = '';
this.folderError = '';
@@ -334,14 +336,67 @@ var $__build_47_app__ = function () {
this.getFeedsOfFolder = function (folderId) {
return FeedResource.getByFolderId(folderId);
};
- this.createFeed = function () {
- console.log('TBD');
+ this.getUnreadCount = function () {
+ return FeedResource.getUnreadCount();
};
- this.createFolder = function () {
- console.log('TBD');
+ this.getFeedUnreadCount = function (feedId) {
+ return FeedResource.getById(feedId).unreadCount;
};
- this.renameFeed = function () {
- console.log('TBD');
+ this.getFolderUnreadCount = function (folderId) {
+ return FeedResource.getFolderUnreadCount(folderId);
+ };
+ this.getStarredCount = function () {
+ return ItemResource.getStarredCount();
+ };
+ this.toggleFolder = function (folderName) {
+ FolderResource.toggleOpen(folderName);
+ };
+ this.hasFeeds = function (folderId) {
+ return FeedResource.getFolderUnreadCount(folderId) !== undefined;
+ };
+ this.subFeedActive = function (folderId) {
+ var type = $route.current.$$route.type;
+ if (type === FEED_TYPE.FEED) {
+ try {
+ throw undefined;
+ } catch (feed) {
+ feed = FeedResource.getById($route.current.params.id);
+ if (feed.folderId === folderId) {
+ return true;
+ }
+ }
+ }
+ return false;
+ };
+ this.isSubscriptionsActive = function () {
+ return $route.current.$$route.type === FEED_TYPE.SUBSCRIPTIONS;
+ };
+ this.isStarredActive = function () {
+ return $route.current.$$route.type === FEED_TYPE.STARRED;
+ };
+ this.isFolderActive = function (folderId) {
+ return $route.current.$$route.type === FEED_TYPE.FOLDER && $route.current.params.id === folderId;
+ };
+ this.isFeedActive = function (feedId) {
+ return $route.current.$$route.type === FEED_TYPE.FEED && $route.current.params.id === feedId;
+ };
+ this.isAddingFolder = function () {
+ return true;
+ };
+ this.createFeed = function (feedUrl, folderId) {
+ console.log(feedUrl + folderId);
+ };
+ this.createFolder = function (folderName) {
+ console.log(folderName);
+ };
+ this.cancelRenameFolder = function (folderId) {
+ console.log(folderId);
+ };
+ this.renameFeed = function (feedId, feedTitle) {
+ console.log(feedId + feedTitle);
+ };
+ this.cancelRenameFeed = function (feedId) {
+ console.log(feedId);
};
this.renameFolder = function () {
console.log('TBD');
@@ -355,12 +410,6 @@ var $__build_47_app__ = function () {
this.moveFeed = function () {
console.log('TBD');
};
- this.isActive = function () {
- console.log('TBD');
- };
- this.isVisible = function () {
- console.log('TBD');
- };
}
]);
app.controller('SettingsController', [
@@ -408,6 +457,15 @@ var $__build_47_app__ = function () {
};
}
]);
+ app.filter('unreadCountFormatter', function () {
+ 'use strict';
+ return function (unreadCount) {
+ if (unreadCount > 999) {
+ return '999+';
+ }
+ return unreadCount;
+ };
+ });
app.factory('FeedResource', [
'Resource',
'$http',
@@ -541,7 +599,7 @@ var $__build_47_app__ = function () {
return this.unreadCount;
},
getFolderUnreadCount: function (folderId) {
- return this.folderUnreadCount[$traceurRuntime.toProperty(folderId)] || 0;
+ return this.folderUnreadCount[$traceurRuntime.toProperty(folderId)];
},
getByFolderId: function (folderId) {
return this.folderIds[$traceurRuntime.toProperty(folderId)] || [];
diff --git a/js/controller/NavigationController.js b/js/controller/NavigationController.js
index e6cb14a93..17ef923aa 100644
--- a/js/controller/NavigationController.js
+++ b/js/controller/NavigationController.js
@@ -8,7 +8,8 @@
* @copyright Bernhard Posselt 2014
*/
app.controller('NavigationController',
-function (FeedResource, FolderResource, ItemResource, SettingsResource) {
+function ($route, FEED_TYPE,
+ FeedResource, FolderResource, ItemResource, SettingsResource) {
'use strict';
this.feedError = '';
@@ -48,42 +49,101 @@ function (FeedResource, FolderResource, ItemResource, SettingsResource) {
return FeedResource.getByFolderId(folderId);
};
+ this.getUnreadCount = () => {
+ return FeedResource.getUnreadCount();
+ };
+
+ this.getFeedUnreadCount = (feedId) => {
+ return FeedResource.getById(feedId).unreadCount;
+ };
+
+ this.getFolderUnreadCount= (folderId) => {
+ return FeedResource.getFolderUnreadCount(folderId);
+ };
+
+ this.getStarredCount = () => {
+ return ItemResource.getStarredCount();
+ };
+
+ this.toggleFolder = (folderName) => {
+ FolderResource.toggleOpen(folderName);
+ };
+
+ this.hasFeeds = (folderId) => {
+ return FeedResource.getFolderUnreadCount(folderId) !== undefined;
+ };
+
+ this.subFeedActive = (folderId) => {
+ let type = $route.current.$$route.type;
+
+ if (type === FEED_TYPE.FEED) {
+ let feed = FeedResource.getById($route.current.params.id);
+
+ if (feed.folderId === folderId) {
+ return true;
+ }
+ }
+
+ return false;
+ };
+
+ this.isSubscriptionsActive = () => {
+ return $route.current.$$route.type === FEED_TYPE.SUBSCRIPTIONS;
+ };
+
+ this.isStarredActive = () => {
+ return $route.current.$$route.type === FEED_TYPE.STARRED;
+ };
+
+ this.isFolderActive = (folderId) => {
+ return $route.current.$$route.type === FEED_TYPE.FOLDER &&
+ $route.current.params.id === folderId;
+ };
+
+ this.isFeedActive = (feedId) => {
+ return $route.current.$$route.type === FEED_TYPE.FEED &&
+ $route.current.params.id === feedId;
+ };
+
// TBD
- this.createFeed = () => {
- console.log('TBD');
+ this.isAddingFolder = () => {
+ return true;
};
- this.createFolder = () => {
- console.log('TBD');
+ this.createFeed = (feedUrl, folderId) => {
+ console.log(feedUrl + folderId);
};
- this.renameFeed = () => {
- console.log('TBD');
+ this.createFolder = (folderName) => {
+ console.log(folderName);
};
- this.renameFolder = () => {
- console.log('TBD');
+ this.cancelRenameFolder = (folderId) => {
+ console.log(folderId);
};
- this.deleteFeed = () => {
- console.log('TBD');
+ this.renameFeed = (feedId, feedTitle) => {
+ console.log(feedId + feedTitle);
};
- this.deleteFolder = () => {
- console.log('TBD');
+ this.cancelRenameFeed = (feedId) => {
+ console.log(feedId);
};
- this.moveFeed = () => {
+ this.renameFolder = () => {
console.log('TBD');
};
- this.isActive = () => {
+ this.deleteFeed = () => {
console.log('TBD');
};
- this.isVisible = () => {
+ this.deleteFolder = () => {
console.log('TBD');
};
+ this.moveFeed = () => {
+ console.log('TBD');
+ };
}); \ No newline at end of file
diff --git a/js/filter/UnreadCountFormatter.js b/js/filter/UnreadCountFormatter.js
new file mode 100644
index 000000000..3450114b1
--- /dev/null
+++ b/js/filter/UnreadCountFormatter.js
@@ -0,0 +1,19 @@
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+app.filter('unreadCountFormatter', () => {
+ 'use strict';
+
+ return (unreadCount) => {
+ if (unreadCount > 999) {
+ return '999+';
+ }
+ return unreadCount;
+ };
+}); \ No newline at end of file
diff --git a/js/service/FeedResource.js b/js/service/FeedResource.js
index 9759724ac..1bbb3cbd2 100644
--- a/js/service/FeedResource.js
+++ b/js/service/FeedResource.js
@@ -130,7 +130,7 @@ app.factory('FeedResource', (Resource, $http, BASE_URL) => {
getFolderUnreadCount (folderId) {
- return this.folderUnreadCount[folderId] || 0;
+ return this.folderUnreadCount[folderId];
}
diff --git a/js/service/ItemResource.js b/js/service/ItemResource.js
index 79a07efd9..420e20775 100644
--- a/js/service/ItemResource.js
+++ b/js/service/ItemResource.js
@@ -30,6 +30,7 @@ app.factory('ItemResource', (Resource, $http, BASE_URL, ITEM_BATCH_SIZE) => {
case 'starred':
this.starredCount = value;
break;
+
default:
super.receive(value, channel);
}
diff --git a/js/tests/unit/controller/NavigationControllerSpec.js b/js/tests/unit/controller/NavigationControllerSpec.js
index adefd157f..6837160bf 100644
--- a/js/tests/unit/controller/NavigationControllerSpec.js
+++ b/js/tests/unit/controller/NavigationControllerSpec.js
@@ -14,11 +14,24 @@ describe('NavigationController', () => {
beforeEach(module('News', ($provide) => {
$provide.value('BASE_URL', 'base');
+ $provide.value('FEED_TYPE', {
+ FEED: 0,
+ FOLDER: 1,
+ STARRED: 2,
+ SUBSCRIPTIONS: 3,
+ SHARED: 4
+ });
$provide.constant('ITEM_BATCH_SIZE', 5);
}));
- beforeEach(inject(($controller) => {
+ beforeEach(inject(($controller, FeedResource) => {
controller = $controller('NavigationController');
+ FeedResource.receive([
+ {id: 1, folderId: 3, url: 'ye', unreadCount: 45},
+ {id: 2, folderId: 4, url: 'sye', unreadCount: 25},
+ {id: 3, folderId: 3, title: 'hore', url: '1sye', unreadCount: 1}
+ ]);
+
}));
@@ -126,4 +139,143 @@ describe('NavigationController', () => {
}));
-}); \ No newline at end of file
+ it('should get the unreadcount', inject((FeedResource, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ });
+
+
+ expect(ctrl.getUnreadCount()).toBe(71);
+ expect(ctrl.getFeedUnreadCount(1)).toBe(45);
+ expect(ctrl.getFolderUnreadCount(3)).toBe(46);
+ }));
+
+
+ it('should get the starred count', inject((ItemResource, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ ItemResource: ItemResource,
+ });
+
+ ItemResource.receive(99, 'starred');
+
+ expect(ctrl.getStarredCount()).toBe(99);
+ }));
+
+
+ it('should toggle a folder', inject((FolderResource, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FolderResource: FolderResource,
+ });
+
+ FolderResource.toggleOpen = jasmine.createSpy('open');
+
+ ctrl.toggleFolder(3);
+
+ expect(FolderResource.toggleOpen).toHaveBeenCalledWith(3);
+ }));
+
+
+ it('should check if a folder has feeds', inject((FeedResource,
+ $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ });
+
+ expect(ctrl.hasFeeds(3)).toBe(true);
+ expect(ctrl.hasFeeds(1)).toBe(false);
+ }));
+
+
+ it('should check if a subfeed is active', inject((FeedResource,
+ FEED_TYPE, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: {
+ current: {
+ params: {
+ id: 3
+ },
+ $$route: {
+ type: FEED_TYPE.FEED
+ }
+ }
+ }
+ });
+
+ expect(ctrl.subFeedActive(3)).toBe(true);
+ }));
+
+ it('should check if a subscriptions is active', inject((FeedResource,
+ FEED_TYPE, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: {
+ current: {
+ $$route: {
+ type: FEED_TYPE.SUBSCRIPTIONS
+ }
+ }
+ }
+ });
+
+ expect(ctrl.isSubscriptionsActive()).toBe(true);
+ }));
+
+
+ it('should check if a starred is active', inject((FeedResource,
+ FEED_TYPE, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: {
+ current: {
+ $$route: {
+ type: FEED_TYPE.STARRED
+ }
+ }
+ }
+ });
+
+ expect(ctrl.isStarredActive()).toBe(true);
+ }));
+
+
+
+ it('should check if a feed is active', inject((FeedResource,
+ FEED_TYPE, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: {
+ current: {
+ params: {
+ id: 3
+ },
+ $$route: {
+ type: FEED_TYPE.FEED
+ }
+ }
+ }
+ });
+
+ expect(ctrl.isFeedActive(3)).toBe(true);
+ }));
+
+
+ it('should check if a folder is active', inject((FeedResource,
+ FEED_TYPE, $controller) => {
+ let ctrl = $controller('NavigationController', {
+ FeedResource: FeedResource,
+ $route: {
+ current: {
+ params: {
+ id: 3
+ },
+ $$route: {
+ type: FEED_TYPE.FOLDER
+ }
+ }
+ }
+ });
+
+ expect(ctrl.isFolderActive(3)).toBe(true);
+ }));
+});
diff --git a/js/tests/unit/filter/UnreadCountFormatterSpec.js b/js/tests/unit/filter/UnreadCountFormatterSpec.js
new file mode 100644
index 000000000..14152f047
--- /dev/null
+++ b/js/tests/unit/filter/UnreadCountFormatterSpec.js
@@ -0,0 +1,27 @@
+/**
+ * ownCloud - News
+ *
+ * This file is licensed under the Affero General Public License version 3 or
+ * later. See the COPYING file.
+ *
+ * @author Bernhard Posselt <dev@bernhard-posselt.com>
+ * @copyright Bernhard Posselt 2014
+ */
+describe('unreadCountFormatter', () => {
+ 'use strict';
+
+ let filter;
+
+ beforeEach(module('News'));
+
+ beforeEach(inject(($filter) => {
+ filter = $filter('unreadCountFormatter');
+ }));
+
+ it('should format the unread count', () => {
+ expect(filter(999)).toBe(999);
+ expect(filter(1000)).toBe('999+');
+ });
+
+
+}); \ No newline at end of file
diff --git a/js/tests/unit/service/FeedResourceSpec.js b/js/tests/unit/service/FeedResourceSpec.js
index a37ff42f3..d7473cb70 100644
--- a/js/tests/unit/service/FeedResourceSpec.js
+++ b/js/tests/unit/service/FeedResourceSpec.js
@@ -97,7 +97,7 @@ describe('FeedResource', () => {
expect(FeedResource.getFolderUnreadCount(3)).toBe(0);
FeedResource.markRead();
- expect(FeedResource.getFolderUnreadCount(4)).toBe(0);
+ expect(FeedResource.getFolderUnreadCount(4)).toBe(undefined);
}));
diff --git a/templates/main.php b/templates/main.php
index 37f707118..d0cac8fa6 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -10,7 +10,7 @@
\OCP\Util::addStyle('news', 'bootstrap/tooltip');
\OCP\Util::addStyle('news', 'app');
-//\OCP\Util::addStyle('news', 'navigation');
+\OCP\Util::addStyle('news', 'navigation');
\OCP\Util::addStyle('news', 'content');
\OCP\Util::addStyle('news', 'settings');
?>
@@ -26,7 +26,7 @@
<ul class="with-icon" data-folder-id="0" news-droppable>
<?php print_unescaped($this->inc('part.addnew')) ?>
<?php print_unescaped($this->inc('part.feed.unread')) ?>
- <?php //print_unescaped($this->inc('part.feed.starred')) ?>
+ <?php print_unescaped($this->inc('part.feed.starred')) ?>
<?php print_unescaped($this->inc('part.listfeed', ['folderId' => '0'])) ?>
<?php print_unescaped($this->inc('part.listfolder')) ?>
</ul>
diff --git a/templates/part.addnew.php b/templates/part.addnew.php
index 69ca47810..b3e02afdf 100644
--- a/templates/part.addnew.php
+++ b/templates/part.addnew.php
@@ -1,69 +1,63 @@
<li class="add-new">
- <a class="list-title list-title-with-icon"
- data-apps-slide-toggle=".add-new-popup"
- href="#"
- oc-click-focus="{
- selector: '.add-new-popup input[ng-model=feedUrl]'
- }"
- >+ <span><?php p($l->t('Add Website'))?></span></a>
+ <a class="list-title list-title-with-icon"
+ data-apps-slide-toggle=".add-new-popup"
+ href="#">+ <span><?php p($l->t('Add Website'))?></span></a>
- <div class="add-new-popup">
+ <div class="add-new-popup">
- <fieldset class="personalblock">
- <p class="error" ng-show="feedExistsError || folderExistsError">
- <span ng-show="feedExistsError">
- <?php p($l->t('Error: address exists already!')); ?>
- </span>
- <span ng-show="folderExistsError">
- <?php p($l->t('Error: folder exists already')); ?>
- </span>
- </p>
- <form>
+ <p class="error">
+ <span ng-show="Navigation.feedExistsError">
+ <?php p($l->t('Error: address exists already!')); ?>
+ </span>
+ <span ng-show="Navigation.folderExistsError">
+ <?php p($l->t('Error: folder exists already')); ?>
+ </span>
+ </p>
+ <form>
- <input type="text"
- ng-model="feedUrl"
- placeholder="<?php p($l->t('Address')); ?>"
- name="adress"
- autofocus>
- <button title="<?php p($l->t('Add')); ?>"
- class="primary"
- ng-disabled="!feedUrl.trim()"
- ng-click="addFeed(feedUrl, folderId.id)"><?php p($l->t('Add')); ?></button>
- </form>
- <form>
- <select name="folder"
- data-create="<?php p($l->t('New folder')); ?>"
- title="<?php p($l->t('Folder')); ?>"
- ng-model="folderId"
- ng-options="folder.name for folder in folderBusinessLayer.getAll()"
- ng-hide="addNewFolder">
- <option value="" selected="selected"><?php p($l->t('Choose folder')); ?></option>
- </select>
- <button title="<?php p($l->t('New folder')); ?>"
- ng-click="addNewFolder=true"
- ng-hide="addNewFolder"
- class="action-button new-button action"
- oc-click-focus="{selector: 'input[name=\'foldername\']'}"></button>
- <input type="text"
- ng-model="folderName"
- ng-show="addNewFolder"
- name="foldername"
- placeholder="<?php p($l->t('Folder name')); ?>"
- autofocus
- class="folder-input"
- ui-keyup="{13: 'addFolder(folderName)'}"/>
- <button title="<?php p($l->t('Back to folder selection')); ?>"
- ng-show="addNewFolder"
- ng-click="addNewFolder=false"
- class="action-button back-button action"></button>
- <button title="<?php p($l->t('Create folder')); ?>"
- ng-show="addNewFolder"
- ng-click="addFolder(folderName)"
- ng-disabled="!folderName.trim()"
- ng-class="{loading: isAddingFolder()}"
- class="action-button create-button action">
- </button>
- </form>
- </fieldset>
- </div>
+ <input type="text"
+ ng-model="feedUrl"
+ placeholder="<?php p($l->t('Address')); ?>"
+ name="adress"
+ autofocus>
+ <button title="<?php p($l->t('Add')); ?>"
+ class="primary"
+ ng-disabled="!feedUrl.trim()"
+ ng-click="createFeed(feedUrl, folderId.id)"><?php p($l->t('Add')); ?></button>
+ </form>
+ <form>
+ <select name="folder"
+ data-create="<?php p($l->t('New folder')); ?>"
+ title="<?php p($l->t('Folder')); ?>"
+ ng-model="folderId"
+ ng-options="folder.name for folder in Navigation.getAllFolders() track by folder.name"
+ ng-hide="addNewFolder">
+ <option value="" selected="selected"><?php p($l->t('Choose folder')); ?></option>
+ </select>
+ <button title="<?php p($l->t('New folder')); ?>"
+ ng-click="addNewFolder=true"
+ ng-hide="addNewFolder"
+ class="action-button new-button action"></button>
+ <input type="text"
+ ng-model="folderName"
+ ng-if="addNewFolder"
+ name="foldername"
+ placeholder="<?php p($l->t('Folder name')); ?>"
+ autofocus
+ class="folder-input"
+ ui-keyup="{13: 'Navigation.createFolder(folderName)'}"/>
+ <button title="<?php p($l->t('Back to folder selection')); ?>"
+ ng-show="addNewFolder"
+ ng-click="addNewFolder=false"
+ class="action-button back-button action"></button>
+ <button title="<?php p($l->t('Create folder')); ?>"
+ ng-show="addNewFolder"
+ ng-click="Navigation.createFolder(folderName)"
+ ng-disabled="!folderName.trim()"
+ ng-class="{loading: Navigation.isAddingFolder()}"
+ class="action-button create-button action">
+ </button>
+ </form>
+ </fieldset>
+ </div>
</li>
diff --git a/templates/part.feed.starred.php b/templates/part.feed.starred.php
index 15f5e0a07..48e3eda8a 100644
--- a/templates/part.feed.starred.php
+++ b/templates/part.feed.starred.php
@@ -1,18 +1,14 @@
-<li ng-class="{
- active: starredBusinessLayer.isActive(0),
- unread: starredBusinessLayer.getUnreadCount() > 0
- }"
- ng-show="starredBusinessLayer.isVisible(0)"
+<li ng-class="{
+ active: Navigation.isStarredActive(),
+ unread: Navigation.getStarredCount() > 0
+ }"
class="starred">
- <a class="starred-icon"
- href="#"
- ng-click="starredBusinessLayer.load(0)"
- oc-click-focus="{selector: '#app-content'}">
+ <a class="starred-icon" href="#/items/starred">
<?php p($l->t('Starred')) ?>
</a>
<span class="utils">
<span class="unread-counter">
- {{ unreadCountFormatter(starredBusinessLayer.getUnreadCount()) }}
+ {{ Navigation.getStarredCount() | unreadCountFormatter }}
</span>
</span>
</li> \ No newline at end of file
diff --git a/templates/part.feed.unread.php b/templates/part.feed.unread.php
index 049332002..ff91c55c1 100644
--- a/templates/part.feed.unread.php
+++ b/templates/part.feed.unread.php
@@ -1,8 +1,7 @@
<li ng-class="{
- active: subscriptionsBusinessLayer.isActive(0),
- unread: getTotalUnreadCount() > 0
- }"
- ng-show="subscriptionsBusinessLayer.isVisible(0)">
+ active: Navigation.isSubscriptionsActive(),
+ unread: Navigation.getUnreadCount() > 0
+ }">
<a class="rss-icon" href="#/items" ng-if="!Navigation.isShowAll()">
<?php p($l->t('Unread articles'))?>
@@ -16,14 +15,15 @@
</div>
<span class="utils">
- <span class="unread-counter"
- ng-show="getTotalUnreadCount() > 0">
- {{ unreadCountFormatter(getTotalUnreadCount()) }}
+ <span class="unread-counter" ng-show="getUnreadCount() > 0">
+ {{ Navigation.getUnreadCount() | unreadCountFormatter }}
</span>
+ <!--
<button class="svg action mark-read-icon"
- ng-click="subscriptionsBusinessLayer.markRead()"
+ ng-click="Navigation.markRead()"
title="<?php p($l->t('Mark read')) ?>"
ng-show="getTotalUnreadCount() > 0"
oc-tooltip data-placement="bottom"></button>
+ -->
</span>
</li> \ No newline at end of file
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php
index 96e0dafbc..fc9c24470 100644
--- a/templates/part.listfeed.php
+++ b/templates/part.listfeed.php
@@ -1,10 +1,13 @@
<li ng-class="{
- active: feedBusinessLayer.isActive(feed.id),
- unread: feedBusinessLayer.getUnreadCount(feed.id) > 0,
+ active: Navigation.isFeedActive(feed.id),
+ unread: Navigation.getFeedUnreadCount(feed.id) > 0,
failed: feed.error
}"
- ng-repeat="feed in .getFeedsOfFolder(<?php p($_['folderId']); ?>) | orderBy:'id':true"
- ng-show="feedBusinessLayer.isVisible(feed.id) || !feed.id"
+ ng-repeat="feed in Navigation.getFeedsOfFolder(<?php p($_['folderId']); ?>) | orderBy:'id':true"
+ ng-show="Navigation.getFeedUnreadCount(feed.id) > 0
+ || Navigation.isShowAll()
+ || Navigation.isFeedActive(feed.id)
+ || !feed.id"
data-id="{{ feed.id }}"
class="feed"
news-draggable="{
@@ -17,47 +20,47 @@
revert: true
}">
- <div ng-show="feed.editing" class="rename-feed">
+ <div ng-if="feed.editing" class="rename-feed">
<input type="text" ng-model="feed.title" autofocus>
<button title="<?php p($l->t('Cancel')); ?>"
- ng-click="cancel(feed)"
+ ng-click="cancelRenameFeed(feed.id)"
class="action-button back-button action"></button>
<button title="<?php p($l->t('Save')); ?>"
- ng-click="feedBusinessLayer.renameFeed(feed.id, feed.title)"
+ ng-click="Navigation.renameFeed(feed.id, feed.title)"
class="action-button create-button action">
</button>
</div>
<a ng-style="{ backgroundImage: feed.faviconLink }"
- ng-click="feedBusinessLayer.load(feed.id)"
ng-class="{
'progress-icon': !feed.id,
'problem-icon': feed.error
}"
ng-hide="feed.editing"
- href="#"
+ href="#/items/feeds/{{ feed.id }}"
class="title"
- title="{{ feed.title }}"
+ title="{{ feed.title }}">
{{ feed.title }}
</a>
<span class="utils">
- <button ng-click="feedBusinessLayer.delete(feed.id)"
+ <!--<button ng-click="Navigation.deleteFeed(feed.id)"
class="svg action delete-icon delete-button"
title="<?php p($l->t('Delete website')); ?>"
ng-show="feed.id && !feed.editing && !feed.error"
- oc-tooltip></button>
+ oc-tooltip></button>-->
<span class="unread-counter"
- ng-show="feed.id && feedBusinessLayer.getUnreadCou