Skip to content

Commit

Permalink
Refactor: rename dashboard_controller to pages_controller
Browse files Browse the repository at this point in the history
  • Loading branch information
jasonm committed Jan 28, 2013
1 parent 7d71bcb commit 44b40e3
Show file tree
Hide file tree
Showing 11 changed files with 21 additions and 17 deletions.
2 changes: 1 addition & 1 deletion app/assets/stylesheets/application.scss
Expand Up @@ -6,7 +6,7 @@ body {
padding-bottom: 40px;
}

body.dashboard-show div.hero-unit {
body.pages-show div.hero-unit {
padding: 60px 60px 60px 360px;

img.logo {
Expand Down
9 changes: 0 additions & 9 deletions app/controllers/dashboard_controller.rb

This file was deleted.

2 changes: 1 addition & 1 deletion app/controllers/github_oauth_controller.rb
Expand Up @@ -8,7 +8,7 @@ def callback
end

def failure
redirect_to dashboard_url, alert: "You'll need to sign into GitHub. Maybe next time?"
redirect_to home_url, alert: "You'll need to sign into GitHub. Maybe next time?"
end

private
Expand Down
12 changes: 12 additions & 0 deletions app/controllers/pages_controller.rb
@@ -0,0 +1,12 @@
class PagesController < ApplicationController
SUPPRESS_NAVBAR_ON = %w(home)

def show
if params[:id] == 'home'
@suppress_navbar = SUPPRESS_NAVBAR_ON.include?(params[:id])
session[:redirect_after_github_oauth_url] = new_agreement_url
end

render template: "pages/#{params[:id]}"
end
end
2 changes: 1 addition & 1 deletion app/controllers/sessions_controller.rb
@@ -1,6 +1,6 @@
class SessionsController < ApplicationController
def destroy
sign_out
redirect_to dashboard_url
redirect_to home_url
end
end
File renamed without changes.
Expand Up @@ -4,7 +4,7 @@
<h2>Contributor License Agreements on GitHub</h2>
<p>Easily add a <a href="http://en.wikipedia.org/wiki/Contributor_License_Agreement">Contributor License Agreement</a> to your GitHub project, let contributors sign it, and see at a glance which pull request authors have signed your CLA, and which haven&rsquo;t.</p>
<p><a class="btn btn-primary btn-large" href="/auth/github">Sign in with GitHub to get started &raquo;</a></p>
<p>Or, read more about <a href="/why_cla">what CLAs are and why you might use one</a>&hellip;</p>
<p>Or, read more about <%= link_to 'what CLAs are and why you might use one', page_path('why_cla') %>&hellip;</p>
</div>

<%= render partial: 'how_it_works' %>
File renamed without changes.
4 changes: 2 additions & 2 deletions app/views/shared/_navbar.html.erb
Expand Up @@ -2,8 +2,8 @@
<div class="navbar-inner">
<a class="brand" href="#">CLAHub</a>
<ul class="nav">
<%= nav_link_to 'Home', '/' %>
<%= nav_link_to 'Why CLAs?', '/why_cla' %>
<%= nav_link_to 'Home', page_path('home') %>
<%= nav_link_to 'Why CLAs?', page_path('why_cla') %>
</ul>
</div>
</div>
5 changes: 3 additions & 2 deletions config/routes.rb
@@ -1,6 +1,7 @@
Clahub::Application.routes.draw do
root to: "dashboard#show", :as => :dashboard
match '/why_cla' => 'dashboard#why_cla'
root to: "pages#home", :as => :home
match "/pages/*id" => 'pages#show', as: :page, format: false

match 'auth/github/callback' => 'github_oauth#callback', :as => :github_oauth_callback
match 'auth/failure' => 'github_oauth#failure'
match 'sign_out' => 'sessions#destroy', :as => :sign_out
Expand Down
File renamed without changes.

0 comments on commit 44b40e3

Please sign in to comment.