diff --git a/README.rdoc b/README.rdoc index f36bde4..76f8406 100644 --- a/README.rdoc +++ b/README.rdoc @@ -2,10 +2,11 @@ * Handle relative URLs in Atom feed. (http://www.rfc1149.net/blog/2010/12/27/feed-and-relative-links/) -* Update a single feed manually and mark the new feeds in the db * Rake task to update all feeds at once * Detect an RSS link in a given website URL - +* Add an optional manual title to the imported feed +* Collapse the opened item again +* Make the UI consistend (read/unread items) === Low priority @@ -16,4 +17,3 @@ === Broken feeds with feedzirra -* http://blog.fefe.de/rss.xml diff --git a/app/assets/stylesheets/items.css.scss b/app/assets/stylesheets/items.css.scss index 574a089..2e7375a 100644 --- a/app/assets/stylesheets/items.css.scss +++ b/app/assets/stylesheets/items.css.scss @@ -1,5 +1,9 @@ @import "config"; +a.unread { + font-weight: bold; +} + li.item { overflow: auto; diff --git a/app/assets/stylesheets/layout.css.scss b/app/assets/stylesheets/layout.css.scss index cfa8c8f..659ef39 100644 --- a/app/assets/stylesheets/layout.css.scss +++ b/app/assets/stylesheets/layout.css.scss @@ -1,7 +1,7 @@ @import "config"; aside { - width: 250px; + width: 350px; float: left; ul { diff --git a/app/controllers/feeds_controller.rb b/app/controllers/feeds_controller.rb index 5bd1337..1c6821d 100644 --- a/app/controllers/feeds_controller.rb +++ b/app/controllers/feeds_controller.rb @@ -10,6 +10,12 @@ class FeedsController < ApplicationController render :layout => false end + def refresh + @feed = Feed.find(params[:id]) + @feed.fetch! + redirect_to :action => :show, :notice => "Add the feed" + end + def create @feed = Feed.import(params[:feed][:url]) redirect_to :action => :index, :notice => "Add the feed" diff --git a/app/controllers/items_controller.rb b/app/controllers/items_controller.rb index eee7cb6..07e2aa7 100644 --- a/app/controllers/items_controller.rb +++ b/app/controllers/items_controller.rb @@ -1,6 +1,7 @@ class ItemsController < ApplicationController def show @item = Item.find(params[:id]) + @item.read render :layout => false end end diff --git a/app/models/feed.rb b/app/models/feed.rb index eead359..5e300b8 100644 --- a/app/models/feed.rb +++ b/app/models/feed.rb @@ -1,5 +1,3 @@ -require "pp" - class Feed < ActiveRecord::Base has_many :items, :dependent => :destroy has_many :errors, :dependent => :destroy diff --git a/app/models/item.rb b/app/models/item.rb index 8713928..b6f3e17 100644 --- a/app/models/item.rb +++ b/app/models/item.rb @@ -1,11 +1,14 @@ class Item < ActiveRecord::Base belongs_to :feed - + validates_presence_of :title, :author, :content validates_uniqueness_of :url default_scope order("published_at DESC") scope :recent, limit(10) + scope :unread, where(:read_at => nil) + + #attr_accessible :read_at def self.create_from_feed_entry!(feed_entry) feed_entry.sanitize! @@ -19,6 +22,10 @@ class Item < ActiveRecord::Base ) end + def read + update_attribute(:read_at, Time.now) + end + def <=>(other) self.published_at <=> other.published_at end diff --git a/app/views/feeds/_navigation.html.erb b/app/views/feeds/_navigation.html.erb index 55bfa8a..553375a 100644 --- a/app/views/feeds/_navigation.html.erb +++ b/app/views/feeds/_navigation.html.erb @@ -1,9 +1,14 @@ diff --git a/app/views/feeds/show.html.erb b/app/views/feeds/show.html.erb index cb70947..83331f9 100644 --- a/app/views/feeds/show.html.erb +++ b/app/views/feeds/show.html.erb @@ -3,7 +3,8 @@