Permalink
Browse files

groupy branch: blog feed refresh link in admin interface

  • Loading branch information...
1 parent 46256b4 commit e3205eaa6ce432f183831987920f642d95c6a850 @herestomwiththeweather herestomwiththeweather committed Feb 21, 2011
@@ -0,0 +1,12 @@
+class FeedPostsController < ApplicationController
+ before_filter :login_required, :admin_required
+ def refresh_blog
+ new_posts_count = FeedPost.update_posts
+ if nil == new_posts_count
+ flash[:error] = t('error_blog_update')
+ else
+ flash[:notice] = t('notice_blog_updated') + " #{new_posts_count} " + t('notice_entries')
+ end
+ redirect_to '/admin/feed_posts'
+ end
+end
@@ -14,13 +14,4 @@ def show
@post = FeedPost.find(params[:id])
end
- def refreshblog
- new_posts_count = FeedPost.update_posts
- if nil == new_posts_count
- flash[:error] = t('error_blog_update')
- else
- flash[:notice] = t('notice_blog_updated') + " #{new_posts_count} " + t('notice_entries')
- end
- redirect_to '/'
- end
end
@@ -0,0 +1,2 @@
+module FeedPostsHelper
+end
@@ -35,6 +35,7 @@
<%- if current_person.admin? -%>
<br />
<%- if admin_view? -%>
+ <%= link_to("Refresh Blog Feed", '/refreshblog') %> |
<%= link_to("Standard view", home_path) %>
<%- else -%>
<%= link_to("Admin view", admin_preferences_path) %>
View
@@ -67,12 +67,6 @@
admin.resources :people, :active_scaffold => true
admin.resources :exchanges, :active_scaffold => true
admin.resources :preferences, :broadcast_emails, :feed_posts
- admin.resources :groups
- admin.resources :forums do |forums|
- forums.resources :topics do |topic|
- topic.resources :posts
- end
- end
end
map.resources :blogs do |blog|
blog.resources :posts do |post|
@@ -90,7 +84,7 @@
map.login '/login', :controller => 'person_sessions', :action => 'new'
map.logout '/logout', :controller => 'person_sessions', :action => 'destroy'
map.home '/', :controller => 'home'
- map.refreshblog '/refreshblog', :controller => 'home', :action => 'refreshblog'
+ map.refreshblog '/refreshblog', :controller => 'feed_posts', :action => 'refresh_blog'
map.about '/about', :controller => 'home', :action => 'about'
map.practice '/practice', :controller => 'home', :action => 'practice'
map.steps '/steps', :controller => 'home', :action => 'steps'
@@ -0,0 +1,8 @@
+require 'test_helper'
+
+class FeedPostsControllerTest < ActionController::TestCase
+ # Replace this with your real tests.
+ test "the truth" do
+ assert true
+ end
+end
@@ -0,0 +1,4 @@
+require 'test_helper'
+
+class FeedPostsHelperTest < ActionView::TestCase
+end

0 comments on commit e3205ea

Please sign in to comment.