1
0
mirror of https://github.com/chylex/Nextcloud-News.git synced 2025-01-08 10:42:54 +01:00
Nextcloud-News/templates/part.content.php

244 lines
13 KiB
PHP
Raw Normal View History

2017-05-24 20:52:23 +02:00
<?php print_unescaped($this->inc('part.content.warnings')) ?>
2014-05-23 20:19:06 +02:00
<div news-auto-focus="#app-content"
2014-10-20 17:24:42 +02:00
id="articles"
ng-class="{
compact: Content.isCompactView(),
'feed-view': Content.isFeed()
}"
news-compact-expand="{{ Content.isCompactExpand() }}"
class="app-content-detail">
2014-11-19 19:39:59 +01:00
<div ng-show="Content.getItems().length == 0" class="no-feeds-available">
<p ng-show="Content.isShowAll()"><?php p($l->t('No articles available')) ?></p>
<p ng-show="!Content.isShowAll()"><?php p($l->t('No unread articles available')) ?></p>
</div>
<button ng-controller="NavigationController as Navigation" id="mark-all-read-button" ng-click="Navigation.markCurrentRead()" class="hidden">
<span title="Mark Read" class="icon-checkmark"></span>
</button>
2014-09-09 22:21:40 +02:00
<ul>
<li class="item {{ ::Content.getFeed(item.feedId).cssClass }}"
ng-repeat="item in Content.getItems() |
orderBy:'id':Content.oldestFirst:Content.sortIds track by item.id"
2015-06-02 09:49:12 +02:00
ng-mouseup="Content.markRead(item.id)"
2016-04-18 21:18:13 +02:00
ng-click="Content.markRead(item.id); Content.setItemActive(item.id)"
news-on-active="Content.setItemActive(item.id)"
ng-class="{read: !item.unread, open: item.show, active: Content.isItemActive(item.id)}"
data-id="{{ ::item.id }}">
<div class="utils"
ng-click="Content.toggleItem(item)"
ng-class="{'compact-dropdown': Content.showDropdown[item.id]}">
2014-09-09 23:44:25 +02:00
<ul>
<li class="util-spacer"></li>
<li class="util only-in-compact">
<a class="external icon-link"
ng-click="Content.markRead(item.id)"
target="_blank"
rel="noreferrer"
ng-href="{{ ::item.url }}"
title="<?php p($l->t('Open website')) ?>"
news-stop-propagation>
</a>
</li>
2014-09-13 19:46:40 +02:00
<li class="title only-in-compact"
ng-class="{
'icon-rss':
!Content.getFeed(item.feedId).faviconLink
}"
ng-style="{
backgroundImage:
'url('
+ Content.getFeed(item.feedId).faviconLink +
')'
}">
<h1 ng-attr-dir="{{item.rtl && 'rtl'}}"><a>{{ ::item.title }} <span class="intro" news-bind-html-unsafe="::item.intro"></span></a></h1>
2014-09-13 20:13:51 +02:00
</li>
<li class="only-in-compact">
<time class="date"
title="{{ item.pubDate*1000 |
date:'yyyy-MM-dd HH:mm:ss' }}"
datetime="{{ item.pubDate*1000 |
date:'yyyy-MM-ddTHH:mm:ssZ' }}">
{{ item.pubDate*1000 | relativeTimestamp }}
2014-09-13 20:13:51 +02:00
</time>
2014-09-10 17:52:07 +02:00
</li>
<li ng-click="Content.toggleStar(item.id)"
class="util"
news-stop-propagation>
<button class="star svg"
ng-hide="item.starred"
title="<?php p($l->t('Star article')); ?>">
</button>
<button class="starred svg"
ng-show="item.starred"
title="<?php p($l->t('Unstar article')); ?>">
</button>
2014-09-09 23:44:25 +02:00
</li>
<li ng-click="Content.toggleKeepUnread(item.id)"
2014-12-02 15:16:04 +01:00
class="util toggle-keep-unread"
news-stop-propagation>
2014-12-02 15:16:04 +01:00
<button class="icon-toggle"
ng-hide="item.keepUnread"
title="<?php p($l->t('Keep article unread')); ?>">
</button>
<button
2014-12-02 15:16:04 +01:00
class="icon-toggle keep-unread"
ng-show="item.keepUnread"
title="<?php
p($l->t('Remove keep article unread'));
?>">
</button>
2014-09-29 14:58:29 +02:00
</li>
<li
class="util"
news-stop-propagation>
<button class="icon-share share"
title="<?php p($l->t('Share')) ?>"
ng-click="Content.openDropdown(item.id)">
</button>
</li>
2015-09-20 16:38:10 +02:00
<li class="util more" news-stop-propagation ng-hide="noPlugins">
2015-09-20 16:28:02 +02:00
<button class="icon-more" news-toggle-show="#actions-{{item.id}}"></button>
<div class="article-actions" id="actions-{{item.id}}">
<ul news-article-actions="item" no-plugins="noPlugins"></ul>
2015-09-20 16:28:02 +02:00
</div>
</li>
2014-09-09 23:44:25 +02:00
</ul>
<!-- Share dropdown -->
<ng-container click-outside="Content.hide()" news-stop-propagation>
<div
ng-controller="ShareController as Share"
ng-if="Content.showDropdown[item.id]"
class="dropdown-content"
news-stop-propagation>
<!-- Share with users -->
<p class="label-group"><?php p($l->t('Share with users')) ?></p>
<form ng-submit=""
name="contactForm"
autocomplete="off">
<fieldset class="contact-input">
<input
ng-model="nameQuery"
ng-model-options="{debounce: 400}"
ng-change="Share.searchUsers(nameQuery)"
type="text"
placeholder="<?php p($l->t('Username')) ?>"
title="<?php p($l->t('Username')) ?>"
name="contactName"
required
style="width: 200px">
<div ng-if="App.loading.isLoading('user')"
ng-class="{'icon-loading-small': App.loading.isLoading('user') }">
</div>
</fieldset>
</form>
<div class="dropdown-search-message"
ng-if="Share.userList.length === 0 && nameQuery && !App.loading.isLoading('user') && !Share.searchUsersFailed">
<?php p($l->t('No users found')) ?>
</div>
<div class="dropdown-search-message"
ng-if="Share.userList.length === 0 && Share.searchUsersFailed">
<?php p($l->t('Error while searching for users')) ?>
</div>
<a
ng-repeat="user in Share.userList"
class="icon-category-installed pr-3"
ng-click="Share.shareItem(item.id, user.value.shareWith)">
{{ user.label }}
<span class="share-status-icon"
ng-class="{'icon-loading-small': Share.isLoading(user.value.shareWith), 'icon-checkmark': Share.isStatus(item.id, user.value.shareWith, true), 'icon-close': Share.isStatus(item.id, user.value.shareWith, false)}">
</span>
</a>
<div ng-if="Share.isAnySocialAppEnabled()">
<p class="label-group"> <?php p($l->t('Share on social media')) ?> </p>
<div class="row">
<div ng-if="Share.isSocialAppEnabled('facebook')" class="col-4">
<a target="_blank"
class="icon-dropdown icon-facebook pr-5"
ng-href="{{ Share.getFacebookUrl(item.url) }}"></a>
</div>
<div ng-if="Share.isSocialAppEnabled('twitter')" class="col-4">
<a target="_blank"
class="icon-dropdown icon-twitter pr-5"
ng-href="{{ Share.getTwitterUrl(item.url) }}"></a>
</div>
<div ng-if="Share.isSocialAppEnabled('email')" class="col-4">
<a class="icon-dropdown icon-mail pr-5"
ng-href="{{ Share.getEmailUrl(item.url, '<?php p($l->t('I wanted you to see this article')) ?>', '<?php p($l->t('Check out this article')) ?>') }}"></a>
</div>
</div>
</div>
</div>
</ng-container>
<!-- End share dropdown -->
2014-09-09 23:44:25 +02:00
</div>
2014-09-09 22:21:40 +02:00
2015-05-08 09:36:22 +02:00
<div class="article" ng-if="!Content.isCompactView() || item.show">
2014-09-09 22:21:40 +02:00
2014-09-13 19:46:40 +02:00
<div class="heading only-in-expanded">
<time class="date"
title="{{ item.pubDate*1000 |
date:'yyyy-MM-dd HH:mm:ss' }}"
datetime="{{ item.pubDate*1000 |
date:'yyyy-MM-ddTHH:mm:ssZ' }}">
{{ item.pubDate*1000 | relativeTimestamp }}
</time>
2015-08-31 16:11:51 +02:00
<h1 ng-attr-dir="{{item.rtl && 'rtl'}}">
2014-09-18 17:01:29 +02:00
<a class="external"
target="_blank"
rel="noreferrer"
ng-href="{{ ::item.url }}"
title="{{ ::item.title }}">
{{ ::item.title }}
2014-09-18 17:01:29 +02:00
</a>
</h1>
2014-09-13 19:46:40 +02:00
</div>
2015-08-31 16:11:51 +02:00
<div class="subtitle" ng-attr-dir="{{item.rtl && 'rtl'}}">
<span class="author" ng-show="item.author">
<?php p($l->t('by')) ?> {{ ::item.author }}
</span>
<span ng-if="!item.sharedBy" class="source"><?php p($l->t('from')) ?>
<a ng-href="#/items/feeds/{{ ::item.feedId }}/">
{{ ::Content.getFeed(item.feedId).title }}
<img ng-if="Content.getFeed(item.feedId).faviconLink && !Content.isCompactView()" ng-src="{{ ::Content.getFeed(item.feedId).faviconLink }}" alt="favicon">
</a>
</span>
<span ng-if="item.sharedBy">
<span ng-if="item.author">-</span>
<?php p($l->t('shared by')) ?>
{{ ::item.sharedByDisplayName }}
</span>
2014-09-13 19:46:40 +02:00
</div>
<div class="enclosure" ng-if="Content.getMediaType(item.enclosureMime) == 'audio'">
<button ng-click="App.play(item)"><?php p($l->t('Play audio')) ?></button>
<a class="button" ng-href="{{ item.enclosureLink|trustUrl }}" target="_blank" rel="noreferrer">
<?php p($l->t('Download audio')) ?>
</a>
</div>
<div class="enclosure" ng-if="Content.getMediaType(item.enclosureMime) == 'video'">
<video controls preload="none" news-play-one ng-src="{{ item.enclosureLink|trustUrl }}" type="{{ item.enclosureMime }}">
2015-03-30 16:20:05 +02:00
</video>
<a class="button" ng-href="{{ item.enclosureLink|trustUrl }}" target="_blank" rel="noreferrer">
2015-03-30 16:20:05 +02:00
<?php p($l->t('Download video')) ?>
</a>
2014-09-09 23:44:25 +02:00
</div>
2014-09-09 22:21:40 +02:00
<div class="enclosure thumbnail" ng-if="item.mediaThumbnail">
<a ng-href="{{ ::item.enclosureLink }}"><img ng-src="{{ item.mediaThumbnail|trustUrl }}" alt="" /></a>
</div>
<div class="enclosure description" ng-if="item.mediaDescription" news-bind-html-unsafe="item.mediaDescription"></div>
2015-08-26 13:03:55 +02:00
<div class="body" news-bind-html-unsafe="item.body" ng-attr-dir="{{item.rtl && 'rtl'}}"></div>
2014-09-09 23:44:25 +02:00
</div>
</li>
2014-05-23 20:19:06 +02:00
</ul>
</div>