diff options
author | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2012-11-01 16:57:35 +0100 |
---|---|---|
committer | Jan-Christoph Borchardt <hey@jancborchardt.net> | 2012-11-01 16:57:35 +0100 |
commit | 018a1d10794ee2a7d9c0487ce7c0aa1050f6c9a4 (patch) | |
tree | 7c70170f2f3a7cddd43a38360387411fba51f00d /templates | |
parent | a77ab8799cb33cd378e83c3a5905c8c3eb4c08b8 (diff) | |
parent | c32dfe9802a26415213ab611a2ff8f142a2db134 (diff) |
Merge branch 'master' into navigation
Diffstat (limited to 'templates')
-rw-r--r-- | templates/main.php | 2 | ||||
-rw-r--r-- | templates/part.feeds.php | 11 | ||||
-rw-r--r-- | templates/part.items.php | 3 | ||||
-rw-r--r-- | templates/part.listfolder.php | 1 | ||||
-rw-r--r-- | templates/part.shared.php | 68 |
5 files changed, 84 insertions, 1 deletions
diff --git a/templates/main.php b/templates/main.php index 3c4eff3f4..ccc8c5261 100644 --- a/templates/main.php +++ b/templates/main.php @@ -4,7 +4,6 @@ <?php -$l = $_['trans']; $lastViewedFeedId = $_['lastViewedFeedId']; $lastViewedFeedType = $_['lastViewedFeedType']; @@ -52,6 +51,7 @@ echo $this->inc("part.dialogues"); <div id="rightcontent" class="rightcontent"> <?php echo '<div id="feed_items">'; + //echo $this->inc("part.shared"); echo $this->inc("part.items"); echo '</div>'; ?> diff --git a/templates/part.feeds.php b/templates/part.feeds.php index 14a7b0dd4..553e45f74 100644 --- a/templates/part.feeds.php +++ b/templates/part.feeds.php @@ -40,11 +40,13 @@ $allfeeds = isset($_['allfeeds']) ? $_['allfeeds'] : ''; $lastViewedFeedId = $_['lastViewedFeedId']; $lastViewedFeedType = $_['lastViewedFeedType']; $starredCount = $_['starredCount']; +//$sharedCount = $_['sharedCount']; ?> <li class="subscriptions <?php if($lastViewedFeedType == OCA\News\FeedType::SUBSCRIPTIONS) { echo "active"; }; ?>"> <a class="title" href="#" ><?php echo $l->t('New articles'); ?></a> + <span class="unread_items_counter"><?php echo $starredCount ?></span> <span class="buttons"> <button class="svg action feeds_markread" title="<?php echo $l->t('Mark all read'); ?>"></button> </span> @@ -55,4 +57,13 @@ $starredCount = $_['starredCount']; </li> <?php +/* +<li class="shared <?php if($lastViewedFeedType == OCA\News\FeedType::SHARED) { echo "active"; }; ?>"> + <a class="title" href="#" ><?php echo $l->t('Shared'); ?></a> + <span class="unread_items_counter"><?php echo $sharedCount ?></span> +</li> +*/ +?> + +<?php print_collection_list($allfeeds, $lastViewedFeedId, $lastViewedFeedType); diff --git a/templates/part.items.php b/templates/part.items.php index 70bdb4022..062cb557e 100644 --- a/templates/part.items.php +++ b/templates/part.items.php @@ -53,9 +53,12 @@ foreach($items as $item) { echo '<div class="bottom_utils">'; echo '<ul class="secondary_item_utils">'; + echo '<li class="share_link"><a class="share" data-item-type="news_item" data-item="' . $item->getId() . '" title="' . $l->t('Share') . + '" data-possible-permissions="' . (OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE) . '" href="#">' . $l->t('Share') . '</a></li>'; echo '<li class="keep_unread">' . $l->t('Keep unread') . '<input type="checkbox" /></li>'; echo '</ul>'; echo '</div>'; + echo '</li>'; diff --git a/templates/part.listfolder.php b/templates/part.listfolder.php index 6bc5b1472..31444c729 100644 --- a/templates/part.listfolder.php +++ b/templates/part.listfolder.php @@ -28,6 +28,7 @@ if ($lastViewedFeedType == OCA\News\FeedType::FOLDER && $lastViewedFeedId == $fo echo '<li class="folder ' . $openedClass . ' ' . $activeClass . ' all_read" data-id="' . $folderId . '">'; echo '<button class="collapsable_trigger" title="' . $l->t('Collapse') . '"></button>'; echo '<a href="#" class="title">' . htmlspecialchars($folderName, ENT_QUOTES, 'UTF-8') . '</a>'; + echo '<span class="unread_items_counter"></span>'; echo '<span class="buttons">'; echo '<button class="svg action feeds_delete" title="' . $l->t('Delete folder') . '"></button>'; echo '<button class="svg action feeds_edit" title="' . $l->t('Rename folder') . '"></button>'; diff --git a/templates/part.shared.php b/templates/part.shared.php new file mode 100644 index 000000000..5e29d8c92 --- /dev/null +++ b/templates/part.shared.php @@ -0,0 +1,68 @@ +<?php + +$items = OCP\Share::getItemsSharedWith('news_item', 1); + +//print_r($items); + +echo '<ul>'; +foreach($items as $item) { + + if($item->isRead()) { + $newsItemClass = "read"; + } else { + $newsItemClass = ""; + } + + if($item->isImportant()) { + $starClass = 'important'; + $startTitle = $l->t('Mark as unimportant'); + } else { + $starClass = ''; + $startTitle = $l->t('Mark as important'); + } + + echo '<li class="feed_item ' . $newsItemClass .'" data-id="' . $item->getId() . '" data-feedid="' . $item->getFeedId() . '">'; + echo '<span class="timestamp">' . $item->getDate() . '</span>'; + echo '<h2 class="item_date"><time class="timeago" datetime="' . + date('c', $item->getDate()) . '">' . date('F j, Y, g:i a', $item->getDate()) . '</time>' . '</h2>'; + + echo '<div class="utils">'; + echo '<ul class="primary_item_utils">'; + echo '<li class="star ' . $starClass . '" title="' . $startTitle . '"></li>'; + echo '</ul>'; + echo '</div>'; + + echo '<h1 class="item_title"><a target="_blank" href="' . $item->getUrl() . '">' . htmlspecialchars($item->getTitle(), ENT_QUOTES, 'UTF-8') . '</a></h1>'; + + if ((int)$lastViewedFeedType !== OCA\News\FeedType::FEED) { + $feedTitle = $l->t('from') . ' ' . '<a href="#" class="from_feed"> ' . $item->getFeedTitle() . '</a> '; + } else { + $feedTitle = ''; + } + + if(($item->getAuthor() !== null) && (trim($item->getAuthor()) !== '')) { + $author = $l->t('by') . ' ' . htmlspecialchars($item->getAuthor(), ENT_QUOTES, 'UTF-8'); + } else { + $author = ''; + } + + if(!($feedTitle === '' && $author === '')){ + echo '<h2 class="item_author">'. $feedTitle . $author . '</h2>'; + } + + echo '<div class="body">' . $item->getBody() . '</div>'; + + echo '<div><a class="share" data-item-type="news_item" data-item="' . $item->getId() . '" title="' . $l->t('Share') . + '" data-possible-permissions="' . (OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE) . '"/></div>'; + + echo '<div class="bottom_utils">'; + echo '<ul class="secondary_item_utils">'; + echo '<li class="keep_unread">' . $l->t('Keep unread') . '<input type="checkbox" /></li>'; + echo '</ul>'; + echo '</div>'; + + + echo '</li>'; + + } +echo '</ul>'; |