diff options
| author | 2018-09-29 20:47:17 +0200 | |
|---|---|---|
| committer | 2018-09-29 20:47:17 +0200 | |
| commit | 8ee8a573f1f7e9cc45f9b3c46627d15670f14f3a (patch) | |
| tree | 14200758ab43e4031f60b46b8c6e9018b43e53af /app/views | |
| parent | 3ae1b57c9d2e23157be54e8fe9865b85872ff9e7 (diff) | |
Custom labels (#2027)
* First draft of custom tags
https://github.com/FreshRSS/FreshRSS/issues/928
https://github.com/FreshRSS/FreshRSS/issues/1367
* SMALLINT to BIGINT for id_entry
And uppercase SQL types
* Fix layout for unreads
* Start UI menu
* Change menu order
* Clean database helpers
https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r217971535
* Travis rules do not understand PostgreSQL constants
Grrr
* Tag controller + UI
* Add column attributes to tags
* Use only favicon for now, for label
* Fix styling for different themes
* Constant for maximum InnoDB index length in Unicode
https://github.com/FreshRSS/FreshRSS/pull/2027#discussion_r219052200
(I would have personnally prefered keeping the readability of a real
value instead of a constant, in this case of many SQL fields)
* Use FreshRSS_Factory::createCategoryDao
* Add view of all articles containing any tag
* Fix search in tags
* Mark as read tags
* Partial auto-update unread tags
* More auto update tag unreads
* Add tag deletion
* Do not purge tagged articles
* Minor comment
* Fix SQLite and UI bug
* Google Reader API support for user tags
Add SQL check that tag names must be distinct from category names
* whitespace
* Add missing API for EasyRSS
* Compatibility SQLite
Problematic parentheses
* Add SQL DISTINCT for cases with multiple tags
* Fix for PostgreSQL
PostgreSQL needs some additional type hint to avoid "could not determine
data type of parameter $1"
http://www.postgresql-archive.org/Could-not-determine-data-type-of-parameter-1-tp2171092p2171094.html
Diffstat (limited to 'app/views')
| -rw-r--r-- | app/views/configure/display.phtml | 4 | ||||
| -rwxr-xr-x | app/views/entry/read.phtml | 3 | ||||
| -rw-r--r-- | app/views/helpers/index/normal/entry_bottom.phtml | 56 | ||||
| -rw-r--r-- | app/views/index/normal.phtml | 2 | ||||
| -rw-r--r-- | app/views/javascript/nbUnreadsPerFeed.phtml | 10 | ||||
| -rw-r--r-- | app/views/tag/getTagsForEntry.phtml | 2 |
6 files changed, 51 insertions, 26 deletions
diff --git a/app/views/configure/display.phtml b/app/views/configure/display.phtml index 132b9536c..c6c08e3bc 100644 --- a/app/views/configure/display.phtml +++ b/app/views/configure/display.phtml @@ -79,8 +79,8 @@ <th> </th> <th title="<?php echo _t('gen.action.mark_read'); ?>"><?php echo _i('read'); ?></th> <th title="<?php echo _t('gen.action.mark_favorite'); ?>"><?php echo _i('bookmark'); ?></th> - <th><?php echo _t('conf.display.icon.sharing'); ?></th> <th><?php echo _t('conf.display.icon.related_tags'); ?></th> + <th><?php echo _t('conf.display.icon.sharing'); ?></th> <th><?php echo _t('conf.display.icon.publication_date'); ?></th> <th><?php echo _i('link'); ?></th> </tr> @@ -98,8 +98,8 @@ <th><?php echo _t('conf.display.icon.bottom_line'); ?></th> <td><input type="checkbox" name="bottomline_read" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_read ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_read; ?>"/></td> <td><input type="checkbox" name="bottomline_favorite" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_favorite ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_favorite; ?>"/></td> - <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_sharing; ?>"/></td> <td><input type="checkbox" name="bottomline_tags" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_tags ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_tags; ?>"/></td> + <td><input type="checkbox" name="bottomline_sharing" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_sharing ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_sharing; ?>"/></td> <td><input type="checkbox" name="bottomline_date" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_date ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_date; ?>"/></td> <td><input type="checkbox" name="bottomline_link" value="1"<?php echo FreshRSS_Context::$user_conf->bottomline_link ? ' checked="checked"' : ''; ?> data-leave-validation="<?php echo FreshRSS_Context::$user_conf->bottomline_link; ?>"/></td> </tr> diff --git a/app/views/entry/read.phtml b/app/views/entry/read.phtml index 73977d94b..fb9e129f2 100755 --- a/app/views/entry/read.phtml +++ b/app/views/entry/read.phtml @@ -12,5 +12,6 @@ $url['params']['is_read'] = Minz_Request::param('is_read', true) ? '0' : '1'; FreshRSS::loadStylesAndScripts(); echo json_encode(array( 'url' => str_ireplace('&', '&', Minz_Url::display($url)), - 'icon' => _i($url['params']['is_read'] === '1' ? 'unread' : 'read') + 'icon' => _i($url['params']['is_read'] === '1' ? 'unread' : 'read'), + 'tags' => $this->tags, )); diff --git a/app/views/helpers/index/normal/entry_bottom.phtml b/app/views/helpers/index/normal/entry_bottom.phtml index d22b32625..784a41e1f 100644 --- a/app/views/helpers/index/normal/entry_bottom.phtml +++ b/app/views/helpers/index/normal/entry_bottom.phtml @@ -7,6 +7,7 @@ $bottomline_read = FreshRSS_Context::$user_conf->bottomline_read; $bottomline_favorite = FreshRSS_Context::$user_conf->bottomline_favorite; $bottomline_sharing = FreshRSS_Context::$user_conf->bottomline_sharing && (count($sharing) > 0); + $bottomline_labels = true; //TODO $bottomline_tags = FreshRSS_Context::$user_conf->bottomline_tags; $bottomline_date = FreshRSS_Context::$user_conf->bottomline_date; $bottomline_link = FreshRSS_Context::$user_conf->bottomline_link; @@ -32,8 +33,41 @@ echo _i($this->entry->isFavorite() ? 'starred' : 'non-starred'); ?></a><?php ?></li><?php } - } ?> - <li class="item"><?php + } + if ($bottomline_labels) { + ?><li class="item"> + <div class="dropdown dynamictags"> + <div id="dropdown-labels-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <?php echo FreshRSS_Themes::alt('label'); ?> + <a class="dropdown-toggle" href="#dropdown-labels-<?php echo $this->entry->id();?>"><?php + echo _t('index.menu.tags'); + ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li> + <!-- Ajax --> + </ul> + </div> + </li><?php + } + $tags = $bottomline_tags ? $this->entry->tags() : null; + if (!empty($tags)) { + ?><li class="item"> + <div class="dropdown"> + <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div> + <?php echo _i('tag'); ?> + <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php + echo _t('index.tag.related'); + ?></a> + <ul class="dropdown-menu"> + <li class="dropdown-close"><a href="#close">❌</a></li><?php + foreach ($tags as $tag) { + ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))); ?>"><?php echo $tag; ?></a></li><?php + } ?> + </ul> + </div> + </li><?php + } + ?><li class="item"><?php if ($bottomline_sharing) { ?><div class="dropdown"> <div id="dropdown-share-<?php echo $this->entry->id();?>" class="dropdown-target"></div> @@ -69,24 +103,6 @@ </div> <?php } ?> </li><?php - $tags = $bottomline_tags ? $this->entry->tags() : null; - if (!empty($tags)) { - ?><li class="item"> - <div class="dropdown"> - <div id="dropdown-tags-<?php echo $this->entry->id();?>" class="dropdown-target"></div> - <?php echo _i('tag'); ?> - <a class="dropdown-toggle" href="#dropdown-tags-<?php echo $this->entry->id();?>"><?php - echo _t('index.tag.related'); - ?></a> - <ul class="dropdown-menu"> - <li class="dropdown-close"><a href="#close">❌</a></li><?php - foreach ($tags as $tag) { - ?><li class="item"><a href="<?php echo _url('index', 'index', 'search', '#' . str_replace(' ', '+', htmlspecialchars_decode($tag, ENT_QUOTES))); ?>"><?php echo $tag; ?></a></li><?php - } ?> - </ul> - </div> - </li><?php - } if ($bottomline_date) { ?><li class="item date"><?php echo $this->entry->date(); ?></li><?php } diff --git a/app/views/index/normal.phtml b/app/views/index/normal.phtml index e659509f9..ac2ea812d 100644 --- a/app/views/index/normal.phtml +++ b/app/views/index/normal.phtml @@ -20,7 +20,7 @@ if (!empty($this->entries)) { </div><?php foreach ($this->entries as $item) { $this->entry = Minz_ExtensionManager::callHook('entry_before_display', $item); - if (is_null($this->entry)) { + if ($this->entry == null) { continue; } diff --git a/app/views/javascript/nbUnreadsPerFeed.phtml b/app/views/javascript/nbUnreadsPerFeed.phtml index 68f98ce9e..ce4db37b7 100644 --- a/app/views/javascript/nbUnreadsPerFeed.phtml +++ b/app/views/javascript/nbUnreadsPerFeed.phtml @@ -1,8 +1,14 @@ <?php -$result = array(); +$result = array( + 'feeds' => array(), + 'tags' => array(), +); foreach ($this->categories as $cat) { foreach ($cat->feeds() as $feed) { - $result[$feed->id()] = $feed->nbNotRead(); + $result['feeds'][$feed->id()] = $feed->nbNotRead(); } } +foreach ($this->tags as $tag) { + $result['tags'][$tag->id()] = $tag->nbUnread(); +} echo json_encode($result); diff --git a/app/views/tag/getTagsForEntry.phtml b/app/views/tag/getTagsForEntry.phtml new file mode 100644 index 000000000..76b2ada4e --- /dev/null +++ b/app/views/tag/getTagsForEntry.phtml @@ -0,0 +1,2 @@ +<?php +echo json_encode($this->tags); |
