summaryrefslogtreecommitdiffstats
path: root/templates/part.content.php
blob: 8c96e7d9680ef7206f535c67cdb2350d621f6325 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
<?php print_unescaped($this->inc('part.content.warnings')) ?>

<div news-auto-focus="#app-content"
    id="articles"
     ng-class="{
        compact: Content.isCompactView(),
        'feed-view': Content.isFeed()
    }"
    news-compact-expand="{{ Content.isCompactExpand() }}"
    class="app-content-detail">
    <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>

    <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"
            ng-mouseup="Content.markRead(item.id)"
            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]}">
                <ul>
                    <li class="util-spacer"></li>
                    <vue-component name="IconLinkCompact" v-props-item="item" v-props-ctrl="Content" v-props-t="App.t" />
                    <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>
                    </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' }}">
                                {{ Content.getRelativeDate(item.pubDate) }}
                        </time>
                    </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>
                    </li>
                    <li ng-click="Content.toggleKeepUnread(item.id)"
                        class="util toggle-keep-unread"
                        news-stop-propagation>
                        <button class="icon-toggle"
                            ng-hide="item.keepUnread"
                            title="<?php p($l->t('Keep article unread')); ?>">
                        </button>
                        <button
                            class="icon-toggle keep-unread"
                            ng-show="item.keepUnread"
                            title="<?php
                                p($l->t('Remove keep article unread'));
                            ?>">
                        </button>
                    </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>

                    <li class="util more" news-stop-propagation ng-hide="noPlugins">
                        <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>
                        </div>
                    </li>
                </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 -->
            </div>

            <div class="article" ng-if="!Content.isCompactView() || item.show">

                <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' }}">
                        {{ Content.getRelativeDate(item.pubDate) }}
                    </time>
                    <h1 ng-attr-dir="{{item.rtl && 'rtl'}}">
                        <a class="external"
                            target="_blank"
                            rel="noreferrer"
                            ng-href="{{ ::item.url }}"
                            title="{{ ::item.title }}">
                            {{ ::item.title }}
                        </a>
                    </h1>
                </div>

                <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"