summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ajax/usersettings.php11
-rw-r--r--css/news.css35
-rw-r--r--img/active_star.svg14
-rw-r--r--img/inactive_star.svg10
-rw-r--r--img/starred.svg16
-rw-r--r--js/news.js4
-rw-r--r--templates/part.items.header.php7
-rw-r--r--templates/part.items.php9
8 files changed, 56 insertions, 50 deletions
diff --git a/ajax/usersettings.php b/ajax/usersettings.php
index c01e8e35d..9ddd69f6e 100644
--- a/ajax/usersettings.php
+++ b/ajax/usersettings.php
@@ -15,7 +15,16 @@ OCP\JSON::checkLoggedIn();
OCP\JSON::checkAppEnabled('news');
OCP\JSON::callCheck();
-// TODO: receive and save user settings
+switch($_POST['show']){
+ case 'all':
+ $showAll = true;
+ break;
+ default:
+ $showAll = false;
+ break;
+}
+// TODO: receive and save user settings
+OCP\Config::setUserValue(OCP\USER::getUser(), 'news', 'showAll', $showAll);
OCP\JSON::success(); \ No newline at end of file
diff --git a/css/news.css b/css/news.css
index 6b0469cfe..2d048bd22 100644
--- a/css/news.css
+++ b/css/news.css
@@ -54,6 +54,21 @@ div.add_parentfolder {
clear: both;
}
+
+ #addfeedbtn {
+ background-image: url('%appswebroot%/news/img/rss.svg');
+ background-position: .5em center;
+ background-repeat: no-repeat;
+ padding-left: 1.8em;
+ }
+
+ #importopmlbtn {
+ background-image: url('%appswebroot%/news/img/opml-icon.svg');
+ background-position: .5em center;
+ background-repeat: no-repeat;
+ padding-left: 1.8em;
+ }
+
/**
* View above the feeds which shows the feed title
@@ -487,20 +502,6 @@ div.feed_controls {
}
-#addfeedbtn {
- background-image: url('%appswebroot%/news/img/rss.svg');
- background-position: .5em center;
- background-repeat: no-repeat;
- padding-left: 1.8em;
-}
-
-#importopmlbtn {
- background-image: url('%appswebroot%/news/img/opml-icon.svg');
- background-position: .5em center;
- background-repeat: no-repeat;
- padding-left: 1.8em;
-}
-
/* item view */
@@ -682,8 +683,9 @@ div.feed_controls {
*/
.bottom_utils {
width: 100%;
- padding: 0 2.5em;
height: 2.5em;
+ margin: 0;
+ padding: 0 0.5em .5em 0;
box-sizing: border-box;
-moz-box-sizing: border-box;
}
@@ -699,16 +701,13 @@ div.feed_controls {
.feed_item:hover .secondary_item_utils {
display: block;
- height: 2.5em;
}
.feed_item:hover .secondary_item_utils li.keep_unread {
cursor: pointer;
- line-height: 2.5em;
}
.feed_item .secondary_item_utils li input[type=checkbox]{
- margin-right: 1em;
}
/* dialog/menues */
diff --git a/img/active_star.svg b/img/active_star.svg
index 39c608975..badb81b98 100644
--- a/img/active_star.svg
+++ b/img/active_star.svg
@@ -14,7 +14,7 @@
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="active_star.svg">
+ sodipodi:docname="inactive_star.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -25,8 +25,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
- inkscape:cx="44.591479"
- inkscape:cy="134.37797"
+ inkscape:cx="116.4202"
+ inkscape:cy="165.53453"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -47,7 +47,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -64,13 +64,13 @@
sodipodi:cx="330"
sodipodi:cy="1027.7194"
sodipodi:r1="169.28609"
- sodipodi:r2="84.643051"
+ sodipodi:r2="75.090069"
sodipodi:arg1="-1.5686866"
- sodipodi:arg2="-0.94036809"
+ sodipodi:arg2="-0.95344865"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
- d="m 330.35715,858.43365 49.53914,100.91316 111.21435,16.40006 -80.66568,78.29843 18.76975,110.839 -99.39328,-52.5221 -99.61401,52.1023 19.23725,-110.7589 -80.33458,-78.63807 111.28255,-15.93065 z"
+ d="m 330.35715,858.43365 43.11057,108.05601 117.64292,9.25721 -89.44547,74.39173 27.54954,114.7457 -98.39092,-62.0794 -100.61637,61.6596 28.63654,-112.759 -89.73387,-76.63797 116.08927,-7.60945 z"
inkscape:transform-center-x="-0.11036321"
inkscape:transform-center-y="-16.060386"
transform="translate(-21.071429,-112.5)" />
diff --git a/img/inactive_star.svg b/img/inactive_star.svg
index d2dbb0bd9..f62c6b033 100644
--- a/img/inactive_star.svg
+++ b/img/inactive_star.svg
@@ -25,8 +25,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
- inkscape:cx="44.591479"
- inkscape:cy="133.66368"
+ inkscape:cx="116.4202"
+ inkscape:cy="165.53453"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -64,13 +64,13 @@
sodipodi:cx="330"
sodipodi:cy="1027.7194"
sodipodi:r1="169.28609"
- sodipodi:r2="84.643051"
+ sodipodi:r2="75.090069"
sodipodi:arg1="-1.5686866"
- sodipodi:arg2="-0.94036809"
+ sodipodi:arg2="-0.95344865"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
- d="m 330.35715,858.43365 49.53914,100.91316 111.21435,16.40006 -80.66568,78.29843 18.76975,110.839 -99.39328,-52.5221 -99.61401,52.1023 19.23725,-110.7589 -80.33458,-78.63807 111.28255,-15.93065 z"
+ d="m 330.35715,858.43365 43.11057,108.05601 117.64292,9.25721 -89.44547,74.39173 27.54954,114.7457 -98.39092,-62.0794 -100.61637,61.6596 28.63654,-112.759 -89.73387,-76.63797 116.08927,-7.60945 z"
inkscape:transform-center-x="-0.11036321"
inkscape:transform-center-y="-16.060386"
transform="translate(-21.071429,-112.5)" />
diff --git a/img/starred.svg b/img/starred.svg
index d31fd5f6e..ca62aa455 100644
--- a/img/starred.svg
+++ b/img/starred.svg
@@ -14,7 +14,7 @@
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
- sodipodi:docname="active_star.svg">
+ sodipodi:docname="starred.svg">
<defs
id="defs4" />
<sodipodi:namedview
@@ -25,8 +25,8 @@
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
- inkscape:cx="44.591479"
- inkscape:cy="134.37797"
+ inkscape:cx="116.4202"
+ inkscape:cy="165.53453"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
@@ -47,7 +47,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title></dc:title>
+ <dc:title />
</cc:Work>
</rdf:RDF>
</metadata>
@@ -58,19 +58,19 @@
transform="translate(-148.03866,-745.93365)">
<path
sodipodi:type="star"
- style="fill:#ffcc00;fill-opacity:1;stroke:#000000;stroke-opacity:0.57894736999999996;"
+ style="fill:#ffcc00;fill-opacity:1;stroke:#000000;stroke-opacity:0.56578946;stroke-width:5;stroke-miterlimit:0;stroke-dasharray:none;stroke-linecap:butt;stroke-linejoin:round"
id="path2987"
sodipodi:sides="5"
sodipodi:cx="330"
sodipodi:cy="1027.7194"
sodipodi:r1="169.28609"
- sodipodi:r2="84.643051"
+ sodipodi:r2="75.090069"
sodipodi:arg1="-1.5686866"
- sodipodi:arg2="-0.94036809"
+ sodipodi:arg2="-0.95344865"
inkscape:flatsided="false"
inkscape:rounded="0"
inkscape:randomized="0"
- d="m 330.35715,858.43365 49.53914,100.91316 111.21435,16.40006 -80.66568,78.29843 18.76975,110.839 -99.39328,-52.5221 -99.61401,52.1023 19.23725,-110.7589 -80.33458,-78.63807 111.28255,-15.93065 z"
+ d="m 330.35715,858.43365 43.11057,108.05601 117.64292,9.25721 -89.44547,74.39173 27.54954,114.7457 -98.39092,-62.0794 -100.61637,61.6596 28.63654,-112.759 -89.73387,-76.63797 116.08927,-7.60945 z"
inkscape:transform-center-x="-0.11036321"
inkscape:transform-center-y="-16.060386"
transform="translate(-21.071429,-112.5)" />
diff --git a/js/news.js b/js/news.js
index 39b4cc0d8..dada15fb2 100644
--- a/js/news.js
+++ b/js/news.js
@@ -336,9 +336,7 @@ News={
}
$.post(OC.filePath('news', 'ajax', 'usersettings.php'), data, function(jsondata){
if(jsondata.status == 'success'){
- // TODO
- var currentFeed = $('#rightcontent').data('id');
- News.Feed.load(currentFeed);
+ News.Feed.load(News.Feed.activeFeedId);
} else {
//TODO
}
diff --git a/templates/part.items.header.php b/templates/part.items.header.php
index c54a2ae65..8a2043288 100644
--- a/templates/part.items.header.php
+++ b/templates/part.items.header.php
@@ -17,8 +17,7 @@ if(isset($_['feedid'])){
$unreadItemsCount = 0;
}
-// FIXME: get this setting from the database
-$showOnlyUnread = true;
+$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll');
?>
@@ -30,8 +29,8 @@ $showOnlyUnread = true;
<div class="controls">
<input type="button" value="<?php echo $l->t('Mark all read'); ?>" id="mark_all_as_read" />
<select id="feed_filter">
- <option value="unread" <?php if($showOnlyUnread){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show only unread articles'); ?></option>
- <option value="all" <?php if(!$showOnlyUnread){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show read/unread articles'); ?></option>
+ <option value="unread" <?php if(!$showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show only unread articles'); ?></option>
+ <option value="all" <?php if($showAll){ echo 'selected="selected"'; }; ?>><?php echo $l->t('Show read/unread articles'); ?></option>
</select>
</div>
</div> \ No newline at end of file
diff --git a/templates/part.items.php b/templates/part.items.php
index 85eb17c08..91bcdfafe 100644
--- a/templates/part.items.php
+++ b/templates/part.items.php
@@ -4,11 +4,12 @@ $feedId = isset($_['feedid']) ? $_['feedid'] : '';
$itemMapper = new OCA\News\ItemMapper();
-$showOnlyUnread = true; // FIXME: get this from the settings db
-if($showOnlyUnread){
- $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD);
-} else {
+$showAll = OCP\Config::getUserValue(OCP\USER::getUser(), 'news', 'showAll');
+
+if($showAll){
$items = $itemMapper->findAll($feedId);
+} else {
+ $items = $itemMapper->findAllStatus($feedId, OCA\News\StatusFlag::UNREAD);
}
echo '<ul>';