bullet_train-themes-tailwind_css 1.4.4 → 1.4.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: a4916f4b8cc6676ec9d3b930ae4115819272a4457d5331c50efb80da59f9fe3b
4
- data.tar.gz: ebef2fd18041a167af4b3817b851b7986bd9d416cb3d4e9ff050ab8b89b64295
3
+ metadata.gz: 7b290267d6349a0f801129249b291d8cdc91f44fe6abd090e630b2fe4588513a
4
+ data.tar.gz: a2e4319852a2701482987177b1afcdbb5cdda981709a7bf97a72ecbe05f6e7ef
5
5
  SHA512:
6
- metadata.gz: bd5f98d68a2f07ab0789a25c1862121d7d3c72a84e23224a5583ca079c770c220bdd2831e40ff880137a369ce5cbc4a5a45fb7aefd5a272dc867c57c324bcfe9
7
- data.tar.gz: 30ea2e1c778b9027bda76812fd21fb1f78bf515d36e90026043a87347d3c20214daefcee070ef32cbe28e17e30fb1b343ab12189b4b703eaed36fbba3c316314
6
+ metadata.gz: cf63605bbc2041ac47ff3972b3c7d6f461e493db86ad94b484e07df4d39bb7d26f4b9d305125ce47b6369e39e4e7b6a9540fa188edef7ad49c2933281587fd89
7
+ data.tar.gz: 30a01e220002d886a50b797010a5a3f60eadb1b7141c533eeacd12f9de21fd58a068c9bb6ad91c37fee2c9e6671221be641f0a8c5ac77c6d9820802ea6616f97
@@ -0,0 +1,56 @@
1
+ <%# TODO: This is mostly just copy pasta from the field_field partial.
2
+ # Should we just try to make that partial aware of images?
3
+ # If not, should we make a new dedicated stimulus controler for this partial,
4
+ # instead of hijacking the "fields--file-field" controller?
5
+ %>
6
+ <%
7
+ form ||= current_fields_form
8
+ options ||= {}
9
+ other_options ||= {}
10
+ multiple ||= false
11
+ persisted_files = multiple ? form.object.send(method) : [form.object.send(method)]
12
+
13
+ options[:width] ||= 100
14
+ options[:height] ||= 100
15
+
16
+ # options[:resize_to_limit] ||= [options[:width], options[:height]]
17
+ %>
18
+
19
+ <%= render 'shared/fields/field', form: form, method: method, helper: :file_field, options: options, other_options: other_options do %>
20
+ <% content_for :field do %>
21
+ <div class="file-field" data-controller="fields--file-field">
22
+ <%= form.file_field method, class: 'file-upload hidden', multiple: multiple, direct_upload: true, data: {'fields--file-field-target': 'fileField', action: 'change->fields--file-field#handleFileSelected'} %>
23
+ <div>
24
+ <% if form.object.send(method).attached? %>
25
+ <div class="divide-y-2 divide-dashed">
26
+ <% persisted_files.each do |file| %>
27
+ <div data-controller="fields--file-item" data-fields--file-item-id-value="<%= file.id %>">
28
+ <%= form.hidden_field "#{method}_removal".to_sym, multiple: multiple, value: nil, data: {'fields--file-item-target': 'removeFileFlag'} %>
29
+ <%= image_tag photo_url_for_active_storage_attachment(file, options), class: 'mb-1.5', data: {'fields--file-item-target': "fileName"} %>
30
+
31
+ <%= link_to url_for(file), class: 'button download-file mr-3', data: {'fields--file-item-target': 'downloadFileButton'} do %>
32
+ <i class="leading-none mr-2 text-base ti ti-download"></i>
33
+ <span><%= t('fields.download_image') %></span>
34
+ <% end %>
35
+ <div class="button-alternative cursor-pointer mr-3" data-action="click->fields--file-item#removeFile" data-fields--file-item-target="removeFileButton">
36
+ <i class="leading-none mr-2 text-base ti ti-trash"></i>
37
+ <span><%= t('fields.remove_image') %></span>
38
+ </div>
39
+ </div>
40
+ <% end %>
41
+ </div>
42
+ <% end %>
43
+ </div>
44
+ <div class="mt-2">
45
+ <div class="button-alternative cursor-pointer" data-action="click->fields--file-field#uploadFile" data-fields--file-field-target="selectFileButton">
46
+ <i class="leading-none mr-2 text-base ti ti-upload dark:text-white"></i>
47
+ <span class="dark:text-white"><%= t('fields.upload_image') %></span>
48
+ </div>
49
+ <div class="mt-2 hidden overflow-hidden text-xs rounded bg-slate-100 shadow-inner relative">
50
+ <div data-fields--file-field-target="progressBar" aria-valuemax="100" aria-valuemin="0" aria-valuenow="0" class="absolute top-0 left-0 whitespace-nowrap overflow-hidden animate-pulse bg-primary-500 dark:bg-slate-800 rounded" role="progressbar" style="width: 0%;">&nbsp;</div>
51
+ <div class="text-black text-center" data-fields--file-field-target="progressLabel">0%</div>
52
+ </div>
53
+ </div>
54
+ </div>
55
+ <% end %>
56
+ <% end %>
@@ -0,0 +1,13 @@
1
+ <%
2
+ form ||= current_fields_form
3
+ options ||= {}
4
+ other_options ||= {}
5
+ multiple ||= false
6
+ #persisted_files = multiple ? form.object.send(method) : [form.object.send(method)]
7
+ %>
8
+
9
+ <% if cloudinary_enabled? %>
10
+ <%= render 'shared/fields/cloudinary_image', method: method, form: form, options: options, other_options: other_options %>
11
+ <% else %>
12
+ <%= render 'shared/fields/active_storage_image', method: method, form: form, options: options, other_options: other_options %>
13
+ <% end %>
@@ -13,7 +13,7 @@ labels = labels_for(form, method) if form
13
13
  # 4. form.radio_button
14
14
  #
15
15
  # the `append_class` local can be used to append any other styles desired for the element.
16
- option_field_options[:class] ||= "focus:ring-blue h-4 w-4 text-blue border-slate-300 dark:bg-slate-800 dark:border-slate-900 #{"rounded" if multiple || single_check_box}"
16
+ option_field_options[:class] ||= "focus:ring-primary-500 h-4 w-4 text-primary-500 border-slate-300 dark:bg-slate-800 dark:border-slate-900 #{"rounded" if multiple || single_check_box}"
17
17
  option_field_options[:class] += " #{append_class}"
18
18
  %>
19
19
 
@@ -54,7 +54,7 @@ end
54
54
  <%= check_box_tag "#{html_options[:id]}-select_all", 'select-all', false, data: {
55
55
  "select-all-target": 'toggleCheckbox',
56
56
  'action': "select-all#selectAllOrNone"
57
- }, class: "focus:ring-blue h-4 w-4 text-blue border-slate-300 rounded" %>
57
+ }, class: "focus:ring-primary-500 h-4 w-4 text-primary-500 border-slate-300 rounded" %>
58
58
  </div>
59
59
  <div class="ml-2.5 text-sm pr-4">
60
60
  <%= t("global.bulk_select.all") %>
@@ -3,3 +3,6 @@ en:
3
3
  download_document: Download Current Document
4
4
  upload_document: Upload New Document
5
5
  remove_document: Remove Current Document
6
+ download_image: Download Current Image
7
+ upload_image: Upload New Image
8
+ remove_image: Remove Current Image
@@ -1,7 +1,7 @@
1
1
  module BulletTrain
2
2
  module Themes
3
3
  module TailwindCss
4
- VERSION = "1.4.4"
4
+ VERSION = "1.4.6"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bullet_train-themes-tailwind_css
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrew Culver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-09-19 00:00:00.000000000 Z
11
+ date: 2023-09-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: standard
@@ -82,6 +82,7 @@ files:
82
82
  - app/views/themes/tailwind_css/attributes/_code.html.erb
83
83
  - app/views/themes/tailwind_css/attributes/_file.erb
84
84
  - app/views/themes/tailwind_css/attributes/_files.erb
85
+ - app/views/themes/tailwind_css/fields/_active_storage_image.html.erb
85
86
  - app/views/themes/tailwind_css/fields/_address_field.html.erb
86
87
  - app/views/themes/tailwind_css/fields/_buttons.html.erb
87
88
  - app/views/themes/tailwind_css/fields/_cloudinary_image.html.erb
@@ -90,6 +91,7 @@ files:
90
91
  - app/views/themes/tailwind_css/fields/_date_field.html.erb
91
92
  - app/views/themes/tailwind_css/fields/_field.html.erb
92
93
  - app/views/themes/tailwind_css/fields/_file_field.html.erb
94
+ - app/views/themes/tailwind_css/fields/_image.html.erb
93
95
  - app/views/themes/tailwind_css/fields/_option.html.erb
94
96
  - app/views/themes/tailwind_css/fields/_options.html.erb
95
97
  - app/views/themes/tailwind_css/limits/_form.html.erb