diff options
Diffstat (limited to 'templates')
-rw-r--r-- | templates/firstrun.php | 28 | ||||
-rw-r--r-- | templates/main.php | 111 | ||||
-rw-r--r-- | templates/part.dialogues.php | 46 | ||||
-rw-r--r-- | templates/part.feeds.php | 69 | ||||
-rw-r--r-- | templates/part.items.php | 135 | ||||
-rw-r--r-- | templates/part.listfeed.php | 60 | ||||
-rw-r--r-- | templates/part.listfolder.php | 74 | ||||
-rw-r--r-- | templates/part.settings.php | 108 | ||||
-rw-r--r-- | templates/part.shared.php | 68 | ||||
-rw-r--r-- | templates/part.subscribelet.php | 19 | ||||
-rw-r--r-- | templates/settings.php | 19 | ||||
-rw-r--r-- | templates/subscribelet.php | 8 | ||||
-rw-r--r-- | templates/test.php | 9 |
13 files changed, 301 insertions, 453 deletions
diff --git a/templates/firstrun.php b/templates/firstrun.php deleted file mode 100644 index 0fc58a8aa..000000000 --- a/templates/firstrun.php +++ /dev/null @@ -1,28 +0,0 @@ -<div id="firstrun"> - <h1><?php echo $l->t("You don't have any feed in your reader.") ?></h1> - <div id="selections"> - <fieldset id="addfeed_dialog_firstrun"> - <legend style="margin-left:10px;"><img src="<?php echo OCP\Util::imagePath('news','rss.svg'); ?>"> <?php echo $l->t('Add feed') ?></legend> - <input type="text" id="feed_add_url" placeholder="<?php echo $l->t('Address'); ?>" /> - <input type="submit" value="<?php echo $l->t('Subscribe'); ?>" onclick="News.Feed.submit(this)" id="feed_add_submit" /> - </fieldset> - <br /> - <fieldset id="importopml_dialog_firstrun"> - <legend style="margin-left:10px"><img src="<?php echo OCP\Util::imagePath('news','opml-icon.svg'); ?>"> <?php echo $l->t('Import OPML') ?></legend> - <button class="svg" id="browsebtn_firstrun" title="<?php echo $l->t('Upload file from desktop'); ?>" onclick="News.DropDownMenu.fade('ul#feedfoldermenu')"><img class="svg" src="<?php echo OCP\Util::imagePath('core','actions/upload.svg'); ?>" alt="<?php echo $l->t('Upload'); ?>" /></button> - <button class="svg" id="cloudbtn_firstrun" title="<?php echo $l->t('Select file from ownCloud'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('core','actions/upload.svg'); ?>" alt="<?php echo $l->t('Select'); ?>" /></button> - <span id="opml_file"> - <?php echo $l->t('Select file from <a href="#" class="settings" id="browselink">local filesystem</a> or <a href="#" class="settings" id="cloudlink">cloud</a>'); ?> - </span> - <input type="file" id="file_upload_start" name="files[]" /> - <input style="float: right" id="importbtn_firstrun" type="submit" value="<?php echo $l->t('Import');?>" /> - </fieldset> - </div> - <div> - <?php - require_once OC_App::getAppPath('news') .'/templates/subscribelet.php'; - echo '<h1>' . $l->t('Or...') . '</h1>'; - ?> - <?php createSubscribelet(); ?> - </div> -</div> diff --git a/templates/main.php b/templates/main.php index f447c9f30..cd2cd8821 100644 --- a/templates/main.php +++ b/templates/main.php @@ -1,63 +1,64 @@ -<!-- Dialogs --> -<div id="dialog_holder"></div> -<!-- End of Dialogs --> +<div class="content_wrapper" ng-app="News"> + <div id="leftcontent_news" class="main_column"> + <div id="feed_wrapper"> + <div id="feeds" ng-controller="FeedController"> + <ul data-id="0" droppable> + <li ng-class="{ + active: isFeedActive(feedType.Subscriptions, 0), + all_read: getUnreadCount(feedType.Subscriptions, 0)==0 + }" + class="subscriptions" + ng-show="isShown(feedType.Subscriptions, 0)"> + <a class="title" + href="#" + ng-click="loadFeed(feedType.Subscriptions, 0)"> + <?php p($l->t('New articles'))?> + </a> + <span class="unread_items_counter"> + {{ getUnreadCount(feedType.Subscriptions, 0) }} + </span> + <span class="buttons"> + <button class="svg action feeds_markread" + ng-click="markAllRead(feedType.Subscriptions, 0)" + title="<?php p($l->t('Mark all read')) ?>"></button> + </span> + </li> + <li ng-class="{ + active: isFeedActive(feedType.Starred, 0), + all_read: getUnreadCount(feedType.Starred, 0)==0 + }" + class="starred" + ng-show="isShown(feedType.Starred, 0)"> + <a class="title" + href="#" + ng-click="loadFeed(feedType.Starred, 0)"> + <?php p($l->t('Starred')) ?> + </a> + <span class="unread_items_counter"> + {{ getUnreadCount(feedType.Starred, 0) }} + </span> + </li> -<?php - -$lastViewedFeedId = $_['lastViewedFeedId']; -$lastViewedFeedType = $_['lastViewedFeedType']; + <?php print_unescaped($this->inc('part.listfolder')) ?> + <?php print_unescaped($this->inc('part.listfeed', array('folderId' => '0'))) ?> + </ul> + </div> + </div> -if($_['showAll']) { - $viewButtonImg = 'eye_all.svg'; - $viewButtonTitle = $l->t('Show everything'); - $viewButtonClass = 'show_all'; -} else { - $viewButtonImg = 'eye_unread.svg'; - $viewButtonTitle = $l->t('Show only unread'); - $viewButtonClass = 'show_unread'; -} + <?php print_unescaped($this->inc('part.settings')) ?> -echo $this->inc("part.dialogues"); -?> + </div> -<div id="leftcontent_news" class="leftcontent_news"> - <div id="feed_wrapper"> - <div id="feeds"> - <ul data-id="0"> - <?php echo $this->inc("part.feeds"); ?> - </ul> + <div id="rightcontent_news" class="main_column"> + <div id="feed_items" + ng-class="{loading: loading.loading>0}" + ng-controller="ItemController" + when-scrolled="scroll()" + feed-navigation> + <?php + print_unescaped($this->inc("part.items")); + ?> </div> </div> - <div id="feed_settings"> - <ul class="controls"> - <li id="addfeedfolder" title="<?php echo $l->t('Add feed or folder'); ?>"> - <button><img class="svg" src="<?php echo OCP\Util::linkTo('news', 'img/add.svg'); ?>" alt="<?php echo $l->t('Add Feed/Folder'); ?>" /></button> - <ul class="menu" id="feedfoldermenu"> - <li id="addfeed"><?php echo $l->t('Feed'); ?></li> - <li id="addfolder"><?php echo $l->t('Folder'); ?></li> - </ul> - </li> - <li id="view" title="<?php echo $viewButtonTitle; ?>" class="<?php echo $viewButtonClass; ?>"> - <button></button> - </li> - <li style="float: right"> - <button id="settingsbtn" title="<?php echo $l->t('Settings'); ?>"><img class="svg" src="<?php echo OCP\Util::imagePath('core','actions/settings.png'); ?>" alt="<?php echo $l->t('Settings'); ?>" /></button> - </li> - </ul> - </div> </div> - -<div id="rightcontent" class="rightcontent"> - <?php - echo '<div id="feed_items">'; - //echo $this->inc("part.shared"); - echo $this->inc("part.items"); - echo '</div>'; - ?> - - <div id="appsettings" class="popup bottomleft hidden"></div> - -</div> - -<div id='notification'></div>
\ No newline at end of file diff --git a/templates/part.dialogues.php b/templates/part.dialogues.php deleted file mode 100644 index 46fbbb312..000000000 --- a/templates/part.dialogues.php +++ /dev/null @@ -1,46 +0,0 @@ -<div id="addfolder_dialog" title="<?php echo $l->t('Add Folder'); ?>" class="dialog"> - <table> - <tr> - <td><?php echo $l->t('Add new folder'); ?></td> - <td></td> - </tr> - <tr> - <td><input type="text" id="folder_add_name" placeholder="<?php echo $l->t('Folder name'); ?>" class="news_input" /></td> - <td><input type="submit" value="<?php echo $l->t('Add folder'); ?>" id="folder_add_submit" /></td> - </tr> - </table> -</div> - -<div id="addfeed_dialog" title="<?php echo $l->t('Add Subscription'); ?>" class="dialog"> - <table> - <tr> - <td><?php echo $l->t('Add new feed'); ?></td> - <td> - <div class="add_parentfolder"> - <button class="dropdownBtn"><?php echo $l->t('Choose folder'); ?></button> - <input class="inputfolderid" type="hidden" name="folderid" value="0" /> - <ul class="menu dropdownmenu"> - </ul> - </div> - </td> - </tr> - <tr> - <td><input type="text" id="feed_add_url" placeholder="<?php echo $l->t('Address'); ?>" class="news_input" /></td> - <td><input type="submit" value="<?php echo $l->t('Add'); ?>" id="feed_add_submit" /></td> - </tr> - </table> -</div> - -<div id="changefolder_dialog" title="<?php echo $l->t('Change folder name'); ?>" class="dialog"> - <input class="inputfolderid" type="hidden" name="folderid" value="" /> - <table> - <tr> - <td><?php echo $l->t('Change folder name'); ?></td> - <td></td> - </tr> - <tr> - <td><input type="text" placeholder="<?php echo $l->t('Folder name'); ?>" class="news_input" /></td> - <td><input type="submit" value="<?php echo $l->t('Change folder name'); ?>" /></td> - </tr> - </table> -</div> diff --git a/templates/part.feeds.php b/templates/part.feeds.php deleted file mode 100644 index 553e45f74..000000000 --- a/templates/part.feeds.php +++ /dev/null @@ -1,69 +0,0 @@ -<?php - -function print_collection_list($list, $lastViewedFeedId, $lastViewedFeedType) { - - foreach($list as $collection) { - if ($collection instanceOf OCA\News\Folder) { - $tmpl_folder = new OCP\Template("news", "part.listfolder"); - $tmpl_folder->assign('folder', $collection, false); - $tmpl_folder->assign('lastViewedFeedId', $lastViewedFeedId); - $tmpl_folder->assign('lastViewedFeedType', $lastViewedFeedType); - $tmpl_folder->printpage(); - print_collection_list($collection->getChildren(), $lastViewedFeedId, - $lastViewedFeedType); - echo '</ul></li>'; - } - elseif ($collection instanceOf OCA\News\Feed) { //onhover $(element).attr('id', 'newID'); - $itemmapper = new OCA\News\ItemMapper(); - - $items = $itemmapper->findByFeedId($collection->getId()); - $counter = 0; - foreach($items as $item) { - if(!$item->isRead()) - ++$counter; - } - $tmpl_feed = new OCP\Template("news", "part.listfeed"); - $tmpl_feed->assign('feed', $collection, false); - $tmpl_feed->assign('unreadItemsCount',$counter); - $tmpl_feed->assign('lastViewedFeedId', $lastViewedFeedId); - $tmpl_feed->assign('lastViewedFeedType', $lastViewedFeedType); - $tmpl_feed->printpage(); - } - else { - //TODO:handle error in this case - } - } - -} - -$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> -</li> -<li class="starred <?php if($lastViewedFeedType == OCA\News\FeedType::STARRED) { echo "active"; }; ?>"> - <a class="title" href="#" ><?php echo $l->t('Starred'); ?></a> - <span class="unread_items_counter"><?php echo $starredCount ?></span> -</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 3d043dfd0..e87c8ad5c 100644 --- a/templates/part.items.php +++ b/templates/part.items.php @@ -1,80 +1,59 @@ -<?php - -$items = isset($_['items']) ? $_['items'] : ''; -$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : ''; - -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>'; - $relative_modified_date = OCP\relative_modified_date($item->getDate()); - echo '<h2 class="item_date"><time class="timeago" datetime="' . - date('c', $item->getDate()) . '">' . $relative_modified_date . '</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">'; - echo $item->getBody(); +<ul> + <li class="feed_item" + ng-repeat="item in getItems(activeFeed.type, activeFeed.id) | orderBy:'date':true " + ng-class="{read: item.isRead}" + data-id="{{item.id}}" + data-feed="{{item.feedId}}"> + <h2 class="item_date"> + <time class="timeago" datetime="">{{item.getRelativeDate()}}</time> + </h2> - if($item->getEnclosure() !== null) { - $enclosure = $item->getEnclosure(); - $enclosureType = htmlspecialchars($enclosure->getMimeType(), ENT_QUOTES, 'UTF-8'); - $enclosureLink = htmlspecialchars($enclosure->getLink(), ENT_QUOTES, 'UTF-8'); - $enclosureFilename = htmlspecialchars(basename($enclosureLink), ENT_QUOTES, 'UTF-8'); - - echo '<br /><br /><audio controls="controls"><source src="' . $enclosureLink . '" type="' . $enclosureType . '"></source></audio><br />'; - echo '<a href="' . $enclosureLink . '" target="_blank">Original audio source (' . $enclosureFilename . ')</a>'; - } + <div class="utils"> + <ul class="primary_item_utils"> + <li ng-class="{important: item.isImportant}" + ng-click="toggleImportant(item.id)" + class="star" + title="{{item.isImportant}}"> + </li> + </ul> + </div> + + <h1 class="item_title"> + <a ng-click="markRead(item.id, item.feedId)" + target="_blank" href="{{item.url}}">{{item.title}}</a> + </h1> + + <h2 class="item_author">from + <a href="#" + ng-click="loadFeed(item.feedId)" + class="from_feed">{{item.feedTitle}}</a> {{item.getAuthorLine()}} + </h2> + + <div class="enclosure" ng-show="item.enclosure"> + <audio controls="controls"><source ng-src="{{item.enclosure.link}}" type="{{item.enclosure.type}}"></source></audio> + </div> - echo '</div>'; - - 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\PERMISSION_READ | OCP\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>'; - - } -echo '</ul>'; + <div class="body" + ng-click="markRead(item.id, item.feedId)" + ng-bind-html-unsafe="item.body"> + </div> + + <div class="bottom_utils"> + <ul class="secondary_item_utils" + ng-class="{show_keep_unread: isKeptUnread(item.id)}"> + <li class="share_link"> + <a class="share" data-item-type="news_item" + data-item="{{item.id}}" title="<?php p($l->t('Share')) ?>" + data-possible-permissions="<?php //p((OCP\Share::PERMISSION_READ | OCP\Share::PERMISSION_SHARE)) ?>" + href="#"> + <?php p($l->t('Share')) ?> + </a> + </li> + <li ng-click="keepUnread(item.id, item.feedId)" + class="keep_unread"><?php p($l->t('Keep unread')); ?> + <input type="checkbox" ng-checked="isKeptUnread(item.id)"/> + </li> + </ul> + </div> + </li> +</ul> diff --git a/templates/part.listfeed.php b/templates/part.listfeed.php index 5db86d975..e462d7683 100644 --- a/templates/part.listfeed.php +++ b/templates/part.listfeed.php @@ -1,36 +1,24 @@ -<?php - -require_once \OC_App::getAppPath('news') . '/lib/feedtypes.php'; - - -$l = new OC_l10n('news'); - - -$feed = isset($_['feed']) ? $_['feed'] : null; - -$feedTitle = $feed->getTitle(); -$feedId = $feed->getId(); -$unreadItemsCount = isset($_['unreadItemsCount']) ? $_['unreadItemsCount'] : null; -$favicon = $feed->getFavicon(); - -if ($favicon == null) { - $favicon = OCP\Util::imagePath('core', 'actions/public.svg'); -} - -$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null; -$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null; - -if ($lastViewedFeedType == OCA\News\FeedType::FEED && $lastViewedFeedId == $feedId){ - $activeClass = 'active'; -} else { - $activeClass = ''; -} - -echo '<li class="feed ' . $activeClass . '" data-id="' . $feedId . '">'; - echo '<a style="background-image: url(' . $favicon . ');" href="#" class="title">' . $feedTitle .'</a>'; - echo '<span class="unread_items_counter">' . $unreadItemsCount . '</span>'; - echo '<span class="buttons">'; - echo '<button class="svg action feeds_delete" title="' . $l->t('Delete feed') . '"></button>'; - echo '<button class="svg action feeds_markread" title="' . $l->t('Mark all read') . '"></button>'; - echo '</span>'; -echo '</li>'; +<li ng-class="{active: isFeedActive(feedType.Feed, feed.id), all_read: feed.unreadCount==0}" + ng-repeat="feed in feeds|feedInFolder:<?php p($_['folderId']); ?>" + ng-show="feed.show" + data-id="{{feed.id}}" + class="feed" + draggable> + <a ng-style="{backgroundImage: feed.icon}" + href="#" + class="title" + ng-click="loadFeed(feedType.Feed, feed.id)"> + {{feed.name}} + </a> + <span class="unread_items_counter"> + {{ getUnreadCount(feedType.Feed, feed.id) }} + </span> + <span class="buttons"> + <button ng-click="delete(feedType.Feed, feed.id)" + class="svg action feeds_delete" + title="<?php p($l->t('Delete feed')); ?>"></button> + <button class="svg action feeds_markread" + ng-click="markAllRead(feedType.Feed, feed.id)" + title="<?php p($l->t('Mark all read')); ?>"></button> + </span> +</li>
\ No newline at end of file diff --git a/templates/part.listfolder.php b/templates/part.listfolder.php index 31444c729..72052df9e 100644 --- a/templates/part.listfolder.php +++ b/templates/part.listfolder.php @@ -1,37 +1,37 @@ -<?php - -require_once \OC_App::getAppPath('news') . '/lib/feedtypes.php'; - - -$l = new OC_l10n('news'); - - -$folder = isset($_['folder']) ? $_['folder'] : null; -$folderId = $folder->getId(); -$folderName = $folder->getName(); - -if($folder->getOpened()){ - $openedClass = 'open'; -} else { - $openedClass = 'collapsed'; -} - - -$lastViewedFeedId = isset($_['lastViewedFeedId']) ? $_['lastViewedFeedId'] : null; -$lastViewedFeedType = isset($_['lastViewedFeedType']) ? $_['lastViewedFeedType'] : null; -if ($lastViewedFeedType == OCA\News\FeedType::FOLDER && $lastViewedFeedId == $folderId){ - $activeClass = 'active'; -} else { - $activeClass = ''; -} - -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>'; - echo '<button class="svg action feeds_markread" title="' . $l->t('Mark all read') . '"></button>'; - echo '</span>'; - echo '<ul data-id="' . $folderId . '">'; +<li ng-class="{ + active: isFeedActive(feedType.Folder, folder.id), + open: folder.open, + collapsable: folder.hasChildren, + all_read: getUnreadCount(feedType.Folder, folder.id)==0 +}" + ng-repeat="folder in folders" + ng-show="folder.show" + class="folder" + data-id="{{folder.id}}" + droppable> + <button class="collapsable_trigger" + title="<?php p($l->t('Collapse'));?>" + ng-click="toggleFolder(folder.id)"></button> + <a href="#" + class="title" + ng-click="loadFeed(feedType.Folder, folder.id)"> + {{folder.name}} + </a> + <span class="unread_items_counter"> + {{ getUnreadCount(feedType.Folder, folder.id) }} + </span> + <span class="buttons"> + <button ng-click="delete(feedType.Folder, folder.id)" + class="svg action feeds_delete" + title="<?php p($l->t('Delete folder')); ?>"></button> + <button class="svg action feeds_edit" + ng-click="renameFolder(folder.id)" + title="<?php p($l->t('Rename folder')); ?>"></button> + <button class="svg action feeds_markread" + ng-click="markAllRead(feedType.Folder, folder.id)" + title="<?php p($l->t('Mark all read')); ?>"></button> + </span> + <ul> + <?php print_unescaped($this->inc('part.listfeed', array('folderId' => 'folder.id'))); ?> + </ul> +</li>
\ No newline at end of file diff --git a/templates/part.settings.php b/templates/part.settings.php new file mode 100644 index 000000000..97a2b99a6 --- /dev/null +++ b/templates/part.settings.php @@ -0,0 +1,108 @@ +<div + class="bottom_settings" + ng-controller="SettingsController" + hide-settings-when-focus-lost> + + <div class="open_add bottom_popup" + ng-show="addIsShown()" + ng-class="{expanded: addIsShown()}"> + <fieldset class="personalblock"> + <legend><strong><?php p($l->t('Add Subscription')); ?></strong></legend> + <form> + <select name="folder" + title="<?php p($l->t('Folder under which the feed is being saved')); ?>" + ng-model="folderId" + ng-disabled="isAddingFeed()" + ng-options="folder.name for folder in getFolders()"> + <option value=""><?php p($l->t('-- choose folder --')); ?></option> + </select> + <p class="error"> + <span ng-show="feedEmptyError"><?php p($l->t('Address must not be empty!')); ?></span> + <span ng-show="feedExistsError"><?php p($l->t('Feed exists already!')); ?></span> + <span ng-show="feedError"><?php p($l->t('Could not add feed!')); ?></span> + </p> + <input type="text" + ng-model="feedUrl" + placeholder="<?php p($l->t('Address')); ?>" + ng-disabled="isAddingFeed()"> + <button title="<?php p($l->t('Add')); ?>" + ng-class="{loading: isAddingFeed()}" + ng-click="addFeed(feedUrl, folderId)"><?php p($l->t('Add')); ?></button> + </form> + </fieldset> + <fieldset class="personalblock"> + <legend><strong><?php p($l->t('Add Folder')); ?></strong></legend> + <form name="addFolderForm"> + <p class="error"> + <span ng-show="folderEmptyError"><?php p($l->t('Folder name must not be empty!')); ?></span> + <span ng-show="folderExistsError"><?php p($l->t('Folder exists already!')); ?></span> + </p> + <input type="text" + ng-model="folderName" + ng-disabled="isAddingFolder()" + name="folderName" + maxlength="30" + placeholder="<?php p($l->t('Folder Name')); ?>"> + <button title="<?php p($l->t('Add')); ?>" + ng-click="addFolder(folderName)" + ng-class="{loading: isAddingFolder()}"><?php p($l->t('Add')); ?></button> + </form> + </fieldset> + </div> + + + <div id="feed_settings" class="bottom_popup" + ng-class="{expanded: settingsAreShown()}"> + <ul class="controls"> + <li class="view show_all" + ng-show="getShowAll()" + ng-click="setShowAll(false)" + title="<?php p($l->t('Show everything')); ?>"> + <button></button> + </li> + <li class="view show_unread" + ng-show="!getShowAll()" + ng-click="setShowAll(true)" + title="<?php p($l->t('Show only unread')); ?>"> + <button></button> + </li> + <li style="float: right" + ng-class="{active: settingsAreShown()}"> + <button id="settingsbtn" + title="<?php p($l->t('Settings')); ?>" + ng-click="toggleSettings()"> + <img class="svg" + src="<?php print_unescaped(image_path('core','actions/settings.png')); ?>" + alt="<?php p($l->t('Settings')); ?>" /> + </button> + </li> + <li style="float: right" + title="<?php p($l->t('Add feed or folder')) ?>" + ng-class="{active: addIsShown()}"> + <button ng-click="toggleAdd()"> + <img class="svg" + src="<?php print_unescaped(link_to('news', 'img/add.svg')) ?>" + alt="<?php p($l->t('Add Feed/Folder')) ?>" /></button> + </li> + </ul> + + <div class="open_settings" ng-show="settingsAreShown()"> + <fieldset class="personalblock"> + <legend><strong><?php p($l->t('Import / Export')); ?></strong></legend> + <input type="file" id="file_upload_start" name="files[]" read-file/> + <button title="<?php p($l->t('Import OPML')); ?>" + id="browselink"> + <?php p($l->t('Import OPML')); ?> + </button> + <a class="button" + href="<?php print_unescaped(\OC_Helper::linkToRoute('news_export_opml')) ?>" + title="<?php p($l->t('Export OPML')); ?>"><?php p($l->t('Export OPML')); ?></a> + </fieldset> + <fieldset class="personalblock"> + <legend><strong><?php p($l->t('Subscribelet')); ?></strong></legend> + <p><?php print_unescaped($this->inc('part.subscribelet'));?> + </p> + </fieldset> + </div> + </div> +</div>
\ No newline at end of file diff --git a/templates/part.shared.php b/templates/part.shared.php deleted file mode 100644 index 574e13457..000000000 --- a/templates/part.shared.php +++ /dev/null @@ -1,68 +0,0 @@ -<?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\PERMISSION_READ | OCP\PERMISSION_SHARE) . '"/></di |