rails_app_generator 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
Files changed (32) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +7 -0
  3. data/after_templates/addons/rails_html_sanitizer/_.rb +15 -0
  4. data/after_templates/addons/rails_html_sanitizer/home/index.html.erb +3 -0
  5. data/after_templates/addons/{rails_html_sanitizer → rails_html_sanitizer_xxx/home}/index.html.erb +0 -0
  6. data/lib/rails_app_generator/app_generator.rb +1 -0
  7. data/lib/rails_app_generator/version.rb +1 -1
  8. data/package-lock.json +2 -2
  9. data/package.json +1 -1
  10. data/profiles/addons/rails-html-sanitizer.json +2 -2
  11. data/profiles/addons/rails_html_sanitizer.json +12 -0
  12. data/tasks/addon.thor +7 -21
  13. data/tasks/profile.thor +84 -9
  14. data/templates/thor_task/profile/{after_template.tt → after_template.rb.tt} +3 -3
  15. data/templates/thor_task/profile/home/index.html.erb.tt +3 -0
  16. data/templates/thor_task/profile/profile.json.tt +12 -0
  17. metadata +22 -18
  18. data/after_templates/addons/rails_html_sanitizer.rb +0 -15
  19. data/templates/app_x/controllers/authorized_controller.rb.erb +0 -10
  20. data/templates/app_x/controllers/errors_controller.rb.erb +0 -24
  21. data/templates/app_x/javascript/images/checkmark.svg +0 -1
  22. data/templates/app_x/javascript/images/logo.svg +0 -1
  23. data/templates/app_x/javascript/stylesheets/components.scss +0 -206
  24. data/templates/app_x/views/errors/internal_error.html.erb +0 -14
  25. data/templates/app_x/views/errors/not_found.html.erb +0 -14
  26. data/templates/app_x/views/errors/unacceptable.html.erb +0 -14
  27. data/templates/app_x/views/layouts/application.html.erb.tt +0 -30
  28. data/templates/app_x/views/pages/home.html.erb.tt +0 -20
  29. data/templates/app_x/views/shared/_flashes.html.erb.tt +0 -12
  30. data/templates/app_x/views/shared/_footer.html.erb.tt +0 -21
  31. data/templates/app_x/views/shared/_navbar.html.erb.tt +0 -55
  32. data/templates/app_x/workers/application_worker.rb +0 -5
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6ec3cdb2cbf9342e0d11d2564095d01beec1cdf4578c2b935463f1d1948d05c6
4
- data.tar.gz: 2070fd5c3e20f44048a8866de460369f151b4426c3623c28fd4aae87e3438823
3
+ metadata.gz: b44292560d4550ab186996b836d0fb0c84fb5d17ea6cf7b6c72df0c6d5fac33c
4
+ data.tar.gz: 46074355f3d140e76c0722c99111d0fccfcbc3b5cba1e6f905e76985b7629196
5
5
  SHA512:
6
- metadata.gz: 2881fdb69ec894026ecd7c0fb4bfffbb70c00fa1388d74f8ae8f913d560f878d6a54b9f1d8d987c4b30a1883c16cee35ce822e0b8505759301ee2f6458a30951
7
- data.tar.gz: c9b77351ad707f91a9d214e33f9fad4691aba37e6f1e66846c627521f7e92bb7bd27eb66b5f5772c4fa470dfb31fc8773ef3338b9cd41940a63595fd84af4fa6
6
+ metadata.gz: caf678cc3d14eadd3f04e537fba8e6bdad98f3b078d34ba449206d87902c43818bca2a0302245e227b9dc368616ace587ab200aaac1046dd41d24ea9887295f8
7
+ data.tar.gz: 9d4147b99276b596098e73931d755b0ffbbda649fd214e503b7f3476a52ea955d0dea881ea0ecbba1a1e5492e1ca84eefef542b8025fa3b0f43ee2f03aa5bed3
data/CHANGELOG.md CHANGED
@@ -1,3 +1,10 @@
1
+ ## [0.1.10](https://github.com/klueless-io/rails_app_generator/compare/v0.1.9...v0.1.10) (2022-08-02)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * refactor GemInfo ([9294d5f](https://github.com/klueless-io/rails_app_generator/commit/9294d5faff71e69f6812868c976a26171a12d4c5))
7
+
1
8
  ## [0.1.9](https://github.com/klueless-io/rails_app_generator/compare/v0.1.8...v0.1.9) (2022-08-02)
2
9
 
3
10
 
@@ -0,0 +1,15 @@
1
+ # frozen_string_literal: true
2
+
3
+ # HTML sanitization for Rails applications
4
+ require 'pry'
5
+
6
+ self.local_template_path = File.dirname(__FILE__)
7
+
8
+ gac 'base rails 7 image created'
9
+
10
+ add_controller('home', 'index')
11
+ route("root 'home#index'")
12
+
13
+ force_copy
14
+
15
+ copy_file 'home/index.html.erb', 'app/views/home/index.html.erb'
@@ -0,0 +1,3 @@
1
+ <h1>Rails html sanitizer</h1>
2
+
3
+ <h2>HTML sanitization for Rails applications</h2>
@@ -343,6 +343,7 @@ module RailsAppGenerator
343
343
  # gsub_file 'app/views/layouts/application.html.erb', %(container mx-auto mt-28 px-5 flex), 'container mx-auto px-5'
344
344
  # template 'home.css', 'app/assets/stylesheets/home.css'
345
345
 
346
+ # OLD style will be removed soon
346
347
  def local_template_base(xxx)
347
348
  File.join(File.dirname(xxx), File.basename(xxx, '.*'))
348
349
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module RailsAppGenerator
4
- VERSION = '0.1.10'
4
+ VERSION = '0.1.11'
5
5
  end
data/package-lock.json CHANGED
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "lockfileVersion": 2,
5
5
  "requires": true,
6
6
  "packages": {
7
7
  "": {
8
8
  "name": "rails_app_generator",
9
- "version": "0.1.10",
9
+ "version": "0.1.11",
10
10
  "dependencies": {
11
11
  "daisyui": "^2.20.0"
12
12
  },
data/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rails_app_generator",
3
- "version": "0.1.10",
3
+ "version": "0.1.11",
4
4
  "description": "Create new Rails Application with custom opinions",
5
5
  "scripts": {
6
6
  "release": "semantic-release"
@@ -1,12 +1,12 @@
1
1
  {
2
2
  "args": {
3
- "app_path": "rails-html-sanitizer",
3
+ "app_path": "rails_html_sanitizer",
4
4
  "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
5
5
  },
6
6
  "opts": {
7
7
  "skip_git": true,
8
8
  "skip_test": true,
9
- "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/rails_html_sanitizer.rb",
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/rails_html_sanitizer/_.rb",
10
10
  "add_rails_html_sanitizer": true
11
11
  }
12
12
  }
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "rails_html_sanitizer",
4
+ "destination_root": "/Users/davidcruwys/dev/kgems/rails_app_generator/a/addons"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "/Users/davidcruwys/dev/kgems/rails_app_generator/after_templates/addons/rails_html_sanitizer/_.rb",
10
+ "add_rails_html_sanitizer": true
11
+ }
12
+ }
data/tasks/addon.thor CHANGED
@@ -40,32 +40,18 @@ class AddOn < Thor
40
40
  end
41
41
 
42
42
  def build_required_gem_code
43
- return nil unless options[:gem]
44
-
45
- gem_name = options[:gem] == 'gem' ? name : options[:gem]
46
-
47
- info = gem_info(gem_name)
43
+ info = gem_info
48
44
 
49
45
  " required_gem gem.version('#{info.name}', '#{info.version}', '#{info.description}')"
50
46
  end
51
47
 
52
48
  # example: 'https://rubygems.org/api/v1/gems/draper.json'
53
- def gem_info(name)
54
- link = "https://rubygems.org/api/v1/gems/#{name.downcase}.json"
55
- info = Net::HTTP.get(URI.parse(link))
56
- json = JSON.parse(info)
57
-
58
- GemInfo.new(
59
- name: json['name'],
60
- version: json['version'],
61
- description: json['info']
62
- )
63
- rescue SocketError
64
- abort 'Internet connection cannot be established to RubyGems.org'
65
- rescue JSON::ParserError
66
- abort "Check you have entered the right Gem name\n#{link}"
49
+ def gem_info
50
+ return nil unless options[:gem]
51
+
52
+ gem_name = options[:gem] == 'gem' ? name : options[:gem]
53
+
54
+ ::GemInfo.get(gem_name)
67
55
  end
68
56
  end
69
57
  end
70
- # /Users/davidcruwys/dev/kgems/rails_app_generator/templates/thor/addon
71
- # /Users/davidcruwys/dev/kgems/rails_app_generator/lib/templates/thor
data/tasks/profile.thor CHANGED
@@ -3,37 +3,112 @@
3
3
  # https://codecrate.com/2014/01/replace-rake-with-thor.html
4
4
 
5
5
  require 'pry'
6
+ require_relative 'gem_info'
7
+ require 'cmdlet'
8
+
6
9
  # Thor task to create a new Profile for Rails App Generator
7
10
  class Profile < Thor
8
11
  include Thor::Actions
9
12
 
10
13
  source_root(File.expand_path('../templates/thor_task', File.dirname(__FILE__)))
11
14
 
12
- attr_accessor :name
15
+ Data = Struct.new(
16
+ :name,
17
+ :name_dash,
18
+ :name_snake,
19
+ :name_human,
20
+ :description,
21
+ :destination_root,
22
+ :template_file,
23
+ keyword_init: true
24
+ )
25
+
26
+ attr_accessor :data
13
27
 
14
28
  desc 'new', 'Create a new Profile for testing Rails App Generator settings'
15
- method_option :variant, type: :string, default: 'default', desc: 'Profile variant to create, valid values are (default, addon)'
29
+ method_option :variant, type: :string, default: 'default', desc: 'Profile variant to create, valid values are (nil, addons)'
16
30
  method_option :gem, type: :string, default: nil, desc: 'Gem name is looked up to find version and description'
17
31
  method_option :force, type: :boolean, default: false, desc: 'Overwrite existing files'
32
+ # rubocop:disable Metrics/AbcSize
18
33
  def new(name)
19
- self.name = name
34
+ @data = build_data(name)
20
35
 
21
36
  say "Creating profile #{name}"
22
37
  puts "Variant: #{options[:variant]}"
23
38
 
24
- gi = gem_info
25
- gi&.debug
26
-
27
- # template('profile/profile', "lib/rails_app_generator/profiles/#{name}.rb", force: options[:force])
39
+ template('profile/profile.json', profile_path("#{data.name_dash}.json"), force: options[:force])
40
+ template('profile/after_template.rb', after_template_path('_.rb'), force: options[:force])
41
+ template('profile/home/index.html.erb', after_template_path('home/index.html.erb'), force: options[:force])
28
42
  end
43
+ # rubocop:enable Metrics/AbcSize
29
44
 
45
+ # rubocop:disable Metrics/BlockLength
30
46
  no_commands do
31
- def gem_info
47
+ def human(value)
48
+ Cmdlet::Case::Human.new.call(value)
49
+ end
50
+
51
+ def dash(value)
52
+ Cmdlet::Case::Dash.new.call(value)
53
+ end
54
+
55
+ def snake(value)
56
+ Cmdlet::Case::Snake.new.call(value)
57
+ end
58
+
59
+ def profile_path(file)
60
+ path = 'profiles'
61
+ path = File.join(path, options[:variant]) if options[:variant]
62
+ File.join(path, file)
63
+ end
64
+
65
+ def after_template_path(file)
66
+ path = 'after_templates'
67
+ path = File.join(path, options[:variant]) if options[:variant]
68
+ path = File.join(path, data.name_snake)
69
+ File.join(path, file)
70
+ end
71
+
72
+ def build_data(name)
73
+ gi = gem_info(name)
74
+
75
+ name_dash = dash(name)
76
+ name_snake = snake(name)
77
+ description = gi ? gi.description : 'Description goes here'
78
+
79
+ Data.new(
80
+ name: name,
81
+ name_dash: name_dash,
82
+ name_snake: name_snake,
83
+ name_human: human(name_dash),
84
+ description: description,
85
+ destination_root: build_destination_root,
86
+ template_file: build_template_file(name_snake)
87
+ )
88
+ end
89
+
90
+ def build_template_file(name_snake)
91
+ path = '~/dev/kgems/rails_app_generator/after_templates/'
92
+ path = File.join(path, options[:variant]) if options[:variant]
93
+ path = File.join(path, "#{name_snake}/_.rb")
94
+ File.expand_path(path)
95
+ end
96
+
97
+ def build_destination_root
98
+ # Do not use destination_root as the method name because it already exists on Thor::Actions
99
+ path = '~/dev/kgems/rails_app_generator/a/'
100
+ path = File.join(path, options[:variant]) if options[:variant]
101
+ File.expand_path(path)
102
+ end
103
+
104
+ # example: 'https://rubygems.org/api/v1/gems/draper.json'
105
+ def gem_info(name)
32
106
  return nil unless options[:gem]
33
107
 
34
108
  gem_name = options[:gem] == 'gem' ? name : options[:gem]
35
109
 
36
- GemInfo.create(gem_name)
110
+ GemInfo.get(gem_name)
37
111
  end
38
112
  end
113
+ # rubocop:enable Metrics/BlockLength
39
114
  end
@@ -1,9 +1,9 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- # Description goes here
3
+ # <%= data.description %>
4
4
  require 'pry'
5
5
 
6
- self.local_template_path = local_template_base(__FILE__)
6
+ self.local_template_path = File.dirname(__FILE__)
7
7
 
8
8
  gac 'base rails 7 image created'
9
9
 
@@ -12,4 +12,4 @@ route("root 'home#index'")
12
12
 
13
13
  force_copy
14
14
 
15
- copy_file 'index.html.erb', 'app/views/home/index.html.erb'
15
+ copy_file 'home/index.html.erb', 'app/views/home/index.html.erb'
@@ -0,0 +1,3 @@
1
+ <h1><%= data.name_human %></h1>
2
+
3
+ <h2><%= data.description %></h2>
@@ -0,0 +1,12 @@
1
+ {
2
+ "args": {
3
+ "app_path": "<%= data.name_snake %>",
4
+ "destination_root": "<%= data.destination_root %>"
5
+ },
6
+ "opts": {
7
+ "skip_git": true,
8
+ "skip_test": true,
9
+ "template": "<%= data.template_file %>",
10
+ "add_<%= data.name_snake %>": true
11
+ }
12
+ }
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rails_app_generator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - David Cruwys
@@ -122,6 +122,20 @@ dependencies:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
124
  version: '0'
125
+ - !ruby/object:Gem::Dependency
126
+ name: cmdlet
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '0'
132
+ type: :runtime
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '0'
125
139
  description: " Create new Rails Application with custom opinions\n"
126
140
  email:
127
141
  - david@ideasmen.com.au
@@ -146,8 +160,9 @@ files:
146
160
  - README.md
147
161
  - Rakefile
148
162
  - after_templates/README.md
149
- - after_templates/addons/rails_html_sanitizer.rb
150
- - after_templates/addons/rails_html_sanitizer/index.html.erb
163
+ - after_templates/addons/rails_html_sanitizer/_.rb
164
+ - after_templates/addons/rails_html_sanitizer/home/index.html.erb
165
+ - after_templates/addons/rails_html_sanitizer_xxx/home/index.html.erb
151
166
  - after_templates/rag_bootstrap.rb
152
167
  - after_templates/rag_bootstrap/application-yield.html.erb
153
168
  - after_templates/rag_bootstrap/application.html.erb
@@ -339,6 +354,7 @@ files:
339
354
  - package-lock.json
340
355
  - package.json
341
356
  - profiles/addons/rails-html-sanitizer.json
357
+ - profiles/addons/rails_html_sanitizer.json
342
358
  - profiles/rag-add-some-pages.json
343
359
  - profiles/rag-bootstrap.json
344
360
  - profiles/rag-devise.json
@@ -398,22 +414,10 @@ files:
398
414
  - templates/addons/scaffold/lib/templates/erb/scaffold/new.html.erb
399
415
  - templates/addons/scaffold/lib/templates/erb/scaffold/show.html.erb
400
416
  - templates/addons/services/app/services/application_service.rb
401
- - templates/app_x/controllers/authorized_controller.rb.erb
402
- - templates/app_x/controllers/errors_controller.rb.erb
403
- - templates/app_x/javascript/images/checkmark.svg
404
- - templates/app_x/javascript/images/logo.svg
405
- - templates/app_x/javascript/stylesheets/components.scss
406
- - templates/app_x/views/errors/internal_error.html.erb
407
- - templates/app_x/views/errors/not_found.html.erb
408
- - templates/app_x/views/errors/unacceptable.html.erb
409
- - templates/app_x/views/layouts/application.html.erb.tt
410
- - templates/app_x/views/pages/home.html.erb.tt
411
- - templates/app_x/views/shared/_flashes.html.erb.tt
412
- - templates/app_x/views/shared/_footer.html.erb.tt
413
- - templates/app_x/views/shared/_navbar.html.erb.tt
414
- - templates/app_x/workers/application_worker.rb
415
417
  - templates/thor_task/addon/addon.tt
416
- - templates/thor_task/profile/after_template.tt
418
+ - templates/thor_task/profile/after_template.rb.tt
419
+ - templates/thor_task/profile/home/index.html.erb.tt
420
+ - templates/thor_task/profile/profile.json.tt
417
421
  homepage: http://appydave.com/gems/rails_app_generator
418
422
  licenses:
419
423
  - MIT
@@ -1,15 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # Rails HTML Sanitizer is responsible for sanitizing HTML fragments in Rails applications, i.e. in the sanitize, sanitize_css, strip_tags and strip_links methods.
4
- require 'pry'
5
-
6
- self.local_template_path = local_template_base(__FILE__)
7
-
8
- gac 'base rails 7 image created'
9
-
10
- add_controller('home', 'index')
11
- route("root 'home#index'")
12
-
13
- force_copy
14
-
15
- copy_file 'index.html.erb', 'app/views/home/index.html.erb'
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class AuthorizedController < ApplicationController
4
- include Pundit
5
-
6
- before_action :authenticate_user!
7
-
8
- after_action :verify_authorized, except: :index
9
- after_action :verify_policy_scoped, only: :index
10
- end
@@ -1,24 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ErrorsController < ApplicationController
4
- def not_found
5
- respond_to do |format|
6
- format.html { render status: 404 }
7
- format.json { render json: { error: 'Resource not found' }, status: 404 }
8
- end
9
- end
10
-
11
- def unacceptable
12
- respond_to do |format|
13
- format.html { render status: 422 }
14
- format.json { render json: { error: 'Params unacceptable' }, status: 422 }
15
- end
16
- end
17
-
18
- def internal_error
19
- respond_to do |format|
20
- format.html { render status: 500 }
21
- format.json { render json: { error: 'Internal server error' }, status: 500 }
22
- end
23
- end
24
- end
@@ -1 +0,0 @@
1
- <svg fill="#fff" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M0 11l2-2 5 5L18 3l2 2L7 18z"/></svg>
@@ -1 +0,0 @@
1
- <?xml version="1.0" encoding="utf-8"?><svg version="1.1" id="Layer_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px" viewBox="0 0 92.81 122.88" style="enable-background:new 0 0 92.81 122.88" xml:space="preserve"><style type="text/css">.st0{fill-rule:evenodd;clip-rule:evenodd;}</style><g><path class="st0" d="M66.69,101.35H26.68l-4.7,6.94h49.24L66.69,101.35L66.69,101.35z M17.56,114.81l-5.47,8.07H0l19.64-29.46 h-3.49c-4.76,0-8.66-3.9-8.66-8.66V8.66C7.5,3.9,11.39,0,16.15,0h61.22c4.76,0,8.66,3.9,8.66,8.66v76.1c0,4.76-3.9,8.66-8.66,8.66 h-3.4l18.83,29.04H80.45l-4.99-7.65H17.56L17.56,114.81z M62.97,67.66h10.48c1.14,0,2.07,0.93,2.07,2.07V80.2 c0,1.14-0.93,2.07-2.07,2.07H62.97c-1.14,0-2.07-0.93-2.07-2.07V69.72C60.9,68.59,61.83,67.66,62.97,67.66L62.97,67.66z M18.98,67.66h10.48c1.14,0,2.07,0.93,2.07,2.07V80.2c0,1.14-0.93,2.07-2.07,2.07H18.98c-1.14,0-2.07-0.93-2.07-2.07V69.72 C16.91,68.59,17.84,67.66,18.98,67.66L18.98,67.66z M25.1,16.7h42.81c4.6,0,8.36,3.76,8.36,8.37v13.17c0,4.6-3.76,8.36-8.36,8.36 H25.1c-4.6,0-8.36-3.76-8.36-8.36V25.07C16.74,20.47,20.5,16.7,25.1,16.7L25.1,16.7z M38.33,3.8h16.2C55.34,3.8,56,4.46,56,5.27 v6.38c0,0.81-0.66,1.47-1.47,1.47h-16.2c-0.81,0-1.47-0.66-1.47-1.47V5.27C36.85,4.46,37.51,3.8,38.33,3.8L38.33,3.8z"/></g></svg>
@@ -1,206 +0,0 @@
1
-
2
- .btn {
3
- @apply font-normal text-base rounded cursor-pointer border border-transparent appearance-none inline-block select-none leading-normal antialiased align-baseline;
4
-
5
- padding: 0.35rem 0.75rem;
6
- transition: 0.15s ease;
7
-
8
- }
9
-
10
- .btn-default {
11
- @apply bg-white border border-gray-400 text-gray-700;
12
-
13
- &:hover,
14
- &:focus {
15
- @apply border-gray-700;
16
- }
17
- }
18
-
19
- .btn-blue {
20
- @apply bg-blue-600 text-white;
21
-
22
- &:hover,
23
- &:focus {
24
- @apply bg-blue-700;
25
- }
26
-
27
- &.btn-outline {
28
- @apply bg-transparent text-blue-600 border border-blue-600;
29
-
30
- &:hover,
31
- &:focus {
32
- @apply bg-blue-600 text-white;
33
- }
34
- }
35
- }
36
-
37
- .btn-group {
38
- .btn {
39
- @apply rounded-none;
40
-
41
- &:first-child {
42
- @apply rounded-tr-none rounded-br-none border-r-0 rounded-tl rounded-bl;
43
- }
44
-
45
- &:last-child {
46
- @apply rounded-tl-none rounded-bl-none border-l-0 rounded-tr rounded-br;
47
- }
48
- }
49
- }
50
-
51
- %focus-style {
52
- @apply shadow outline-none border-gray-500;
53
-
54
- box-shadow: 0 0 0 0.2rem theme("colors.gray.200");
55
- background-clip: padding-box;
56
- }
57
-
58
- .input {
59
- @apply appearance-none block w-full text-gray-700 border border-gray-400 rounded px-3 leading-tight bg-white shadow-inner;
60
- padding-top: .65rem;
61
- padding-bottom: .65rem;
62
- }
63
-
64
- .input:focus,
65
- .input:hover {
66
- @extend %focus-style;
67
- }
68
-
69
- .label {
70
- @apply block text-gray-700 text-sm font-bold mb-2;
71
- }
72
-
73
- .select {
74
- @apply appearance-none py-3 px-4 pr-8 block w-full bg-white border border-gray-300 text-gray-700 rounded leading-tight;
75
- -webkit-appearance: none;
76
-
77
- }
78
-
79
- .select:focus {
80
- @apply outline-none border-gray-400;
81
-
82
- box-shadow: 0 0 0 0.2rem theme("colors.gray.100");
83
- background-clip: padding-box;
84
- }
85
-
86
- .caret {
87
- @apply pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-800;
88
- }
89
-
90
- .input-group {
91
- @apply mb-6;
92
- }
93
-
94
- .input-file {
95
- height: auto;
96
- z-index: 2;
97
- cursor: pointer;
98
-
99
- @apply inline-block opacity-0 pl-0 pr-0 py-3 px-3 overflow-hidden absolute border-none;
100
-
101
- + label {
102
- @extend .btn;
103
- @extend .btn-default;
104
-
105
- @apply cursor-pointer inline-flex items-center justify-start w-auto;
106
-
107
- * {
108
- pointer-events: none;
109
- }
110
-
111
- &:focus {
112
- outline: 1px dotted #000;
113
- outline: -webkit-focus-ring-color auto 5px;
114
- }
115
- }
116
- }
117
-
118
- .input-checkbox {
119
- @apply flex items-center justify-start;
120
-
121
- input[type="checkbox"] {
122
- @apply hidden appearance-none;
123
-
124
- &:checked ~ label:before {
125
- content: "";
126
- background-image: url('~images/checkmark.svg');
127
- background-size: 10px 10px;
128
- border-radius: 2px;
129
- @apply bg-blue-500 border-transparent text-white bg-no-repeat bg-center transition ease-in-out duration-100 shadow-none;
130
- }
131
-
132
- &:disabled {
133
- @apply pointer-events-none opacity-50;
134
- }
135
- }
136
-
137
- label {
138
- @apply cursor-pointer appearance-none;
139
-
140
- &:before {
141
- border-radius: 2px;
142
- border: 1px solid rgb(209, 209, 209);
143
- box-shadow: inset 0 1px 1px rgba(#ddd, .8);
144
- content: "";
145
- height: 16px;
146
- margin-right: 10px;
147
- top: -5px;
148
- width: 16px;
149
-
150
- @apply bg-white inline-flex items-center justify-center relative transition ease-in-out duration-200;
151
-
152
- }
153
-
154
- &:hover::before {
155
- @apply bg-gray-100 border-gray-500;
156
- }
157
- }
158
- }
159
-
160
- .input-radio {
161
- @apply flex items-center justify-start;
162
-
163
- input[type="radio"] {
164
- @apply hidden appearance-none;
165
-
166
- &:checked ~ label:before {
167
- content: "";
168
- @apply bg-blue-500 border-transparent text-white transition ease-in-out duration-100 shadow-none;
169
- }
170
-
171
- &:checked ~ label:after {
172
- @apply bg-white rounded-full;
173
- content: "";
174
- width: 6px;
175
- height: 6px;
176
- position: absolute;
177
- top: 8px;
178
- left: 5px;
179
- box-shadow: 0 1px 1px rgba(#2B6CB0, .9);
180
- }
181
-
182
- &:disabled {
183
- @apply pointer-events-none opacity-50;
184
- }
185
- }
186
-
187
- label {
188
- @apply cursor-pointer appearance-none relative;
189
-
190
- &:before {
191
- border: 1px solid rgb(209, 209, 209);
192
- box-shadow: inset 0 1px 1px rgba(#ddd, .8);
193
- content: "";
194
- height: 16px;
195
- margin-right: 4px;
196
- top: -5px;
197
- width: 16px;
198
-
199
- @apply bg-white inline-flex items-center justify-center relative transition ease-in-out duration-200 rounded-full;
200
- }
201
-
202
- &:hover::before {
203
- @apply bg-gray-100 border-gray-500;
204
- }
205
- }
206
- }
@@ -1,14 +0,0 @@
1
- <div class="container mx-auto px-4">
2
- <section class="py-8 px-4 text-center">
3
- <div class="max-w-auto mx-auto">
4
- <div class="md:max-w-lg mx-auto flex justify-center">
5
- <svg class="fill-current text-gray-300 h-48" viewBox="0 0 445 202" xmlns="http://www.w3.org/2000/svg">
6
- <path d="M38.804 144.71c1.527 8.356 4.447 14.803 8.76 19.34 4.312 4.537 10.601 6.805 18.867 6.805 9.523 0 16.778-3.346 21.764-10.04 4.987-6.693 7.48-15.116 7.48-25.268 0-9.973-2.336-18.396-7.008-25.269-4.672-6.873-11.95-10.31-21.832-10.31-4.672 0-8.715.585-12.129 1.753-6.02 2.156-10.557 6.154-13.611 11.994l-34.5-1.617L20.34 4.15h107.678v32.614H48.103l-7.008 42.72c5.93-3.863 10.556-6.423 13.88-7.681 5.57-2.067 12.354-3.1 20.35-3.1 16.172 0 30.277 5.436 42.317 16.307 12.039 10.87 18.058 26.683 18.058 47.437 0 18.059-5.795 34.186-17.385 48.381-11.59 14.196-28.93 21.293-52.02 21.293-18.597 0-33.87-4.986-45.82-14.959C8.527 177.19 1.879 163.04.53 144.711h38.274zm155.789-43.528c0 22.46 1.842 39.643 5.525 51.547 3.684 11.905 11.23 17.857 22.64 17.857 11.411 0 18.89-5.952 22.44-17.857 3.548-11.904 5.323-29.086 5.323-51.547 0-23.54-1.775-40.97-5.324-52.29s-11.028-16.98-22.438-16.98c-11.41 0-18.957 5.66-22.64 16.98-3.684 11.32-5.526 28.75-5.526 52.29zM222.759.242c24.887 0 42.339 8.76 52.356 26.28 10.018 17.52 15.027 42.406 15.027 74.66s-5.01 57.095-15.027 74.525c-10.017 17.43-27.47 26.145-52.356 26.145-24.887 0-42.339-8.715-52.357-26.145-10.017-17.43-15.026-42.271-15.026-74.525 0-32.254 5.009-57.14 15.026-74.66C180.42 9.001 197.872.241 222.76.241zm125.332 100.94c0 22.46 1.842 39.643 5.525 51.547 3.684 11.905 11.23 17.857 22.64 17.857 11.411 0 18.89-5.952 22.44-17.857 3.548-11.904 5.323-29.086 5.323-51.547 0-23.54-1.775-40.97-5.324-52.29s-11.028-16.98-22.438-16.98c-11.41 0-18.957 5.66-22.64 16.98-3.684 11.32-5.526 28.75-5.526 52.29zM376.257.242c24.887 0 42.339 8.76 52.356 26.28 10.018 17.52 15.027 42.406 15.027 74.66s-5.01 57.095-15.027 74.525c-10.017 17.43-27.47 26.145-52.356 26.145-24.887 0-42.339-8.715-52.357-26.145-10.017-17.43-15.026-42.271-15.026-74.525 0-32.254 5.009-57.14 15.026-74.66C333.918 9.001 351.37.241 376.257.241z" fill-rule="nonzero"/>
7
- </svg>
8
- </div>
9
- <h2 class="mt-8 uppercase text-xl lg:text-5xl font-black">Something went terribly wrong</h2>
10
- <p class="mt-6 text-sm lg:text-base text-gray-900">If you are the application owner check the logs for more information.</p>
11
- <a href="/" class="mt-12 btn btn-default">Back To Homepage</a>
12
- </div>
13
- </section>
14
- </div>
@@ -1,14 +0,0 @@
1
- <div class="container mx-auto px-4">
2
- <section class="py-8 px-4 text-center">
3
- <div class="max-w-auto mx-auto">
4
- <div class="md:max-w-lg mx-auto flex justify-center">
5
- <svg class="fill-current text-gray-300 h-48" viewBox="0 0 445 202" xmlns="http://www.w3.org/2000/svg">
6
- <path d="M137.587 154.953h-22.102V197h-37.6v-42.047H.53v-33.557L72.36 2.803h43.125V124.9h22.102v30.053zM77.886 124.9V40.537L28.966 124.9h48.92zm116.707-23.718c0 22.46 1.842 39.643 5.525 51.547 3.684 11.905 11.23 17.857 22.64 17.857 11.411 0 18.89-5.952 22.44-17.857 3.548-11.904 5.323-29.086 5.323-51.547 0-23.54-1.775-40.97-5.324-52.29s-11.028-16.98-22.438-16.98c-11.41 0-18.957 5.66-22.64 16.98-3.684 11.32-5.526 28.75-5.526 52.29zM222.759.242c24.887 0 42.339 8.76 52.356 26.28 10.018 17.52 15.027 42.406 15.027 74.66s-5.01 57.095-15.027 74.525c-10.017 17.43-27.47 26.145-52.356 26.145-24.887 0-42.339-8.715-52.357-26.145-10.017-17.43-15.026-42.271-15.026-74.525 0-32.254 5.009-57.14 15.026-74.66C180.42 9.001 197.872.241 222.76.241zm221.824 154.711h-22.102V197h-37.6v-42.047h-77.355v-33.557l71.83-118.593h43.125V124.9h22.102v30.053zM384.882 124.9V40.537l-48.92 84.363h48.92z" fill-rule="nonzero" />
7
- </svg>
8
- </div>
9
- <h2 class="mt-8 uppercase text-xl lg:text-5xl font-black">Page not found</h2>
10
- <p class="mt-6 text-sm lg:text-base text-gray-900">The page you are looking for might have been removed had its name changed or is temporarily unavailable.</p>
11
- <a href="/" class="mt-12 btn btn-default">Back To Homepage</a>
12
- </div>
13
- </section>
14
- </div>
@@ -1,14 +0,0 @@
1
- <div class="container mx-auto px-4">
2
- <section class="py-8 px-4 text-center">
3
- <div class="max-w-auto mx-auto">
4
- <div class="md:max-w-lg mx-auto flex justify-center">
5
- <svg class="fill-current text-gray-300 h-48" viewBox="0 0 445 202" xmlns="http://www.w3.org/2000/svg">
6
- <path d="M137.587 154.953h-22.102V197h-37.6v-42.047H.53v-33.557L72.36 2.803h43.125V124.9h22.102v30.053zM77.886 124.9V40.537L28.966 124.9h48.92zm77.49 72.1c.36-14.016 3.37-26.818 9.03-38.408 5.48-13.028 18.417-26.818 38.812-41.373 17.7-12.668 29.154-21.742 34.365-27.223 7.996-8.535 11.994-17.879 11.994-28.031 0-8.266-2.29-15.139-6.873-20.62-4.582-5.48-11.14-8.22-19.676-8.22-11.68 0-19.63 4.357-23.853 13.072-2.426 5.032-3.863 13.028-4.313 23.989h-37.33c.63-16.622 3.639-30.053 9.03-40.295C176.804 10.394 194.997.646 221.142.646c20.664 0 37.105 5.728 49.324 17.183 12.219 11.455 18.328 26.616 18.328 45.483 0 14.465-4.313 27.313-12.938 38.543-5.66 7.458-14.958 15.768-27.896 24.932l-15.363 10.916c-9.614 6.828-16.195 11.77-19.743 14.824a43.443 43.443 0 00-8.962 10.647h85.306V197H155.376zm153.498 0c.36-14.016 3.37-26.818 9.03-38.408 5.48-13.028 18.417-26.818 38.812-41.373 17.7-12.668 29.154-21.742 34.365-27.223 7.996-8.535 11.994-17.879 11.994-28.031 0-8.266-2.29-15.139-6.873-20.62-4.582-5.48-11.14-8.22-19.676-8.22-11.68 0-19.63 4.357-23.853 13.072-2.426 5.032-3.863 13.028-4.313 23.989h-37.33c.63-16.622 3.639-30.053 9.03-40.295C330.302 10.394 348.495.646 374.64.646c20.664 0 37.105 5.728 49.324 17.183 12.219 11.455 18.328 26.616 18.328 45.483 0 14.465-4.312 27.313-12.938 38.543-5.66 7.458-14.958 15.768-27.896 24.932l-15.363 10.916c-9.614 6.828-16.195 11.77-19.743 14.824a43.443 43.443 0 00-8.962 10.647h85.306V197H308.874z" fill-rule="nonzero"/>
7
- </svg>
8
- </div>
9
- <h2 class="mt-8 uppercase text-xl lg:text-5xl font-black">The change you wanted was rejected</h2>
10
- <p class="mt-6 text-sm lg:text-base text-gray-900">Maybe you tried to change something you didn't have access to?</p>
11
- <a href="/" class="mt-12 btn btn-default">Back To Homepage</a>
12
- </div>
13
- </section>
14
- </div>
@@ -1,30 +0,0 @@
1
- <!DOCTYPE html>
2
- <html>
3
- <head>
4
- <title><%= camelized %></title>
5
- <meta name="viewport" content="width=device-width,initial-scale=1">
6
- <%%= csrf_meta_tags %>
7
- <%%= csp_meta_tag %>
8
-
9
- <%- if options[:skip_javascript] -%>
10
- <%%= stylesheet_link_tag 'application' %>
11
- <%- else -%>
12
- <%- unless options[:skip_turbolinks] -%>
13
- <%%= stylesheet_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
14
- <%%= javascript_pack_tag 'application', 'data-turbolinks-track': 'reload' %>
15
- <%- else -%>
16
- <%%= stylesheet_pack_tag 'application' %>
17
- <%%= javascript_pack_tag 'application' %>
18
- <%- end -%>
19
- <%- end -%>
20
- </head>
21
-
22
- <body class="flex flex-col min-h-screen">
23
- <%%= render 'shared/navbar' %>
24
- <%%= render 'shared/flashes' %>
25
- <main class="flex-grow">
26
- <%%= yield %>
27
- </main>
28
- <%%= render 'shared/footer' %>
29
- </body>
30
- </html>
@@ -1,20 +0,0 @@
1
- <div class="py-20 bg-gray-100">
2
- <div class="container mx-auto px-6">
3
- <h2 class="text-6xl font-bold mb-2">
4
- <%= camelized %>
5
- </h2>
6
- <h3 class="text-2xl mb-8 text-gray-800">
7
- Created with <a class="underline" href="https://github.com/hschne/schienenzeppelin">Schienenzeppelin</a>
8
- </h3>
9
- <button class="btn btn-blue">
10
- View Documentation
11
- </button>
12
- </div>
13
- </div>
14
-
15
- <section class="container mx-auto px-6 p-10 text-center">
16
- <h2 class="text-2xl font-bold text-gray-800 mb-2">Ready to do some magic?</h2>
17
- <p>Edit this page in <code class="bg-gray-100">app/views/pages/home.html.erb</code></p>
18
- </section>
19
-
20
-
@@ -1,12 +0,0 @@
1
- <%% flash.each do |type, message| %>
2
- <%% if type == "alert" %>
3
- <div class="bg-red-500">
4
- <div class="container px-2 py-4 mx-auto font-sans font-medium text-center text-white"><%%= message %></div>
5
- </div>
6
- <%% end %>
7
- <%% if type == "notice" %>
8
- <div class="bg-green-500">
9
- <div class="container px-2 py-4 mx-auto font-sans font-medium text-center text-white"><%%= message %></div>
10
- </div>
11
- <%% end %>
12
- <%% end %>
@@ -1,21 +0,0 @@
1
- <footer class="bg-gray-100">
2
- <div class="container mx-auto px-8">
3
-
4
- <div class="w-full flex py-6 justify-between">
5
- <div class="flex align-middle">
6
- © <%%= Date.current.year %> <%= app_name.capitalize %>
7
- </div>
8
- <div class="flex w-1/3 justify-end">
9
- <ul class="list-reset w-full flex justify-around align-middle items-center mb-6">
10
- <li class="mt-2 mr-2 md:mr-0">
11
- <a href="#" class="no-underline hover:underline">About</a>
12
- </li>
13
- <li class="mt-2 mr-2 md:mr-0">
14
- <a href="#" class="no-underline hover:underline">Contact</a>
15
- </li>
16
- </ul>
17
- </div>
18
- </div>
19
- </div>
20
- </footer>
21
-
@@ -1,55 +0,0 @@
1
- <header class="shadow">
2
- <nav
3
- <%-if uses?(:stimulus_components) -%>
4
- data-controller="dropdown"
5
- <%- end -%>
6
- class="container mx-auto flex flex-wrap justify-between items-center p-5">
7
- <div>
8
- <a
9
- class="flex items-center mr-2"
10
- <%- if uses?(:high_voltage) -%>
11
- href="<%%= root_path %>"
12
- <%- else -%>
13
- href="/"
14
- <%- end -%>
15
- >
16
- <%- if uses?(:inline_svg) -%>
17
- <%%= inline_svg_pack_tag('media/images/logo.svg', class: "rounded mx-2", size: "3rem * 3rem") %>
18
- <%- end -%>
19
- <p class="font-bold text-lg"><%= app_name.capitalize %> </p>
20
- </a>
21
- </div>
22
- <div class="flex md:hidden">
23
- <button
24
- <%- if uses?(:stimulus_components) -%>
25
- data-action="click->dropdown#toggle click@window->dropdown#hide"
26
- <%- end -%>
27
- class="px-3 py-2 border border-gray-500 rounded text-grey hover:text-gray-600 hover:border-gray-600" >
28
- <svg class="w-3 h-3 fill-current" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
29
- <title>Menu</title>
30
- <path d="M0 3h20v2H0V3zm0 6h20v2H0V9zm0 6h20v2H0v-2z"/>
31
- </svg>
32
- </button>
33
- </div>
34
- <div
35
- <%-if uses?(:stimulus_components) -%>
36
- data-dropdown-target="menu"
37
- <%- end -%>
38
- class="hidden md:flex-grow md:flex w-full md:w-auto text-right md:text-left text-bold mt-5 md:mt-0 border-t-2 border-gray-200 md:border-none">
39
- <div class="justify-start flex-grow">
40
- <!-- SZ Link Placeholder -->
41
- </div>
42
- <%-if uses?(:devise) -%>
43
- <ul class="w-full flex-col md:flex md:flex-row items-center justify-end md:w-auto">
44
- <%% if user_signed_in? %>
45
- <li><%%= link_to "Edit account", edit_user_registration_path, class: "btn btn-default md:mr-2 my-2 md:my-0 " %></li>
46
- <li><%%= link_to "Log out", destroy_user_session_path, method: :delete, class: "btn btn-default" %></li>
47
- <%% else %>
48
- <li><%%= link_to "Login", new_user_session_path, class: "btn btn-blue md:mr-2 my-2 md:my-0" %></li>
49
- <li><%%= link_to "Sign Up", new_user_registration_path, class: "btn btn-blue" %></li>
50
- <%% end %>
51
- </ul>
52
- <%- end -%>
53
- </div>
54
- </nav>
55
- </header>
@@ -1,5 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class ApplicationWorker
4
- include Sidekiq::Worker
5
- end