r5 0.3.0.0 → 0.4.0.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 403fc5eccfca585f763889f7a44d056df32eeef1
4
- data.tar.gz: 16bc2d93a43b3fdfc6026020c03773f250ab3b2d
3
+ metadata.gz: 93af2608bcdfb8cbbc70ccbf21a8cd45e6f4280f
4
+ data.tar.gz: fbedfe5803fde6f4dcc74fadcfb316f7743f7ccc
5
5
  SHA512:
6
- metadata.gz: 40944f70b4cac75a68cb574eb6e6c5baeacdcb8e86a33a847bd1970f572c90bf9e551652f81f2aa7f108cb70247c95e107a29387baabb02a8fe3f6319512d6ee
7
- data.tar.gz: '02390d5b0a2c9514ba582dfcb15c079d35e779c9821bc2ec56fa45d26ff944020c646f57019b98c1f93a6e4a974c0bf356fed78ad2ef65bc981efea293c76e0c'
6
+ metadata.gz: 812e27657b6e13c66e464095a7494424a9bcf001cedd6882f7cfc9028fc4e30a3fadfb4162bda692d57ac359d0012a3c3784dda2594f13f749ec66b5209f5fcf
7
+ data.tar.gz: 31e1e90e0b7fea5a4de1ec028f8617ed88853b7d5da85225d9713ce83bddd59f38eed2553291b232552cbcb0f12d5d2c4e89f9b4ef7530b6ac6c7d65f1f2cfb9
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
10
+ !/lib/r5/template/.ruby-version
11
+ !/lib/r5/template/.gitignore
@@ -0,0 +1,57 @@
1
+ # BOOTSRAP VERSION
2
+ copy '.ruby-version'
3
+ gsub_file "#{@project_path}/.ruby-version", /version/, RUBY_VERSION
4
+ apply 'recipes/gemfile.rb'
5
+ run 'bundle install'
6
+
7
+ copy 'config/initializers/html_helpers.rb'
8
+ copy 'config/locales/cs.yml'
9
+ copy 'app/assets/stylesheets/theme.css'
10
+ copy 'app/assets/stylesheets/custom.css.scss'
11
+ copy 'app/assets/stylesheets/timepress.css.scss'
12
+ copy 'app/assets/stylesheets/bootstrap-variables.scss'
13
+ copy 'app/assets/stylesheets/bootstrap-generators.scss'
14
+
15
+ remove 'app/views/layouts/application.html.erb'
16
+ copy 'app/views/layouts/application_bootstrap.html.erb', 'app/views/layouts/application.html.erb'
17
+
18
+ apply 'recipes/bootstrap_app.rb'
19
+ apply 'recipes/upload_app.rb'
20
+ gsub_file "#{@project_path}/lib/tasks/upload.rake", /PROJECT_DIR/, @project_name
21
+
22
+ insert_into_file "#{@project_path}/config/application.rb",
23
+ after: "class Application < Rails::Application\n" do <<-RUBY
24
+ config.assets.enabled = true
25
+ config.assets.precompile += %w()
26
+ config.i18n.default_locale = :cs
27
+ config.time_zone = 'Prague'
28
+ RUBY
29
+ end
30
+
31
+ apply 'recipes/mysql.rb'
32
+ apply 'recipes/rspec_generators.rb'
33
+ apply 'recipes/exception_notification.rb'
34
+ rake 'db:drop'
35
+ rake 'db:create'
36
+
37
+ apply 'recipes/devise.rb'
38
+ apply 'recipes/bootstrap.rb'
39
+ layout_file = "#{@project_path}/app/views/layouts/application.html.erb"
40
+ remove 'app/views/layouts/application.html.erb'
41
+ copy 'app/views/layouts/application.html.erb'
42
+ apply 'recipes/mail_settings.rb'
43
+ apply 'recipes/timepress_specifics.rb'
44
+ apply 'recipes/add_rack_mini_profiler.rb'
45
+ gsub_file layout_file, 'PROJECT_NAME', @project_name
46
+ apply 'recipes/gitignore.rb'
47
+ run 'git init'
48
+ run 'git add .'
49
+ run "git commit -a -m 'Initial commit'"
50
+
51
+ todo =
52
+ <<TEXT
53
+ Check mail configuration in config/environments/production.rb for your server
54
+ Check upload.rake task for your server
55
+ TEXT
56
+
57
+ say todo, :green
@@ -6,14 +6,15 @@ run 'bundle install'
6
6
 
7
7
  copy 'config/initializers/html_helpers.rb'
8
8
  copy 'config/locales/cs.yml'
9
- copy 'app/assets/stylesheets/theme.css'
10
- copy 'app/assets/stylesheets/custom.css.scss'
11
- copy 'app/assets/stylesheets/timepress.css.scss'
12
- copy 'app/assets/stylesheets/bootstrap-variables.scss'
13
- copy 'app/assets/stylesheets/bootstrap-generators.scss'
9
+ # copy 'app/assets/stylesheets/theme.css'
10
+ # copy 'app/assets/stylesheets/custom.css.scss'
11
+ # copy 'app/assets/stylesheets/timepress.css.scss'
12
+ # only for bootstrap
13
+ #copy 'app/assets/stylesheets/bootstrap-variables.scss'
14
+ #copy 'app/assets/stylesheets/bootstrap-generators.scss'
14
15
 
15
- remove 'app/views/layouts/application.html.erb'
16
- copy 'app/views/layouts/application.html.erb'
16
+ #remove 'app/views/layouts/application.html.erb'
17
+ copy 'app/views/layouts/application_materialize.html.erb', 'application.html.erb'
17
18
 
18
19
  apply 'recipes/bootstrap_app.rb'
19
20
  apply 'recipes/upload_app.rb'
@@ -35,7 +36,7 @@ rake 'db:drop'
35
36
  rake 'db:create'
36
37
 
37
38
  apply 'recipes/devise.rb'
38
- apply 'recipes/bootstrap.rb'
39
+ apply 'recipes/materialize.rb'
39
40
  layout_file = "#{@project_path}/app/views/layouts/application.html.erb"
40
41
  remove 'app/views/layouts/application.html.erb'
41
42
  copy 'app/views/layouts/application.html.erb'
@@ -0,0 +1,56 @@
1
+ run 'bundle install'
2
+
3
+ system "yarn add materialize-css jquery moment"
4
+
5
+ insert_into_file "#{@project_path}/app/assets/stylesheets/application.css",
6
+ before: "\n *= require_tree ." do <<-TXT
7
+
8
+ *= require materialize-css/dist/css/materialize
9
+ TXT
10
+ end
11
+
12
+ insert_into_file "#{@project_path}/app/assets/javascripts/application.js",
13
+ before: "\n//= require_tree ." do <<-TXT
14
+
15
+ //= require materialize-css/dist/js/materialize
16
+ //= require moment/min/moment-with-locales
17
+ TXT
18
+ end
19
+
20
+ insert_into_file "#{@project_path}/app/javascript/packs/application.js",
21
+ after: "console.log('Hello World from Webpacker')" do <<-JS
22
+
23
+ import jQuery from 'jquery'
24
+ window.jQuery = jQuery
25
+
26
+ let ready;
27
+ ready = function() {
28
+ $(".datepicker").datetimepicker({locale: 'cs', format: 'D. M. YYYY'});
29
+ };
30
+ // Fire javascript after turbolinks event
31
+ $(document).on('turbolinks:load', ready);
32
+ JS
33
+ end
34
+
35
+ insert_into_file "#{@project_path}/config/webpack/shared.js",
36
+ after: "new ManifestPlugin({ fileName: paths.manifest, publicPath, writeToFileEmit: true })
37
+ ]," do <<-JS
38
+
39
+ resolve: {
40
+ alias: {
41
+ jquery: "jquery/src/jquery"
42
+ }
43
+ },
44
+ JS
45
+ end
46
+
47
+ insert_into_file "#{@project_path}/config/webpack/shared.js",
48
+ after: "new ExtractTextPlugin(env.NODE_ENV === 'production' ? '[name]-[hash].css' : '[name].css')," do <<-JS
49
+
50
+ new webpack.ProvidePlugin({
51
+ $: 'jquery',
52
+ jQuery: 'jquery',
53
+ jquery: 'jquery'
54
+ }),
55
+ JS
56
+ end
data/lib/r5/starter.rb CHANGED
@@ -155,8 +155,9 @@ class Starter < Thor
155
155
  [root_path + '/template', root_path]
156
156
  end
157
157
 
158
- def copy filename
159
- copy_file filename, "#{@project_path}/#{filename}"
158
+ def copy filename, destination_name=nil
159
+ new_name = destination_name ? destination_name : filename
160
+ copy_file filename, "#{@project_path}/#{new_name}"
160
161
  end
161
162
 
162
163
  def my_directory path
@@ -0,0 +1,64 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>PROJECT_NAME</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
7
+ <meta name="description" content="">
8
+ <meta name="author" content="">
9
+
10
+ <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
11
+ <!--[if lt IE 9]>
12
+ <%= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js" %>
13
+ <![endif]-->
14
+
15
+ <%= javascript_pack_tag 'application' %>
16
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
17
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
18
+ <%= csrf_meta_tags %>
19
+ </head>
20
+ <body>
21
+ <div class="navbar navbar-default navbar-fixed-top">
22
+ <div class="container container-large">
23
+ <div class="navbar-header">
24
+ <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
25
+ <span class="sr-only">Toggle navigation</span>
26
+ <span class="icon-bar"></span>
27
+ <span class="icon-bar"></span>
28
+ <span class="icon-bar"></span>
29
+ </button>
30
+ </div>
31
+ <% if current_user %>
32
+ <div class="collapse navbar-collapse">
33
+ <ul class="nav navbar-nav">
34
+ <%= menu_item 'example', '#', /example(?!new)/ %>
35
+ </ul>
36
+ <ul class="nav navbar-nav navbar-right">
37
+ <li id="fat-menu" class="dropdown">
38
+ <a href="#" role="button" class="dropdown-toggle" data-toggle="dropdown">
39
+ <i class="icon-user"></i> <%= 'Přihlášen' %>: <%= current_user.display_name %>
40
+ <i class="icon-caret-down"></i>
41
+ </a>
42
+ <ul class="dropdown-menu">
43
+ <li><%= link_to 'Změnit heslo', {controller: 'users', action: 'edit_own_password'} , :tabindex => -1 %></li>
44
+ <li class="divider"></li>
45
+ <li><%= link_to 'Odhlásit', destroy_user_session_path, :method => :delete %></li>
46
+ </ul>
47
+ </li>
48
+ </ul>
49
+ </div>
50
+ <% end %>
51
+ </div>
52
+ </div>
53
+ <div class="container container-large content">
54
+ <% flash.each do |name, msg| %>
55
+ <%= content_tag :div, :class => "alert alert-#{ name == :error ? "danger" : "success" } alert-dismissable" do %>
56
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
57
+ <%= msg %>
58
+ <% end %>
59
+ <% end %>
60
+
61
+ <%= yield %>
62
+ </div>
63
+ </body>
64
+ </html>
@@ -0,0 +1,54 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8">
5
+ <title>PROJECT_NAME</title>
6
+ <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
7
+ <meta name="description" content="">
8
+ <meta name="author" content="">
9
+
10
+ <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
11
+ <!--[if lt IE 9]>
12
+ <%= javascript_include_tag "https://oss.maxcdn.com/libs/html5shiv/3.7.0/html5shiv.js", "https://oss.maxcdn.com/libs/respond.js/1.3.0/respond.min.js" %>
13
+ <![endif]-->
14
+
15
+ <%= javascript_pack_tag 'application' %>
16
+ <link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
17
+ <%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
18
+ <%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
19
+ <%= csrf_meta_tags %>
20
+ </head>
21
+ <body>
22
+ <% if current_user %>
23
+ <ul id="user-details" class="dropdown-content">
24
+ <li><%= link_to 'Změnit heslo', {controller: 'users', action: 'edit_own_password'} , :tabindex => -1 %></li>
25
+ <li class="divider"></li>
26
+ <li><%= link_to 'Odhlásit', destroy_user_session_path, :method => :delete %></li>
27
+ </ul>
28
+
29
+ <nav>
30
+ <div class="nav-wrapper">
31
+ <a href="#" class="brand-logo right">Logo</a>
32
+ <ul id="nav-mobile" class="hide-on-med-and-down">
33
+ <%= menu_item 'example', '#', /example(?!new)/ %>
34
+ <li><a class="dropdown-button" href="#!" data-activates="user-details">
35
+ Přihlášen: <%= current_user.display_name %><i class="material-icons right">arrow_drop_down</i>
36
+ </a>
37
+ </li>
38
+ </ul>
39
+ </div>
40
+ </nav>
41
+ <% end %>
42
+
43
+ <div class="container container-large content">
44
+ <% flash.each do |name, msg| %>
45
+ <%= content_tag :div, :class => "alert alert-#{ name == :error ? "danger" : "success" } alert-dismissable" do %>
46
+ <button type="button" class="close" data-dismiss="alert" aria-hidden="true">&times;</button>
47
+ <%= msg %>
48
+ <% end %>
49
+ <% end %>
50
+
51
+ <%= yield %>
52
+ </div>
53
+ </body>
54
+ </html>
@@ -1,4 +1,4 @@
1
- <%%= form_for(@<%= singular_table_name %>, html: { class: "form-horizontal", role: "form" }) do |f| %>
1
+ <%%= form_for(@<%= singular_table_name %>, html: { class: "col s12", role: "form" }) do |f| %>
2
2
  <%% if @<%= singular_table_name %>.errors.any? %>
3
3
  <div class="alert alert-danger alert-dismissable" role="alert">
4
4
  <button type="button" class="close" data-dismiss="alert"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
@@ -13,25 +13,23 @@
13
13
  <%% end %>
14
14
 
15
15
  <% attributes.each do |attribute| -%>
16
- <% if attribute.field_type == :date_select %>
17
- <div class="form-group">
18
- <%%= f.label :<%= attribute.name %>, class: "col-sm-2 control-label" %>
19
- <div class="col-sm-10">
20
- <%%= f.text_field :<%= attribute.name %>, class: "form-control datepicker" %>
16
+ <% if attribute.field_type == :textarea %>
17
+ <div class="row">
18
+ <div class="input-field col s12">
19
+ <%%= f.text_area :<%= attribute.name %>, class: "materialize-textarea" %>
20
+ <%%= f.label :<%= attribute.name %> %>
21
21
  </div>
22
22
  </div>
23
23
  <% else %>
24
- <div class="form-group">
25
- <%%= f.label :<%= attribute.name %>, class: "col-sm-2 control-label" %>
26
- <div class="col-sm-10">
27
- <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, class: "form-control" %>
24
+ <div class="row">
25
+ <div class="input-field col s12">
26
+ <%%= f.text_field :<%= attribute.name %> %>
27
+ <%%= f.label :<%= attribute.name %> %>
28
28
  </div>
29
29
  </div>
30
30
  <% end %>
31
31
  <% end -%>
32
- <div class="form-group">
33
- <div class="col-sm-offset-2 col-sm-10">
34
- <%%= f.submit 'Save', class: "btn btn-primary" %>
35
- </div>
32
+ <div class="row">
33
+ <%%= f.submit 'Save', class: "waves-effect waves-light btn" %>
36
34
  </div>
37
35
  <%% end %>
@@ -1,4 +1,4 @@
1
- <div class="page-header">
1
+ <div>
2
2
  <%%= delete_button @<%= singular_table_name %>, 'Do you really want to archive <%= singular_table_name %>?' %>
3
3
  <h1>Editing <%= singular_table_name %></h1>
4
4
  </div>
@@ -1,13 +1,12 @@
1
- <div class="page-header">
2
- <%%= link_to new_<%= singular_table_name %>_path, class: 'btn btn-primary' do %>
3
- <span class="glyphicon glyphicon-plus"></span>
1
+ <div>
2
+ <%%= link_to new_<%= singular_table_name %>_path, class: 'waves-effect waves-light btn' do %>
4
3
  New <%= human_name %>
5
4
  <%% end %>
6
5
  <h1>Listing <%= plural_table_name %></h1>
7
6
  </div>
8
7
 
9
- <div class="table-responsive">
10
- <table class="table table-striped table-bordered table-hover">
8
+ <div>
9
+ <table class="bordered">
11
10
  <thead>
12
11
  <tr>
13
12
  <% attributes.each do |attribute| -%>
@@ -1,4 +1,4 @@
1
- <div class="page-header">
1
+ <div>
2
2
  <h1>New <%= singular_table_name %></h1>
3
3
  </div>
4
4
 
@@ -1,10 +1,8 @@
1
- <div class="page-header">
2
- <%%= link_to <%= index_helper %>_path, class: 'btn btn-default' do %>
3
- <span class="glyphicon glyphicon-list-alt"></span>
1
+ <div>
2
+ <%%= link_to <%= index_helper %>_path, class: 'waves-effect waves-light btn' do %>
4
3
  Back
5
4
  <%% end %>
6
- <%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'btn btn-primary' do %>
7
- <span class="glyphicon glyphicon-pencil"></span>
5
+ <%%= link_to edit_<%= singular_table_name %>_path(@<%= singular_table_name %>), class: 'waves-effect waves-light btn' do %>
8
6
  Edit
9
7
  <%% end %>
10
8
  <h1>Show <%= singular_table_name %></h1>
data/lib/r5/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module R5
2
- VERSION = "0.3.0.0"
2
+ VERSION = "0.4.0.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: r5
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0.0
4
+ version: 0.4.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - mousse
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-06-20 00:00:00.000000000 Z
11
+ date: 2017-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,6 +62,7 @@ executables:
62
62
  extensions: []
63
63
  extra_rdoc_files: []
64
64
  files:
65
+ - ".gitignore"
65
66
  - Gemfile
66
67
  - README.md
67
68
  - Rakefile
@@ -70,6 +71,7 @@ files:
70
71
  - bin/setup
71
72
  - lib/r5.rb
72
73
  - lib/r5/config.rb
74
+ - lib/r5/installations/app_with_bootstrap.rb
73
75
  - lib/r5/installations/default.rb
74
76
  - lib/r5/installations/testing.rb
75
77
  - lib/r5/odin.rb
@@ -83,6 +85,7 @@ files:
83
85
  - lib/r5/recipes/install_questions.rb
84
86
  - lib/r5/recipes/lazy_high_charts.rb
85
87
  - lib/r5/recipes/mail_settings.rb
88
+ - lib/r5/recipes/materialize.rb
86
89
  - lib/r5/recipes/mysql.rb
87
90
  - lib/r5/recipes/rspec_generators.rb
88
91
  - lib/r5/recipes/timepress_specifics.rb
@@ -105,6 +108,8 @@ files:
105
108
  - lib/r5/template/app/assets/stylesheets/timepress.css.scss
106
109
  - lib/r5/template/app/controllers/users_controller.rb
107
110
  - lib/r5/template/app/views/layouts/application.html.erb
111
+ - lib/r5/template/app/views/layouts/application_bootstrap.html.erb
112
+ - lib/r5/template/app/views/layouts/application_materialize.html.erb
108
113
  - lib/r5/template/app/views/users/_form.html.erb
109
114
  - lib/r5/template/app/views/users/edit.html.erb
110
115
  - lib/r5/template/app/views/users/edit_password.html.erb