summaryrefslogtreecommitdiffstats
path: root/templates
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 /templates
parent32f2759945521129e00a7cd4933682ff63d9440f (diff)
add active and unread stuff
Diffstat (limited to 'templates')
-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
6 files changed, 163 insertions, 164 deletions
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.getUnreadCount(feed.id) > 0 && !feed.error && !feed.editing">
- {{ unreadCountFormatter(feedBusinessLayer.getUnreadCount(feed.id)) }}
+ ng-show="feed.id && Navigation.getUnreadCount(feed.id) > 0 && !feed.error && !feed.editing">
+ {{ Navigation.getFeedUnreadCount(feed.id) | unreadCountFormatter }}
</span>
+ <!--
<button class="svg action mark-read-icon"
- ng-show="feedBusinessLayer.getUnreadCount(feed.id) > 0 && feed.id && !feed.error && !feed.editing"
- ng-click="feedBusinessLayer.markRead(feed.id)"
+ ng-show="Navigation.getUnreadCount(feed.id) > 0 && feed.id && !feed.error && !feed.editing"
+ ng-click="Navigation.markRead(feed.id)"
title="<?php p($l->t('Mark read')); ?>"
oc-tooltip></button>
@@ -69,10 +72,11 @@
oc-tooltip></button>
<button class="svg action delete-icon"
- ng-click="feedBusinessLayer.markErrorRead(feed.url)"
+ ng-click="Navigation.markErrorRead(feed.url)"
title="<?php p($l->t('Delete website')); ?>"
ng-show="feed.error"
oc-tooltip></button>
+ -->
</span>
<div class="message" ng-show="feed.error">{{ feed.error }}</div>
diff --git a/templates/part.listfolder.php b/templates/part.listfolder.php
index 9aecb58c4..f7a81ff03 100644
--- a/templates/part.listfolder.php
+++ b/templates/part.listfolder.php
@@ -1,76 +1,81 @@
<li ng-class="{
- active: folderBusinessLayer.isActive(folder.id),
- open: folder.opened && folderBusinessLayer.hasFeeds(folder.id),
- collapsible: folderBusinessLayer.hasFeeds(folder.id),
- unread: folderBusinessLayer.getUnreadCount(folder.id) != 0,
- failed: folder.error
- }"
- ng-repeat="folder in folderBusinessLayer.getAll() | orderBy:'id':true"
- ng-show="folderBusinessLayer.isVisible(folder.id) || !folder.id"
- class="folder"
- data-id="{{ folder.id }}"
- news-droppable>
- <button class="collapse"
- ng-hide="folder.editing"
- title="<?php p($l->t('Collapse'));?>"
- ng-click="folderBusinessLayer.toggleFolder(folder.id)"></button>
- <div ng-show="folder.editing" class="rename-feed">
+ active: Navigation.isFolderActive(folder.id),
+ open: folder.opened && Navigation.hasFeeds(folder.id),
+ collapsible: Navigation.hasFeeds(folder.id),
+ unread: Navigation.getFolderUnreadCount(folder.id) != 0,
+ failed: folder.error
+ }"
+ ng-repeat="folder in Navigation.getAllFolders() | orderBy:'id':true"
+ ng-show="Navigation.getFolderUnreadCount(folder.id) != 0
+ || Navigation.isShowAll()
+ || Navigation.isFolderActive(folder.id)
+ || Navigation.subFeedActive(folder.id)
+ || !folder.id"
+ class="folder"
+ data-id="{{ folder.id }}"
+ news-droppable>
+ <button class="collapse"
+ ng-hide="folder.editing"
+ title="<?php p($l->t('Collapse'));?>"
+ ng-click="Navigation.toggleFolder(folder.name)"></button>
+ <div ng-if="folder.editing" class="rename-feed">
<input type="text" ng-model="folder.name" class="folder-input" autofocus>
<button title="<?php p($l->t('Cancel')); ?>"
- ng-click="folderBusinessLayer.cancel(folder.id)"
- class="action-button back-button action"></button>
- <button title="<?php p($l->t('Save')); ?>"
- ng-click="folderBusinessLayer.rename(folder.id, folder.name)"
- class="action-button create-button action">
- </button>
+ ng-click="Navigation.cancelRenameFolder(folder.id)"
+ class="action-button back-button action"></button>
+ <button title="<?php p($l->t('Save')); ?>"
+ ng-click="Navigation.renameFolder(folder.id, folder.name)"
+ class="action-button create-button action">
+ </button>
</div>
- <a href="#"
- class="title folder-icon"
- ng-hide="folder.editing"
- ng-click="folderBusinessLayer.load(folder.id)"
- ng-class="{
- 'progress-icon': !folder.id,
- 'problem-icon': folder.error
- }"
- oc-click-focus="{selector: '#app-content'}">
- {{ folder.name }}
- </a>
- <span class="utils">
+ <a href="#/items/folders/{{ folder.id }}"
+ class="title folder-icon"
+ ng-hide="folder.editing"
+ ng-class="{
+ 'progress-icon': !folder.id,
+ 'problem-icon': folder.error
+ }">
+ {{ folder.name }}
+ </a>
- <button ng-click="folderBusinessLayer.delete(folder.id)"
- ng-hide="folder.editing || !folder.id"
- class="svg action delete-icon delete-button"
- title="<?php p($l->t('Delete folder')); ?>"
- oc-tooltip></button>
+ <span class="utils">
- <span class="unread-counter"
- ng-show="folderBusinessLayer.getUnreadCount(folder.id) > 0 && !folder.editing">
- {{ unreadCountFormatter(folderBusinessLayer.getUnreadCount(folder.id)) }}
- </span>
- <button class="svg action mark-read-icon"
- ng-show="folderBusinessLayer.getUnreadCount(folder.id) > 0 && folder.id && !folder.editing"
- ng-click="folderBusinessLayer.markRead(folder.id)"
- title="<?php p($l->t('Mark read')); ?>"
- oc-tooltip></button>
+ <span class="unread-counter"
+ ng-show="Navigation.getUnreadCount(folder.id) > 0 && !folder.editing">
+ {{ Navigation.getFolderUnreadCount(folder.id) | unreadCountFormatter }}
+ </span>
- <button class="svg action delete-icon"
- ng-click="folderBusinessLayer.markErrorRead(folder.name)"
- title="<?php p($l->t('Delete folder')); ?>"
- ng-show="folder.error"
- oc-tooltip></button>
+ <!--
+ <button ng-click="Navigation.delete(folder.id)"
+ ng-hide="folder.editing || !folder.id"
+ class="svg action delete-icon delete-button"
+ title="<?php p($l->t('Delete folder')); ?>"
+ oc-tooltip></button>
- <button class="svg action rename-feed-icon"
- ng-hide="folder.editing"
- ng-click="folderBusinessLayer.edit(folder.id)"
- title="<?php p($l->t('Rename folder')); ?>"
- oc-tooltip></button>
+ <button class="svg action mark-read-icon"
+ ng-show="Navigation.getUnreadCount(folder.id) > 0 && folder.id && !folder.editing"
+ ng-click="Navigation.markRead(folder.id)"
+ title="<?php p($l->t('Mark read')); ?>"
+ oc-tooltip></button>
- </span>
- <ul>
- <?php print_unescaped($this->inc('part.listfeed', ['folderId' => 'folder.id'])); ?>
- </ul>
+ <button class="svg action delete-icon"
+ ng-click="Navigation.markErrorRead(folder.name)"
+ title="<?php p($l->t('Delete folder')); ?>"
+ ng-show="folder.error"
+ oc-tooltip></button>
- <div class="message" ng-show="folder.error">{{ folder.error }}</div>
+ <button class="svg action rename-feed-icon"
+ ng-hide="folder.editing"
+ ng-click="Navigation.edit(folder.id)"
+ title="<?php p($l->t('Rename folder')); ?>"
+ oc-tooltip></button>
+ -->
+ </span>
+ <ul>
+ <?php print_unescaped($this->inc('part.listfeed', ['folderId' => 'folder.id'])); ?>
+ </ul>
+
+ <div class="message" ng-show="folder.error">{{ folder.error }}</div>
</li>