tybo 0.0.5 → 0.0.6

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 91fb59c76c56ea609b93d85cca672305dac0a42875fbd9da8a1b68340c8c5680
4
- data.tar.gz: acb7e7c3f088b8db387a35c16ec066c083d96fee5635ebb277fe4badddc07db5
3
+ metadata.gz: dd5c4733f48e573d4ce2d7a6a7877504d78af27b5d37d590e63c78d9f0ee9d2e
4
+ data.tar.gz: 4708d208bc5a3e48aac73eb4792eac2768bc9cbe45a51e8b5df2ca1fb9b2170d
5
5
  SHA512:
6
- metadata.gz: 659f38ba69978f6963f0fe16fdde1e25fbb648473ad69026225a230677865dec508fd2aa25d4bf822a57f035816bb772153ae2ae20055da508f08145bc23f4c4
7
- data.tar.gz: 4a9fefbf4ca44927feadda09778bc2a8cf68a9602273e11f9a62974af664ee835bf492a58b0bbc91a6feac5d882c084d0c0281d1a6d38752eb09b95259ab4430
6
+ metadata.gz: a8ca34909966ef20707abb3cb7624d8899dffcb497834b1c64b6bf19d8c96a14eb8865468da66ddd339cbdfa8656ed1c9aff28051856f50516b43dd9fd5a38fe
7
+ data.tar.gz: cd167ec2dc625a303182710d4a2ac0f025b6a50a2b7591e267d49037d170c425d55cbcb2a8525132eaeeee8561433619be5ce49da5f6720814281fc7d501266c
data/README.md CHANGED
@@ -1,23 +1,52 @@
1
1
  # Tybo
2
+
2
3
  A custom admin engine for Ruby on Rails
3
4
 
5
+
6
+
4
7
  ## Installation
8
+
5
9
  Add this line to your application's Gemfile:
6
10
 
11
+
12
+
7
13
  ```ruby
8
- gem 'tybo'
14
+
15
+ gem 'tybo'
16
+
9
17
  ```
10
18
 
19
+
20
+
11
21
  And
22
+
12
23
  ```bash
24
+
13
25
  $ bundle install
26
+
14
27
  ```
28
+
15
29
  Then execute the generator
30
+
16
31
  ```bash
32
+
17
33
  $ bundle exec rails g tybo_install
34
+
18
35
  ```
36
+
37
+ ## Customize
38
+
39
+ **Update images**: change `logo_url` and `cover_url` in `config/initializer/tybo.rb`
40
+
41
+ **Customize colors**: Change the `tybo` colors class in `tailwind.config.js`,
42
+ you can use https://uicolors.app/create to generate complete palette
43
+
19
44
  ## Contributing
45
+
20
46
  Contribution directions go here.
21
47
 
48
+
49
+
22
50
  ## License
51
+
23
52
  The gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).
@@ -0,0 +1,3 @@
1
+ <div class="relative hidden w-0 flex-1 lg:block">
2
+ <%= image_tag @url , class: 'absolute inset-0 h-full w-full object-cover' %>
3
+ </div>
@@ -0,0 +1,5 @@
1
+ class CoverComponent < ViewComponent::Base
2
+ def initialize(url: Tybo.configuration.cover_url)
3
+ @url = url
4
+ end
5
+ end
@@ -1,3 +1,3 @@
1
- <button type="button" class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500" type="delete">
1
+ <button type="button" class="inline-flex items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-red-400 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-tybo-500" type="delete">
2
2
  <%= link_to "Supprimer", @path, data: { "turbo-method": :delete, turbo_confirm: 'Êtes vous sûr ?' } %>
3
3
  </button>
@@ -1,6 +1,6 @@
1
1
  <div class="pt-5">
2
2
  <div class="flex justify-end">
3
- <button type="submit" class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-indigo-600 hover:bg-indigo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500">
3
+ <button type="submit" class="ml-3 inline-flex justify-center py-2 px-4 border border-transparent shadow-sm text-sm font-medium rounded-md text-white bg-tybo-600 hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-tybo-500">
4
4
  Sauvegarder
5
5
  </button>
6
6
  </div>
@@ -1,3 +1,3 @@
1
1
  <div class="mt-4 sm:mt-0 sm:ml-16 sm:flex-none">
2
- <%= link_to '+', @path, class: "inline-flex items-center justify-center rounded-md border border-transparent bg-custom px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-custom-700 focus:outline-none focus:ring-2 focus:ring-custom-500 focus:ring-offset-2 sm:w-auto" %>
2
+ <%= link_to '+', @path, class: "inline-flex items-center justify-center rounded-md border border-transparent bg-tybo px-4 py-2 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2 sm:w-auto" %>
3
3
  </div>
@@ -1,5 +1,5 @@
1
1
  <div class=" md:flex md:w-64 md:flex-col md:fixed md:inset-y-0">
2
- <div class="flex-1 flex flex-col min-h-0 bg-custom">
2
+ <div class="flex-1 flex flex-col min-h-0 bg-tybo">
3
3
  <div class="flex-1 flex flex-col pt-5 pb-4 overflow-y-auto">
4
4
  <div class="flex items-center flex-shrink-0 px-4">
5
5
  <%= image_tag("https://www.datocms-assets.com/33962/1667496758-logo-white.svg", alt: "logo rif", class: 'mx-auto h-15 w-auto') %>
@@ -1,20 +1,18 @@
1
1
 
2
2
 
3
- <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">
4
- <div class="mx-auto w-full max-w-sm lg:w-96">
5
- <div>
6
- <img class="h-12 w-auto" src="https://www.datocms-assets.com/33962/1667497145-logo-colored.svg" alt="Your Company">
7
- <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Sign in to your account</h2>
8
- </div>
9
- <div class="mt-4">
10
- <% @resources.each do |resource| %>
11
- <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">
12
- Sign in as <%= I18n.t("bo.#{resource.to_s}.one")%>
13
- </a>
14
- <% end %>
15
- </div>
3
+ <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">
4
+ <div class="mx-auto w-full max-w-sm lg:w-96">
5
+ <div>
6
+ <img class="h-12 w-auto" src="<%= -Tybo.configuration.logo_url %>" alt="">
7
+ <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Sign in to your account</h2>
8
+ </div>
9
+ <div class="mt-4">
10
+ <% @resources.each do |resource| %>
11
+ <a href="<%=send("new_#{resource.to_s}_session_path")%>" class="mt-2 flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2">
12
+ Sign in as <%= I18n.t("bo.#{resource.to_s}.one")%>
13
+ </a>
14
+ <% end %>
16
15
  </div>
17
16
  </div>
18
- <div class="relative hidden w-0 flex-1 lg:block">
19
- <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="">
20
- </div>
17
+ </div>
18
+ <%= render(CoverComponent.new) %>
@@ -3,7 +3,7 @@
3
3
  <%= render 'devise/shared/devise_errors' %>
4
4
  <div class="mx-auto w-full max-w-sm lg:w-96">
5
5
  <div>
6
- <img class="h-12 w-auto" src="https://www.datocms-assets.com/33962/1667497145-logo-colored.svg" alt="Your Company">
6
+ <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
7
7
  <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Créer un nouveau mot de passe</h2>
8
8
  </div>
9
9
 
@@ -23,14 +23,12 @@
23
23
  class: 'block text-sm font-medium text-gray-700' %>
24
24
  </div>
25
25
  <div class="mt-5">
26
- <%= f.button :submit, "Sauvegarder", class: "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" %>
26
+ <%= f.button :submit, "Sauvegarder", class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2" %>
27
27
  </div>
28
28
  <% end %>
29
29
  </div>
30
30
  </div>
31
31
  </div>
32
32
  </div>
33
- <div class="relative hidden w-0 flex-1 lg:block">
34
- <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="">
35
- </div>
33
+ <%= render(CoverComponent.new) %>
36
34
  </div>
@@ -3,7 +3,7 @@
3
3
  <%= render 'devise/shared/devise_errors' %>
4
4
  <div class="mx-auto w-full max-w-sm lg:w-96">
5
5
  <div>
6
- <img class="h-12 w-auto" src="https://www.datocms-assets.com/33962/1667497145-logo-colored.svg" alt="Your Company">
6
+ <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
7
7
  <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Forgot your password?</h2>
8
8
  </div>
9
9
 
@@ -20,7 +20,7 @@
20
20
 
21
21
  </div>
22
22
  <div class="mt-5">
23
- <%= f.button :submit, "Send me reset password instructions", class: "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" %>
23
+ <%= f.button :submit, "Send me reset password instructions", class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2" %>
24
24
  </div>
25
25
  <% end %>
26
26
  </div>
@@ -28,7 +28,5 @@
28
28
  <%= render "devise/shared/links" %>
29
29
  </div>
30
30
  </div>
31
- <div class="relative hidden w-0 flex-1 lg:block">
32
- <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="">
33
- </div>
31
+ <%= render(CoverComponent.new) %>
34
32
  </div>
@@ -3,7 +3,7 @@
3
3
  <div class="mx-auto w-full max-w-sm lg:w-96">
4
4
  <%= render 'devise/shared/devise_errors' %>
5
5
  <div>
6
- <img class="h-12 w-auto" src="https://www.datocms-assets.com/33962/1667497145-logo-colored.svg" alt="Your Company">
6
+ <%= image_tag Tybo.configuration.logo_url, class: 'h-12 w-auto'%>
7
7
  <h2 class="mt-6 text-3xl font-bold tracking-tight text-gray-900">Sign in to your account</h2>
8
8
  </div>
9
9
  <div class="mt-8">
@@ -21,30 +21,28 @@
21
21
  <%= f.input :password,
22
22
  required: false,
23
23
  input_html: { autocomplete: "current-password" },
24
- class: 'block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-indigo-500 focus:outline-none focus:ring-indigo-500 sm:text-sm' %>
24
+ class: 'block w-full appearance-none rounded-md border border-gray-300 px-3 py-2 placeholder-gray-400 shadow-sm focus:border-tybo-500 focus:outline-none focus:ring-tybo-500 sm:text-sm' %>
25
25
  </div>
26
26
  </div>
27
27
 
28
28
  <div class="flex items-center justify-between">
29
29
  <div class="flex items-center">
30
- <input id="remember_me" name="remember_me" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-indigo-600 focus:ring-indigo-500">
30
+ <input id="remember_me" name="remember_me" type="checkbox" class="h-4 w-4 rounded border-gray-300 text-tybo-600 focus:ring-tybo-500">
31
31
  <label for="remember_me" class="ml-2 block text-sm text-gray-900">Remember me</label>
32
32
  </div>
33
33
 
34
34
  <div class="text-sm">
35
- <a href="<%= new_password_path(Administrator)%>" class="font-medium text-indigo-600 hover:text-indigo-500">Forgot your password?</a>
35
+ <a href="<%= new_password_path(Administrator)%>" class="font-medium text-tybo-600 hover:text-tybo-500">Forgot your password?</a>
36
36
  </div>
37
37
  </div>
38
38
 
39
39
  <div class="mt-5">
40
- <%= f.button :submit, "Sign in", class: "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" %>
40
+ <%= f.button :submit, "Sign in", class: "flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2" %>
41
41
  </div>
42
42
  <% end %>
43
43
  </div>
44
44
  </div>
45
45
  </div>
46
46
  </div>
47
- <div class="relative hidden w-0 flex-1 lg:block">
48
- <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="">
49
- </div>
47
+ <%= render(CoverComponent.new) %>
50
48
  </div>
@@ -8,7 +8,7 @@
8
8
  </svg>
9
9
  </div>
10
10
  <div class="ml-3">
11
- <p class="text-sm font-medium text-indigo-800"><%= notice %></p>
11
+ <p class="text-sm font-medium text-tybo-800"><%= notice %></p>
12
12
  <p class="text-sm font-medium text-red-800"><%= alert %></p>
13
13
  </div>
14
14
  <div class="ml-auto pl-3">
@@ -7,7 +7,7 @@
7
7
  </div>
8
8
  <div class="mt-4">
9
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">
10
+ <a href="<%=send("new_#{resource.to_s}_session_path")%>" class="mt-2 flex w-full justify-center rounded-md border border-transparent bg-tybo-600 py-2 px-4 text-sm font-medium text-white shadow-sm hover:bg-tybo-700 focus:outline-none focus:ring-2 focus:ring-tybo-500 focus:ring-offset-2">
11
11
  Sign in as <%= I18n.t("bo.#{resource.to_s}.one")%>
12
12
  </a>
13
13
  <% end %>
@@ -3,7 +3,7 @@
3
3
 
4
4
  <% if pagy.prev -%>
5
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""') %>
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-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600""') %>
7
7
  </div>
8
8
  <% else -%>
9
9
  <div class="min-w-0 flex-1">
@@ -13,9 +13,9 @@
13
13
  <% if pagy.next -%>
14
14
  <% pagy.series.each do |item| # series example: [1, :gap, 7, 8, "9", 10, 11, :gap, 36] -%>
15
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"') %>
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-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %>
17
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"') %>
18
+ <%== link.call(item, item, 'class="toto inline-flex h-10 items-center rounded-md border border-tybo-600 bg-white px-4 ring-1 ring-tybo-600 hover:bg-gray-100 focus:border-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %>
19
19
  <% elsif item == :gap -%>
20
20
  <span class="inline-flex h-10 items-center px-1.5 text-gray-500">
21
21
  <%== pagy_t('pagy.nav.gap') %>
@@ -26,7 +26,7 @@
26
26
 
27
27
  <% if pagy.next -%>
28
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"') %>
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-tybo-600 focus:outline-none focus:ring-2 focus:ring-tybo-600 focus:ring-opacity-25 focus:ring-offset-1 focus:ring-offset-tybo-600"') %>
30
30
  </div>
31
31
  <% else -%>
32
32
  <div class="flex min-w-0 flex-1 justify-end">
@@ -19,7 +19,7 @@
19
19
  <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
20
20
  </label>
21
21
  <div class="mt-1 sm:col-span-2 sm:mt-0">
22
- <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" %>
22
+ <%%= f.text_field :<%= col.name %>_cont, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
23
23
  </div>
24
24
  </div>
25
25
  <%- elsif col.type ==:integer -%>
@@ -28,7 +28,7 @@
28
28
  <%%= I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>') %>
29
29
  </label>
30
30
  <div class="mt-1 sm:col-span-2 sm:mt-0">
31
- <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:max-w-xs sm:text-sm" %>
31
+ <%%= f.number_field :<%= col.name %>_eq, placeholder: I18n.t('bo.<%= class_name.underscore %>.attributes.<%= col.name %>'), data: { action: "input->search-form#search" }, class: "block w-full max-w-lg rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:max-w-xs sm:text-sm" %>
32
32
  </div>
33
33
  </div>
34
34
  <%- elsif col.type == :boolean -%>
@@ -41,20 +41,20 @@
41
41
  <button type="button"
42
42
  data-target-id='q_<%= col.name %>_eq'
43
43
  data-action="click->search-form#setBooleanField"
44
- class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500">
44
+ class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-tybo-500 focus:outline-none focus:ring-1 focus:ring-tybo-500">
45
45
  -
46
46
  </button>
47
47
  <button type="button"
48
48
  data-action="click->search-form#setBooleanField"
49
49
  data-value='true'
50
50
  data-target-id='q_<%= col.name %>_eq'
51
- class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500">ON
51
+ class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-tybo-500 focus:outline-none focus:ring-1 focus:ring-tybo-500">ON
52
52
  </button>
53
53
  <button type="button"
54
54
  data-action="click->search-form#setBooleanField"
55
55
  data-value='false'
56
56
  data-target-id='q_<%= col.name %>_eq'
57
- class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-indigo-500 focus:outline-none focus:ring-1 focus:ring-indigo-500">OFF</button>
57
+ class="relative inline-flex items-center rounded-l-md border border-gray-300 bg-white px-4 py-2 text-sm font-medium text-gray-700 hover:bg-gray-50 focus:z-10 focus:border-tybo-500 focus:outline-none focus:ring-1 focus:ring-tybo-500">OFF</button>
58
58
  </span>
59
59
  <%%= f.hidden_field :<%= col.name %>_eq, value: nil, data: { action: "change->search-form#search"}%>
60
60
  </div>
@@ -67,13 +67,13 @@
67
67
  </label>
68
68
  </div>
69
69
  <div class="mt-1 sm:col-span-3 sm:mt-0">
70
- <%%= f.date_field :<%= col.name %>_from_date, data: { action: "input->search-form#search" }, class: "rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" %>
70
+ <%%= f.date_field :<%= col.name %>_from_date, data: { action: "input->search-form#search" }, class: "rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:text-sm" %>
71
71
  </div>
72
72
  <div class="mt-1 sm:col-span-2 text-center">
73
73
  to
74
74
  </div>
75
75
  <div class="mt-1 sm:col-span-3 sm:mt-0">
76
- <%%= f.date_field :<%= col.name %>_to_date, data: { action: "input->search-form#search" }, class: "rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm" %>
76
+ <%%= f.date_field :<%= col.name %>_to_date, data: { action: "input->search-form#search" }, class: "rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:text-sm" %>
77
77
  </div>
78
78
  </div>
79
79
  <%- end -%>
@@ -86,7 +86,7 @@
86
86
  <%%=I18n.t('bo.<%=association.klass.name.underscore%>.one')%>
87
87
  </label>
88
88
  <div class="mt-1 sm:col-span-2 sm:mt-0">
89
- <%%= f.select :<%= association.foreign_key %>_eq, <%=association.klass.name.constantize%>.all.map { |value| [value.<%=bo_model_title(association.class_name.constantize)%>, value.id] }, { include_blank: true }, { class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-indigo-500 focus:ring-indigo-500 sm:text-sm", data: { action: "input->search-form#search" } } %>
89
+ <%%= f.select :<%= association.foreign_key %>_eq, <%=association.klass.name.constantize%>.all.map { |value| [value.<%=bo_model_title(association.class_name.constantize)%>, value.id] }, { include_blank: true }, { class: "block w-full rounded-md border-gray-300 shadow-sm focus:border-tybo-500 focus:ring-tybo-500 sm:text-sm", data: { action: "input->search-form#search" } } %>
90
90
  </div>
91
91
  </div>
92
92
  <%- end -%>
@@ -9,16 +9,16 @@
9
9
  <%% @<%= class_name.underscore.pluralize %>&.each_with_index do |<%= class_name.underscore %>, i| %>
10
10
  <%%= tbody.with_tr(index: i) do |tr| %>
11
11
  <%- bo_model.column_names.each do |column| -%>
12
- <%%= tr.with_td { <%= class_name.underscore %>.<%= column %>.to_s } -%>
12
+ <%%= tr.with_td { <%= class_name.underscore %>.<%= column %>.to_s } %>
13
13
  <%- end -%>
14
14
  <%%= tr.with_td do %>
15
- <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>, class: "text-indigo-600 hover:text-indigo-900" do %>
15
+ <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>, class: "text-tybo-600 hover:text-tybo-900" do %>
16
16
  Détails
17
17
  <%% end %>
18
18
  <%% end %>
19
19
  <%%= tr.with_td do %>
20
20
  <%%= link_to <%="#{options[:namespace]}_#{class_name.underscore}_path(#{class_name.underscore})"%>,
21
- class: "text-indigo-600 hover:text-indigo-900",
21
+ class: "text-tybo-600 hover:text-tybo-900",
22
22
  data: {turbo_method: :delete, turbo_confirm: "êtes vous sur ?"} do %>
23
23
  <%%= render(Icons::TrashComponent.new) %>
24
24
  <%% end %>
@@ -17,14 +17,14 @@
17
17
  .pagy-nav-js .page.active,
18
18
  .pagy-nav-js .page.prev.disabled,
19
19
  .pagy-nav-js .page.next.disabled {
20
- @apply block rounded-lg px-3 py-1 text-sm text-indigo-500 font-semibold bg-indigo-200 shadow-md;
20
+ @apply block rounded-lg px-3 py-1 text-sm text-tybo-500 font-semibold bg-tybo-200 shadow-md;
21
21
 
22
22
  &:hover {
23
- @apply bg-indigo-300;
23
+ @apply bg-tybo-300;
24
24
  }
25
25
 
26
26
  &:active {
27
- @apply bg-indigo-400 text-white;
27
+ @apply bg-tybo-400 text-white;
28
28
  }
29
29
  }
30
30
 
@@ -32,33 +32,33 @@
32
32
  .pagy-nav .page.next.disabled,
33
33
  .pagy-nav-js .page.prev.disabled,
34
34
  .pagy-nav-js .page.next.disabled {
35
- @apply text-indigo-400 cursor-default;
35
+ @apply text-tybo-400 cursor-default;
36
36
 
37
37
  &:hover {
38
- @apply text-indigo-400 bg-indigo-200;
38
+ @apply text-tybo-400 bg-tybo-200;
39
39
  }
40
40
 
41
41
  &:active {
42
- @apply text-indigo-400 bg-indigo-200;
42
+ @apply text-tybo-400 bg-tybo-200;
43
43
  }
44
44
  }
45
45
 
46
46
  .pagy-nav .page.active,
47
47
  .pagy-nav-js .page.active {
48
- @apply text-white cursor-default bg-indigo-400;
48
+ @apply text-white cursor-default bg-tybo-400;
49
49
 
50
50
  &:hover {
51
- @apply text-white bg-indigo-400;
51
+ @apply text-white bg-tybo-400;
52
52
  }
53
53
 
54
54
  &:active {
55
- @apply bg-indigo-400 text-white;
55
+ @apply bg-tybo-400 text-white;
56
56
  }
57
57
  }
58
58
 
59
59
 
60
60
  .pagy-combo-nav-js {
61
- @apply flex max-w-max rounded-full px-3 py-1 text-sm text-indigo-500 font-semibold bg-indigo-200 shadow-md;
61
+ @apply flex max-w-max rounded-full px-3 py-1 text-sm text-tybo-500 font-semibold bg-tybo-200 shadow-md;
62
62
  }
63
63
 
64
64
  .pagy-combo-nav-js .pagy-combo-input {
@@ -68,17 +68,17 @@
68
68
  .pagy-combo-nav-js .page.prev,
69
69
  .pagy-combo-nav-js .page.next {
70
70
  &:hover {
71
- @apply text-indigo-800;
71
+ @apply text-tybo-800;
72
72
  }
73
73
 
74
74
  &:active {
75
- @apply text-indigo-800;
75
+ @apply text-tybo-800;
76
76
  }
77
77
  }
78
78
 
79
79
  .pagy-combo-nav-js .page.prev.disabled,
80
80
  .pagy-combo-nav-js .page.next.disabled {
81
- @apply text-indigo-400 cursor-default;
81
+ @apply text-tybo-400 cursor-default;
82
82
  }
83
83
 
84
84
  /* tom-select */
@@ -87,11 +87,11 @@ ts-wrapper {
87
87
  }
88
88
 
89
89
  .ts-control {
90
- @apply shadow-sm rounded-lg my-5 border-indigo-300 bg-white py-2 px-3 text-base;
90
+ @apply shadow-sm rounded-lg my-5 border-tybo-300 bg-white py-2 px-3 text-base;
91
91
  }
92
92
 
93
93
  .ts-dropdown {
94
- @apply rounded-md border border-solid border-t border-indigo-300 text-base;
94
+ @apply rounded-md border border-solid border-t border-tybo-300 text-base;
95
95
  }
96
96
 
97
97
  .ts-dropdown [data-selectable].option:first-child {
@@ -108,5 +108,5 @@ ts-wrapper {
108
108
  }
109
109
 
110
110
  .ts-dropdown .active {
111
- @apply bg-indigo-100 text-indigo-900;
111
+ @apply bg-tybo-100 text-tybo-900;
112
112
  }
@@ -47,7 +47,7 @@ SimpleForm.setup do |config|
47
47
  b.optional :readonly
48
48
  b.use :label, class: 'block text-sm font-medium text-gray-700', error_class: 'text-red-500'
49
49
  b.use :input,
50
- class: 'mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-indigo-500 focus:border-indigo-500 sm:text-sm', error_class: 'border-red-500', valid_class: 'border-green-400'
50
+ class: 'mt-1 block w-full border border-gray-300 rounded-md shadow-sm py-2 px-3 focus:outline-none focus:ring-tybo-500 focus:border-tybo-500 sm:text-sm', error_class: 'border-red-500', valid_class: 'border-green-400'
51
51
  b.use :full_error, wrap_with: { tag: 'p', class: 'mt-2 text-red-500 text-xs italic' }
52
52
  b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
53
53
  end
@@ -58,7 +58,7 @@ SimpleForm.setup do |config|
58
58
  b.optional :readonly
59
59
  b.wrapper tag: 'div', class: 'flex items-center h-5' do |ba|
60
60
  ba.use :input,
61
- class: 'focus:ring-2 focus:ring-indigo-500:focus ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded'
61
+ class: 'focus:ring-2 focus:ring-tybo-500:focus ring-offset-2 h-4 w-4 text-tybo-600 border-gray-300 rounded'
62
62
  end
63
63
  b.wrapper tag: 'div', class: 'ml-3 text-sm' do |bb|
64
64
  bb.use :label, class: 'block', error_class: 'text-red-500'
@@ -77,7 +77,7 @@ SimpleForm.setup do |config|
77
77
  ba.use :label_text
78
78
  end
79
79
  b.use :input,
80
- class: 'focus:ring-2 focus:ring-indigo-500 ring-offset-2 h-4 w-4 text-indigo-600 border-gray-300 rounded', error_class: 'text-red-500', valid_class: 'text-green-400'
80
+ class: 'focus:ring-2 focus:ring-tybo-500 ring-offset-2 h-4 w-4 text-tybo-600 border-gray-300 rounded', error_class: 'text-red-500', valid_class: 'text-green-400'
81
81
  b.use :full_error, wrap_with: { tag: 'p', class: 'block mt-2 text-red-500 text-xs italic' }
82
82
  b.use :hint, wrap_with: { tag: 'p', class: 'mt-2 text-grey-700 text-xs italic' }
83
83
  end
@@ -28,6 +28,19 @@ module.exports = {
28
28
  },
29
29
  home: {
30
30
  DEFAULT: '#F5F5F5'
31
+ },
32
+ tybo: {
33
+ DEFAULT: '#11072C',
34
+ 50: '#e9ebff',
35
+ 100: '#d8d9ff',
36
+ 200: '#b8b8ff',
37
+ 300: '#918eff',
38
+ 400: '#7561ff',
39
+ 500: '#653dff',
40
+ 600: '#5f1cff',
41
+ 700: '#5611f1',
42
+ 800: '#4512c1',
43
+ 900: '#11072c'
31
44
  }
32
45
  }
33
46
  },
@@ -0,0 +1,6 @@
1
+ Tybo.configure do |config|
2
+ # customise logo and cover url
3
+ # should be an external url or image should be present in (app/assets/images)
4
+ # config.logo_url =
5
+ # config.cover_url =
6
+ end
@@ -15,6 +15,7 @@ class TyboInstallGenerator < Rails::Generators::Base
15
15
  template 'tailwind.config.js', File.join('config/tailwind.config.js'), force: true
16
16
  template 'tom-select.css', File.join('app/assets/stylesheets/tom-select.css')
17
17
  template 'simple_form_tailwind.rb', File.join('config/initializers/simple_form_tailwind.rb')
18
+ template 'tybo_config.rb', File.join('config/initializers/tybo.rb')
18
19
  end
19
20
 
20
21
  def pin_js_dependencies
@@ -0,0 +1,5 @@
1
+ module Tybo
2
+ class Configuration
3
+ attr_accessor :logo_url, :cover_url
4
+ end
5
+ end
data/lib/tybo/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Tybo
2
- VERSION = "0.0.5"
2
+ VERSION = '0.0.6'
3
3
  end
data/lib/tybo.rb CHANGED
@@ -1,6 +1,15 @@
1
1
  require "tybo/version"
2
2
  require "tybo/engine"
3
+ require "tybo/configuration"
3
4
 
4
5
  module Tybo
5
- # Your code goes here...
6
+ class << self
7
+ def configuration
8
+ @configuration ||= Configuration.new
9
+ end
10
+
11
+ def configure
12
+ yield(configuration)
13
+ end
14
+ end
6
15
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tybo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michel Delpierre
8
8
  - Julien Camblan
9
- autorequire:
9
+ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2023-02-01 00:00:00.000000000 Z
12
+ date: 2023-02-06 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rails
@@ -129,6 +129,8 @@ files:
129
129
  - app/components/attachment_card_component.rb
130
130
  - app/components/attachments_list_component.html.erb
131
131
  - app/components/attachments_list_component.rb
132
+ - app/components/cover_component.html.erb
133
+ - app/components/cover_component.rb
132
134
  - app/components/current_user_mini_card_component.html.erb
133
135
  - app/components/current_user_mini_card_component.rb
134
136
  - app/components/form_component.html.erb
@@ -245,8 +247,10 @@ files:
245
247
  - lib/generators/tybo_install/templates/simple_form_tailwind.rb
246
248
  - lib/generators/tybo_install/templates/tailwind.config.js
247
249
  - lib/generators/tybo_install/templates/tom-select.css
248
- - lib/generators/tybo_install/tybo_install_generator.rb
250
+ - lib/generators/tybo_install/templates/tybo_config.rb
251
+ - lib/generators/tybo_install/tybo_config.rb
249
252
  - lib/tybo.rb
253
+ - lib/tybo/configuration.rb
250
254
  - lib/tybo/engine.rb
251
255
  - lib/tybo/version.rb
252
256
  homepage: https://rubygems.org/gems/tybo
@@ -254,7 +258,7 @@ licenses:
254
258
  - MIT
255
259
  metadata:
256
260
  homepage_uri: https://rubygems.org/gems/tybo
257
- post_install_message:
261
+ post_install_message:
258
262
  rdoc_options: []
259
263
  require_paths:
260
264
  - lib
@@ -269,8 +273,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
269
273
  - !ruby/object:Gem::Version
270
274
  version: '0'
271
275
  requirements: []
272
- rubygems_version: 3.3.7
273
- signing_key:
276
+ rubygems_version: 3.0.3.1
277
+ signing_key:
274
278
  specification_version: 4
275
279
  summary: A tailwind custom admin engine for Ruby on Rails
276
280
  test_files: []