tybo 0.0.3 → 0.0.4

Sign up to get free protection for your applications and to get access to all the features.
Files changed (141) hide show
  1. checksums.yaml +4 -4
  2. data/MIT-LICENSE +20 -0
  3. data/README.md +23 -0
  4. data/Rakefile +8 -0
  5. data/app/assets/config/tybo_manifest.js +1 -0
  6. data/app/assets/stylesheets/tybo/application.css +15 -0
  7. data/{lib/app → app}/components/attachment_card_component.html.erb +0 -0
  8. data/{lib/app → app}/components/attachment_card_component.rb +0 -0
  9. data/{lib/app → app}/components/attachments_list_component.html.erb +0 -0
  10. data/{lib/app → app}/components/attachments_list_component.rb +0 -0
  11. data/{lib/app → app}/components/current_user_mini_card_component.html.erb +2 -2
  12. data/{lib/app → app}/components/current_user_mini_card_component.rb +0 -0
  13. data/{lib/app → app}/components/form_component.html.erb +0 -0
  14. data/{lib/app → app}/components/form_component.rb +0 -0
  15. data/{lib/app → app}/components/forms/breadcrumb_component.html.erb +0 -0
  16. data/{lib/app → app}/components/forms/breadcrumb_component.rb +0 -0
  17. data/{lib/app → app}/components/forms/delete_button_component.html.erb +0 -0
  18. data/{lib/app → app}/components/forms/delete_button_component.rb +0 -0
  19. data/{lib/app → app}/components/forms/divider_component.html.erb +0 -0
  20. data/{lib/app → app}/components/forms/divider_component.rb +0 -0
  21. data/{lib/app → app}/components/forms/submit_button_component.html.erb +0 -0
  22. data/{lib/app → app}/components/forms/submit_button_component.rb +0 -0
  23. data/{lib/app → app}/components/forms/subtitle_component.html.erb +0 -0
  24. data/{lib/app → app}/components/forms/subtitle_component.rb +0 -0
  25. data/{lib/app → app}/components/forms/title_component.html.erb +0 -0
  26. data/{lib/app → app}/components/forms/title_component.rb +0 -0
  27. data/{lib/app → app}/components/icons/collection_component.html.erb +0 -0
  28. data/{lib/app → app}/components/icons/collection_component.rb +0 -0
  29. data/{lib/app → app}/components/icons/home_component.html.erb +0 -0
  30. data/{lib/app → app}/components/icons/home_component.rb +0 -0
  31. data/{lib/app → app}/components/icons/mic_component.html.erb +0 -0
  32. data/{lib/app → app}/components/icons/mic_component.rb +0 -0
  33. data/{lib/app → app}/components/icons/news_paper_component.html.erb +0 -0
  34. data/{lib/app → app}/components/icons/news_paper_component.rb +0 -0
  35. data/{lib/app → app}/components/icons/office_building_component.html.erb +0 -0
  36. data/{lib/app → app}/components/icons/office_building_component.rb +0 -0
  37. data/{lib/app → app}/components/icons/question_mark_circle_component.html.erb +0 -0
  38. data/{lib/app → app}/components/icons/question_mark_circle_component.rb +0 -0
  39. data/{lib/app → app}/components/icons/trash_component.html.erb +0 -0
  40. data/{lib/app → app}/components/icons/trash_component.rb +0 -0
  41. data/{lib/app → app}/components/icons/users_component.html.erb +0 -0
  42. data/{lib/app → app}/components/icons/users_component.rb +0 -0
  43. data/{lib/app → app}/components/index_component.html.erb +0 -0
  44. data/{lib/app → app}/components/index_component.rb +0 -0
  45. data/{lib/app → app}/components/index_header_add_component.html.erb +0 -0
  46. data/{lib/app → app}/components/index_header_add_component.rb +0 -0
  47. data/{lib/app → app}/components/index_header_component.html.erb +0 -0
  48. data/{lib/app → app}/components/index_header_component.rb +0 -0
  49. data/{lib/app → app}/components/input/file_component.html.erb +0 -0
  50. data/{lib/app → app}/components/input/file_component.rb +0 -0
  51. data/{lib/app → app}/components/sidebar_component.html.erb +0 -0
  52. data/{lib/app → app}/components/sidebar_component.rb +0 -0
  53. data/{lib/app → app}/components/sidebar_item_component.html.erb +0 -0
  54. data/{lib/app → app}/components/sidebar_item_component.rb +0 -0
  55. data/{lib/app → app}/components/sign_out_button_component.html.erb +1 -1
  56. data/{lib/app → app}/components/sign_out_button_component.rb +3 -0
  57. data/{lib/app → app}/components/tables/active_record_th_component.html.erb +0 -0
  58. data/{lib/app → app}/components/tables/active_record_th_component.rb +1 -0
  59. data/{lib/app → app}/components/tables/table_component.html.erb +0 -0
  60. data/{lib/app → app}/components/tables/table_component.rb +0 -0
  61. data/{lib/app → app}/components/tables/tbody_component.html.erb +0 -0
  62. data/{lib/app → app}/components/tables/tbody_component.rb +0 -0
  63. data/{lib/app → app}/components/tables/td_component.html.erb +1 -1
  64. data/{lib/app → app}/components/tables/td_component.rb +0 -0
  65. data/{lib/app → app}/components/tables/th_component.html.erb +0 -0
  66. data/{lib/app → app}/components/tables/th_component.rb +0 -0
  67. data/{lib/app → app}/components/tables/thead_component.html.erb +0 -0
  68. data/{lib/app → app}/components/tables/thead_component.rb +0 -0
  69. data/{lib/app → app}/components/tables/tr_component.html.erb +0 -0
  70. data/{lib/app → app}/components/tables/tr_component.rb +0 -0
  71. data/app/controllers/tybo/application_controller.rb +4 -0
  72. data/app/controllers/tybo/login_controller.rb +8 -0
  73. data/app/helpers/tybo/application_helper.rb +5 -0
  74. data/app/helpers/tybo/flash_helper.rb +12 -0
  75. data/app/jobs/tybo/application_job.rb +4 -0
  76. data/app/mailers/tybo/application_mailer.rb +6 -0
  77. data/app/models/tybo/application_record.rb +5 -0
  78. data/app/views/devise/confirmations/new.html.erb +20 -0
  79. data/app/views/devise/login/home.html.erb +20 -0
  80. data/app/views/devise/mailer/_reset_password_instructions.html.erb +8 -0
  81. data/app/views/devise/mailer/confirmation_instructions.html.erb +5 -0
  82. data/app/views/devise/mailer/email_changed.html.erb +7 -0
  83. data/app/views/devise/mailer/password_change.html.erb +3 -0
  84. data/app/views/devise/mailer/unlock_instructions.html.erb +7 -0
  85. data/app/views/devise/passwords/edit.html.erb +36 -0
  86. data/app/views/devise/passwords/new.html.erb +34 -0
  87. data/app/views/devise/registrations/edit.html.erb +35 -0
  88. data/app/views/devise/registrations/new.html.erb +25 -0
  89. data/app/views/devise/sessions/new.html.erb +50 -0
  90. data/app/views/devise/shared/_devise_errors.html.erb +26 -0
  91. data/app/views/devise/shared/_error_messages.html.erb +15 -0
  92. data/app/views/devise/shared/_links.html.erb +65 -0
  93. data/app/views/devise/unlocks/new.html.erb +19 -0
  94. data/app/views/layouts/_errors.html.erb +22 -0
  95. data/app/views/layouts/_flash.html.erb +24 -0
  96. data/app/views/layouts/devise_admin.html.erb +16 -0
  97. data/app/views/layouts/tybo/application.html.erb +14 -0
  98. data/app/views/login/home.html.erb +19 -0
  99. data/app/views/shared/_pagination.html.erb +36 -0
  100. data/config/initializers/devise.rb +311 -0
  101. data/config/initializers/pagy.rb +246 -0
  102. data/config/initializers/ransack.rb +13 -0
  103. data/config/locales/devise.en.yml +65 -0
  104. data/config/routes.rb +3 -0
  105. data/lib/generators/bo/USAGE +12 -0
  106. data/lib/generators/bo/bo_generator.rb +88 -0
  107. data/lib/generators/bo/templates/_form.html.erb +32 -0
  108. data/lib/generators/bo/templates/_search_bar.html.erb +96 -0
  109. data/lib/generators/bo/templates/_table.html.erb +29 -0
  110. data/lib/generators/bo/templates/controller.rb +66 -0
  111. data/lib/generators/bo/templates/index.html.erb +19 -0
  112. data/lib/generators/bo/templates/item.html.erb +17 -0
  113. data/lib/generators/bo/templates/new.html.erb +1 -0
  114. data/lib/generators/bo/templates/show.html.erb +1 -0
  115. data/lib/generators/bo/utils/files/fr.json +19 -0
  116. data/lib/generators/bo/utils/translations.rb +47 -0
  117. data/lib/generators/bo_namespace/USAGE +11 -0
  118. data/lib/generators/bo_namespace/bo_namespace_generator.rb +50 -0
  119. data/lib/generators/bo_namespace/templates/admin.html.erb +27 -0
  120. data/lib/generators/bo_namespace/templates/admin_controller.rb +7 -0
  121. data/lib/generators/bo_namespace/templates/seeds.rb +9 -0
  122. data/lib/generators/bo_namespace/templates/side_bar.html.erb +4 -0
  123. data/lib/generators/tybo_install/templates/application.tailwind.css +112 -0
  124. data/lib/generators/tybo_install/templates/simple_form_tailwind.rb +147 -0
  125. data/lib/generators/tybo_install/templates/tailwind.config.js +40 -0
  126. data/lib/generators/tybo_install/templates/tom-select.css +458 -0
  127. data/lib/generators/tybo_install/tybo_install_generator.rb +44 -0
  128. data/lib/tybo/engine.rb +19 -0
  129. data/lib/tybo/version.rb +3 -0
  130. data/lib/tybo.rb +4 -43
  131. metadata +186 -98
  132. data/lib/app/helpers/application_helper.rb +0 -5
  133. data/lib/app/helpers/flash_helper.rb +0 -16
  134. data/lib/app/javascript/controllers/attachments_controller.js +0 -14
  135. data/lib/app/javascript/controllers/dropdown_controller.js +0 -15
  136. data/lib/app/javascript/controllers/flash_controller.js +0 -7
  137. data/lib/app/javascript/controllers/index.js +0 -6
  138. data/lib/app/javascript/controllers/questions_controller.js +0 -61
  139. data/lib/app/javascript/controllers/search_form_controller.js +0 -20
  140. data/lib/app/javascript/controllers/ts/search_controller.js +0 -35
  141. data/lib/app/javascript/controllers/ts/select_controller.js +0 -9
@@ -0,0 +1,26 @@
1
+
2
+ <% if notice || alert %>
3
+ <div class="rounded-md bg-red-50 p-4 my-3" data-controller="flash">
4
+ <div class="flex">
5
+ <div class="flex-shrink-0">
6
+ <svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
7
+ <path fill-rule="evenodd" d="M8.485 3.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 3.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
8
+ </svg>
9
+ </div>
10
+ <div class="ml-3">
11
+ <p class="text-sm font-medium text-indigo-800"><%= notice %></p>
12
+ <p class="text-sm font-medium text-red-800"><%= alert %></p>
13
+ </div>
14
+ <div class="ml-auto pl-3">
15
+ <div class="-mx-1.5 -my-1.5">
16
+ <button type="button" data-action="flash#dismiss" class="inline-flex bg-red-50 rounded-md p-1.5 text-red-500 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
17
+ <span class="sr-only">Dismiss</span>
18
+ <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
19
+ <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"/>
20
+ </svg>
21
+ </button>
22
+ </div>
23
+ </div>
24
+ </div>
25
+ </div>
26
+ <% end %>
@@ -0,0 +1,15 @@
1
+ <% if resource.errors.any? %>
2
+ <div id="error_explanation">
3
+ <h2>
4
+ <%= I18n.t("errors.messages.not_saved",
5
+ count: resource.errors.count,
6
+ resource: resource.class.model_name.human.downcase)
7
+ %>
8
+ </h2>
9
+ <ul>
10
+ <% resource.errors.full_messages.each do |message| %>
11
+ <li><%= message %></li>
12
+ <% end %>
13
+ </ul>
14
+ </div>
15
+ <% end %>
@@ -0,0 +1,65 @@
1
+ <div class="space-y-1 mt-1">
2
+ <%- if controller_name != 'sessions' %>
3
+ <%= link_to "Log in", new_session_path(resource_name), class: "inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50" %><br />
4
+ <% end %>
5
+
6
+ <%- if devise_mapping.registerable? && controller_name != 'registrations' %>
7
+ <%= link_to "Sign up", new_registration_path(resource_name), class: "inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50" %><br />
8
+ <% end %>
9
+
10
+ <%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
11
+ <%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
12
+ <% end %>
13
+
14
+ <%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
15
+ <%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
16
+ <% end %>
17
+
18
+ <%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
19
+ <%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
20
+ <% end %>
21
+ </div>
22
+ <%- if devise_mapping.omniauthable? %>
23
+ <%- resource_class.omniauth_providers.each do |provider| %>
24
+ <%= link_to "Sign in with #{OmniAuth::Utils.camelize(provider)}", omniauth_authorize_path(resource_name, provider), method: :post %><br />
25
+ <% end %>
26
+ <div class="mt-6">
27
+ <div class="relative">
28
+ <div class="absolute inset-0 flex items-center">
29
+ <div class="w-full border-t border-gray-300"></div>
30
+ </div>
31
+ <div class="relative flex justify-center text-sm">
32
+ <span class="bg-white px-2 text-gray-500"></span>
33
+ </div>
34
+ </div>
35
+
36
+ <div class="mt-6 grid grid-cols-3 gap-3">
37
+ <div>
38
+ <a href="#" class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
39
+ <span class="sr-only">Sign in with Facebook</span>
40
+ <svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
41
+ <path fill-rule="evenodd" d="M20 10c0-5.523-4.477-10-10-10S0 4.477 0 10c0 4.991 3.657 9.128 8.438 9.878v-6.987h-2.54V10h2.54V7.797c0-2.506 1.492-3.89 3.777-3.89 1.094 0 2.238.195 2.238.195v2.46h-1.26c-1.243 0-1.63.771-1.63 1.562V10h2.773l-.443 2.89h-2.33v6.988C16.343 19.128 20 14.991 20 10z" clip-rule="evenodd" />
42
+ </svg>
43
+ </a>
44
+ </div>
45
+
46
+ <div>
47
+ <a href="#" class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
48
+ <span class="sr-only">Sign in with Twitter</span>
49
+ <svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
50
+ <path d="M6.29 18.251c7.547 0 11.675-6.253 11.675-11.675 0-.178 0-.355-.012-.53A8.348 8.348 0 0020 3.92a8.19 8.19 0 01-2.357.646 4.118 4.118 0 001.804-2.27 8.224 8.224 0 01-2.605.996 4.107 4.107 0 00-6.993 3.743 11.65 11.65 0 01-8.457-4.287 4.106 4.106 0 001.27 5.477A4.073 4.073 0 01.8 7.713v.052a4.105 4.105 0 003.292 4.022 4.095 4.095 0 01-1.853.07 4.108 4.108 0 003.834 2.85A8.233 8.233 0 010 16.407a11.616 11.616 0 006.29 1.84" />
51
+ </svg>
52
+ </a>
53
+ </div>
54
+
55
+ <div>
56
+ <a href="#" class="inline-flex w-full justify-center rounded-md border border-gray-300 bg-white py-2 px-4 text-sm font-medium text-gray-500 shadow-sm hover:bg-gray-50">
57
+ <span class="sr-only">Sign in with GitHub</span>
58
+ <svg class="h-5 w-5" fill="currentColor" viewBox="0 0 20 20" aria-hidden="true">
59
+ <path fill-rule="evenodd" d="M10 0C4.477 0 0 4.484 0 10.017c0 4.425 2.865 8.18 6.839 9.504.5.092.682-.217.682-.483 0-.237-.008-.868-.013-1.703-2.782.605-3.369-1.343-3.369-1.343-.454-1.158-1.11-1.466-1.11-1.466-.908-.62.069-.608.069-.608 1.003.07 1.531 1.032 1.531 1.032.892 1.53 2.341 1.088 2.91.832.092-.647.35-1.088.636-1.338-2.22-.253-4.555-1.113-4.555-4.951 0-1.093.39-1.988 1.029-2.688-.103-.253-.446-1.272.098-2.65 0 0 .84-.27 2.75 1.026A9.564 9.564 0 0110 4.844c.85.004 1.705.115 2.504.337 1.909-1.296 2.747-1.027 2.747-1.027.546 1.379.203 2.398.1 2.651.64.7 1.028 1.595 1.028 2.688 0 3.848-2.339 4.695-4.566 4.942.359.31.678.921.678 1.856 0 1.338-.012 2.419-.012 2.747 0 .268.18.58.688.482A10.019 10.019 0 0020 10.017C20 4.484 15.522 0 10 0z" clip-rule="evenodd" />
60
+ </svg>
61
+ </a>
62
+ </div>
63
+ </div>
64
+ </div>
65
+ <% end %>
@@ -0,0 +1,19 @@
1
+ <h2>Resend unlock instructions</h2>
2
+
3
+ <%= simple_form_for(resource, as: resource_name, url: unlock_path(resource_name), html: { method: :post }) do |f| %>
4
+ <%= f.error_notification %>
5
+ <%= f.full_error :unlock_token %>
6
+
7
+ <div class="form-inputs">
8
+ <%= f.input :email,
9
+ required: true,
10
+ autofocus: true,
11
+ input_html: { autocomplete: "email" } %>
12
+ </div>
13
+
14
+ <div class="form-actions">
15
+ <%= f.button :submit, "Resend unlock instructions" %>
16
+ </div>
17
+ <% end %>
18
+
19
+ <%= render "devise/shared/links" %>
@@ -0,0 +1,22 @@
1
+ <div class="rounded-md bg-red-50 p-4 my-3" data-controller="flash">
2
+ <div class="flex">
3
+ <div class="flex-shrink-0">
4
+ <svg class="h-5 w-5 text-red-400" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
5
+ <path fill-rule="evenodd" d="M8.485 3.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 3.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
6
+ </svg>
7
+ </div>
8
+ <div class="ml-3">
9
+ <p class="text-sm font-medium text-red-800"><%= errors %></p>
10
+ </div>
11
+ <div class="ml-auto pl-3">
12
+ <div class="-mx-1.5 -my-1.5">
13
+ <button type="button" data-action="flash#dismiss" class="inline-flex bg-red-50 rounded-md p-1.5 text-red-500 hover:bg-red-100 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-red-50 focus:ring-red-600">
14
+ <span class="sr-only">Dismiss</span>
15
+ <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
16
+ <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"/>
17
+ </svg>
18
+ </button>
19
+ </div>
20
+ </div>
21
+ </div>
22
+ </div>
@@ -0,0 +1,24 @@
1
+ <% flash.each do |key, errors| %>
2
+ <div class="<%= classes_for_flash(key) %> m-5 p-5 rounded-md" data-controller="flash">
3
+ <div class="flex">
4
+ <div class="flex-shrink-0">
5
+ <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
6
+ <path fill-rule="evenodd" d="M8.485 3.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 3.495zM10 6a.75.75 0 01.75.75v3.5a.75.75 0 01-1.5 0v-3.5A.75.75 0 0110 6zm0 9a1 1 0 100-2 1 1 0 000 2z" clip-rule="evenodd"/>
7
+ </svg>
8
+ </div>
9
+ <div class="ml-3">
10
+ <p class="text-sm font-medium bold"><%= errors %></p>
11
+ </div>
12
+ <div class="ml-auto pl-3">
13
+ <div class="-mx-1.5 -my-1.5">
14
+ <button type="button" data-action="flash#dismiss" class="inline-flex rounded-md p-1.5 focus:outline-none focus:ring-2 focus:ring-offset-2">
15
+ <span class="sr-only">Dismiss</span>
16
+ <svg class="h-5 w-5" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20" fill="currentColor" aria-hidden="true">
17
+ <path d="M6.28 5.22a.75.75 0 00-1.06 1.06L8.94 10l-3.72 3.72a.75.75 0 101.06 1.06L10 11.06l3.72 3.72a.75.75 0 101.06-1.06L11.06 10l3.72-3.72a.75.75 0 00-1.06-1.06L10 8.94 6.28 5.22z"/>
18
+ </svg>
19
+ </button>
20
+ </div>
21
+ </div>
22
+ </div>
23
+ </div>
24
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <!DOCTYPE html>
2
+ <html class="h-full bg-white">
3
+ <head>
4
+ <title>TY-BO</title>
5
+ <meta name="viewport" content="width=device-width,initial-scale=1">
6
+ <%= csrf_meta_tags %>
7
+ <%= csp_meta_tag %>
8
+ <%= stylesheet_link_tag "tailwind", "inter-font", "data-turbo-track": "reload" %>
9
+ <%= javascript_importmap_tags %>
10
+ </head>
11
+ <body class="h-full">
12
+ <main class="flex min-h-full">
13
+ <%= yield %>
14
+ </main>
15
+ </body>
16
+ </html>
@@ -0,0 +1,14 @@
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Tybo</title>
5
+ <%= csrf_meta_tags %>
6
+ <%= csp_meta_tag %>
7
+ <%= stylesheet_link_tag "tybo", "data-turbo-track": "reload" %>
8
+ </head>
9
+ <body>
10
+
11
+ <%= yield %>
12
+
13
+ </body>
14
+ </html>
@@ -0,0 +1,19 @@
1
+
2
+ <div class="flex flex-1 flex-col justify-center py-12 px-4 sm:px-6 lg:flex-none lg:px-20 xl:px-24">
3
+ <div class="mx-auto w-full max-w-sm lg:w-96">
4
+ <div>
5
+ <img class="h-12 w-auto" src="https://www.datocms-assets.com/33962/1667497145-logo-colored.svg" alt="Your Company">
6
+ <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Sign in to your account</h2>
7
+ </div>
8
+ <div class="mt-4">
9
+ <% @resources.each do |resource| %>
10
+ <a href="<%=send("new_#{resource.to_s}_session_path")%>" class="mt-2 flex w-full justify-center rounded-md border border-transparent bg-indigo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-indigo-500 focus:ring-offset-2">
11
+ Sign in as <%= I18n.t("bo.#{resource.to_s}.one")%>
12
+ </a>
13
+ <% end %>
14
+ </div>
15
+ </div>
16
+ </div>
17
+ <div class="relative hidden w-0 flex-1 lg:block">
18
+ <img class="absolute inset-0 h-full w-full object-cover" src="https://tymate.com/_next/image?url=https%3A%2F%2Fwww.datocms-assets.com%2F33962%2F1667561118-natif-dribbble-2.png%3Fw%3D1600&w=1920&q=75" alt="">
19
+ </div>
@@ -0,0 +1,36 @@
1
+ <% link = pagy_link_proc(pagy) -%>
2
+ <nav class="mx-auto mt-6 flex max-w-7xl justify-between px-4 text-sm font-medium text-gray-700 sm:px-6 lg:px-8" role="navigation">
3
+
4
+ <% if pagy.prev -%>
5
+ <div class="min-w-0 flex-1">
6
+ <%== link.call(pagy.prev, pagy_t('pagy.nav.prev'), 'aria-label="previous" class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-indigo-600""') %>
7
+ </div>
8
+ <% else -%>
9
+ <div class="min-w-0 flex-1">
10
+ <%== link.call(pagy.next, pagy_t('pagy.nav.prev'), 'aria-label="next" class="hidden"') %>
11
+ </div>
12
+ <% end -%>
13
+ <% if pagy.next -%>
14
+ <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
15
+ <% if item.is_a?(Integer) -%>
16
+ <%== link.call(item, item, 'class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-indigo-600"') %>
17
+ <% elsif item.is_a?(String) -%>
18
+ <%== link.call(item, item, 'class="toto inline-flex h-10 items-center rounded-md border border-indigo-600 bg-white px-4 ring-1 ring-indigo-600 hover:bg-gray-100 focus:border-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-indigo-600"') %>
19
+ <% elsif item == :gap -%>
20
+ <span class="inline-flex h-10 items-center px-1.5 text-gray-500">
21
+ <%== pagy_t('pagy.nav.gap') %>
22
+ </span>
23
+ <% end -%>
24
+ <% end -%>
25
+ <% end -%>
26
+
27
+ <% if pagy.next -%>
28
+ <div class="flex min-w-0 flex-1 justify-end">
29
+ <%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next" class="inline-flex h-10 items-center rounded-md border border-gray-300 bg-white px-4 hover:bg-gray-100 focus:border-indigo-600 focus:outline-none focus:ring-2 focus:ring-indigo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-indigo-600"') %>
30
+ </div>
31
+ <% else -%>
32
+ <div class="flex min-w-0 flex-1 justify-end">
33
+ <%== link.call(pagy.next, pagy_t('pagy.nav.next'), 'aria-label="next" class="hidden"') %>
34
+ </div>
35
+ <% end -%>
36
+ </nav>
@@ -0,0 +1,311 @@
1
+ # frozen_string_literal: true
2
+
3
+ # Assuming you have not yet modified this file, each configuration option below
4
+ # is set to its default value. Note that some are commented out while others
5
+ # are not: uncommented lines are intended to protect your configuration from
6
+ # breaking changes in upgrades (i.e., in the event that future versions of
7
+ # Devise change the default values for those options).
8
+ #
9
+ # Use this hook to configure devise mailer, warden hooks and so forth.
10
+ # Many of these configuration options can be set straight in your model.
11
+ Devise.setup do |config|
12
+ # The secret key used by Devise. Devise uses this key to generate
13
+ # random tokens. Changing this key will render invalid all existing
14
+ # confirmation, reset password and unlock tokens in the database.
15
+ # Devise will use the `secret_key_base` as its `secret_key`
16
+ # by default. You can change it below and use your own secret key.
17
+ # config.secret_key = 'f2db45f41dff5f5dcad76fa6760490bf0cd1a23391c3cd5485f9d0ec4f4dcb538091b1c481a78a24dea2ebef4db12895ed53c5493d09435c2dbe3c2af4417004'
18
+
19
+ # ==> Controller configuration
20
+ # Configure the parent class to the devise controllers.
21
+ # config.parent_controller = 'DeviseController'
22
+
23
+ # ==> Mailer Configuration
24
+ # Configure the e-mail address which will be shown in Devise::Mailer,
25
+ # note that it will be overwritten if you use your own mailer class
26
+ # with default "from" parameter.
27
+ config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
28
+
29
+ # Configure the class responsible to send e-mails.
30
+ # config.mailer = 'Devise::Mailer'
31
+
32
+ # Configure the parent class responsible to send e-mails.
33
+ # config.parent_mailer = 'ActionMailer::Base'
34
+
35
+ # ==> ORM configuration
36
+ # Load and configure the ORM. Supports :active_record (default) and
37
+ # :mongoid (bson_ext recommended) by default. Other ORMs may be
38
+ # available as additional gems.
39
+ require 'devise/orm/active_record'
40
+
41
+ # ==> Configuration for any authentication mechanism
42
+ # Configure which keys are used when authenticating a user. The default is
43
+ # just :email. You can configure it to use [:username, :subdomain], so for
44
+ # authenticating a user, both parameters are required. Remember that those
45
+ # parameters are used only when authenticating and not when retrieving from
46
+ # session. If you need permissions, you should implement that in a before filter.
47
+ # You can also supply a hash where the value is a boolean determining whether
48
+ # or not authentication should be aborted when the value is not present.
49
+ # config.authentication_keys = [:email]
50
+
51
+ # Configure parameters from the request object used for authentication. Each entry
52
+ # given should be a request method and it will automatically be passed to the
53
+ # find_for_authentication method and considered in your model lookup. For instance,
54
+ # if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
55
+ # The same considerations mentioned for authentication_keys also apply to request_keys.
56
+ # config.request_keys = []
57
+
58
+ # Configure which authentication keys should be case-insensitive.
59
+ # These keys will be downcased upon creating or modifying a user and when used
60
+ # to authenticate or find a user. Default is :email.
61
+ config.case_insensitive_keys = [:email]
62
+
63
+ # Configure which authentication keys should have whitespace stripped.
64
+ # These keys will have whitespace before and after removed upon creating or
65
+ # modifying a user and when used to authenticate or find a user. Default is :email.
66
+ config.strip_whitespace_keys = [:email]
67
+
68
+ # Tell if authentication through request.params is enabled. True by default.
69
+ # It can be set to an array that will enable params authentication only for the
70
+ # given strategies, for example, `config.params_authenticatable = [:database]` will
71
+ # enable it only for database (email + password) authentication.
72
+ # config.params_authenticatable = true
73
+
74
+ # Tell if authentication through HTTP Auth is enabled. False by default.
75
+ # It can be set to an array that will enable http authentication only for the
76
+ # given strategies, for example, `config.http_authenticatable = [:database]` will
77
+ # enable it only for database authentication.
78
+ # For API-only applications to support authentication "out-of-the-box", you will likely want to
79
+ # enable this with :database unless you are using a custom strategy.
80
+ # The supported strategies are:
81
+ # :database = Support basic authentication with authentication key + password
82
+ # config.http_authenticatable = false
83
+
84
+ # If 401 status code should be returned for AJAX requests. True by default.
85
+ # config.http_authenticatable_on_xhr = true
86
+
87
+ # The realm used in Http Basic Authentication. 'Application' by default.
88
+ # config.http_authentication_realm = 'Application'
89
+
90
+ # It will change confirmation, password recovery and other workflows
91
+ # to behave the same regardless if the e-mail provided was right or wrong.
92
+ # Does not affect registerable.
93
+ # config.paranoid = true
94
+
95
+ # By default Devise will store the user in session. You can skip storage for
96
+ # particular strategies by setting this option.
97
+ # Notice that if you are skipping storage for all authentication paths, you
98
+ # may want to disable generating routes to Devise's sessions controller by
99
+ # passing skip: :sessions to `devise_for` in your config/routes.rb
100
+ config.skip_session_storage = [:http_auth]
101
+
102
+ # By default, Devise cleans up the CSRF token on authentication to
103
+ # avoid CSRF token fixation attacks. This means that, when using AJAX
104
+ # requests for sign in and sign up, you need to get a new CSRF token
105
+ # from the server. You can disable this option at your own risk.
106
+ # config.clean_up_csrf_token_on_authentication = true
107
+
108
+ # When false, Devise will not attempt to reload routes on eager load.
109
+ # This can reduce the time taken to boot the app but if your application
110
+ # requires the Devise mappings to be loaded during boot time the application
111
+ # won't boot properly.
112
+ # config.reload_routes = true
113
+
114
+ # ==> Configuration for :database_authenticatable
115
+ # For bcrypt, this is the cost for hashing the password and defaults to 12. If
116
+ # using other algorithms, it sets how many times you want the password to be hashed.
117
+ # The number of stretches used for generating the hashed password are stored
118
+ # with the hashed password. This allows you to change the stretches without
119
+ # invalidating existing passwords.
120
+ #
121
+ # Limiting the stretches to just one in testing will increase the performance of
122
+ # your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
123
+ # a value less than 10 in other environments. Note that, for bcrypt (the default
124
+ # algorithm), the cost increases exponentially with the number of stretches (e.g.
125
+ # a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
126
+ config.stretches = Rails.env.test? ? 1 : 12
127
+
128
+ # Set up a pepper to generate the hashed password.
129
+ # config.pepper = '6d099d571921492a580c14dd259ec5c074f1eac78938689e00690b3c8fea2cb8062076445b07edf08c4ac7f7e3760a687624702b2faf9ccf03e60f38402e82ed'
130
+
131
+ # Send a notification to the original email when the user's email is changed.
132
+ # config.send_email_changed_notification = false
133
+
134
+ # Send a notification email when the user's password is changed.
135
+ # config.send_password_change_notification = false
136
+
137
+ # ==> Configuration for :confirmable
138
+ # A period that the user is allowed to access the website even without
139
+ # confirming their account. For instance, if set to 2.days, the user will be
140
+ # able to access the website for two days without confirming their account,
141
+ # access will be blocked just in the third day.
142
+ # You can also set it to nil, which will allow the user to access the website
143
+ # without confirming their account.
144
+ # Default is 0.days, meaning the user cannot access the website without
145
+ # confirming their account.
146
+ # config.allow_unconfirmed_access_for = 2.days
147
+
148
+ # A period that the user is allowed to confirm their account before their
149
+ # token becomes invalid. For example, if set to 3.days, the user can confirm
150
+ # their account within 3 days after the mail was sent, but on the fourth day
151
+ # their account can't be confirmed with the token any more.
152
+ # Default is nil, meaning there is no restriction on how long a user can take
153
+ # before confirming their account.
154
+ # config.confirm_within = 3.days
155
+
156
+ # If true, requires any email changes to be confirmed (exactly the same way as
157
+ # initial account confirmation) to be applied. Requires additional unconfirmed_email
158
+ # db field (see migrations). Until confirmed, new email is stored in
159
+ # unconfirmed_email column, and copied to email column on successful confirmation.
160
+ config.reconfirmable = true
161
+
162
+ # Defines which key will be used when confirming an account
163
+ # config.confirmation_keys = [:email]
164
+
165
+ # ==> Configuration for :rememberable
166
+ # The time the user will be remembered without asking for credentials again.
167
+ # config.remember_for = 2.weeks
168
+
169
+ # Invalidates all the remember me tokens when the user signs out.
170
+ config.expire_all_remember_me_on_sign_out = true
171
+
172
+ # If true, extends the user's remember period when remembered via cookie.
173
+ # config.extend_remember_period = false
174
+
175
+ # Options to be passed to the created cookie. For instance, you can set
176
+ # secure: true in order to force SSL only cookies.
177
+ # config.rememberable_options = {}
178
+
179
+ # ==> Configuration for :validatable
180
+ # Range for password length.
181
+ config.password_length = 6..128
182
+
183
+ # Email regex used to validate email formats. It simply asserts that
184
+ # one (and only one) @ exists in the given string. This is mainly
185
+ # to give user feedback and not to assert the e-mail validity.
186
+ config.email_regexp = /\A[^@\s]+@[^@\s]+\z/
187
+
188
+ # ==> Configuration for :timeoutable
189
+ # The time you want to timeout the user session without activity. After this
190
+ # time the user will be asked for credentials again. Default is 30 minutes.
191
+ # config.timeout_in = 30.minutes
192
+
193
+ # ==> Configuration for :lockable
194
+ # Defines which strategy will be used to lock an account.
195
+ # :failed_attempts = Locks an account after a number of failed attempts to sign in.
196
+ # :none = No lock strategy. You should handle locking by yourself.
197
+ # config.lock_strategy = :failed_attempts
198
+
199
+ # Defines which key will be used when locking and unlocking an account
200
+ # config.unlock_keys = [:email]
201
+
202
+ # Defines which strategy will be used to unlock an account.
203
+ # :email = Sends an unlock link to the user email
204
+ # :time = Re-enables login after a certain amount of time (see :unlock_in below)
205
+ # :both = Enables both strategies
206
+ # :none = No unlock strategy. You should handle unlocking by yourself.
207
+ # config.unlock_strategy = :both
208
+
209
+ # Number of authentication tries before locking an account if lock_strategy
210
+ # is failed attempts.
211
+ # config.maximum_attempts = 20
212
+
213
+ # Time interval to unlock the account if :time is enabled as unlock_strategy.
214
+ # config.unlock_in = 1.hour
215
+
216
+ # Warn on the last attempt before the account is locked.
217
+ # config.last_attempt_warning = true
218
+
219
+ # ==> Configuration for :recoverable
220
+ #
221
+ # Defines which key will be used when recovering the password for an account
222
+ # config.reset_password_keys = [:email]
223
+
224
+ # Time interval you can reset your password with a reset password key.
225
+ # Don't put a too small interval or your users won't have the time to
226
+ # change their passwords.
227
+ config.reset_password_within = 6.hours
228
+
229
+ # When set to false, does not sign a user in automatically after their password is
230
+ # reset. Defaults to true, so a user is signed in automatically after a reset.
231
+ # config.sign_in_after_reset_password = true
232
+
233
+ # ==> Configuration for :encryptable
234
+ # Allow you to use another hashing or encryption algorithm besides bcrypt (default).
235
+ # You can use :sha1, :sha512 or algorithms from others authentication tools as
236
+ # :clearance_sha1, :authlogic_sha512 (then you should set stretches above to 20
237
+ # for default behavior) and :restful_authentication_sha1 (then you should set
238
+ # stretches to 10, and copy REST_AUTH_SITE_KEY to pepper).
239
+ #
240
+ # Require the `devise-encryptable` gem when using anything other than bcrypt
241
+ # config.encryptor = :sha512
242
+
243
+ # ==> Scopes configuration
244
+ # Turn scoped views on. Before rendering "sessions/new", it will first check for
245
+ # "users/sessions/new". It's turned off by default because it's slower if you
246
+ # are using only default views.
247
+ # config.scoped_views = false
248
+
249
+ # Configure the default scope given to Warden. By default it's the first
250
+ # devise role declared in your routes (usually :user).
251
+ # config.default_scope = :user
252
+
253
+ # Set this configuration to false if you want /users/sign_out to sign out
254
+ # only the current scope. By default, Devise signs out all scopes.
255
+ # config.sign_out_all_scopes = true
256
+
257
+ # ==> Navigation configuration
258
+ # Lists the formats that should be treated as navigational. Formats like
259
+ # :html, should redirect to the sign in page when the user does not have
260
+ # access, but formats like :xml or :json, should return 401.
261
+ #
262
+ # If you have any extra navigational formats, like :iphone or :mobile, you
263
+ # should add them to the navigational formats lists.
264
+ #
265
+ # The "*/*" below is required to match Internet Explorer requests.
266
+ # config.navigational_formats = ['*/*', :html]
267
+
268
+ # The default HTTP method used to sign out a resource. Default is :delete.
269
+ config.sign_out_via = :delete
270
+
271
+ # ==> OmniAuth
272
+ # Add a new OmniAuth provider. Check the wiki for more information on setting
273
+ # up on your models and hooks.
274
+ # config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
275
+
276
+ # ==> Warden configuration
277
+ # If you want to use other strategies, that are not supported by Devise, or
278
+ # change the failure app, you can configure them inside the config.warden block.
279
+ #
280
+ # config.warden do |manager|
281
+ # manager.intercept_401 = false
282
+ # manager.default_strategies(scope: :user).unshift :some_external_strategy
283
+ # end
284
+
285
+ # ==> Mountable engine configurations
286
+ # When using Devise inside an engine, let's call it `MyEngine`, and this engine
287
+ # is mountable, there are some extra configurations to be taken into account.
288
+ # The following options are available, assuming the engine is mounted as:
289
+ #
290
+ # mount MyEngine, at: '/my_engine'
291
+ #
292
+ # The router that invoked `devise_for`, in the example above, would be:
293
+ # config.router_name = :my_engine
294
+ #
295
+ # When using OmniAuth, Devise cannot automatically set OmniAuth path,
296
+ # so you need to do it manually. For the users scope, it would be:
297
+ # config.omniauth_path_prefix = '/my_engine/users/auth'
298
+
299
+ # ==> Turbolinks configuration
300
+ # If your app is using Turbolinks, Turbolinks::Controller needs to be included to make redirection work correctly:
301
+ #
302
+ # ActiveSupport.on_load(:devise_failure_app) do
303
+ # include Turbolinks::Controller
304
+ # end
305
+
306
+ # ==> Configuration for :registerable
307
+
308
+ # When set to false, does not sign a user in automatically after their password is
309
+ # changed. Defaults to true, so a user is signed in automatically after changing a password.
310
+ # config.sign_in_after_change_password = true
311
+ end