saucy 0.2.45 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -67,12 +67,17 @@ To use seed data in your Cucumber, add this to features/support/seed.rb:
67
67
  Customization
68
68
  -------------
69
69
 
70
- To change the layout for a controller inside of saucy, add a line like this to
71
- your config/application.rb:
70
+ By default Saucy uses and provides a `saucy.html.erb` layout. To change the
71
+ layout for a controller inside of saucy, add a line like this to your
72
+ config/application.rb:
72
73
 
73
74
  config.saucy.layouts.accounts.index = "custom"
74
75
 
75
- Your layout should yield(:header) in order to get the headers from saucy views.
76
+ In addition to just the normal yield, your layout should yield the following
77
+ items in order to get everything from saucy views:
78
+
79
+ * :header
80
+ * :subnav
76
81
 
77
82
  To extend the ProjectsController:
78
83
 
@@ -1,5 +1,6 @@
1
1
  class BillingsController < ApplicationController
2
2
  before_filter :authorize_admin, :except => [:show]
3
+ layout Saucy::Layouts.to_proc
3
4
 
4
5
  def show
5
6
  end
@@ -1,5 +1,5 @@
1
- <div class="tabs">
2
- <ul>
1
+ <% content_for :subnav do -%>
2
+ <ul class="subnav">
3
3
  <li class="accounts"><%= link_to "Account Info", edit_account_url(current_account) %></li>
4
4
  <li class="projects"><%= link_to "Projects", account_projects_url(current_account) %></li>
5
5
  <li class="users"><%= link_to "Users", account_memberships_url(current_account) %></li>
@@ -7,4 +7,4 @@
7
7
  <li class="billing"><%= link_to "Billing", account_billing_path(current_account) %></li>
8
8
  <% end -%>
9
9
  </ul>
10
- </div>
10
+ <% end -%>
@@ -2,7 +2,7 @@
2
2
  <h2>Settings for <span><%= current_account.name %></span></h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'tab_bar' %>
5
+ <%= render :partial => 'subnav' %>
6
6
 
7
7
  <div class="plan current">
8
8
  <h3>Your Plan</h3>
@@ -2,7 +2,7 @@
2
2
  <h2>Billing Information</h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'accounts/tab_bar' %>
5
+ <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <%= semantic_form_for @account, :url => account_billing_path(@account) do |form| %>
8
8
  <%= render :partial => 'billings/form', :locals => { :form => form } %>
@@ -3,7 +3,7 @@
3
3
  <h2>Billing Information</h2>
4
4
  <% end -%>
5
5
 
6
- <%= render :partial => 'accounts/tab_bar' %>
6
+ <%= render :partial => 'accounts/subnav' %>
7
7
 
8
8
  <div class="current_credit_card">
9
9
  <p>We're currently charging the credit card ending in <%= current_account.credit_card.last_4 %>. <%= link_to "Change", edit_account_billing_path(current_account) %></p>
@@ -2,7 +2,7 @@
2
2
  <h2>Invite a new User</h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'accounts/tab_bar' %>
5
+ <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <%= semantic_form_for [current_account, @invitation] do |form| -%>
8
8
  <%= form.inputs do -%>
@@ -0,0 +1,24 @@
1
+ <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
+ <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
4
+ <head>
5
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
6
+ <%= csrf_meta_tag %>
7
+ </head>
8
+
9
+ <body class="saucy">
10
+ <% flash.each do |key, value| -%>
11
+ <%= value %>
12
+ <% end -%>
13
+
14
+ <% if signed_in? -%>
15
+ <%= link_to 'Sign out', sign_out_path, :method => :delete %>
16
+ <% else -%>
17
+ <%= link_to 'Sign in', sign_in_path %>
18
+ <% end -%>
19
+
20
+ <%= yield(:subnav) %>
21
+ <%= yield(:header) %>
22
+ <%= yield %>
23
+ </body>
24
+ </html>
@@ -8,7 +8,7 @@
8
8
  <% end -%>
9
9
  </div>
10
10
 
11
- <%= render :partial => 'accounts/tab_bar' %>
11
+ <%= render :partial => 'accounts/subnav' %>
12
12
 
13
13
  <%= semantic_form_for @membership do |form| -%>
14
14
  <%= form.inputs do -%>
@@ -2,7 +2,7 @@
2
2
  <h2>Users for <span><%= current_account.name %></span></h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'accounts/tab_bar' %>
5
+ <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <ul class="users">
8
8
  <% @memberships.each do |membership| -%>
@@ -9,7 +9,7 @@
9
9
  </div>
10
10
 
11
11
 
12
- <%= render :partial => 'accounts/tab_bar' %>
12
+ <%= render :partial => 'accounts/subnav' %>
13
13
 
14
14
  <%= semantic_form_for @project do |form| %>
15
15
  <%= render 'form', :form => form,
@@ -2,7 +2,7 @@
2
2
  <h2>Projects for <%= current_account.name %></h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'accounts/tab_bar' %>
5
+ <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <ul class="projects">
8
8
  <% @projects.each do |project| -%>
@@ -2,7 +2,7 @@
2
2
  <h2>Create a new project</h2>
3
3
  <% end -%>
4
4
 
5
- <%= render :partial => 'accounts/tab_bar' %>
5
+ <%= render :partial => 'accounts/subnav' %>
6
6
 
7
7
  <%= semantic_form_for(@project, :url => account_projects_url(current_account)) do |form| %>
8
8
  <%= render 'form', :form => form,
@@ -1,15 +1,4 @@
1
1
  When /^I bootstrap the application for saucy$/ do
2
- steps %{
3
- And I add a header to the layout
4
- }
5
- end
6
-
7
- When /^I add a header to the layout$/ do
8
- header = "<%= yield(:header) %>"
9
-
10
- replace_in_file "app/views/layouts/application.html.erb",
11
- /(<body>)/,
12
- "\\1\n#{header}"
13
2
  end
14
3
 
15
4
  When /^I copy the locked Gemfile from this project$/ do
@@ -19,7 +19,7 @@ Feature: edit permissions for a project
19
19
  And "jane@example.com" is a member of the "thoughtbot" account
20
20
  And "hank@example.com" is an admin of the "Stocknames" project
21
21
  When I go to the settings page for the "thoughtbot" account
22
- And I follow "Projects" within ".tabs"
22
+ And I follow "Projects" within ".subnav"
23
23
  And I follow "Stocknames" within "ul.projects"
24
24
  Then "Bill" should be listed as a member
25
25
  And "Hank" should be listed as an admin
@@ -20,7 +20,7 @@ Feature: Manage account
20
20
  And a project named "Projection" exists under the "Test" account
21
21
  And the user "captain@awesome.com" exists under the "Test" account
22
22
  When I go to the settings page for the "Test" account
23
- And I follow "Projects" within ".tabs"
23
+ And I follow "Projects" within ".subnav"
24
24
  Then I should see "Projection"
25
25
  When I follow "Users"
26
26
  Then I should see "captain@awesome.com"
@@ -31,7 +31,7 @@ Feature: Manage Plan
31
31
  And I have signed in with "joe@example.com/test"
32
32
  And "joe@example.com" is an admin of the "Test" account
33
33
  When I go to the settings page for the "Test" account
34
- Then I should not see "Billing" within ".tabs"
34
+ Then I should not see "Billing" within ".subnav"
35
35
  Then I should see "Your Plan"
36
36
  And I follow "Upgrade"
37
37
  Then I should see "Upgrade Your Plan"
@@ -59,7 +59,7 @@ Feature: Manage Plan
59
59
  And I have signed in with "joe@example.com/test"
60
60
  And "joe@example.com" is an admin of the "Test" account
61
61
  When I go to the settings page for the "Test" account
62
- Then I should not see "Billing" within ".tabs"
62
+ Then I should not see "Billing" within ".subnav"
63
63
  Then I should see "Your Plan"
64
64
  And I follow "Upgrade"
65
65
  When I choose the "Basic" plan
data/lib/saucy/layouts.rb CHANGED
@@ -28,7 +28,7 @@ module Saucy
28
28
  if action_name.sub!(/=$/, '')
29
29
  @actions[action_name] = args.first
30
30
  else
31
- @actions[action_name] ||= "application"
31
+ @actions[action_name] ||= "saucy"
32
32
  end
33
33
  end
34
34
  end
data/spec/layouts_spec.rb CHANGED
@@ -6,8 +6,8 @@ describe Saucy::Layouts do
6
6
  subject.accounts.index.should == "custom"
7
7
  end
8
8
 
9
- it "defaults to the application layout" do
10
- subject.accounts.index.should == "application"
9
+ it "defaults to the saucy layout" do
10
+ subject.accounts.index.should == "saucy"
11
11
  end
12
12
 
13
13
  it "selects a layout for a controller" do
@@ -15,7 +15,7 @@ describe Saucy::Layouts do
15
15
  controller.stubs(:action_name => 'index')
16
16
  block = subject.class.to_proc
17
17
 
18
- block.call(controller).should == 'application'
18
+ block.call(controller).should == 'saucy'
19
19
  end
20
20
  end
21
21
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: saucy
3
3
  version: !ruby/object:Gem::Version
4
- hash: 77
4
+ hash: 19
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
- - 2
9
- - 45
10
- version: 0.2.45
8
+ - 3
9
+ - 0
10
+ version: 0.3.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - thoughtbot, inc.
@@ -18,7 +18,7 @@ autorequire:
18
18
  bindir: bin
19
19
  cert_chain: []
20
20
 
21
- date: 2011-03-18 00:00:00 -04:00
21
+ date: 2011-03-21 00:00:00 -04:00
22
22
  default_executable:
23
23
  dependencies:
24
24
  - !ruby/object:Gem::Dependency
@@ -147,7 +147,7 @@ files:
147
147
  - app/views/accounts/_account.html.erb
148
148
  - app/views/accounts/_blank_slate.html.erb
149
149
  - app/views/accounts/_projects.html.erb
150
- - app/views/accounts/_tab_bar.html.erb
150
+ - app/views/accounts/_subnav.html.erb
151
151
  - app/views/accounts/edit.html.erb
152
152
  - app/views/accounts/index.html.erb
153
153
  - app/views/accounts/new.html.erb
@@ -163,6 +163,7 @@ files:
163
163
  - app/views/invitation_mailer/invitation.text.erb
164
164
  - app/views/invitations/new.html.erb
165
165
  - app/views/invitations/show.html.erb
166
+ - app/views/layouts/saucy.html.erb
166
167
  - app/views/memberships/edit.html.erb
167
168
  - app/views/memberships/index.html.erb
168
169
  - app/views/plans/_plan.html.erb