From f0098b40808602b26c3087ad89dd9a933f1858f8 Mon Sep 17 00:00:00 2001 From: Adrian Short Date: Thu, 21 Jun 2012 16:28:37 +0100 Subject: [PATCH] Nicer root route --- app/views/feeds/index.html.haml | 2 +- app/views/feeds/show.html.haml | 30 +++++++++++++++++++------ app/views/layouts/application.html.haml | 2 +- 3 files changed, 25 insertions(+), 9 deletions(-) diff --git a/app/views/feeds/index.html.haml b/app/views/feeds/index.html.haml index 60c99da..3ca51fd 100644 --- a/app/views/feeds/index.html.haml +++ b/app/views/feeds/index.html.haml @@ -22,7 +22,7 @@ = time_ago_in_words feed.last_fetched ago %td= link_to 'Edit', edit_feed_path(feed) - %td= link_to 'Delete', feed, :confirm => 'Are you sure?', :method => :delete + %td= link_to 'Delete', feed, :confirm => "Delete #{feed.title} and all its posts?", :method => :delete #new_feed = render 'form' diff --git a/app/views/feeds/show.html.haml b/app/views/feeds/show.html.haml index 553d95c..38d8546 100644 --- a/app/views/feeds/show.html.haml +++ b/app/views/feeds/show.html.haml @@ -1,13 +1,29 @@ +%h1= link_to @feed.title, @feed.url + +%p= @feed.description + %p - %b Title: - = @feed.title + = pluralize(@feed.posts.size, "post") + %p - %b Link: - = @feed.link + = link_to @feed.feed_url, @feed.feed_url + %p - %b Last fetched: - = @feed.last_fetched + - if @feed.last_fetched.nil? + This feed has never been fetched + - else + Last fetched + = time_ago_in_words @feed.last_fetched + ago + +%table + - @feed.posts.each do |p| + %tr + %td= link_to p.title, p.url + %td= p.loc['lat'] + %td= p.loc['lng'] + %td= p.published = link_to 'Edit', edit_feed_path(@feed) \| -= link_to 'Back', feeds_path += link_to 'Back', :root diff --git a/app/views/layouts/application.html.haml b/app/views/layouts/application.html.haml index e6a379b..9b6dc27 100644 --- a/app/views/layouts/application.html.haml +++ b/app/views/layouts/application.html.haml @@ -8,7 +8,7 @@ %body - = link_to(image_tag("TAL_logo_blue-h100.png", :size => "275x100", :alt => "Talk About Local logo"), '/') + = link_to(image_tag("TAL_logo_blue-h100.png", :size => "275x100", :alt => "Talk About Local logo"), :root) %p#notice= notice