saucy 0.2.45 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -3
- data/app/controllers/billings_controller.rb +1 -0
- data/app/views/accounts/{_tab_bar.html.erb → _subnav.html.erb} +3 -3
- data/app/views/accounts/edit.html.erb +1 -1
- data/app/views/billings/edit.html.erb +1 -1
- data/app/views/billings/show.html.erb +1 -1
- data/app/views/invitations/new.html.erb +1 -1
- data/app/views/layouts/saucy.html.erb +24 -0
- data/app/views/memberships/edit.html.erb +1 -1
- data/app/views/memberships/index.html.erb +1 -1
- data/app/views/projects/edit.html.erb +1 -1
- data/app/views/projects/index.html.erb +1 -1
- data/app/views/projects/new.html.erb +1 -1
- data/features/step_definitions/saucy_steps.rb +0 -11
- data/lib/generators/saucy/features/templates/features/edit_project_permissions.feature +1 -1
- data/lib/generators/saucy/features/templates/features/manage_account.feature +1 -1
- data/lib/generators/saucy/features/templates/features/manage_plan.feature +2 -2
- data/lib/saucy/layouts.rb +1 -1
- data/spec/layouts_spec.rb +3 -3
- metadata +7 -6
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
|
-
|
71
|
-
your
|
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
|
-
|
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,5 @@
|
|
1
|
-
|
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
|
-
|
10
|
+
<% end -%>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<h2>Billing Information</h2>
|
3
3
|
<% end -%>
|
4
4
|
|
5
|
-
<%= render :partial => 'accounts/
|
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/
|
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>
|
@@ -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>
|
@@ -2,7 +2,7 @@
|
|
2
2
|
<h2>Create a new project</h2>
|
3
3
|
<% end -%>
|
4
4
|
|
5
|
-
<%= render :partial => 'accounts/
|
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 ".
|
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 ".
|
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 ".
|
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 ".
|
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
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
|
10
|
-
subject.accounts.index.should == "
|
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 == '
|
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:
|
4
|
+
hash: 19
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
-
|
10
|
-
version: 0.
|
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-
|
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/
|
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
|