tailwind_views_generator 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. checksums.yaml +7 -0
  2. data/.fasterer.yml +23 -0
  3. data/.gitignore +11 -0
  4. data/.rubocop.yml +34 -0
  5. data/.simplecov +9 -0
  6. data/.tool-versions +1 -0
  7. data/.yardopts +12 -0
  8. data/CHANGELOG.md +10 -0
  9. data/CODE_OF_CONDUCT.md +22 -0
  10. data/Gemfile +13 -0
  11. data/Gemfile.lock +98 -0
  12. data/LICENSE.txt +21 -0
  13. data/README.md +121 -0
  14. data/Rakefile +16 -0
  15. data/bin/console +15 -0
  16. data/bin/setup +8 -0
  17. data/lib/generators/tailwind_views/devise_generator.rb +52 -0
  18. data/lib/generators/tailwind_views/install_generator.rb +134 -0
  19. data/lib/tailwind_views_generator.rb +10 -0
  20. data/lib/tailwind_views_generator/helpers.rb +15 -0
  21. data/lib/tailwind_views_generator/version.rb +6 -0
  22. data/lib/templates/.DS_Store +0 -0
  23. data/lib/templates/devise/.DS_Store +0 -0
  24. data/lib/templates/devise/erb/confirmations/new.html.erb.tt +25 -0
  25. data/lib/templates/devise/erb/mailer/confirmation_instructions.html.erb +5 -0
  26. data/lib/templates/devise/erb/mailer/email_changed.html.erb +7 -0
  27. data/lib/templates/devise/erb/mailer/password_change.html.erb +3 -0
  28. data/lib/templates/devise/erb/mailer/reset_password_instructions.html.erb +8 -0
  29. data/lib/templates/devise/erb/mailer/unlock_instructions.html.erb +7 -0
  30. data/lib/templates/devise/erb/passwords/edit.html.erb.tt +33 -0
  31. data/lib/templates/devise/erb/passwords/new.html.erb.tt +23 -0
  32. data/lib/templates/devise/erb/registrations/edit.html.erb.tt +53 -0
  33. data/lib/templates/devise/erb/registrations/new.html.erb.tt +37 -0
  34. data/lib/templates/devise/erb/sessions/new.html.erb.tt +36 -0
  35. data/lib/templates/devise/erb/shared/_error_messages.html.erb +15 -0
  36. data/lib/templates/devise/erb/shared/_links.html.erb +28 -0
  37. data/lib/templates/devise/erb/unlocks/new.html.erb.tt +24 -0
  38. data/lib/templates/devise/haml/confirmations/new.html.haml.tt +15 -0
  39. data/lib/templates/devise/haml/mailer/confirmation_instructions.html.haml +3 -0
  40. data/lib/templates/devise/haml/mailer/email_changed.html.haml +7 -0
  41. data/lib/templates/devise/haml/mailer/password_change.html.haml +2 -0
  42. data/lib/templates/devise/haml/mailer/reset_password_instructions.html.haml +5 -0
  43. data/lib/templates/devise/haml/mailer/unlock_instructions.html.haml +4 -0
  44. data/lib/templates/devise/haml/passwords/edit.html.haml.tt +23 -0
  45. data/lib/templates/devise/haml/passwords/new.html.haml.tt +15 -0
  46. data/lib/templates/devise/haml/registrations/edit.html.haml.tt +42 -0
  47. data/lib/templates/devise/haml/registrations/new.html.haml.tt +27 -0
  48. data/lib/templates/devise/haml/sessions/new.html.haml.tt +25 -0
  49. data/lib/templates/devise/haml/shared/_error_messages.html.haml +6 -0
  50. data/lib/templates/devise/haml/shared/_links.html.haml +20 -0
  51. data/lib/templates/devise/haml/unlocks/new.html.haml.tt +16 -0
  52. data/lib/templates/devise/simple_form/erb/confirmations/new.html.erb.tt +18 -0
  53. data/lib/templates/devise/simple_form/erb/passwords/edit.html.erb.tt +20 -0
  54. data/lib/templates/devise/simple_form/erb/passwords/new.html.erb.tt +17 -0
  55. data/lib/templates/devise/simple_form/erb/registrations/edit.html.erb.tt +27 -0
  56. data/lib/templates/devise/simple_form/erb/registrations/new.html.erb.tt +19 -0
  57. data/lib/templates/devise/simple_form/erb/sessions/new.html.erb.tt +18 -0
  58. data/lib/templates/devise/simple_form/erb/unlocks/new.html.erb.tt +17 -0
  59. data/lib/templates/devise/simple_form/haml/confirmations/new.html.haml.tt +13 -0
  60. data/lib/templates/devise/simple_form/haml/passwords/edit.html.haml.tt +15 -0
  61. data/lib/templates/devise/simple_form/haml/passwords/new.html.haml.tt +12 -0
  62. data/lib/templates/devise/simple_form/haml/registrations/edit.html.haml.tt +21 -0
  63. data/lib/templates/devise/simple_form/haml/registrations/new.html.haml.tt +14 -0
  64. data/lib/templates/devise/simple_form/haml/sessions/new.html.haml.tt +13 -0
  65. data/lib/templates/devise/simple_form/haml/unlocks/new.html.haml.tt +12 -0
  66. data/lib/templates/devise/simple_form/slim/confirmations/new.html.slim.tt +13 -0
  67. data/lib/templates/devise/simple_form/slim/passwords/edit.html.slim.tt +15 -0
  68. data/lib/templates/devise/simple_form/slim/passwords/new.html.slim.tt +12 -0
  69. data/lib/templates/devise/simple_form/slim/registrations/edit.html.slim.tt +21 -0
  70. data/lib/templates/devise/simple_form/slim/registrations/new.html.slim.tt +14 -0
  71. data/lib/templates/devise/simple_form/slim/sessions/new.html.slim.tt +13 -0
  72. data/lib/templates/devise/simple_form/slim/unlocks/new.html.slim.tt +12 -0
  73. data/lib/templates/devise/slim/confirmations/new.html.slim.tt +16 -0
  74. data/lib/templates/devise/slim/mailer/confirmation_instructions.html.slim +3 -0
  75. data/lib/templates/devise/slim/mailer/email_changed.html.slim +5 -0
  76. data/lib/templates/devise/slim/mailer/password_change.html.slim +2 -0
  77. data/lib/templates/devise/slim/mailer/reset_password_instructions.html.slim +5 -0
  78. data/lib/templates/devise/slim/mailer/unlock_instructions.html.slim +4 -0
  79. data/lib/templates/devise/slim/passwords/edit.html.slim.tt +24 -0
  80. data/lib/templates/devise/slim/passwords/new.html.slim.tt +16 -0
  81. data/lib/templates/devise/slim/registrations/edit.html.slim.tt +43 -0
  82. data/lib/templates/devise/slim/registrations/new.html.slim.tt +28 -0
  83. data/lib/templates/devise/slim/sessions/new.html.slim.tt +26 -0
  84. data/lib/templates/devise/slim/shared/_error_messages.html.slim +6 -0
  85. data/lib/templates/devise/slim/shared/_links.html.slim +20 -0
  86. data/lib/templates/devise/slim/unlocks/new.html.slim.tt +17 -0
  87. data/lib/templates/layouts/application.html.erb.tt +36 -0
  88. data/lib/templates/layouts/application.html.haml.tt +32 -0
  89. data/lib/templates/layouts/application.html.slim.tt +31 -0
  90. data/lib/templates/scaffolds/erb/_form.html.erb +22 -0
  91. data/lib/templates/scaffolds/erb/edit.html.erb.tt +13 -0
  92. data/lib/templates/scaffolds/erb/index.html.erb.tt +38 -0
  93. data/lib/templates/scaffolds/erb/new.html.erb.tt +14 -0
  94. data/lib/templates/scaffolds/erb/show.html.erb.tt +20 -0
  95. data/lib/templates/scaffolds/haml/_form.html.haml +17 -0
  96. data/lib/templates/scaffolds/haml/edit.html.haml.tt +13 -0
  97. data/lib/templates/scaffolds/haml/index.html.haml.tt +29 -0
  98. data/lib/templates/scaffolds/haml/new.html.haml.tt +10 -0
  99. data/lib/templates/scaffolds/haml/show.html.haml.tt +18 -0
  100. data/lib/templates/scaffolds/simple_form/_form.html.erb +9 -0
  101. data/lib/templates/scaffolds/simple_form/_form.html.haml +9 -0
  102. data/lib/templates/scaffolds/simple_form/_form.html.slim +9 -0
  103. data/lib/templates/scaffolds/slim/_form.html.slim +17 -0
  104. data/lib/templates/scaffolds/slim/edit.html.slim.tt +13 -0
  105. data/lib/templates/scaffolds/slim/index.html.slim.tt +29 -0
  106. data/lib/templates/scaffolds/slim/new.html.slim.tt +11 -0
  107. data/lib/templates/scaffolds/slim/show.html.slim.tt +18 -0
  108. data/lib/templates/shared/footer/_footer.html.erb.tt +5 -0
  109. data/lib/templates/shared/footer/_footer.html.haml.tt +3 -0
  110. data/lib/templates/shared/footer/_footer.html.slim.tt +3 -0
  111. data/lib/templates/shared/navigation/_navigation.html.erb.tt +32 -0
  112. data/lib/templates/shared/navigation/_navigation.html.haml.tt +23 -0
  113. data/lib/templates/shared/navigation/_navigation.html.slim.tt +23 -0
  114. data/lib/templates/shared/pagination/_pagination.html.erb +5 -0
  115. data/lib/templates/shared/pagination/_pagination.html.haml +3 -0
  116. data/lib/templates/shared/pagination/_pagination.html.slim +3 -0
  117. data/tailwind_views_generator.gemspec +38 -0
  118. metadata +223 -0
@@ -0,0 +1,6 @@
1
+ - if resource.errors.any?
2
+ .error_explanation
3
+ h2 = I18n.t('errors.messages.not_saved', count: resource.errors.count, resource: resource.class.model_name.human.downcase)
4
+ ul
5
+ - resource.errors.full_messages.each do |message|
6
+ li = message
@@ -0,0 +1,20 @@
1
+ .text-center.text-sm.mt-2
2
+ - if controller_name != 'sessions'
3
+ = link_to "Log in", new_session_path(resource_name)
4
+ br
5
+ - if devise_mapping.registerable? && controller_name != 'registrations'
6
+ = link_to "Sign up", new_registration_path(resource_name)
7
+ br
8
+ - if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations'
9
+ = link_to "Forgot your password?", new_password_path(resource_name)
10
+ br
11
+ - if devise_mapping.confirmable? && controller_name != 'confirmations'
12
+ = link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name)
13
+ br
14
+ - if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks'
15
+ = link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name)
16
+ br
17
+ - if devise_mapping.omniauthable?
18
+ - resource_class.omniauth_providers.each do |provider|
19
+ = link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider)
20
+ br
@@ -0,0 +1,17 @@
1
+ div class='md:mx-auto md:max-w-md overflow-hidden mx-0'
2
+ .shadow-md.rounded.px-8.pt-6.pb-8.mb-4.flex.flex-col.justify-center.bg-gray-50
3
+ h2.text-center.text-xl.text-black
4
+ <%- if options[:metatags] -%>
5
+ = title('Resend unlock instructions')
6
+ <%- else -%>
7
+ | Resend unlock instructions
8
+ <%- end -%>
9
+
10
+ = form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f|
11
+ = render 'devise/shared/error_messages', resource: resource
12
+
13
+ .mb-4
14
+ = f.label :email, class: 'block email optional text-sm font-medium text-gray-600'
15
+ = f.email_field :email, autofocus: true, autocomplete: 'email', class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out'
16
+ = f.submit 'Resend unlock instructions', class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full'
17
+ = render 'devise/shared/links'
@@ -0,0 +1,36 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <meta charset="utf-8" />
5
+ <meta content="IE=Edge" http-equiv="X-UA-Compatible" />
6
+ <meta content="width=device-width, initial-scale=1.0" name="viewport" />
7
+ <%- if options[:metatags] -%>
8
+ <%%= display_meta_tags site: '<%= app_name %>' %>
9
+ <%- else -%>
10
+ <title><%= app_name %></title>
11
+ <%- end -%>
12
+ <%%= csrf_meta_tags %>
13
+ <%%= csp_meta_tag %>
14
+ <link rel="stylesheet" href="https://rsms.me/inter/inter.css" />
15
+ <%%= stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %> %>
16
+ <%- unless options[:skip_javascript] -%>
17
+ <%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
18
+ <%%= javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%> %>
19
+ <%- else -%>
20
+ <%%= javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%> %>
21
+ <%- end -%>
22
+ <%- end -%>
23
+ <!--IE Polyfill for CSS Properties-->
24
+ <!--[if lte IE 11]>
25
+ <script>window.MSInputMethodContext && document.documentMode && document.write('<scrip src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\/script>');</script>
26
+ <![endif]-->
27
+ </head>
28
+ <body class="antialiased flex flex-col min-h-screen font-sans font-normal leading-normal bg-white text-gray-400">
29
+ <%%= render 'shared/navigation' %>
30
+ <main class="w-full flex-grow px-5 my-7" role="main">
31
+ <%%= flash_messages %>
32
+ <%%= yield %>
33
+ </main>
34
+ <%%= render 'shared/footer' %>
35
+ </body>
36
+ </html>
@@ -0,0 +1,32 @@
1
+ !!!
2
+ %html
3
+ %head
4
+ %meta{content: "text/html; charset=UTF-8", "http-equiv" => "Content-Type"}
5
+ %meta{charset: "utf-8"}
6
+ %meta{content: "IE=Edge", "http-equiv" => "X-UA-Compatible"}
7
+ %meta{content: "width=device-width, initial-scale=1.0", name: "viewport"}
8
+ <%- if options[:metatags] -%>
9
+ = display_meta_tags site: '<%= app_name %>'
10
+ <%- else -%>
11
+ %title= '<%= app_name %>'
12
+ <%- end -%>
13
+ = csrf_meta_tags
14
+ = csp_meta_tag
15
+ %link{href: "https://rsms.me/inter/inter.css", rel: "stylesheet"}
16
+ = stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %>
17
+ <%- unless options[:skip_javascript] -%>
18
+ <%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
19
+ = javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%>
20
+ <%- else -%>
21
+ = javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%>
22
+ <%- end -%>
23
+ <%- end %>
24
+ / IE Polyfill for CSS Properties
25
+ /[if lte IE 11]
26
+ <script>window.MSInputMethodContext && document.documentMode && document.write('<scrip src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\/script>');</script>
27
+ %body.antialiased.flex.flex-col.min-h-screen.font-sans.font-normal.leading-normal.bg-white.text-gray-400
28
+ = render 'shared/navigation'
29
+ %main.w-full.flex-grow.px-5.my-7{role: "main"}
30
+ = flash_messages
31
+ = yield
32
+ = render 'shared/footer'
@@ -0,0 +1,31 @@
1
+ doctype html
2
+ html
3
+ head
4
+ meta charset="utf-8"
5
+ meta content="IE=Edge" http-equiv="X-UA-Compatible"
6
+ meta content="width=device-width, initial-scale=1.0" name="viewport"
7
+ <%- if options[:metatags] -%>
8
+ = display_meta_tags site: '<%= app_name %>'
9
+ <%- else -%>
10
+ title <%= app_name %>
11
+ <%- end -%>
12
+ = csrf_meta_tags
13
+ = csp_meta_tag
14
+ link rel="stylesheet" href="https://rsms.me/inter/inter.css"
15
+ = stylesheet_link_tag 'application', media: 'all'<%= (options[:skip_turbolinks] || options[:skip_javascript]) ? '' : ", 'data-turbolinks-track': 'reload'" %>
16
+ <%- unless options[:skip_javascript] -%>
17
+ <%- if Gem::Version.new(Rails.version) < Gem::Version.new('6.0') -%>
18
+ = javascript_include_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': true" -%>
19
+ <%- else -%>
20
+ = javascript_pack_tag 'application'<%= options[:skip_turbolinks] ? '' : ", 'data-turbolinks-track': 'reload'" -%>
21
+ <%- end -%>
22
+ <%- end %>
23
+ /! IE Polyfill for CSS Properties
24
+ /[if lte IE 11]
25
+ script window.MSInputMethodContext && document.documentMode && document.write('<scrip src="https://cdn.jsdelivr.net/gh/nuxodin/ie11CustomProperties@4.1.0/ie11CustomProperties.min.js"><\/script>');
26
+ body.antialiased.flex.flex-col.min-h-screen.font-sans.font-normal.leading-normal.bg-white.text-gray-400
27
+ = render 'shared/navigation'
28
+ main.w-full.flex-grow.px-5.my-7 role="main"
29
+ = flash_messages
30
+ = yield
31
+ = render 'shared/footer'
@@ -0,0 +1,22 @@
1
+ <%%= form_with(model: @<%= singular_table_name %>, local: true) do |f| %>
2
+ <%%= errors_for(@<%= singular_table_name %>) %>
3
+
4
+ <% attributes.each do |attribute| -%>
5
+ <%- if attribute.field_type == :check_box %>
6
+ <div class="mb-4 flex items-start">
7
+ <div class="flex items-center h5">
8
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'focus:ring-2 focus:ring-indigo-500:focus ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded' %>
9
+ </div>
10
+ <div class="ml-3 text-sm">
11
+ <%%= f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600' %>
12
+ </div>
13
+ </div>
14
+ <%- else -%>
15
+ <div class="mb-4">
16
+ <%%= f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600' %>
17
+ <%%= f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out' %>
18
+ </div>
19
+ <% end -%>
20
+ <% end -%>
21
+ <%%= f.submit class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full' %>
22
+ <%% end -%>
@@ -0,0 +1,13 @@
1
+ <div class="md:mx-auto w-full lg:w-1/2 overflow-hidden mx-0">
2
+ <div class="shadow-md rounded px-8 pt-6 pb-8 mb-4 flex flex-col justify-center bg-gray-50">
3
+ <%- if options[:metatags] %>
4
+ <h2 class="text-center text-xl text-black mb-3"><%%%= title('Editing <%%= singular_table_name.titleize %>') %></h1>
5
+ <%- else -%>
6
+ <h2 class="text-center text-xl text-black mb-3">Editing <%%= plural_table_name.titleize %></h1>
7
+ <%- end -%>
8
+ <%%%= render 'form', <%%= singular_table_name %>: @<%%= singular_table_name %> %>
9
+
10
+ </div>
11
+ </div>
12
+
13
+ <%%%= link_to 'Show', @<%%= singular_table_name %> %> | <%%%= link_to 'Back', <%%= index_helper %>_path %>
@@ -0,0 +1,38 @@
1
+ <div class="flex flex-row justify-start mb-5">
2
+ <h1 class="text-xl text-gray-600 mr-10">
3
+ <%- if options[:metatags] -%>
4
+ <%%%= title('<%%= plural_table_name.titleize %>') %>
5
+ <%- else -%>
6
+ <%%= plural_table_name.titleize %>
7
+ <%- end -%>
8
+ </h1>
9
+ <%%%= link_to 'New <%%= singular_table_name.titleize %>', new_<%%= singular_route_name %>_path, class: 'px-2 py-1 inline-flex text-xs font-semibold rounded-full bg-green-100 text-green-800 hover:bg-green-200' %>
10
+ </div>
11
+ <div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg">
12
+ <table class="min-w-full divide-y divide-gray-200 border-collapse">
13
+ <thead class="bg-gray-200">
14
+ <tr>
15
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
16
+ <th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" scope="col"><%%= attribute.human_name %></th>
17
+ <%% end -%>
18
+ <th class="px-3 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wider" scope="col" colspan="3"></th>
19
+ </tr>
20
+ </thead>
21
+ <tbody class="bg-white divide-y divide-gray-200">
22
+ <%%% @<%%= plural_table_name %>.each do |<%%= singular_table_name %>| %>
23
+ <tr class="bg-white hover:bg-blue-50 hover:text-gray-500">
24
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
25
+ <td class="px-3 py-3 text-sm whitespace-nowrap"><%%%= <%%= singular_table_name %>.<%%= attribute.column_name %> %></td>
26
+ <%% end -%>
27
+ <td class="px-3 py-3 text-sm whitespace-nowrap"><%%%= link_to 'Show', <%%= model_resource_name %>, class: 'inline-flex text-xs leading-5 font-semibold text-indigo-500 hover:underline cursor-pointer' %></td>
28
+ <td class="px-3 py-3 text-sm whitespace-nowrap"><%%%= link_to 'Edit', edit_<%%= singular_route_name %>_path(<%%= singular_table_name %>), class: 'inline-flex text-xs leading-5 font-semibold text-yellow-500 hover:underline cursor-pointer' %></td>
29
+ <td class="px-3 py-3 text-sm whitespace-nowrap"><%%%= link_to 'Destroy', <%%= model_resource_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'inline-flex text-xs leading-5 font-semibold text-red-500 hover:underline cursor-pointer' %></td>
30
+ </tr>
31
+ <%%% end %>
32
+ </tbody>
33
+ </table>
34
+
35
+ <%- if options[:pagination] -%>
36
+ <%%%= render 'shared/pagination' %>
37
+ <% end -%>
38
+ </div>
@@ -0,0 +1,14 @@
1
+ <div class="md:mx-auto w-full lg:w-1/2 overflow-hidden mx-0">
2
+ <div class="shadow-md rounded px-8 pt-6 pb-8 mb-4 flex flex-col justify-center bg-gray-50">
3
+
4
+ <%- if options[:metatags] %>
5
+ <h2 class="text-center text-xl text-black mb-3"><%%%= title('New <%%= singular_table_name.titleize %>') %></h1>
6
+ <%- else -%>
7
+ <h2 class="text-center text-xl text-black mb-3">New <%%= plural_table_name.titleize %></h1>
8
+ <%- end -%>
9
+
10
+ <%%%= render 'form', <%%= singular_table_name %>: @<%%= singular_table_name %> %>
11
+
12
+ <%%%= link_to 'Back', <%%= index_helper %>_path %>
13
+ </div>
14
+ </div>
@@ -0,0 +1,20 @@
1
+ <%- if options[:metatags] %>
2
+ <h1 class="text-xl text-gray-600 mr-10"><%%%= title('<%%= singular_table_name.titleize %>') %></h1>
3
+ <%- else -%>
4
+ <h1 class="text-xl text-gray-600 mr-10"><%%= plural_table_name.titleize %></h1>
5
+ <%- end -%>
6
+
7
+ <div class="border border-gray-200 my-7 shadow overflow-hidden rounded-sm">
8
+ <dl>
9
+ <%%- attributes.reject(&:password_digest?).each do |attribute| -%>
10
+ <div class="bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-4 sm:gap-4 sm:px-6">
11
+ <dt class="text-sm font-medium text-gray-500"><%%= attribute.human_name %></dt>
12
+ <dd class="mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-3"><%%%= @<%%= singular_table_name %>.<%%= attribute.name %> %></dd>
13
+ </div>
14
+ <%%- end -%>
15
+ </dl>
16
+ </div>
17
+
18
+ <%%%= link_to 'Edit', edit_<%%= singular_table_name %>_path(@<%%= singular_table_name %>), class: 'hover:underline' %>
19
+ &nbsp;|&nbsp;
20
+ <%%%= link_to 'Back', <%%= index_helper %>_path, class: 'hover:underline' %>
@@ -0,0 +1,17 @@
1
+ = form_with(model: @<%= singular_table_name %>, local: true) do |f|
2
+ = errors_for(@<%= singular_table_name %>)
3
+
4
+ <% attributes.each do |attribute| -%>
5
+ <%- if attribute.field_type == :check_box %>
6
+ .mb-4.flex.items-start
7
+ .flex.items-center.h5
8
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'focus:ring-2 focus:ring-indigo-500:focus ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded'
9
+ .ml-3.text-sm
10
+ = f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600'
11
+ <%- else -%>
12
+ .mb-4
13
+ = f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600'
14
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out'
15
+ <%- end -%>
16
+ <%- end -%>
17
+ = f.submit class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full'
@@ -0,0 +1,13 @@
1
+ %div{class: 'md:mx-auto w-full lg:w-1/2 overflow-hidden mx-0'}
2
+ .shadow-md.rounded.px-8.pt-6.pb-8.mb-4.flex.flex-col.justify-center.bg-gray-50
3
+ %h2.text-center.text-xl.text-black.mb-3
4
+ <%- if options[:metatags] %>
5
+ = title('Editing <%%= singular_table_name.titleize %>')
6
+ <%- else -%>
7
+ Editing <%%= plural_table_name.titleize %>
8
+ <%- end -%>
9
+ = render 'form', <%%= singular_table_name %>: @<%%= singular_table_name %>
10
+
11
+ = link_to 'Show', @<%%= singular_table_name %>
12
+ |
13
+ = link_to 'Back', <%%= index_helper %>_path
@@ -0,0 +1,29 @@
1
+ .flex.flex-row.justify-start.mb-5
2
+ %h1.text-xl.text-gray-600.mr-10
3
+ <%- if options[:metatags] -%>
4
+ = title('<%%= plural_table_name.titleize %>')
5
+ <%- else -%>
6
+ <%%= plural_table_name.titleize %>
7
+ <%- end -%>
8
+ = link_to 'New <%%= singular_table_name.titleize %>', new_<%%= singular_route_name %>_path, class: 'px-2 py-1 inline-flex text-xs font-semibold rounded-full bg-green-100 text-green-800 hover:bg-green-200'
9
+ %div{class: "shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"}
10
+ %table.min-w-full.divide-y.divide-gray-200.border-collapse
11
+ %thead.bg-gray-200
12
+ %tr
13
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
14
+ %th.px-3.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{scope: 'col'} <%%= attribute.human_name %>
15
+ <%% end -%>
16
+ %th.px-3.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider{scope: 'col', colspan: '3'}
17
+ %tbody.bg-white.divide-y.divide-gray-200
18
+ - @<%%= plural_table_name %>.each do |<%%= singular_table_name %>|
19
+ %tr.bg-white.hover:bg-blue-50.hover:text-gray-500
20
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
21
+ %td.px-3.py-3.text-sm.whitespace-nowrap= <%%= singular_table_name %>.<%%= attribute.column_name %>
22
+ <%% end -%>
23
+ %td.px-3.py-3.text-sm.whitespace-nowrap= link_to 'Show', <%%= model_resource_name %>, class: 'inline-flex text-xs leading-5 font-semibold text-indigo-500 hover:underline cursor-pointer'
24
+ %td.px-3.py-3.text-sm.whitespace-nowrap= link_to 'Edit', edit_<%%= singular_route_name %>_path(<%%= singular_table_name %>), class: 'inline-flex text-xs leading-5 font-semibold text-yellow-500 hover:underline cursor-pointer'
25
+ %td.px-3.py-3.text-sm.whitespace-nowrap= link_to 'Destroy', <%%= model_resource_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'inline-flex text-xs leading-5 font-semibold text-red-500 hover:underline cursor-pointer'
26
+
27
+ <%- if options[:pagination] -%>
28
+ = render 'shared/pagination'
29
+ <% end -%>
@@ -0,0 +1,10 @@
1
+ %div{class: 'md:mx-auto w-full lg:w-1/2 overflow-hidden mx-0'}
2
+ .shadow-md.rounded.px-8.pt-6.pb-8.mb-4.flex.flex-col.justify-center.bg-gray-50
3
+ %h2.text-center.text-xl.text-black.mb-3
4
+ <%- if options[:metatags] -%>
5
+ = title('New <%%= singular_table_name.titleize %>')
6
+ <%- else -%>
7
+ New <%%= plural_table_name.titleize %>
8
+ <%- end -%>
9
+ = render 'form', <%%= singular_table_name %>: @<%%= singular_table_name %>
10
+ = link_to 'Back', <%%= index_helper %>_path
@@ -0,0 +1,18 @@
1
+ %h1.text-xl.text-gray-600.mr-10
2
+ <%- if options[:metatags] %>
3
+ = title('<%%= singular_table_name.titleize %>')
4
+ <%- else -%>
5
+ <%%= plural_table_name.titleize %>
6
+ <%- end -%>
7
+
8
+ %div{class: "border border-gray-200 my-7 shadow overflow-hidden rounded-sm"}
9
+ %dl
10
+ <%%- attributes.reject(&:password_digest?).each do |attribute| -%>
11
+ %div{class: "bg-gray-50 px-4 py-5 sm:grid sm:grid-cols-4 sm:gap-4 sm:px-6"}
12
+ %dt.text-sm.font-medium.text-gray-500 <%%= attribute.human_name %>
13
+ %dd{class: "mt-1 text-sm text-gray-900 sm:mt-0 sm:col-span-3"}= @<%%= singular_table_name %>.<%%= attribute.name %>
14
+ <%%- end -%>
15
+
16
+ = link_to 'Edit', edit_<%%= singular_table_name %>_path(@<%%= singular_table_name %>), class: 'hover:underline'
17
+ |
18
+ = link_to 'Back', <%%= index_helper %>_path, class: 'hover:underline'
@@ -0,0 +1,9 @@
1
+ <%%= simple_form_for(@<%= singular_table_name %>) do |f| %>
2
+ <%%= errors_for(@<%= singular_table_name %>) %>
3
+
4
+ <%- attributes.each do |attribute| -%>
5
+ <%%= f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %> %>
6
+ <%- end -%>
7
+
8
+ <%%= f.button :submit %>
9
+ <%% end %>
@@ -0,0 +1,9 @@
1
+ = simple_form_for(@<%= singular_table_name %>) do |f|
2
+ = errors_for(@<%= singular_table_name %>)
3
+
4
+ <%- attributes.each do |attribute| -%>
5
+ .mb-4
6
+ = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
7
+ <%- end -%>
8
+
9
+ = f.button :submit, class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full'
@@ -0,0 +1,9 @@
1
+ = simple_form_for(@<%= singular_table_name %>) do |f|
2
+ = errors_for(@<%= singular_table_name %>)
3
+
4
+ <%- attributes.each do |attribute| -%>
5
+ .mb-4
6
+ = f.<%= attribute.reference? ? :association : :input %> :<%= attribute.name %>
7
+ <%- end -%>
8
+
9
+ = f.button :submit, class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full'
@@ -0,0 +1,17 @@
1
+ = form_with(model: @<%= singular_table_name %>, local: true) do |f|
2
+ = errors_for(@<%= singular_table_name %>)
3
+
4
+ <% attributes.each do |attribute| -%>
5
+ <%- if attribute.field_type == :check_box %>
6
+ .mb-4.flex.items-start
7
+ .flex.items-center.h5
8
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'focus:ring-2 focus:ring-indigo-500:focus ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded'
9
+ .ml-3.text-sm
10
+ = f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600'
11
+ <%- else -%>
12
+ .mb-4
13
+ = f.label :<%= attribute.name %>, class: 'text-sm font-medium text-gray-600'
14
+ = f.<%= attribute.field_type %> :<%= attribute.name %>, class: 'shadow appearance-none border border-gray-300 rounded w-full py-2 px-3 bg-white focus:outline-none focus:ring-0 focus:border-blue-500 text-gray-400 leading-6 transition-colors duration-200 ease-in-out'
15
+ <%- end -%>
16
+ <%- end -%>
17
+ = f.submit class: 'my-2 bg-blue-500 hover:bg-blue-700 text-white font-bold text-sm py-2 px-4 rounded w-full'
@@ -0,0 +1,13 @@
1
+ .md:mx-auto.w-full.lg:w-1/2.overflow-hidden.mx-0
2
+ .shadow-md.rounded.px-8.pt-6.pb-8.mb-4.flex.flex-col.justify-center.bg-gray-50
3
+ h2.text-center.text-xl.text-black.mb-3
4
+ <%- if options[:metatags] %>
5
+ = title('Editing <%%= singular_table_name.titleize %>')
6
+ <%- else -%>
7
+ <%%= plural_table_name.titleize %>
8
+ <%- end -%>
9
+ = render 'form', <%%= singular_table_name %>: @<%%= singular_table_name %>
10
+
11
+ = link_to 'Show', @<%%= singular_table_name %>
12
+ '&nbsp;|
13
+ = link_to 'Back', <%%= index_helper %>_path
@@ -0,0 +1,29 @@
1
+ .flex.flex-row.justify-start.mb-5
2
+ h1.text-xl.text-gray-600.mr-10
3
+ <%- if options[:metatags] -%>
4
+ = title('<%%= plural_table_name.titleize %>')
5
+ <%- else -%>
6
+ <%%= plural_table_name.titleize %>
7
+ <%- end -%>
8
+ = link_to 'New <%%= singular_table_name.titleize %>', new_<%%= singular_route_name %>_path, class: 'px-2 py-1 inline-flex text-xs font-semibold rounded-full bg-green-100 text-green-800 hover:bg-green-200'
9
+ div class="shadow overflow-hidden border-b border-gray-200 sm:rounded-lg"
10
+ table.min-w-full.divide-y.divide-gray-200.border-collapse
11
+ thead.bg-gray-200
12
+ tr
13
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
14
+ th.px-3.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider scope='col' <%%= attribute.human_name %>
15
+ <%% end -%>
16
+ th.px-3.py-3.text-left.text-xs.font-medium.text-gray-500.uppercase.tracking-wider scope='col' colspan='3'
17
+ tbody.bg-white.divide-y.divide-gray-200
18
+ - @<%%= plural_table_name %>.each do |<%%= singular_table_name %>|
19
+ tr.bg-white.hover:bg-blue-50.hover:text-gray-500
20
+ <%% attributes.reject(&:password_digest?).each do |attribute| -%>
21
+ td.px-3.py-3.text-sm.whitespace-nowrap = <%%= singular_table_name %>.<%%= attribute.column_name %>
22
+ <%% end -%>
23
+ td.px-3.py-3.text-sm.whitespace-nowrap = link_to 'Show', <%%= model_resource_name %>, class: 'inline-flex text-xs leading-5 font-semibold text-indigo-500 hover:underline cursor-pointer'
24
+ td.px-3.py-3.text-sm.whitespace-nowrap = link_to 'Edit', edit_<%%= singular_route_name %>_path(<%%= singular_table_name %>), class: 'inline-flex text-xs leading-5 font-semibold text-yellow-500 hover:underline cursor-pointer'
25
+ td.px-3.py-3.text-sm.whitespace-nowrap = link_to 'Destroy', <%%= model_resource_name %>, method: :delete, data: { confirm: 'Are you sure?' }, class: 'inline-flex text-xs leading-5 font-semibold text-red-500 hover:underline cursor-pointer'
26
+
27
+ <%- if options[:pagination] -%>
28
+ = render 'shared/pagination'
29
+ <% end -%>