rails_app_generator 0.3.1 → 0.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (106) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/README.md +22 -1
  4. data/after_templates/addons/factory_bot/_.rb +68 -0
  5. data/after_templates/addons/factory_bot/app/controllers/home_controller.rb +16 -0
  6. data/after_templates/addons/factory_bot/app/services/seed_service.rb +68 -0
  7. data/after_templates/addons/factory_bot/app/views/articles/index.html.erb +32 -0
  8. data/after_templates/addons/factory_bot/app/views/companies/index.html.erb +33 -0
  9. data/after_templates/addons/factory_bot/app/views/employee_roles/index.html.erb +30 -0
  10. data/after_templates/addons/factory_bot/app/views/employees/index.html.erb +36 -0
  11. data/after_templates/addons/factory_bot/app/views/home/index.html.erb +3 -0
  12. data/after_templates/addons/factory_bot/app/views/layouts/_footer.html.erb +0 -0
  13. data/after_templates/addons/factory_bot/app/views/layouts/_navbar.html.erb +17 -0
  14. data/after_templates/addons/factory_bot/app/views/layouts/application.html.erb +29 -0
  15. data/after_templates/addons/factory_bot/app/views/projects/index.html.erb +36 -0
  16. data/after_templates/addons/factory_bot/app/views/regions/index.html.erb +29 -0
  17. data/after_templates/addons/factory_bot/app/views/roles/index.html.erb +29 -0
  18. data/after_templates/addons/factory_bot/app/views/videos/index.html.erb +31 -0
  19. data/after_templates/addons/factory_bot/best-practices/toshima/a1.png +0 -0
  20. data/after_templates/addons/factory_bot/best-practices/toshima/a2.png +0 -0
  21. data/after_templates/addons/factory_bot/best-practices/toshima/a3.png +0 -0
  22. data/after_templates/addons/factory_bot/best-practices/toshima/a4.png +0 -0
  23. data/after_templates/addons/factory_bot/best-practices/toshima/a5.png +0 -0
  24. data/after_templates/addons/factory_bot/best-practices/toshima/a6.png +0 -0
  25. data/after_templates/addons/factory_bot/best-practices/toshima/a7.png +0 -0
  26. data/after_templates/addons/factory_bot/best-practices/toshima/a8.png +0 -0
  27. data/after_templates/addons/factory_bot/best-practices/toshima/a9.png +0 -0
  28. data/after_templates/addons/factory_bot/best-practices/toshima/b1.png +0 -0
  29. data/after_templates/addons/factory_bot/best-practices/toshima/b2.png +0 -0
  30. data/after_templates/addons/factory_bot/best-practices/toshima/b3.png +0 -0
  31. data/after_templates/addons/factory_bot/best-practices/toshima/b4.png +0 -0
  32. data/after_templates/addons/factory_bot/best-practices/toshima/b5.png +0 -0
  33. data/after_templates/addons/factory_bot/best-practices/toshima/b6.png +0 -0
  34. data/after_templates/addons/factory_bot/best-practices/toshima/b7.png +0 -0
  35. data/after_templates/addons/factory_bot/best-practices/toshima/b8.png +0 -0
  36. data/after_templates/addons/factory_bot/best-practices/toshima/b9.png +0 -0
  37. data/after_templates/addons/factory_bot/best-practices/toshima/c1.png +0 -0
  38. data/after_templates/addons/factory_bot/best-practices/toshima/c2.png +0 -0
  39. data/after_templates/addons/factory_bot/best-practices/toshima/c3.png +0 -0
  40. data/after_templates/addons/factory_bot/best-practices/toshima/c4.png +0 -0
  41. data/after_templates/addons/factory_bot/best-practices/toshima/c5.png +0 -0
  42. data/after_templates/addons/factory_bot/best-practices/toshima/c6.png +0 -0
  43. data/after_templates/addons/factory_bot/best-practices/toshima/c7.png +0 -0
  44. data/after_templates/addons/factory_bot/best-practices/toshima/c8.png +0 -0
  45. data/after_templates/addons/factory_bot/best-practices/toshima/c9.png +0 -0
  46. data/after_templates/addons/factory_bot/best-practices/toshima/d1.png +0 -0
  47. data/after_templates/addons/factory_bot/best-practices/toshima/d2.png +0 -0
  48. data/after_templates/addons/factory_bot/best-practices/toshima/d3.png +0 -0
  49. data/after_templates/addons/factory_bot/best-practices/toshima/d4.png +0 -0
  50. data/after_templates/addons/factory_bot/best_practice.rb +630 -0
  51. data/after_templates/addons/factory_bot/config/application.rb +39 -0
  52. data/after_templates/addons/factory_bot/custom_factories/_examples.rb +61 -0
  53. data/after_templates/addons/factory_bot/custom_factories/article.rb +13 -0
  54. data/after_templates/addons/factory_bot/custom_factories/company.rb +9 -0
  55. data/after_templates/addons/factory_bot/custom_factories/employee.rb +37 -0
  56. data/after_templates/addons/factory_bot/custom_factories/project.rb +10 -0
  57. data/after_templates/addons/factory_bot/custom_factories/region.rb +32 -0
  58. data/after_templates/addons/factory_bot/custom_factories/role.rb +21 -0
  59. data/after_templates/addons/factory_bot/custom_factories/user.rb +10 -0
  60. data/after_templates/addons/factory_bot/custom_factories/video.rb +7 -0
  61. data/after_templates/addons/factory_bot/db/seeds.rb +1 -0
  62. data/after_templates/addons/rspec/_.rb +61 -0
  63. data/after_templates/addons/rspec/app/controllers/home_controller.rb +8 -0
  64. data/after_templates/addons/rspec/app/services/seed_service.rb +31 -0
  65. data/after_templates/addons/rspec/app/views/home/index.html.erb +3 -0
  66. data/after_templates/addons/rspec/app/views/layouts/_footer.html.erb +0 -0
  67. data/after_templates/addons/rspec/app/views/layouts/_navbar.html.erb +5 -0
  68. data/after_templates/addons/rspec/app/views/layouts/application.html.erb +29 -0
  69. data/after_templates/addons/rspec/db/seeds.rb +8 -0
  70. data/after_templates/application/klueless/.rubocop.yml +40 -0
  71. data/after_templates/application/klueless/_.rb +28 -14
  72. data/after_templates/application/klueless/app/avo/filters/rubocop_entry_cop_filter.rb +15 -0
  73. data/after_templates/application/klueless/app/avo/filters/rubocop_entry_filename_filter.rb +13 -0
  74. data/after_templates/application/klueless/app/avo/filters/rubocop_entry_message_filter.rb +13 -0
  75. data/after_templates/application/klueless/app/avo/filters/rubocop_entry_status_filter.rb +15 -0
  76. data/after_templates/application/klueless/app/avo/filters/table_count_entry_tablename_filter.rb +13 -0
  77. data/after_templates/application/klueless/app/avo/resource_tools/rubocop_info.rb +4 -0
  78. data/after_templates/application/klueless/app/avo/resources/rubocop_entry_resource.rb +28 -0
  79. data/after_templates/application/klueless/app/avo/resources/rubocop_resource.rb +8 -7
  80. data/after_templates/application/klueless/app/avo/resources/table_count_entry_resource.rb +18 -0
  81. data/after_templates/application/klueless/app/controllers/home_controller.rb +1 -1
  82. data/after_templates/application/klueless/app/services/seed_service.rb +1 -1
  83. data/after_templates/application/klueless/app/views/home/index.html.erb +2 -2
  84. data/after_templates/application/klueless/app/views/layouts/_navbar.html.erb +1 -4
  85. data/after_templates/application/klueless/config/initializers/avo.rb +4 -2
  86. data/after_templates/application/klueless/db/views/{rubocop_logs_v01.sql → rubocop_entries_v01.sql} +2 -2
  87. data/after_templates/application/klueless/db/views/table_count_entries_v01.sql +11 -0
  88. data/docs/last_run/app_generator_class.json +16 -8
  89. data/docs/last_run/app_generator_data.json +11 -11
  90. data/docs/last_run/rails_options_class.json +13 -5
  91. data/docs/last_run/rails_options_data.json +14 -12
  92. data/lib/rails_app_generator/addons/rspec.rb +7 -1
  93. data/lib/rails_app_generator/app_generator.rb +24 -13
  94. data/lib/rails_app_generator/rag_initializer.rb +4 -1
  95. data/lib/rails_app_generator/starter.rb +3 -0
  96. data/lib/rails_app_generator/version.rb +1 -1
  97. data/package-lock.json +2 -2
  98. data/package.json +1 -1
  99. data/profiles/addons/factory_bot.json +16 -0
  100. data/profiles/addons/faker.json +1 -1
  101. data/profiles/addons/rspec.json +14 -0
  102. data/profiles/application/klueless.json +3 -1
  103. data/templates/README.md.erb +2 -2
  104. data/templates/thor_task/profile/app/services/seed_service.rb +8 -4
  105. data/templates/thor_task/profile/profile.json.tt +2 -1
  106. metadata +81 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0c6189ce2463be4e23bbda3e3b1d17c03142b60a7a754feeb7d7dcc75c26fc5f
4
- data.tar.gz: 2d216396594ae4ee2d86626c9b3202419ae6a69536f564e7ba3a044771f7bd0d
3
+ metadata.gz: 7ceb2efc08d6f164b434c85b95ad2f33648e545d7482fd78ec3678aa50c91b11
4
+ data.tar.gz: d8380a66709a7907f26cf22db768c714e32cb9058e336207fd19b9f64e76b17f
5
5
  SHA512:
6
- metadata.gz: 56a17d613f635bb7242ca6c04a93f0ec0f8a03ca987a30813ad15ce3f9d015eb174d8ec7d14d24a12cab3e0011756d702e67704ddfb2841e39ca1e18b1921683
7
- data.tar.gz: 35bb905e32d9d650f828754ac4696ddd13c55ed9503f9bd270f30addae97c3a8b6e53ef8cd450c70a65b5630ac5437e1db8e0fc1a4a55a25c5a416c71e92c82f
6
+ metadata.gz: f77a3033aa8900f2f13c7324c864d74acaee2dd3159f47c476f2ff4c7ed5b1ca50f7f8a2c3ef5dd8fdee2199663f1d7afd634d43f655ea9a3b287c39f9d77d87
7
+ data.tar.gz: 267b51005953b88b77f692ab24693a49b494c66f774f0e0afa0cd7d93613d21694164e17a3b0d7e4a7c9eb1c39d704b924c9b11b67379e8c3f41d57028098ecd
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [0.3.2](https://github.com/klueless-io/rails_app_generator/compare/v0.3.1...v0.3.2) (2022-09-11)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update factory_bot profile ([aa121e3](https://github.com/klueless-io/rails_app_generator/commit/aa121e35efd88b9ed5704cacf4f348e50e4c7dc2))
7
+ * update factory_bot profile ([7b5247d](https://github.com/klueless-io/rails_app_generator/commit/7b5247dd44e239ec20eff74dd64be9d5d05d0e72))
8
+
9
+ ## [0.3.1](https://github.com/klueless-io/rails_app_generator/compare/v0.3.0...v0.3.1) (2022-09-02)
10
+
11
+
12
+ ### Bug Fixes
13
+
14
+ * rename to when_folder_exist ([3363b0c](https://github.com/klueless-io/rails_app_generator/commit/3363b0c5df5c161f3578ae422b79c3bb7f3b863e))
15
+
1
16
  # [0.3.0](https://github.com/klueless-io/rails_app_generator/compare/v0.2.43...v0.3.0) (2022-09-02)
2
17
 
3
18
 
data/README.md CHANGED
@@ -22,7 +22,7 @@ Or install it yourself as:
22
22
  gem install rails_app_generator
23
23
  ```
24
24
 
25
- Use the Gem
25
+ ### Use the Gem
26
26
 
27
27
  ```
28
28
  rag rag-simple
@@ -30,6 +30,27 @@ rag rag-tailwind
30
30
  rag rag-bootstrap
31
31
  ```
32
32
 
33
+ ### Create new Addon to Rails App Generator
34
+
35
+ If you need to make a new addon available then use `thor addon:new`
36
+
37
+ Generally an Addon will be for a gem so if you use the `--gem` option, it will bring in the GEM info such as latest version number
38
+
39
+ ```
40
+ thor addon:new image_processing --gem
41
+ thor addon:new kaminari --gem
42
+ ```
43
+
44
+ ### Create new Profile to Rails App Generator
45
+
46
+ A profile is a sample Rails application template with files that allows you to test one or more Addons and produces a working Rails 7 application.
47
+
48
+ If you are just keeping the example to a simple GEM then use the `--variant` option with the folder you would like to write code into, e.g. `addons`
49
+
50
+ ```
51
+ thor profile:new factory_bot --variant=addons
52
+ thor profile:new kaminari --variant=addons
53
+ ```
33
54
 
34
55
  ## Notes
35
56
 
@@ -0,0 +1,68 @@
1
+ # frozen_string_literal: true
2
+
3
+ # factory_bot provides a framework and DSL for defining and using factories - less error-prone, more explicit, and all-around easier to work with than fixtures.
4
+ #
5
+ # exe/rag addons/factory_bot
6
+
7
+ self.local_template_path = File.dirname(__FILE__)
8
+
9
+ gac 'base rails 7 image created'
10
+
11
+ prepare_environment
12
+
13
+ after_bundle do
14
+ create_db
15
+ scaffolds
16
+ setup_customizations
17
+ migrate_db
18
+ end
19
+
20
+ def scaffolds
21
+ add_scaffold('region', 'name', 'settings:json')
22
+ add_scaffold('company', 'name', 'slug', 'active:boolean', 'region:references')
23
+ add_scaffold('role', 'code', 'description') # contributor, moderator, admin
24
+ add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', 'company:references')
25
+ add_scaffold('employee_role', 'employee:references', 'role:references')
26
+ add_scaffold('project', 'name', 'status', 'budget:decimal', 'country', 'progress:integer', 'company:references')
27
+ add_scaffold('article', 'title', 'body:text', 'is_featured:boolean', 'published:datetime', 'employee:references', 'company:references')
28
+ add_scaffold('video', 'title', 'youtube_id', '', 'article:references')
29
+ add_scaffold('reserved', 'new', 'do', 'end')
30
+ end
31
+
32
+ # https://speakerdeck.com/toshimaru/factorybot-the-right-way
33
+ def setup_customizations
34
+ route("root 'home#index'")
35
+
36
+ force_copy
37
+
38
+ add_controller('home', 'index', 'test_data', 'sample_data')
39
+
40
+ directory "app/controllers"
41
+ directory "app/models"
42
+ directory "app/views"
43
+ template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
44
+ directory "app/services"
45
+ directory 'config'
46
+ directory 'custom_factories'
47
+ end
48
+
49
+ def create_db
50
+ # uncomment this if you need custom configuration in database.yml
51
+ # gsub_file('config/database.yml', ' encoding: unicode', db_development_settings)
52
+ db(create: true)
53
+ end
54
+
55
+ def migrate_db
56
+ template 'db/seeds.rb' , 'db/seeds.rb'
57
+
58
+ db(migrate: true, seed: true)
59
+ end
60
+
61
+ def db_development_settings
62
+ <<-'RUBY'
63
+ encoding: unicode
64
+ host: 127.0.0.1
65
+ username: printspeak
66
+ password: printspeak
67
+ RUBY
68
+ end
@@ -0,0 +1,16 @@
1
+ class HomeController < ApplicationController
2
+ def index
3
+ end
4
+
5
+ def test_data
6
+ SeedService.seed(variant: :test_data)
7
+
8
+ redirect_back_or_to root_path
9
+ end
10
+
11
+ def seed_data
12
+ SeedService.seed(variant: :seed_data)
13
+
14
+ redirect_back_or_to root_path
15
+ end
16
+ end
@@ -0,0 +1,68 @@
1
+ class SeedService
2
+ include FactoryBot::Syntax::Methods
3
+
4
+ class << self
5
+ def seed(variant: :test_data)
6
+ service = SeedService.new
7
+ service.call(variant: variant)
8
+ end
9
+ end
10
+
11
+ def call(variant: :reset)
12
+ reset
13
+ generate_test_data if variant == :test_data
14
+ generate_sample_data if variant == :sample_data
15
+ end
16
+
17
+ private
18
+
19
+ def reset
20
+ Video.delete_all
21
+ Article.delete_all
22
+ Project.delete_all
23
+ EmployeeRole.delete_all
24
+ Employee.delete_all
25
+ Role.delete_all
26
+ Company.delete_all
27
+ Region.delete_all
28
+ end
29
+
30
+ # add_scaffold('region', 'name', 'settings:json')
31
+ # add_scaffold('company', 'name', 'slug', 'active:boolean', 'region:references')
32
+ # add_scaffold('role', 'code', 'description') # contributor, moderator, admin
33
+ # add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', 'company:references')
34
+ # add_scaffold('employee_role', 'employee:references', 'role:references')
35
+ # add_scaffold('project', 'name', 'status', 'budget:decimal', 'country', 'progress:integer', 'company:references')
36
+ # add_scaffold('article', 'title', 'body:text', 'is_featured:boolean', 'published:datetime', 'employee:references', 'company:references')
37
+ # add_scaffold('video', 'title', 'youtube_id', '', 'article:references')
38
+
39
+ def generate_test_data
40
+ test_data_regions
41
+ # companies = create_list(:company, rand(3..5))#, region: region)
42
+ # companies = create_list(:company, rand(3..5))#, region: region)
43
+ # employees = create_list(:employee, rand(10..20), company: companies.sample)
44
+ # _articles = create_list(:article, rand(10..20), company: companies.sample, employee: employees.sample)
45
+ # _projects = create_list(:project, rand(10..20), company: companies.sample)
46
+ end
47
+
48
+ def generate_sample_data
49
+ regions = create_list(:region, rand(2..5))
50
+ companies = create_list(:company, rand(3..5))#, region: region)
51
+ # companies = create_list(:company, rand(3..5))#, region: region)
52
+ # employees = create_list(:employee, rand(10..20), company: companies.sample)
53
+ # _articles = create_list(:article, rand(10..20), company: companies.sample, employee: employees.sample)
54
+ # _projects = create_list(:project, rand(10..20), company: companies.sample)
55
+ end
56
+
57
+ private
58
+
59
+ def test_data_regions
60
+ @region_western_sydney = create(:region, :western_sydney)
61
+ @region_western_sydney2 = create(:region, :western_sydney) # create it again Sam
62
+ @region_sydney = create(:region, :sydney)
63
+ @region_eastern_suburbs = create(:region, :eastern_suburbs)
64
+ @region_inner_west = create(:region, :inner_west)
65
+ @region_north_shore = create(:region, :north_shore)
66
+ @regions_random = create_list(:region, 4)
67
+ end
68
+ end
@@ -0,0 +1,32 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Articles</h1>
4
+
5
+ <div id="articles">
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th>title</th>
10
+ <th>Youtube ID</th>
11
+ <th>Article</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ <% @videos.each do |video| %>
17
+ <tr>
18
+ <td><%= video.name %></td>
19
+ <td><%= video.status %></td>
20
+ <td><%= video.budget %></td>
21
+ <td><%= video.country %></td>
22
+ <td><%= video.company&.name %></td>
23
+ <td><%= link_to "Show", video %></td>
24
+ </tr>
25
+ <% end %>
26
+
27
+ </tbody>
28
+ </table>
29
+
30
+ </div>
31
+
32
+ <%= link_to "New article", new_article_path %>
@@ -0,0 +1,33 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Companies</h1>
4
+
5
+ <div id="companies">
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th>Slug</th>
12
+ <th>Active</th>
13
+ <th>Region</th>
14
+ </tr>
15
+ </thead>
16
+ <tbody>
17
+
18
+ <% @companies.each do |company| %>
19
+ <tr>
20
+ <td><%= company.name %></td>
21
+ <td><%= company.slug %></td>
22
+ <td><%= company.active %></td>
23
+ <td><%= company.region&.name %></td>
24
+ <td><%= link_to "Show", company %></td>
25
+ </tr>
26
+ <% end %>
27
+
28
+ </tbody>
29
+ </table>
30
+
31
+ </div>
32
+
33
+ <%= link_to "New company", new_company_path %>
@@ -0,0 +1,30 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Employee roles</h1>
4
+
5
+ <div id="employee_roles">
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <th>Employee</th>
11
+ <th>Role</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ <% @employee_roles.each do |employee_role| %>
17
+ <tr>
18
+ <td><%= employee_role.employee&.name %></td>
19
+ <td><%= employee_role.role&.name %></td>
20
+ <td><%= link_to "Show", employee_role %></td>
21
+ </tr>
22
+ <% end %>
23
+
24
+ </tbody>
25
+ </table>
26
+
27
+
28
+ </div>
29
+
30
+ <%= link_to "New employee role", new_employee_role_path %>
@@ -0,0 +1,36 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Employees</h1>
4
+
5
+ <div id="employees">
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th>First Name</th>
10
+ <th>Last Name</th>
11
+ <th>Address</th>
12
+ <th>Email</th>
13
+ <th>Password</th>
14
+ <th>Company</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+
19
+ <% @employees.each do |employee| %>
20
+ <tr>
21
+ <td><%= employee.first_name %></td>
22
+ <td><%= employee.last_name %></td>
23
+ <td><%= employee.address %></td>
24
+ <td><%= employee.email %></td>
25
+ <td><%= employee.password %></td>
26
+ <td><%= employee.company&.name %></td>
27
+ <td><%= link_to "Show", employee %></td>
28
+ </tr>
29
+ <% end %>
30
+
31
+ </tbody>
32
+ </table>
33
+
34
+ </div>
35
+
36
+ <%= link_to "New employee", new_employee_path %>
@@ -0,0 +1,3 @@
1
+ <h1>Factory bot</h1>
2
+
3
+ <p>factory_bot provides a framework and DSL for defining and using factories - less error-prone, more explicit, and all-around easier to work with than fixtures.</p>
@@ -0,0 +1,17 @@
1
+ <%= link_to 'Home', root_path %>
2
+ | <%= link_to 'Region', regions_path %>
3
+ | <%= link_to 'Company', companies_path %>
4
+
5
+
6
+
7
+ | <%= link_to 'Video', videos_path %>
8
+ | <%= link_to 'Article', articles_path %>
9
+ | <%= link_to 'Project', projects_path %>
10
+ | <%= link_to 'EmployeeRole', employee_roles_path %>
11
+ | <%= link_to 'Employee', employees_path %>
12
+ | <%= link_to 'Role', roles_path %>
13
+ | <%= link_to 'Reserved', reserveds_path %>
14
+
15
+ | <%= link_to 'Test Data', home_test_data_path, style: 'color: blue; font-weight: 600;' %>
16
+ | <%= link_to 'Sample Data', home_sample_data_path, style: 'color: blue; font-weight: 600;' %>
17
+ <hr />
@@ -0,0 +1,29 @@
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_hotwire] || options[:skip_javascript] -%>
10
+ <%%= stylesheet_link_tag "application" %>
11
+ <%- else -%>
12
+ <%%= stylesheet_link_tag "application", "data-turbo-track": "reload" %>
13
+ <%- end -%>
14
+ </head>
15
+
16
+ <body>
17
+ <header>
18
+ <%%= render 'layouts/navbar' %>
19
+ <hr />
20
+ </header>
21
+ <main>
22
+ <%%= yield %>
23
+ </main>
24
+ <footer>
25
+ <%%= render 'layouts/footer' %>
26
+ </footer>
27
+ </body>
28
+ </html>
29
+
@@ -0,0 +1,36 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Projects</h1>
4
+
5
+ <div id="projects">
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th>Name</th>
10
+ <th>Status</th>
11
+ <th>Budget</th>
12
+ <th>Country</th>
13
+ <th>Progress</th>
14
+ <th>Project</th>
15
+ </tr>
16
+ </thead>
17
+ <tbody>
18
+
19
+ <% @projects.each do |project| %>
20
+ <tr>
21
+ <td><%= project.name %></td>
22
+ <td><%= project.status %></td>
23
+ <td><%= project.budget %></td>
24
+ <td><%= project.country %></td>
25
+ <td><%= project.progress %></td>
26
+ <td><%= project.project&.name %></td>
27
+ <td><%= link_to "Show", project %></td>
28
+ </tr>
29
+ <% end %>
30
+
31
+ </tbody>
32
+ </table>
33
+
34
+ </div>
35
+
36
+ <%= link_to "New project", new_project_path %>
@@ -0,0 +1,29 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Regions</h1>
4
+
5
+ <div id="regions">
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <th>Name</th>
11
+ <th>Settings</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ <% @regions.each do |region| %>
17
+ <tr>
18
+ <td><%= region.name %></td>
19
+ <td><%= region.settings %></td>
20
+ <td><%= link_to "Show", region %></td>
21
+ </tr>
22
+ <% end %>
23
+
24
+ </tbody>
25
+ </table>
26
+
27
+ </div>
28
+
29
+ <%= link_to "New region", new_region_path %>
@@ -0,0 +1,29 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Roles</h1>
4
+
5
+ <div id="roles">
6
+ <table>
7
+ <thead>
8
+ <tr>
9
+ <th>title</th>
10
+ <th>Youtube ID</th>
11
+ <th>Article</th>
12
+ </tr>
13
+ </thead>
14
+ <tbody>
15
+
16
+ <% @roles.each do |role| %>
17
+ <tr>
18
+ <td><%= role.code %></td>
19
+ <td><%= role.description %></td>
20
+ <td><%= link_to "Show", role %></td>
21
+ </tr>
22
+ <% end %>
23
+
24
+ </tbody>
25
+ </table>
26
+
27
+ </div>
28
+
29
+ <%= link_to "New role", new_role_path %>
@@ -0,0 +1,31 @@
1
+ <p style="color: green"><%= notice %></p>
2
+
3
+ <h1>Videos</h1>
4
+
5
+ <div id="videos">
6
+
7
+ <table>
8
+ <thead>
9
+ <tr>
10
+ <th>title</th>
11
+ <th>Youtube ID</th>
12
+ <th>Article</th>
13
+ </tr>
14
+ </thead>
15
+ <tbody>
16
+
17
+ <% @videos.each do |video| %>
18
+ <tr>
19
+ <td><%= video.name %></td>
20
+ <td><%= video.slug %></td>
21
+ <td><%= video.article&.title %></td>
22
+ <td><%= link_to "Show", video %></td>
23
+ </tr>
24
+ <% end %>
25
+
26
+ </tbody>
27
+ </table>
28
+
29
+ </div>
30
+
31
+ <%= link_to "New video", new_video_path %>