thesilverspoon 0.0.24 → 0.0.25

Sign up to get free protection for your applications and to get access to all the features.
data/README.md CHANGED
@@ -21,6 +21,10 @@ Apart from this, The Silver Spoon also extends the scaffolding in your app.
21
21
  * Apart from the standard scaffold views, it also creates an AJAX driven integrated view which combines all the standard views into one.
22
22
  * It also adds schema stubs and standard validation options (uncomment these to use) to your models.
23
23
 
24
+ ##Note
25
+ "Updated to use Bootstrap 2.0"
26
+
27
+
24
28
  ## Installation
25
29
 
26
30
 
data/README.md~ CHANGED
@@ -1,5 +1,4 @@
1
1
 
2
- #The Gem is still under development.We recommend please do not download it yet.
3
2
  # The Silver Spoon
4
3
 
5
4
  Let your Rails App be born with a silver spoon in its mouth.
@@ -9,12 +8,12 @@ This gem preps a new Rails app with some of the best Rails gems and Jquery sweet
9
8
  * <b>Rails Admin</b> for System Management : https://github.com/sferik/rails_admin
10
9
  * <b>Devise</b> for Authentication : https://github.com/plataformatec/devise
11
10
  * <b>Cancan</b> for Authorization : https://github.com/ryanb/cancan
12
- * <b>Bootstrapped</b> and <b>NiftyGenerators</b> for Interface Design : https://github.com/entropillc/bootstrapped and https://github.com/ryanb/nifty-generators
11
+ * <b>Bootstrapped</b> for Layout Design : https://github.com/entropillc/bootstrapped
12
+ * <b>NiftyGenerators</b> for Form Design : https://github.com/ryanb/nifty-generators
13
13
  * <b>Gritter</b> for Notifications : https://github.com/RobinBrouwer/gritter
14
14
  * <b>Carrierwave</b> for File Uploading : https://github.com/jnicklas/carrierwave
15
15
  * <b>Spreadsheet</b> for Excel File Handling : http://spreadsheet.rubyforge.org/
16
16
 
17
-
18
17
  The Silver Spoon takes care of the installation of these gems, and basic implementations of the functionalities. As long as you can live with the conventional defaults specified for these gems, you will be ready to go. If you need customization, you would need to understand the usage of each of these gems individually, which you will find at the respective gem homepages.
19
18
 
20
19
  Apart from this, The Silver Spoon also extends the scaffolding in your app.
@@ -22,40 +21,45 @@ Apart from this, The Silver Spoon also extends the scaffolding in your app.
22
21
  * Apart from the standard scaffold views, it also creates an AJAX driven integrated view which combines all the standard views into one.
23
22
  * It also adds schema stubs and standard validation options (uncomment these to use) to your models.
24
23
 
25
- ## Installation
26
- *Please note:
27
- Before using this gem , please copy the following in your gem file and run 'bundle install'
24
+ ##Note
25
+ "Updated to use Bootstrap 2.0"
28
26
 
29
- ```console
30
- gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
31
- ```
27
+
28
+ ## Installation
32
29
 
33
30
 
34
31
  The Silver Spoon works best if you use it in a new empty Rails App. It requires anything Rails 3.1.3 onwards.
35
32
 
36
- You can install it by simply adding the following line to your Gemfile and running bundle install:
33
+ You can install it by simply adding the following lines to your Gemfile:
37
34
 
38
35
  ```console
36
+ gem 'rails_admin', :git => 'git://github.com/sferik/rails_admin.git'
39
37
  gem 'thesilverspoon'
40
-
41
38
  ```
42
39
 
43
- After you have installed The Silver Spoon, you need to run the generator:
40
+ Now run bundle install. After you have installed The Silver Spoon, you need to run the generator:
44
41
 
45
42
  ```console
46
- rails generate thesilverspoon:install
43
+ rails generate thesilverspoon:install
47
44
  ```
48
45
 
46
+ Rails Admin will ask two questions, just press Enter to accept the defaults.
47
+ Run <b>rake db:migrate</b> <u>and</u> <b>rake db:seed</b> to finish the installation.
48
+
49
+ <b>N.B.</b> The db/seeds.rb file contains the creation code for the admin user. You can edit this before 'rake db:seed' to create your own admin credentials instead.
50
+
49
51
  ## Setup
50
52
 
51
53
  Post installation, your app will have the following:
52
54
 
53
55
  * All the gems mentioned above with standard configurations initialized.
54
56
  * A model called _'User'_ and views (in the devise directory) for you to customize
55
- * An Ability model to enable *cancan* for your authorization. You also get a admin user (email:admin@tss.com | password: secret) with administrative rights to the system. Remember to change the password before you deploy the app.
56
- * An Uploader Model in a uploaders directory and an uploading repository in /public to enable CarrierWave. You might need to install ImageMagick on your system to use photo manipulation with this feature though.
57
- * A Rails Admin interface at /administration. Use the admin user credentials to use this section
58
- * A set of basic image assets which you can replace to quickly start off your app.
57
+ * An Ability model to enable *Cancan* for your authorization. You also get a admin user (email:admin@tss.com | password: secret) with administrative rights to the system. Remember to change the password before you deploy the app.
58
+ * An Uploader Model in a uploaders directory and an uploading repository in /public to enable CarrierWave.
59
+ * A Rails Admin interface at /admin. Login with the admin user credentials to use this section
60
+ * A set of basic image assets which you can use or replace to quickly start off your app.
61
+
62
+ The root location would have been mapped to welcome#index and the relevant controller-action would have been created. Delete public/index.html to access the root location.
59
63
 
60
64
  ## Usage
61
65
 
@@ -67,19 +71,19 @@ The app has been started off with the standard Rails layout. The Silver Spoon al
67
71
  * To use the Nifty Generators style layout
68
72
 
69
73
  ```console
70
- rails generate nifty:layout
74
+ rails generate nifty:layout
71
75
  ```
72
76
 
73
77
  * To use the the Bootstrapped layout
74
78
 
75
79
  ```console
76
- rails generate bootstrapped:layout
80
+ rails generate bootstrapped:layout
77
81
  ```
78
82
 
79
83
  * To revert back to the default Rails layout
80
84
 
81
85
  ```console
82
- rails generate revert:layout
86
+ rails generate revert:layout
83
87
  ```
84
88
 
85
89
  ### Scaffolds
@@ -89,25 +93,27 @@ The Silver Spoon gives you the option of four scaffold styles:
89
93
  * To use The Silver Spoon scaffold
90
94
 
91
95
  ```console
92
- rails generate everything:scaffold Model [parameters]
96
+ rails generate everything:scaffold Model [parameters]
93
97
  ```
94
98
 
99
+ This creates a special layout for the scaffold, over-riding your application layout. Besides the standard views, you can also use an integrated view at '/tablename_integrated_view'
100
+
95
101
  * To use the Nifty Generators scaffold
96
102
 
97
103
  ```console
98
- rails generate nifty:scaffold Model [parameters]
104
+ rails generate nifty:scaffold Model [parameters]
99
105
  ```
100
106
 
101
107
  * To use the the Bootstrapped scaffold
102
108
 
103
109
  ```console
104
- rails generate bootstrapped:scaffold Model [parameters]
110
+ rails generate bootstrapped:scaffold Model [parameters]
105
111
  ```
106
112
 
107
113
  * To use the default Rails scaffold
108
114
 
109
115
  ```console
110
- rails generate scaffold Model [parameters]
116
+ rails generate scaffold Model [parameters]
111
117
  ```
112
118
 
113
119
 
@@ -1,5 +1,116 @@
1
1
  @import "bootstrap";
2
2
 
3
+ // Place all the styles related to the application here.
4
+ // They will automatically be included in application.css.
5
+ // You can use Sass (SCSS) here: http://sass-lang.com/
6
+
7
+ html, body {
8
+ background-image: url('/assets/background.jpg');
9
+ }
10
+
11
+ body {
12
+ padding-top: 22px; /* 40px to make the container go all the way to the bottom of the topbar */
13
+ }
14
+
15
+ .container > footer p {
16
+ text-align: center; /* center align it with the container */
17
+ }
18
+
19
+ .container {
20
+ /*width: 960px; *//* downsize our container to make the content feel a bit tighter and more cohesive. NOTE: this removes two full columns from the grid, meaning you only go to 14 columns and not 16. */
21
+ }
22
+
23
+ /* The white background content wrapper */
24
+ .content {
25
+ background-color: #fff;
26
+ padding: 20px;
27
+ margin: 0 -20px; /* negative indent the amount of the padding to maintain the grid system */
28
+ -webkit-border-radius: 0 0 6px 6px;
29
+ -moz-border-radius: 0 0 6px 6px;
30
+ border-radius: 0 0 6px 6px;
31
+ -webkit-box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
32
+ -moz-box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
33
+ box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
34
+ }
35
+
36
+ /* Page header tweaks */
37
+ .page-header {
38
+ background-color: #000000;
39
+ opacity: 0.6;
40
+ filter: alpha(opacity = 60); /* For IE8 and earlier */
41
+
42
+ padding: 20px 20px 10px;
43
+ /*padding: 20px;*/
44
+
45
+ margin: -20px -20px 20px;
46
+
47
+ }
48
+
49
+ .page-header h1 {
50
+ color: white;
51
+ }
52
+
53
+ /* Styles you shouldn't keep as they are for displaying this base example only */
54
+ .content .span10,
55
+ .content .span4 {
56
+ min-height: 350px;
57
+ }
58
+
59
+ /* Give a quick and non-cross-browser friendly divider */
60
+ .content .span6 {
61
+ margin-left: 0;
62
+ padding-left: 19px;
63
+ border-left: 1px solid #eee;
64
+ }
65
+
66
+ .topbar .btn {
67
+ border: 0;
68
+ }
69
+
70
+ th {
71
+ border: none;
72
+ }
73
+
74
+ a:link {
75
+ color: #556b2f;
76
+ }
77
+
78
+ a:visited {
79
+ color: #556b2f;
80
+ }
81
+
82
+ a:hover {
83
+ text-shadow: none;
84
+ background: none;
85
+ text-decoration: none;
86
+ color: #000000;
87
+ font-weight:bold;
88
+ }
89
+
90
+ .nav a:hover {
91
+ background: black;
92
+ text-decoration: none;
93
+ color: white;
94
+ }
95
+
96
+ .nav_link a:hover {
97
+ text-decoration: underline;
98
+ color: white;
99
+ }
100
+
101
+ .activate_pageslide {
102
+
103
+ }
104
+
105
+ td {
106
+ border:none;
107
+ }
108
+
109
+ tr {
110
+ border:none;
111
+ }
112
+
113
+
3
114
 
4
115
  tr.odd {
5
116
  background-color: #e3f5ac;
@@ -2,76 +2,76 @@
2
2
  <html>
3
3
  <head>
4
4
  <title>BrandName</title>
5
- <%%= stylesheet_link_tag "application" %>
6
- <%%= javascript_include_tag "application" %>
7
- <%%= csrf_meta_tags %>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
8
  <script type="text/javascript">
9
9
  $(function() {
10
- $(".edit_link").click(function(){
11
- $.get("<%%=params[:controller]%>"+"/"+$(this).attr("id")+"/edit",function(data){
10
+ $(".edit_link").click(function() {
11
+ $.get("<%=params[:controller]%>" + "/" + $(this).attr("id") + "/edit", function(data) {
12
12
 
13
13
  $("#edit_form .modal-body").html(data);
14
- $("#edit_form").modal('toggle');
14
+ $("#edit_form").modal('toggle');
15
15
  });
16
- }) ;
16
+ });
17
17
  });
18
18
  </script>
19
- <%%= yield(:head) %>
19
+ <%= yield(:head) %>
20
20
  </head>
21
21
  <body>
22
22
  <div id="wrapper">
23
- <div class="topbar" style="z-index: 999999999">
24
- <div class="fill">
23
+ <div class="navbar navbar-fixed-top" style="z-index: 999999999">
24
+ <div class="navbar-inner" style="z-index: 999999999">
25
25
  <div class="container">
26
26
  <a class="brand" href="/">BrandName</a>
27
27
  <ul class="nav">
28
- <!--<li><a href="#about" style="color:white;">About</a></li>-->
28
+ <li><a href="#about" style="color:white;">About</a></li>
29
29
  <!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
30
30
  </ul>
31
31
 
32
- <%% if !user_signed_in? %>
33
- <%%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class =>
34
- "pull-right"}) do |f| %>
35
- <%%= f.email_field :email, :class=>"input-small", :placeholder=>"Email" %>
36
- <%%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
37
- <%%= f.submit "Sign In", :class=>"primary btn" %>
38
- <%% end %>
39
- <%% else %>
40
- <div class="pull-right" style="margin-top: 10px;color:white;">
41
- <%%= current_user.email %>
32
+ <% if !user_signed_in? %>
33
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class =>
34
+ "pull-right navbar-form"}) do |f| %>
35
+ <%= f.email_field :email, :class=>"input-small", :placeholder=>"Email" %>
36
+ <%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
37
+ <%= f.submit "Sign In", :class=>"primary btn" %>
38
+ <% end %>
39
+ <% else %>
40
+ <div class="pull-right" style="margin-top: 10px;color:white;">
41
+ <%= current_user.email %>
42
42
  <span class="nav_link">
43
- | <%%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
43
+ | <%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
44
44
  </span>
45
- </div>
46
- <%% end %>
45
+ </div>
46
+ <% end %>
47
47
  </div>
48
48
  </div>
49
49
  </div>
50
50
  <div class="container">
51
51
 
52
52
  <div class="page-header" style="height:100px"></div>
53
- <div style="position:absolute;margin-top: -60px;" class="span16">
54
- <h2> <%%= yield(:page_header) %></h2>
53
+ <div style="position:absolute;margin-top: -60px;" class="span12">
54
+ <h2> <%= yield(:page_header) %></h2>
55
55
  </div>
56
56
  </div>
57
57
  <div class="container">
58
58
 
59
59
  <div class="content">
60
- <%%= js extend_gritter :position => :bottom_right %>
61
- <%%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
62
- <%%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
63
- <%%= yield %>
60
+ <%= js extend_gritter :position => :bottom_right %>
61
+ <%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
62
+ <%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
63
+ <%= yield %>
64
64
  </div>
65
65
 
66
- <%% if request.fullpath=="/" %>
66
+ <% if request.fullpath=="/" %>
67
67
 
68
-
69
68
 
70
- <%% end %>
69
+
70
+ <% end %>
71
71
  </div>
72
72
  </div>
73
73
 
74
- <%%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
74
+ <%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
75
75
 
76
76
 
77
77
  </body>
@@ -0,0 +1,87 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>BrandName</title>
5
+ <%= stylesheet_link_tag "application" %>
6
+ <%= javascript_include_tag "application" %>
7
+ <%= csrf_meta_tags %>
8
+ <script type="text/javascript">
9
+ $(function() {
10
+ $(".edit_link").click(function() {
11
+ $.get("<%=params[:controller]%>" + "/" + $(this).attr("id") + "/edit?get=1", function(data) {
12
+
13
+ $("#edit_form .modal-body").html(data);
14
+ $("#edit_form").modal('toggle');
15
+
16
+ });
17
+ });
18
+ });
19
+ </script>
20
+ <%= yield(:head) %>
21
+ <style>
22
+ table td {
23
+ border: none;
24
+ }
25
+
26
+ table tr {
27
+ border: none;
28
+ }
29
+ </style>
30
+ </head>
31
+ <body>
32
+ <div id="wrapper">
33
+ <div class="navbar navbar-fixed-top" style="z-index: 999999999">
34
+ <div class="navbar-inner" style="z-index: 999999999">
35
+ <div class="fill">
36
+ <div class="container">
37
+ <a class="brand" href="/">BrandName</a>
38
+ <ul class="nav">
39
+ <!--<li><a href="#about" style="color:white;">About</a></li>-->
40
+ <!--<li><a href="#contact" style="color:white;">Contact</a></li>-->
41
+ </ul>
42
+
43
+ <% if !user_signed_in? %>
44
+ <%= form_for(resource, :as => resource_name, :url => session_path(resource_name), :html => {:class => "pull-right"}) do |f| %>
45
+ <%= f.email_field :email, :class=>"input-small", :placeholder=>"Email" %>
46
+ <%= f.password_field :password, :class=>"input-small", :placeholder=>"Password" %>
47
+ <%= f.submit "Sign In", :class=>"primary btn" %>
48
+ <% end %>
49
+ <% else %>
50
+ <div class="pull-right" style="margin-top: 10px;color:white;">
51
+ <%= current_user.email %>
52
+ <span class="nav_link">
53
+ | <%= link_to "Sign out", destroy_user_session_path, :method => :delete, :style=>"color:white;" %>
54
+ </span>
55
+ </div>
56
+ <% end %>
57
+ </div>
58
+ </div>
59
+ </div>
60
+ </div>
61
+ <div class="container">
62
+
63
+ <div class="page-header" style="height:100px"></div>
64
+ <div style="position:absolute;margin-top: -110px;" class="span16">
65
+ <%= yield(:page_header) %>
66
+ </div>
67
+
68
+ <div class="content">
69
+ <%= js extend_gritter :position => :bottom_right %>
70
+ <%= js add_gritter(flash[:notice], :image => :success, :title => "Notice", :sticky => false, :time => 2000) %>
71
+ <%= js add_gritter(flash[:alert], :image => :warning, :title => "Alert!", :sticky => false, :time => 2000) %>
72
+ <%= yield %>
73
+ </div>
74
+
75
+ <% if request.fullpath=="/" %>
76
+
77
+
78
+
79
+ <% end %>
80
+ </div>
81
+ </div>
82
+
83
+ <%= javascript_include_tag "/assets/exclusions/jquery.pageslide" %>
84
+
85
+
86
+ </body>
87
+ </html>
@@ -1,3 +1,3 @@
1
1
  module Thesilverspoon
2
- VERSION = "0.0.24"
2
+ VERSION = "0.0.25"
3
3
  end
@@ -1,3 +1,3 @@
1
1
  module Thesilverspoon
2
- VERSION = "0.0.23"
2
+ VERSION = "0.0.24"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thesilverspoon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.24
4
+ version: 0.0.25
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-09 00:00:00.000000000Z
12
+ date: 2012-02-11 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bootstrapped
16
- requirement: &84982240 !ruby/object:Gem::Requirement
16
+ requirement: &78283780 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *84982240
24
+ version_requirements: *78283780
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: gritter
27
- requirement: &84954820 !ruby/object:Gem::Requirement
27
+ requirement: &78282930 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *84954820
35
+ version_requirements: *78282930
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: spreadsheet
38
- requirement: &84952370 !ruby/object:Gem::Requirement
38
+ requirement: &78282300 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ! '>='
@@ -43,10 +43,10 @@ dependencies:
43
43
  version: '0'
44
44
  type: :runtime
45
45
  prerelease: false
46
- version_requirements: *84952370
46
+ version_requirements: *78282300
47
47
  - !ruby/object:Gem::Dependency
48
48
  name: carrierwave
49
- requirement: &84919490 !ruby/object:Gem::Requirement
49
+ requirement: &78281630 !ruby/object:Gem::Requirement
50
50
  none: false
51
51
  requirements:
52
52
  - - ! '>='
@@ -54,10 +54,10 @@ dependencies:
54
54
  version: '0'
55
55
  type: :runtime
56
56
  prerelease: false
57
- version_requirements: *84919490
57
+ version_requirements: *78281630
58
58
  - !ruby/object:Gem::Dependency
59
59
  name: devise
60
- requirement: &84918460 !ruby/object:Gem::Requirement
60
+ requirement: &78280770 !ruby/object:Gem::Requirement
61
61
  none: false
62
62
  requirements:
63
63
  - - ! '>='
@@ -65,10 +65,10 @@ dependencies:
65
65
  version: '0'
66
66
  type: :runtime
67
67
  prerelease: false
68
- version_requirements: *84918460
68
+ version_requirements: *78280770
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: cancan
71
- requirement: &84915740 !ruby/object:Gem::Requirement
71
+ requirement: &78276660 !ruby/object:Gem::Requirement
72
72
  none: false
73
73
  requirements:
74
74
  - - ! '>='
@@ -76,10 +76,10 @@ dependencies:
76
76
  version: '0'
77
77
  type: :runtime
78
78
  prerelease: false
79
- version_requirements: *84915740
79
+ version_requirements: *78276660
80
80
  - !ruby/object:Gem::Dependency
81
81
  name: nifty-generators
82
- requirement: &84914840 !ruby/object:Gem::Requirement
82
+ requirement: &78276160 !ruby/object:Gem::Requirement
83
83
  none: false
84
84
  requirements:
85
85
  - - ! '>='
@@ -87,7 +87,7 @@ dependencies:
87
87
  version: '0'
88
88
  type: :runtime
89
89
  prerelease: false
90
- version_requirements: *84914840
90
+ version_requirements: *78276160
91
91
  description: This gem preps a new Rails app with some of the best Rails gems and Jquery
92
92
  sweetness available( Twitter-Bootstrap, Devise, CanCan, Rails Admin, Spreadsheet,
93
93
  ) Not only does it takes care of the installation of these gems, it also extends
@@ -247,6 +247,7 @@ files:
247
247
  - lib/templates/layouts/general_layout.html.erb~
248
248
  - lib/templates/layouts/information_page.html.erb
249
249
  - lib/templates/layouts/pageslide_form_at.html.erb
250
+ - lib/templates/layouts/scaffold.html.erb
250
251
  - lib/templates/layouts/welcome.html.erb
251
252
  - lib/templates/migration.rb
252
253
  - lib/templates/model.rb