Skip to content

Commit

Permalink
stream <=> latest
Browse files Browse the repository at this point in the history
  • Loading branch information
maxwell committed Jul 31, 2012
1 parent 6a50c90 commit 8216bd0
Show file tree
Hide file tree
Showing 11 changed files with 16 additions and 16 deletions.
4 changes: 2 additions & 2 deletions app/controllers/notifications_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@ def index
def read_all
current_user.notifications.mark_all_as_read!
respond_to do |format|
format.html { redirect_to stream_path }
format.mobile{ redirect_to stream_path}
format.html { redirect_to latest_path }
format.mobile{ redirect_to latest_path}
format.xml { render :xml => {}.to_xml }
format.json { render :json => {}.to_json }
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/posts_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def destroy
respond_to do |format|
format.js { render 'destroy',:layout => false, :format => :js }
format.json { render :nothing => true, :status => 204 }
format.any { redirect_to stream_path }
format.any { redirect_to latest_path}
end
end

Expand Down
4 changes: 2 additions & 2 deletions app/controllers/status_messages_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -48,12 +48,12 @@ def create


respond_to do |format|
format.mobile { redirect_to stream_path }
format.mobile { redirect_to latest_path }
format.json { render :json => PostPresenter.new(@status_message, current_user), :status => 201 }
end
else
respond_to do |format|
format.mobile { redirect_to stream_path }
format.mobile { redirect_to latest_path }
format.json { render :nothing => true , :status => 403 }
end
end
Expand Down
4 changes: 2 additions & 2 deletions app/controllers/users_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ def destroy
if params[:user] && params[:user][:current_password] && current_user.valid_password?(params[:user][:current_password])
current_user.close_account!
sign_out current_user
redirect_to(stream_path, :notice => I18n.t('users.destroy.success'))
redirect_to(latest_path, :notice => I18n.t('users.destroy.success'))
else
if params[:user].present? && params[:user][:current_password].present?
flash[:error] = t 'users.destroy.wrong_password'
Expand All @@ -103,7 +103,7 @@ def public
format.any { redirect_to person_path(@user.person) }
end
else
redirect_to stream_path, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
redirect_to latest_path, :error => I18n.t('users.public.does_not_exist', :username => params[:username])
end
end

Expand Down
2 changes: 1 addition & 1 deletion app/helpers/stream_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ def next_page_path(opts ={})
elsif controller.instance_of?(PostsController)
public_stream_path(:max_time => time_for_scroll(@stream))
elsif controller.instance_of?(StreamsController)
stream_path(:max_time => time_for_scroll(@stream))
latest_path(:max_time => time_for_scroll(@stream))
else
raise 'in order to use pagination for this new controller, update next_page_path in stream helper'
end
Expand Down
2 changes: 1 addition & 1 deletion app/views/layouts/main_stream.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@

%ul.left_nav
%li
= link_to t("streams.multi.title"), stream_path, :class => 'home_selector', :rel => 'backbone'
= link_to t("streams.multi.title"), latest_path, :class => 'home_selector', :rel => 'backbone'

= render 'aspects/aspect_listings', :stream => @stream

Expand Down
2 changes: 1 addition & 1 deletion config/routes.rb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
end

# Streams
get "latest" => "streams#show"
get "latest" => "streams#show", :as => 'latest'
get "latest/updated" => "streams#updated"

get "timewarp/:days_ago" => 'streams#show'
Expand Down
4 changes: 2 additions & 2 deletions features/support/paths.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ module NavigationHelpers
def path_to(page_name)
case page_name
when /^the home(?: )?page$/
stream_path
latest_path
when /^the tag page for "([^\"]*)"$/
tag_path($1)
when /^its ([\w ]+) page$/
Expand All @@ -24,7 +24,7 @@ def path_to(page_name)
when /^my new profile page$/
person_path(@me.person, :ex => true)
when /^the new stream$/
stream_path(:ex => true)
latest_path(:ex => true)
when /^"(\/.*)"/
$1
else
Expand Down
2 changes: 1 addition & 1 deletion lib/stream/multi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ class Stream::Multi < Stream::Base

# @return [String] URL
def link(opts)
Rails.application.routes.url_helpers.stream_path(opts)
Rails.application.routes.url_helpers.latest_path(opts)
end

# @return [String]
Expand Down
2 changes: 1 addition & 1 deletion spec/controllers/home_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
it 'redirects to the stream if logged in' do
sign_in alice
get :show, :home => true
response.should redirect_to(stream_path)
response.should redirect_to(latest_path)
end
end
end
4 changes: 2 additions & 2 deletions spec/controllers/notifications_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -47,12 +47,12 @@
it "should redirect to the stream in the html version" do
Factory(:notification, :recipient => alice)
get :read_all, :format => :html
response.should redirect_to(stream_path)
response.should redirect_to(latest_path)
end
it "should redirect to the stream in the mobile version" do
Factory(:notification, :recipient => alice)
get :read_all, :format => :mobile
response.should redirect_to(stream_path)
response.should redirect_to(latest_path)
end
it "should return a dummy value in the json version" do
Factory(:notification, :recipient => alice)
Expand Down

0 comments on commit 8216bd0

Please sign in to comment.