rails_app_generator 0.3.2 → 0.3.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (99) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +15 -0
  3. data/after_templates/addons/factory_bot/_.rb +12 -26
  4. data/after_templates/addons/factory_bot/app/controllers/home_controller.rb +8 -2
  5. data/after_templates/addons/factory_bot/app/services/seed_service.rb +46 -13
  6. data/after_templates/addons/factory_bot/app/views/articles/index.html.erb +32 -0
  7. data/after_templates/addons/factory_bot/app/views/companies/index.html.erb +33 -0
  8. data/after_templates/addons/factory_bot/app/views/employee_roles/index.html.erb +30 -0
  9. data/after_templates/addons/factory_bot/app/views/employees/index.html.erb +36 -0
  10. data/after_templates/addons/factory_bot/app/views/layouts/_navbar.html.erb +15 -8
  11. data/after_templates/addons/factory_bot/app/views/projects/index.html.erb +36 -0
  12. data/after_templates/addons/factory_bot/app/views/regions/index.html.erb +29 -0
  13. data/after_templates/addons/factory_bot/app/views/roles/index.html.erb +29 -0
  14. data/after_templates/addons/factory_bot/app/views/videos/index.html.erb +31 -0
  15. data/after_templates/addons/factory_bot/best-practices/toshima/a1.png +0 -0
  16. data/after_templates/addons/factory_bot/best-practices/toshima/a2.png +0 -0
  17. data/after_templates/addons/factory_bot/best-practices/toshima/a3.png +0 -0
  18. data/after_templates/addons/factory_bot/best-practices/toshima/a4.png +0 -0
  19. data/after_templates/addons/factory_bot/best-practices/toshima/a5.png +0 -0
  20. data/after_templates/addons/factory_bot/best-practices/toshima/a6.png +0 -0
  21. data/after_templates/addons/factory_bot/best-practices/toshima/a7.png +0 -0
  22. data/after_templates/addons/factory_bot/best-practices/toshima/a8.png +0 -0
  23. data/after_templates/addons/factory_bot/best-practices/toshima/a9.png +0 -0
  24. data/after_templates/addons/factory_bot/best-practices/toshima/b1.png +0 -0
  25. data/after_templates/addons/factory_bot/best-practices/toshima/b2.png +0 -0
  26. data/after_templates/addons/factory_bot/best-practices/toshima/b3.png +0 -0
  27. data/after_templates/addons/factory_bot/best-practices/toshima/b4.png +0 -0
  28. data/after_templates/addons/factory_bot/best-practices/toshima/b5.png +0 -0
  29. data/after_templates/addons/factory_bot/best-practices/toshima/b6.png +0 -0
  30. data/after_templates/addons/factory_bot/best-practices/toshima/b7.png +0 -0
  31. data/after_templates/addons/factory_bot/best-practices/toshima/b8.png +0 -0
  32. data/after_templates/addons/factory_bot/best-practices/toshima/b9.png +0 -0
  33. data/after_templates/addons/factory_bot/best-practices/toshima/c1.png +0 -0
  34. data/after_templates/addons/factory_bot/best-practices/toshima/c2.png +0 -0
  35. data/after_templates/addons/factory_bot/best-practices/toshima/c3.png +0 -0
  36. data/after_templates/addons/factory_bot/best-practices/toshima/c4.png +0 -0
  37. data/after_templates/addons/factory_bot/best-practices/toshima/c5.png +0 -0
  38. data/after_templates/addons/factory_bot/best-practices/toshima/c6.png +0 -0
  39. data/after_templates/addons/factory_bot/best-practices/toshima/c7.png +0 -0
  40. data/after_templates/addons/factory_bot/best-practices/toshima/c8.png +0 -0
  41. data/after_templates/addons/factory_bot/best-practices/toshima/c9.png +0 -0
  42. data/after_templates/addons/factory_bot/best-practices/toshima/d1.png +0 -0
  43. data/after_templates/addons/factory_bot/best-practices/toshima/d2.png +0 -0
  44. data/after_templates/addons/factory_bot/best-practices/toshima/d3.png +0 -0
  45. data/after_templates/addons/factory_bot/best-practices/toshima/d4.png +0 -0
  46. data/after_templates/addons/factory_bot/best_practice.rb +630 -0
  47. data/after_templates/addons/factory_bot/config/application.rb +39 -0
  48. data/after_templates/addons/factory_bot/{factories.rb → custom_factories/_examples.rb} +25 -37
  49. data/after_templates/addons/factory_bot/custom_factories/article.rb +13 -0
  50. data/after_templates/addons/factory_bot/custom_factories/company.rb +9 -0
  51. data/after_templates/addons/factory_bot/custom_factories/employee.rb +37 -0
  52. data/after_templates/addons/factory_bot/custom_factories/project.rb +10 -0
  53. data/after_templates/addons/factory_bot/custom_factories/region.rb +32 -0
  54. data/after_templates/addons/factory_bot/custom_factories/role.rb +21 -0
  55. data/after_templates/addons/factory_bot/custom_factories/user.rb +10 -0
  56. data/after_templates/addons/factory_bot/custom_factories/video.rb +7 -0
  57. data/after_templates/addons/rspec/_.rb +61 -0
  58. data/after_templates/addons/rspec/app/controllers/home_controller.rb +8 -0
  59. data/after_templates/addons/rspec/app/services/seed_service.rb +31 -0
  60. data/after_templates/addons/rspec/app/views/home/index.html.erb +3 -0
  61. data/after_templates/addons/rspec/app/views/layouts/_footer.html.erb +0 -0
  62. data/after_templates/addons/rspec/app/views/layouts/_navbar.html.erb +5 -0
  63. data/after_templates/addons/rspec/app/views/layouts/application.html.erb +29 -0
  64. data/after_templates/addons/rspec/db/seeds.rb +8 -0
  65. data/after_templates/addons/view_component/_.rb +57 -0
  66. data/after_templates/addons/view_component/app/components/price_card_component.html.erb +25 -0
  67. data/after_templates/addons/view_component/app/components/price_card_component.rb +8 -0
  68. data/after_templates/addons/view_component/app/components/price_chart_component.html.erb +12 -0
  69. data/after_templates/addons/view_component/app/components/price_chart_component.rb +13 -0
  70. data/after_templates/addons/view_component/app/controllers/home_controller.rb +50 -0
  71. data/after_templates/addons/view_component/app/services/seed_service.rb +31 -0
  72. data/after_templates/addons/view_component/app/views/home/_price_card.html.erb +25 -0
  73. data/after_templates/addons/view_component/app/views/home/_price_container.html.erb +13 -0
  74. data/after_templates/addons/view_component/app/views/home/component.html.erb +8 -0
  75. data/after_templates/addons/view_component/app/views/home/index.html.erb +206 -0
  76. data/after_templates/addons/view_component/app/views/home/partial.html.erb +6 -0
  77. data/after_templates/addons/view_component/app/views/layouts/_footer.html.erb +0 -0
  78. data/after_templates/addons/view_component/app/views/layouts/_navbar.html.erb +4 -0
  79. data/after_templates/addons/view_component/app/views/layouts/application.html.erb +29 -0
  80. data/docs/last_run/app_generator_class.json +25 -9
  81. data/docs/last_run/app_generator_data.json +10 -7
  82. data/docs/last_run/rails_options_class.json +22 -6
  83. data/docs/last_run/rails_options_data.json +11 -10
  84. data/lib/rails_app_generator/addons/rspec.rb +7 -1
  85. data/lib/rails_app_generator/addons/view_component.rb +11 -0
  86. data/lib/rails_app_generator/app_generator.rb +7 -9
  87. data/lib/rails_app_generator/rag_initializer.rb +5 -1
  88. data/lib/rails_app_generator/version.rb +1 -1
  89. data/package-lock.json +2 -2
  90. data/package.json +1 -1
  91. data/profiles/addons/factory_bot.json +1 -3
  92. data/profiles/addons/rspec.json +14 -0
  93. data/profiles/addons/view_component.json +18 -0
  94. metadata +78 -8
  95. data/after_templates/addons/factory_bot/factory-create-user.png +0 -0
  96. data/after_templates/addons/factory_bot/factory-employee-bad.png +0 -0
  97. data/after_templates/addons/factory_bot/factory-employee-good.png +0 -0
  98. data/after_templates/addons/factory_bot/factory-role.png +0 -0
  99. data/after_templates/addons/factory_bot/factory-video.png +0 -0
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c53c84982de8f9b1f3180f4c84b7527a04cc623dac815cdec90d325f7e56183f
4
- data.tar.gz: 0f2d44fc8597836b396faa7b3ef6995896e41222b34362a0cb73802bd2fbd70d
3
+ metadata.gz: ef1f0bf022c581955784c2ecc4d00b04f540e0a8b9f58b18ab2d17276bb239df
4
+ data.tar.gz: 85813cddac2bf9605a60cf023f72d2cf98b373696d1831b09ae721b3e47dd9e4
5
5
  SHA512:
6
- metadata.gz: 0d2f6fe3d00ca2befc5acaf668f58f655c60e7f0a0d14f7670067f5e3847861e92cf93a927d284d36546a26bf85ea8beebb7ac76cc183d88c0bf2b06e8c60d18
7
- data.tar.gz: 24704cce18d58445b1a1d69122df8e098e3f2b87627030df4b1e863931e7320e0da89e71b8e5d4ac7e886c03c01d7b593aec20da3cc3165703771e8b5945c4c9
6
+ metadata.gz: 89d2992e46e616679ff1e8f9647a2af229d47f44b87a6290f25d225c219a77a421d3185d0269a69b65c282404432a6dd0b09e733be3a797cfbde591809cb3b44
7
+ data.tar.gz: 115d98ec35bc7819a9c87b6fe886a85d016df1abefd5baa1b0876c053b9f9ced2fb0716152df7171322b4797b22497a614ae38d53577f45834d4c95e27e598fc
data/CHANGELOG.md CHANGED
@@ -1,3 +1,18 @@
1
+ ## [0.3.3](https://github.com/klueless-io/rails_app_generator/compare/v0.3.2...v0.3.3) (2022-10-05)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * update factory_bot profile ([f782f42](https://github.com/klueless-io/rails_app_generator/commit/f782f424fdfb90b5f7634e6ff12985ef10cdbdf5))
7
+
8
+ ## [0.3.2](https://github.com/klueless-io/rails_app_generator/compare/v0.3.1...v0.3.2) (2022-09-11)
9
+
10
+
11
+ ### Bug Fixes
12
+
13
+ * update factory_bot profile ([aa121e3](https://github.com/klueless-io/rails_app_generator/commit/aa121e35efd88b9ed5704cacf4f348e50e4c7dc2))
14
+ * update factory_bot profile ([7b5247d](https://github.com/klueless-io/rails_app_generator/commit/7b5247dd44e239ec20eff74dd64be9d5d05d0e72))
15
+
1
16
  ## [0.3.1](https://github.com/klueless-io/rails_app_generator/compare/v0.3.0...v0.3.1) (2022-09-02)
2
17
 
3
18
 
@@ -17,47 +17,33 @@ after_bundle do
17
17
  migrate_db
18
18
  end
19
19
 
20
- # Goals:
21
- # - Store Factories in subfolder under spec
22
- # -
23
- # - Use the faker GEM with both standard and custom data
24
- # - Custom data goes in custom locales folder, see: https://stackoverflow.com/questions/28153540/extending-faker-in-a-gem-where-do-i-put-the-yaml-file
25
- # - Use associations to affectively create related records
26
- # - Create default and NULL factory example
27
- # - Create Seed Data services
28
- # - Add support for STI
29
- # - Add support for polymorphic associations
30
- # Things to be aware of in faker
31
- # - Random focused data is better then sequence
32
- # sequence(:name) { |n| "Category #{n}" }
33
- # vs
34
- # name { Faker::Hipster.word }
35
- # -
36
-
37
-
38
20
  def scaffolds
39
- add_scaffold('app', 'title', 'description', 'settings:json')
40
- add_scaffold('tenant', 'name', 'slug', 'active:boolean', 'app:references')
41
- add_scaffold('role', 'code') # contributor, moderator, admin
42
- add_scaffold('employee', 'first_name', 'last_name', 'address:text', 'email', 'password', 'tenant:references', 'role:references')
43
- add_scaffold('project', 'name', 'status', 'budget:decimal', 'country', 'progress:integer', 'tenant:references')
44
- add_scaffold('article', 'title', 'body:text', 'is_featured:boolean', 'employee:references', 'tenant:references')
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')
45
28
  add_scaffold('video', 'title', 'youtube_id', '', 'article:references')
29
+ add_scaffold('reserved', 'new', 'do', 'end')
46
30
  end
47
31
 
32
+ # https://speakerdeck.com/toshimaru/factorybot-the-right-way
48
33
  def setup_customizations
49
34
  route("root 'home#index'")
50
35
 
51
36
  force_copy
52
37
 
53
- add_controller('home', 'index', 'reseed')
38
+ add_controller('home', 'index', 'test_data', 'sample_data')
54
39
 
55
40
  directory "app/controllers"
56
41
  directory "app/models"
57
42
  directory "app/views"
58
43
  template 'app/views/layouts/application.html.erb' , 'app/views/layouts/application.html.erb'
59
44
  directory "app/services"
60
- copy_file 'factories.rb'
45
+ directory 'config'
46
+ directory 'custom_factories'
61
47
  end
62
48
 
63
49
  def create_db
@@ -2,8 +2,14 @@ class HomeController < ApplicationController
2
2
  def index
3
3
  end
4
4
 
5
- def reseed
6
- SeedService.seed(variant: :reset)
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)
7
13
 
8
14
  redirect_back_or_to root_path
9
15
  end
@@ -1,35 +1,68 @@
1
1
  class SeedService
2
+ include FactoryBot::Syntax::Methods
3
+
2
4
  class << self
3
- def seed(variant: :reset)
5
+ def seed(variant: :test_data)
4
6
  service = SeedService.new
5
7
  service.call(variant: variant)
6
8
  end
7
9
  end
8
10
 
9
11
  def call(variant: :reset)
10
- reset if variant == :reset
11
- refresh if variant == :refresh
12
- create
12
+ reset
13
+ generate_test_data if variant == :test_data
14
+ generate_sample_data if variant == :sample_data
13
15
  end
14
16
 
15
17
  private
16
18
 
17
19
  def reset
20
+ Video.delete_all
18
21
  Article.delete_all
19
22
  Project.delete_all
23
+ EmployeeRole.delete_all
20
24
  Employee.delete_all
21
- Tenant.delete_all
22
- App.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)
23
46
  end
24
47
 
25
- def refresh
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)
26
55
  end
27
56
 
28
- def create
29
- app = FactoryBot.create(:app)
30
- tenants = FactoryBot.create_list(:tenant, rand(10..20), app: app)
31
- employees = FactoryBot.create_list(:employee, rand(10..20), tenant: tenants.sample)
32
- _articles = FactoryBot.create_list(:article, rand(10..20), tenant: tenants.sample, employee: employees.sample)
33
- _projects = FactoryBot.create_list(:project, rand(10..20), tenant: tenants.sample)
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)
34
67
  end
35
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 %>
@@ -1,10 +1,17 @@
1
1
  <%= link_to 'Home', root_path %>
2
- | <%= link_to 'Apps', apps_path %>
3
- | <%= link_to 'Tenants', tenants_path %>
4
- | <%= link_to 'Employees', employees_path %>
5
- | <%= link_to 'Roles', roles_path %>
6
- | <%= link_to 'Projects', projects_path %>
7
- | <%= link_to 'Articles', articles_path %>
8
- | <%= link_to 'Videos', videos_path %>
9
- | <%= link_to 'Re-Seed', home_reseed_path, style: 'color: blue; font-weight: 600;' %>
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;' %>
10
17
  <hr />
@@ -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 %>