diff --git a/src/main/java/com/commafeed/frontend/CommaFeedApplication.java b/src/main/java/com/commafeed/frontend/CommaFeedApplication.java index d029f48e..09eedaad 100644 --- a/src/main/java/com/commafeed/frontend/CommaFeedApplication.java +++ b/src/main/java/com/commafeed/frontend/CommaFeedApplication.java @@ -30,6 +30,7 @@ import org.slf4j.LoggerFactory; import com.commafeed.frontend.pages.HomePage; import com.commafeed.frontend.pages.LoginPage; import com.commafeed.frontend.pages.LogoutPage; +import com.commafeed.frontend.pages.SettingsPage; import com.commafeed.frontend.utils.exception.DisplayExceptionPage; public class CommaFeedApplication extends AuthenticatedWebApplication { @@ -43,6 +44,7 @@ public class CommaFeedApplication extends AuthenticatedWebApplication { mountPage("login", LoginPage.class); mountPage("logout", LogoutPage.class); mountPage("error", DisplayExceptionPage.class); + mountPage("settings", SettingsPage.class); setupInjection(); diff --git a/src/main/java/com/commafeed/frontend/model/MarkRequest.java b/src/main/java/com/commafeed/frontend/model/MarkRequest.java new file mode 100644 index 00000000..a707c397 --- /dev/null +++ b/src/main/java/com/commafeed/frontend/model/MarkRequest.java @@ -0,0 +1,35 @@ +package com.commafeed.frontend.model; + +import java.io.Serializable; + +@SuppressWarnings("serial") +public class MarkRequest implements Serializable { + private String type; + private String id; + private boolean read; + + public String getType() { + return type; + } + + public void setType(String type) { + this.type = type; + } + + public String getId() { + return id; + } + + public void setId(String id) { + this.id = id; + } + + public boolean isRead() { + return read; + } + + public void setRead(boolean read) { + this.read = read; + } + +} diff --git a/src/main/java/com/commafeed/frontend/pages/HomePage.html b/src/main/java/com/commafeed/frontend/pages/HomePage.html index 24683252..4fd8f5b7 100644 --- a/src/main/java/com/commafeed/frontend/pages/HomePage.html +++ b/src/main/java/com/commafeed/frontend/pages/HomePage.html @@ -13,15 +13,17 @@
- -
-
    - -
+
diff --git a/src/main/java/com/commafeed/frontend/pages/SettingsPage.html b/src/main/java/com/commafeed/frontend/pages/SettingsPage.html new file mode 100644 index 00000000..24683252 --- /dev/null +++ b/src/main/java/com/commafeed/frontend/pages/SettingsPage.html @@ -0,0 +1,50 @@ + + + + + + + + + + + +
+
+
+
+ +
+
    + +
+
+
+
+ + +
+
+
+
+ + + + + + + + + + + + + + + + + diff --git a/src/main/java/com/commafeed/frontend/pages/SettingsPage.java b/src/main/java/com/commafeed/frontend/pages/SettingsPage.java new file mode 100644 index 00000000..3960b761 --- /dev/null +++ b/src/main/java/com/commafeed/frontend/pages/SettingsPage.java @@ -0,0 +1,8 @@ +package com.commafeed.frontend.pages; + +import org.apache.wicket.markup.html.WebPage; + +@SuppressWarnings("serial") +public class SettingsPage extends WebPage { + +} diff --git a/src/main/java/com/commafeed/frontend/rest/resources/EntriesREST.java b/src/main/java/com/commafeed/frontend/rest/resources/EntriesREST.java index 252d89cf..9b7d3a0b 100644 --- a/src/main/java/com/commafeed/frontend/rest/resources/EntriesREST.java +++ b/src/main/java/com/commafeed/frontend/rest/resources/EntriesREST.java @@ -65,13 +65,14 @@ public class EntriesREST extends AbstractREST { } }); - int lastIndex = entries.getEntries().size() - - (entries.getEntries().isEmpty() ? 0 : 1); - int from = Math.min(lastIndex, offset); - int to = limit == -1 ? lastIndex : Math.min(lastIndex, offset + limit); - - List subList = entries.getEntries().subList(from, to); - entries.setEntries(Lists.newArrayList(subList)); + if (limit > -1) { + int size = entries.getEntries().size(); + System.out.println(size); + int to = Math.min(size, limit); + List subList = entries.getEntries().subList(0, to); + entries.setEntries(Lists.newArrayList(subList)); + System.out.println(entries.getEntries().size()); + } return entries; } diff --git a/src/main/webapp/css/app.css b/src/main/webapp/css/app.css index 77692ed9..ae4a8b23 100644 --- a/src/main/webapp/css/app.css +++ b/src/main/webapp/css/app.css @@ -1,11 +1,38 @@ +.sidebar-nav-fixed { + padding: 9px 0; + position:fixed; + left:20px; + top:60px; + width:250px; +} + +.row-fluid > .span-fixed-sidebar { + margin-left: 290px; +} + +.css-treeview { + font-size: inherit; + white-space: nowrap; +} + .css-treeview .selected { + color: #d14836; +} + +.css-treeview .unread { font-weight: bold; } .css-treeview a { cursor: pointer; + color: black; } -.accordion-heading .unread { +.css-treeview a:hover { + cursor: pointer; + color: black; +} + +.entry-heading .unread { font-weight: bold; } \ No newline at end of file diff --git a/src/main/webapp/directives/category.html b/src/main/webapp/directives/category.html index 8f7e33c3..d011f92d 100644 --- a/src/main/webapp/directives/category.html +++ b/src/main/webapp/directives/category.html @@ -5,7 +5,7 @@
diff --git a/src/main/webapp/directives/toolbar.html b/src/main/webapp/directives/toolbar.html index 25d17814..96b73c74 100644 --- a/src/main/webapp/directives/toolbar.html +++ b/src/main/webapp/directives/toolbar.html @@ -6,6 +6,15 @@
- - + + + +
+ + +
\ No newline at end of file diff --git a/src/main/webapp/js/controllers.js b/src/main/webapp/js/controllers.js index 44f885f6..670bd76c 100644 --- a/src/main/webapp/js/controllers.js +++ b/src/main/webapp/js/controllers.js @@ -102,11 +102,8 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http, $scope.refreshList(); }); - - $scope.offset = 0; $scope.limit = 10; $scope.busy = false; - $scope.hasMore = true; $scope.refreshList = function() { if ($scope.settings.readingMode) { @@ -114,14 +111,14 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http, _type : $scope.selectedType, _id : $scope.selectedId, _readtype : $scope.settings.readingMode, - offset : $scope.offset, - limit : 30 + offset : 0, + limit : $scope.limit }); } }; $scope.loadMoreEntries = function() { - if ($scope.busy || !$scope.hasMore) + if ($scope.busy) return; if (!$scope.settings.readingMode) return; @@ -130,15 +127,17 @@ module.controller('FeedListCtrl', function($scope, $routeParams, $http, _type : $scope.selectedType, _id : $scope.selectedId, _readtype : $scope.settings.readingMode, - offset : $scope.offset, + offset : $scope.entryList.entries.length, limit : $scope.limit }, function(data) { - for ( var i = 0; i < data.entries.length; i++) { - $scope.entryList.entries.push(data.entries[i]); + console.log(data) + var entries = data.entries + for ( var i = 0; i < entries.length; i++) { + $scope.entryList.entries.push(entries[i]); } - $scope.offset = $scope.offset + data.entries.length; + console.log(entries.length) + console.log($scope.limit) $scope.busy = false; - $scope.hasMore = data.entries.length == $scope.limit; }); } diff --git a/src/main/webapp/templates/feeds.html b/src/main/webapp/templates/feeds.html index 6826a3b8..6408f023 100644 --- a/src/main/webapp/templates/feeds.html +++ b/src/main/webapp/templates/feeds.html @@ -2,9 +2,9 @@ {{readType}} {{entryList.name}} » -
-
-
+
+
+
{{entry.title}} {{entry.date}}
-
-
+
+
+
+

+ {{entry.title}} +

+
+
+
Loading data...