Skip to content

Commit e30121a

Browse files
committed
Merge pull request #95 from seuros/mongo_grave
Renamed App to correct name : CoderWall
2 parents bb6422c + e5aeb6b commit e30121a

28 files changed

+51
-51
lines changed

Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require File.expand_path('../config/application', __FILE__)
22
require 'rake'
33

4-
Badgiy::Application.load_tasks
4+
CoderWall::Application.load_tasks
55

66
puts "RAILS_ENV=#{Rails.env}"

app/controllers/sessions_controller.rb

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,26 @@ class SessionsController < ApplicationController
22
skip_before_filter :require_registration
33

44
def new
5-
return redirect_to destination_url if signed_in?
5+
#FIXME
6+
redirect_to destination_url if signed_in?
67
end
78

89
def signin
10+
#FIXME
911
return redirect_to destination_url if signed_in?
1012
store_location!(params[:return_to]) unless params[:return_to].nil?
1113
end
1214

1315
def force
14-
head(:forbidden) unless Rails.env.test? || Rails.env.development? || current_user.admin?
16+
#REMOVEME
17+
head(:forbidden) unless current_user.admin?
1518
sign_out
1619
sign_in(@user = User.find_by_username(params[:username]))
17-
return redirect_to(badge_url(username: params[:username]))
20+
redirect_to(badge_url(username: params[:username]))
1821
end
1922

2023
def create
24+
#FIXME
2125
Rails.logger.debug "Authenticating: #{oauth}"
2226
raise "OmniAuth returned error #{params[:error]}" unless params[:error].blank?
2327
if signed_in?
@@ -68,6 +72,7 @@ def failure
6872
protected
6973

7074
def oauth
75+
#FIXME
7176
@oauth ||= request.env["omniauth.auth"].with_indifferent_access if request.env["omniauth.auth"]
7277
end
7378
end

app/helpers/application_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def follow_team_link(team)
239239
elsif signed_in?
240240
link_to('', follow_team_path(team), method: :post, remote: true, class: 'follow-team add-to-network')
241241
else
242-
link_to('', signup_path(flash: 'You must signin or signup before you can follow a team'), class: 'follow-team add-to-network noauth')
242+
link_to('', root_path(flash: 'You must signin or signup before you can follow a team'), class: 'follow-team add-to-network noauth')
243243
end
244244
end
245245

app/helpers/networks_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ def join_or_leave_path(network)
4242
if signed_in?
4343
current_user.member_of?(network) ? leave_network_path(network.slug) : join_network_path(network.slug)
4444
else
45-
signup_path
45+
root_path
4646
end
4747
end
4848

app/helpers/teams_helper.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def build_your_team_path
5757
if signed_in?
5858
new_team_path
5959
else
60-
signup_path
60+
root_path
6161
end
6262
end
6363

app/views/achievements/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,5 +36,5 @@
3636
=link_to "See #{@user.display_name}'s other achievements", badge_path(:username => @user.username), :class => 'seeprofile track', 'data-action' => 'view user achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => @badge.display_name}.to_json
3737
.clear
3838
.clear.center
39-
#getyourachievements=link_to 'See Your Achievements', signup_path, :class => 'clickme track','data-action' => 'view own achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => @badge.display_name}.to_json
39+
#getyourachievements=link_to 'See Your Achievements', root_path, :class => 'clickme track','data-action' => 'view own achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => @badge.display_name}.to_json
4040
.see-all=link_to("View #{@user.display_name}'s profile", badge_path(:username => @user.username), 'data-action' => 'view user profile', 'data-from' => 'achievement', 'data-properties' => {'achievement' => @badge.display_name}.to_json)

app/views/badges/_endorse.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
-if !signed_in?
4343
.message You must be signed in to make endorsements.
4444
.join
45-
=link_to("or join coderwall", signup_path, :class => 'track', 'data-category' => 'click', 'data-action' => 'endorsement sign up')
45+
=link_to("or join coderwall", root_path, :class => 'track', 'data-category' => 'click', 'data-action' => 'endorsement sign up')
4646
%ul
4747
%li
4848
%a.button{:href => link_github_path}

app/views/invitations/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
-if !signed_in?
1010
%p Before you can accept the invitation you need to create a coderwall account or sign in.
1111
%ul.sign-btns
12-
%li=link_to('Sign Up', signup_path, :class => 'join')
12+
%li=link_to('Sign Up', root_path, :class => 'join')
1313
%li=link_to('Sign In', signin_path, :id => 'signin', :class => 'join')
1414
-else
1515
-if current_user.team

app/views/networks/_navigation.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
%a{:href => networks_path, :class => networks_nav_class(:index)}
1414
All networks
1515
%li
16-
%a{:href => signed_in? ? user_networks_path(current_user.username) : signup_path, :class => networks_nav_class(:user)}
16+
%a{:href => signed_in? ? user_networks_path(current_user.username) : root_path, :class => networks_nav_class(:user)}
1717
%span
1818
My networks
1919
-#%li

app/views/networks/current_mayor.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,5 @@
3030
=link_to "See #{@mayor.display_name}'s other achievements", badge_path(:username => @mayor.username), :class => 'seeprofile track', 'data-action' => 'view user achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => 'mayor'}.to_json
3131
.clear
3232
.clear.center
33-
#getyourachievements=link_to 'See Your Achievements', signup_path, :class => 'clickme track', 'data-action' => 'view own achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => 'mayor'}.to_json
33+
#getyourachievements=link_to 'See Your Achievements', root_path, :class => 'clickme track', 'data-action' => 'view own achievements', 'data-from' => 'achievement', 'data-properties' => {'achievement' => 'mayor'}.to_json
3434
.see-all=link_to("View #{@mayor.display_name}'s profile", badge_path(:username => @mayor.username), 'data-action' => 'view user profile', 'data-from' => 'achievement', 'data-properties' => {'achievement' => 'mayor'}.to_json)

app/views/protips/topic.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
%p
2626
=link_to('Share', new_protip_path(:topics => @topic), 'data-action' => 'create protip', 'data-from' => 'user protips page') + " a link, code snippet, post or other pro tip about #{@topic}"
2727
-else
28-
=link_to('Sign in', signup_path)
28+
=link_to('Sign in', root_path)
2929
==to start sharing your #{@topic} pro tips or
3030
=link_to('learn more', faq_path, :class => 'track', 'data-action' => 'view faq', 'data-from' => 'user protips page')
3131

app/views/redemptions/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,5 @@
44
#invitations
55
%h1==You have earned the #{@redemption.badge.display_name} badge
66
%p Before you can accept the achievement you need to create a coderwall account or sign in.
7-
=link_to('Sign Up', signup_path, :class => 'button')
7+
=link_to('Sign Up', root_path, :class => 'button')
88
=link_to('Sign In', signin_path, :id => 'signin')

app/views/sessions/_signin.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,4 @@
2323

2424
%p.sign-up-terms
2525
Need an account?
26-
=link_to('Join coderwall', signup_path) + "."
26+
=link_to('Join coderwall', root_path) + "."

app/views/sessions/_signin_old.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@
1919
.clear
2020
%p
2121
Need an account?
22-
=link_to('Join coderwall', signup_path) + "."
22+
=link_to('Join coderwall', root_path) + "."

app/views/teams/_team_nav.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
-elsif signed_in?
1212
=link_to("Get your team's index score", new_team_path, options)
1313
-else
14-
=link_to("Get your team's index score", signup_path, options)
14+
=link_to("Get your team's index score", root_path, options)
1515

1616
%h2.headline Team Leaderboard
1717
.barnav

app/views/teams/leaderboard.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
=render @teams
3333
-if !signed_in?
3434
%li.extended
35-
=link_to 'Sign in to see the Full Leaderboard', signup_path
35+
=link_to 'Sign in to see the Full Leaderboard', root_path
3636

3737
.pagination.cf
3838
-unless params[:page].to_i <= 1

app/views/users/show.html.haml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@
229229
-elsif signed_in?
230230
=link_to(defined_in_css = '', follow_user_path(@user.username), :method => :post, :remote => true, :class => 'add-to-network track', 'data-action' => 'follow user', 'data-from' => 'profile sidebar')
231231
-else
232-
=link_to(defined_in_css = '', signup_path(:flash => 'You must signin or signup before you can follow someone'), :class => 'add-to-network noauth track', 'data-action' => 'follow user', 'data-from' => 'profile sidebar')
232+
=link_to(defined_in_css = '', root_path(:flash => 'You must signin or signup before you can follow someone'), :class => 'add-to-network noauth track', 'data-action' => 'follow user', 'data-from' => 'profile sidebar')
233233
-if signed_in? && @user.following?(current_user)
234234
.followed-back
235235
%p== #{@user.short_name} is following you

config.ru

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
require ::File.expand_path('../config/environment', __FILE__)
22

3-
run Badgiy::Application
3+
run CoderWall::Application

config/application.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77

88
Bundler.require(:default, Rails.env) if defined?(Bundler)
99

10-
module Badgiy
10+
module CoderWall
1111
class Application < Rails::Application
1212
config.autoload_paths += %W(#{config.root}/app)
1313

config/environment.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
require File.expand_path('../application', __FILE__)
2-
Badgiy::Application.initialize!
2+
CoderWall::Application.initialize!

config/environments/development.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Badgiy::Application.configure do
1+
CoderWall::Application.configure do
22
config.threadsafe! unless $rails_rake_task
33

44
config.action_controller.perform_caching = false

config/environments/production.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Badgiy::Application.configure do
1+
CoderWall::Application.configure do
22
config.threadsafe! unless $rails_rake_task
33
config.cache_classes = true
44
config.consider_all_requests_local = false

config/environments/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Badgiy::Application.configure do
1+
CoderWall::Application.configure do
22
config.threadsafe! unless $rails_rake_task
33
config.cache_classes = false
44
config.whiny_nils = true

config/initializers/assets.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Badgiy::Application.configure do
1+
CoderWall::Application.configure do
22
config.assets.precompile << /\.(?:svg|eot|woff|ttf)$/
33
config.assets.precompile << 'admin.css'
44
config.assets.version = '1.1'

config/initializers/cache_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Badgiy::Application.configure do
1+
CoderWall::Application.configure do
22
config.cache_store = :redis_store, "#{ENV['REDIS_URL']}/#{ENV['REDIS_CACHE_STORE'] || 2}"
33
end

config/initializers/secret_token.rb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1 @@
1-
# Be sure to restart your server when you modify this file.
2-
3-
# Your secret key for verifying the integrity of signed cookies.
4-
# If you change this key, all old signed cookies will become invalid!
5-
# Make sure the secret is at least 30 characters and all random,
6-
# no regular words or you'll be exposed to dictionary attacks.
7-
Badgiy::Application.config.secret_token = ENV['SECRET_TOKEN_BASE']
1+
CoderWall::Application.config.secret_token = ENV['SECRET_TOKEN_BASE']

config/initializers/session_store.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# Be sure to restart your server when you modify this file.
2-
Badgiy::Application.config.session_store :redis_store
2+
CoderWall::Application.config.session_store :redis_store

config/routes.rb

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@
291291
# letter_opener_letter /letter_opener/:id/:style.html(.:format) letter_opener/letters#show
292292
#
293293

294-
Badgiy::Application.routes.draw do
294+
CoderWall::Application.routes.draw do
295295

296296
# We get 10K's of requests for this route.
297297
get '/.json', to: proc { [404, {}, ['']] }
@@ -470,7 +470,19 @@
470470
get '/nextaccomplishment' => 'highlights#random', as: :random_accomplishment
471471
get '/add-skill' => 'skills#create', as: :add_skill, :via => :post
472472

473-
require_admin = ->(params, req) { User.where(id: req.session[:current_user]).first.try(:admin?) }
473+
474+
get '/blog' => 'blog_posts#index', as: :blog
475+
get '/blog/:id' => 'blog_posts#show', as: :blog_post
476+
get '/articles.atom' => 'blog_posts#index', as: :atom, :format => :atom
477+
478+
get '/signin' => 'sessions#signin', as: :signin
479+
get '/signout' => 'sessions#destroy', as: :signout
480+
get '/goodbye' => 'sessions#destroy', as: :sign_out
481+
482+
get '/dashboard' => 'events#index', as: :dashboard
483+
get '/roll-the-dice' => 'users#randomize', as: :random_wall
484+
485+
require_admin = ->(params, req) { User.find_by(id: req.session[:current_user], admin: true).exist? }
474486

475487
scope :admin, as: :admin, :path => '/admin', :constraints => require_admin do
476488
get '/' => 'admin#index', as: :root
@@ -483,17 +495,7 @@
483495
mount Sidekiq::Web => '/sidekiq'
484496
end
485497

486-
get '/blog' => 'blog_posts#index', as: :blog
487-
get '/blog/:id' => 'blog_posts#show', as: :blog_post
488-
get '/articles.atom' => 'blog_posts#index', as: :atom, :format => :atom
489498

490-
get '/' => 'protips#index', as: :signup
491-
get '/signin' => 'sessions#signin', as: :signin
492-
get '/signout' => 'sessions#destroy', as: :signout
493-
get '/goodbye' => 'sessions#destroy', as: :sign_out
494-
495-
get '/dashboard' => 'events#index', as: :dashboard
496-
get '/roll-the-dice' => 'users#randomize', as: :random_wall
497499
get '/:username' => 'users#show', as: :badge
498500
get '/:username/achievements/:id' => 'achievements#show', as: :user_achievement
499501
get '/:username/endorsements.json' => 'endorsements#show'
@@ -502,16 +504,15 @@
502504
get '/:username/events' => 'events#index', as: :user_activity_feed
503505
get '/:username/events/more' => 'events#more'
504506

505-
get '/javascripts/*filename.js' => 'legacy#show', extension: 'js'
506-
get '/stylesheets/*filename.css' => 'legacy#show', extension: 'css'
507-
get '/images/*filename.png' => 'legacy#show', extension: 'png'
508-
get '/images/*filename.jpg' => 'legacy#show', extension: 'jpg'
507+
# TODO
508+
# Admin scope should be here to avoid query to database.
509509

510510
namespace :callbacks do
511511
post '/hawt/feature' => 'hawt#feature'
512512
post '/hawt/unfeature' => 'hawt#unfeature'
513513
end
514514

515+
515516
if Rails.env.development?
516517
mount MailPreview => 'mail_view'
517518
get '/letter_opener' => 'letter_opener/letters#index', as: :letter_opener_letters

0 commit comments

Comments
 (0)