From a7f7f04052ded38c94e15a4e94645f6ab2b39941 Mon Sep 17 00:00:00 2001 From: Alessandro Cosentino Date: Sun, 28 Oct 2012 10:57:35 -0400 Subject: sharing items in the News app --- templates/main.php | 1 + templates/part.feeds.php | 7 +++++ templates/part.items.php | 6 ++++- templates/part.shared.php | 68 +++++++++++++++++++++++++++++++++++++++++++++++ 4 files changed, 81 insertions(+), 1 deletion(-) create mode 100644 templates/part.shared.php (limited to 'templates') diff --git a/templates/main.php b/templates/main.php index 3c4eff3f4..364ad9846 100644 --- a/templates/main.php +++ b/templates/main.php @@ -52,6 +52,7 @@ echo $this->inc("part.dialogues");
'; + //echo $this->inc("part.shared"); echo $this->inc("part.items"); echo '
'; ?> diff --git a/templates/part.feeds.php b/templates/part.feeds.php index 14a7b0dd4..5e9895870 100644 --- a/templates/part.feeds.php +++ b/templates/part.feeds.php @@ -40,6 +40,7 @@ $allfeeds = isset($_['allfeeds']) ? $_['allfeeds'] : ''; $lastViewedFeedId = $_['lastViewedFeedId']; $lastViewedFeedType = $_['lastViewedFeedType']; $starredCount = $_['starredCount']; +$sharedCount = $_['sharedCount']; ?> @@ -54,5 +55,11 @@ $starredCount = $_['starredCount']; +
  • "> + t('Shared'); ?> + +
  • + + ' . $item->getBody() . ''; + echo '
    '; + echo '
    '; - echo '
      '; + echo '
        '; echo '
      • ' . $l->t('Keep unread') . '
      • '; echo '
      '; echo '
    '; + echo ''; 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 @@ +'; +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 '
  • ' . htmlspecialchars($item->getTitle(), ENT_QUOTES, 'UTF-8') . '

    '; + + if ((int)$lastViewedFeedType !== OCA\News\FeedType::FEED) { + $feedTitle = $l->t('from') . ' ' . ' ' . $item->getFeedTitle() . ' '; + } 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 '

    '. $feedTitle . $author . '

    '; + } + + echo '
    ' . $item->getBody() . '
    '; + + echo '
  • '; + + } +echo ''; -- cgit v1.2.3