summaryrefslogtreecommitdiffstats
path: root/templates
diff options
context:
space:
mode:
authorAlessandro Cosentino <cosenal@gmail.com>2012-08-17 23:01:13 -0400
committerAlessandro Cosentino <cosenal@gmail.com>2012-08-17 23:01:13 -0400
commit45e7d2dfd727315d3a102aa9ba97c6c2eebec68e (patch)
tree7d397f26b76012666f5f0ff9ff3f74440d7472ca /templates
parent30fcd3949cd8bc74be9debd6fe8c53015dc06798 (diff)
parent91dff3767b957a59cd150be4c8126452964c5826 (diff)
fix conflicts
Diffstat (limited to 'templates')
-rw-r--r--templates/main.php17
-rw-r--r--templates/part.items.header.php51
-rw-r--r--templates/part.listfeed.php1
3 files changed, 15 insertions, 54 deletions
diff --git a/templates/main.php b/templates/main.php
index 3ec909b7d..96e419eeb 100644
--- a/templates/main.php
+++ b/templates/main.php
@@ -5,7 +5,17 @@
<?php
if ($_['feedid']){
-echo $this->inc("part.items.header");
+$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll');
+
+if($showAll){
+ $viewButtonImg = 'eye_all.svg';
+ $viewButtonTitle = $l->t('Show everything');
+ $viewButtonClass = 'show_all';
+} else {
+ $viewButtonImg = 'eye_unread.svg';
+ $viewButtonTitle = $l->t('Show only unread');
+ $viewButtonClass = 'show_unread';
+}
?>
@@ -20,12 +30,15 @@ echo $this->inc("part.items.header");
<div id="feed_settings">
<ul class="controls">
<li id="addfeedfolder" title="<?php echo $l->t('Add feed or folder'); ?>">
- <button class="svg"><img class="svg" src="<?php echo OCP\Util::linkTo('news', 'img/add.svg'); ?>" alt="<?php echo $l->t('Add Feed/Folder'); ?>" /></button>
+ <button class="svg"><img class="svg" src="<?php echo OCP\Util::linkTo('news', 'img/add.svg'); ?>" alt="<?php echo $l->t('Add Feed/Folder'); ?>" /></button>
<ul class="menu" id="feedfoldermenu">
<li id="addfeed"><?php echo $l->t('Feed'); ?></li>
<li id="addfolder"><?php echo $l->t('Folder'); ?></li>
</ul>
</li>
+ <li id="view" title="<?php echo $viewButtonTitle; ?>" class="<?php echo $viewButtonClass; ?>">
+ <button class="svg"></button>
+ </li>
<li style="float: right">
<button class="svg" id="settingsbtn" title="<?php echo $l->t('Settings'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('core','actions/settings.png'); ?>" alt="<?php echo $l->t('Settings'); ?>" /></button>
</li>
diff --git a/templates/part.items.header.php b/templates/part.items.header.php
deleted file mode 100644
index 0a49b9e91..000000000
--- a/templates/part.items.header.php
+++ /dev/null
@@ -1,51 +0,0 @@
-<?php
-
-if(isset($_['feedid'])){
- $feedId = $_['feedid'];
- $itemMapper = new OCA\News\ItemMapper();
- switch ($feedId) {
- case -1:
- $feedTitle = $l->t('Starred');
- $unreadItemCount = $itemMapper->countAllStatus($feedId, OCA\News\StatusFlag::IMPORTANT);
- break;
-
- case -2:
- $feedTitle = $l->t('New articles');
- $unreadItemCount = $itemMapper->countEveryItemByStatus(OCA\News\StatusFlag::UNREAD);
- break;
-
- default:
- $feedMapper = new OCA\News\FeedMapper();
- $feed = $feedMapper->findById($feedId);
- $feedTitle = $feed->getTitle();
- $unreadItemCount = $itemMapper->countAllStatus($feedId, OCA\News\StatusFlag::UNREAD);
- break;
- }
-
- if($unreadItemCount > 0){
- $readClass = '';
- } else {
- $readClass = 'all_read';
- }
-} else {
- $feedTitle = '';
- $unreadItemCount = 0;
-}
-
-$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll');
-
-?>
-
-<div class="feed_controls">
- <span title="<?php echo $l->t('Unread items'); ?>" class="unreaditemcounter <?php echo $readClass; ?>"><?php echo $unreadItemCount; ?></span>
- <div class="feed_title">
- <h1 title="<?php echo $feedTitle; ?>"><?php echo $feedTitle; ?></h1>
- </div>
- <div class="controls">
- <input type="button" value="<?php echo $l->t('Mark all read'); ?>" id="mark_all_as_read" />
- <select id="feed_filter">
- <option value="unread" <?php if(!$showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show only unread articles'); ?></option>
- <option value="all" <?php if($showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show read/unread articles'); ?></option>
- </select>
- </div>
-</div> \ No newline at end of file
diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php
index e06dcd38c..e8d91ecb8 100644
--- a/templates/part.listfeed.php
+++ b/templates/part.listfeed.php
@@ -19,6 +19,5 @@ if($unreadItemsCount == 0){
echo '<li class="feed" data-id="' . $feed->getId() . '" style="background-image: url(' . $favicon . ');">';
echo '<a href="#" " class="' . $allReadClass . '">' . $feed->getTitle() .'</a>';
echo '<span class="unreaditemcounter ' . $allReadClass . '">' . $unreadItemsCount . '</span>';
-echo '<button class="svg action feeds_edit" title="' . $l->t('Edit feed') . '"></button>';
echo '<button class="svg action feeds_delete" onClick="(News.Feed.delete(' . $feed->getId(). '))" title="' . $l->t('Delete feed') . '"></button>';
echo '</li>';