Skip to content

Commit

Permalink
[copycopter#5] Replace current home page with projects index
Browse files Browse the repository at this point in the history
* Use Mario Bros.-like ground on all pages
* Create sweet button for create project
* Remove old home / dashboard pages.
* Be RESTful with projects#index.
  • Loading branch information
thoughtbot-travis authored and Dan Croak committed Mar 14, 2012
1 parent 1137a9f commit f78e94c
Show file tree
Hide file tree
Showing 24 changed files with 210 additions and 735 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -35,5 +35,5 @@ Run the server:
Automatically regenerate CSS when you edit Sass files:

sass --watch public/stylesheets/sass:public/stylesheets \
-r public/stylesheets/sass/bourbon/lib/bourbon.rb
-r ./public/stylesheets/sass/bourbon/lib/bourbon.rb

4 changes: 0 additions & 4 deletions app/controllers/dashboards_controller.rb

This file was deleted.

4 changes: 4 additions & 0 deletions app/controllers/projects_controller.rb
Expand Up @@ -21,6 +21,10 @@ def edit
authorize @project
end

def index
@projects = Project.active
end

def new
@project = Project.new
end
Expand Down
9 changes: 0 additions & 9 deletions app/views/dashboards/show.html.erb

This file was deleted.

4 changes: 0 additions & 4 deletions app/views/homes/show.html.erb
Expand Up @@ -74,7 +74,3 @@
</section>
</section>
</div>

<div id='ground'>
<div id='grass'></div>
</div>
15 changes: 15 additions & 0 deletions app/views/projects/index.html.erb
@@ -0,0 +1,15 @@
<% content_for :button do %>
<div id='new-project'>
<%= link_to 'Create a new project', new_project_path %>
</div>
<% end %>
<% content_for :header do %>
<h2><strong>Projects</strong></h2>
<% end %>

<ul class='projects'>
<% @projects.each do |project| %>
<li><%= link_to project.name, project %></li>
<% end %>
</ul>
4 changes: 4 additions & 0 deletions app/views/shared/_footer.html.erb
Expand Up @@ -5,3 +5,7 @@
</div>

<div id='clouds'></div>

<div id='ground'>
<div id='grass'></div>
</div>
4 changes: 3 additions & 1 deletion app/views/shared/_header.html.erb
@@ -1 +1,3 @@
<h1 id='logo'><%= link_to 'Copycopter', dashboard_path %></h1>
<h1 id='logo'><%= link_to 'Copycopter', root_path %></h1>

<%= yield :button %>
6 changes: 1 addition & 5 deletions config/routes.rb
Expand Up @@ -9,8 +9,6 @@
end
end

resource :dashboard, :only => [:show]

resources :projects do
resources :blurbs, :only => [:destroy]
resources :locales, :only => [:new]
Expand All @@ -20,7 +18,5 @@
resources :versions, :only => [:new, :create]
end

resource :home, :only => [:show]

root :to => 'homes#show'
root :to => 'projects#index'
end
4 changes: 2 additions & 2 deletions features/edit_blurb.feature
Expand Up @@ -37,14 +37,14 @@ Feature: Blurb Editing
Then I should not see "test.key"

Scenario: View a project with no blurbs
When I go to the dashboard page
When I go to the home page
And I follow "Project 1"
Then I should see "Setting up your Rails app"
And I should see "Adding blurbs to your app"
But I should not see "Search blurbs"

Scenario: View a project with no blurbs
When I go to the dashboard page
When I go to the home page
Then I should not see "Setting up your Rails app"
And I should not see "Adding blurbs to your app"

Expand Down
2 changes: 0 additions & 2 deletions features/support/paths.rb
Expand Up @@ -4,8 +4,6 @@ def path_to(page_name)
when /the blurbs index for the "([^"]+)" project/i
project = Project.find_by_name!($1)
project_path project
when /the dashboard page/
dashboard_path
when /the edit blurb page for "(.+)" on "(.+)"/i
project = Project.find_by_name!($2)
blurb = project.blurbs.find_by_key!($1)
Expand Down
2 changes: 1 addition & 1 deletion features/translate_blurb.feature
Expand Up @@ -9,7 +9,7 @@ Feature: translate blurbs
| hola | one | es |
| goodbye | two | en |
| adios | two | es |
When I go to the dashboard page
When I go to the home page
And I follow "Project 1"

Scenario: view blurbs in a particular locale
Expand Down
2 changes: 1 addition & 1 deletion features/view_blurbs.feature
Expand Up @@ -9,7 +9,7 @@ Feature: View blurbs
| blah ha | awesome! |
| this is a very long bunch of words | more.key |
| Some simple text | another |
When I go to the dashboard page
When I go to the home page
And I follow "Project 1"
Then no visible elements should contain "test"
When I follow "View all 4 blurbs"
Expand Down
2 changes: 1 addition & 1 deletion features/view_instructions_for_new_locale.feature
Expand Up @@ -6,7 +6,7 @@ Feature: View instructions for new locale
And the following localizations exist in the "Project 1" project:
| draft_content | key | locale |
| hello | one | en |
When I go to the dashboard page
When I go to the home page
And I follow "Project 1"
And I follow "Add a new locale..."
Then I should see "Adding new locales to Copycopter"

0 comments on commit f78e94c

Please sign in to comment.