spina 2.20.0 → 2.21.0

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 (67) hide show
  1. checksums.yaml +4 -4
  2. data/Rakefile +0 -2
  3. data/app/assets/builds/spina/tailwind.css +3338 -3725
  4. data/app/assets/javascripts/spina/controllers/confirm_controller.js +2 -2
  5. data/app/assets/javascripts/spina/controllers/navigation_controller.js +4 -4
  6. data/app/assets/stylesheets/spina/application.tailwind.css +105 -62
  7. data/app/components/spina/forms/switch_component.html.erb +2 -2
  8. data/app/components/spina/forms/trix_toolbar_component.html.erb +16 -33
  9. data/app/components/spina/media_picker/modal_component.html.erb +1 -1
  10. data/app/components/spina/media_picker/modal_component.rb +2 -2
  11. data/app/components/spina/pages/actions_component.html.erb +4 -4
  12. data/app/components/spina/pages/location_component.html.erb +2 -2
  13. data/app/components/spina/pages/new_page_button_component.html.erb +2 -2
  14. data/app/components/spina/pages/page_component.html.erb +1 -1
  15. data/app/components/spina/pages/page_component.rb +2 -2
  16. data/app/components/spina/pages/translations_component.html.erb +3 -3
  17. data/app/components/spina/pages/translations_component.rb +1 -1
  18. data/app/components/spina/user_interface/modal_component.html.erb +2 -2
  19. data/app/components/spina/user_interface/tab_link_component.rb +1 -1
  20. data/app/components/spina/user_interface/translations_component.html.erb +2 -2
  21. data/app/components/spina/user_interface/translations_component.rb +1 -1
  22. data/app/controllers/concerns/spina/current_spina_account.rb +1 -1
  23. data/app/controllers/spina/admin/page_select_options_controller.rb +1 -1
  24. data/app/controllers/spina/admin/resource_select_options_controller.rb +1 -1
  25. data/app/controllers/spina/application_controller.rb +1 -1
  26. data/app/jobs/spina/replace_signed_id_job.rb +12 -9
  27. data/app/models/concerns/spina/attachable.rb +1 -1
  28. data/app/models/concerns/spina/translated_content.rb +1 -1
  29. data/app/models/spina/account.rb +2 -2
  30. data/app/models/spina/resource.rb +3 -1
  31. data/app/models/spina/setting.rb +2 -0
  32. data/app/presenters/spina/menu_presenter.rb +7 -12
  33. data/app/views/spina/admin/embeds/new.html.erb +4 -4
  34. data/app/views/spina/admin/images/_image.html.erb +1 -1
  35. data/app/views/spina/admin/layout/edit.html.erb +2 -2
  36. data/app/views/spina/admin/move_pages/new.html.erb +2 -2
  37. data/app/views/spina/admin/navigation_items/_navigation_item.html.erb +5 -5
  38. data/app/views/spina/admin/pages/_form.html.erb +1 -1
  39. data/app/views/spina/admin/pages/_form_advanced.html.erb +1 -1
  40. data/app/views/spina/admin/pages/edit_template.html.erb +2 -2
  41. data/app/views/spina/admin/pages/index.html.erb +1 -1
  42. data/app/views/spina/admin/parts/image_collections/_fields.html.erb +1 -1
  43. data/app/views/spina/admin/parts/images/_form.html.erb +1 -1
  44. data/app/views/spina/admin/parts/page_links/_form.html.erb +2 -2
  45. data/app/views/spina/admin/parts/repeaters/_form.html.erb +1 -1
  46. data/app/views/spina/admin/parts/resource_links/_form.html.erb +1 -1
  47. data/app/views/spina/admin/parts/texts/_form.html.erb +2 -2
  48. data/app/views/spina/admin/settings/_wysiwyg_field.html.erb +3 -3
  49. data/app/views/spina/admin/shared/_navigation.html.erb +1 -1
  50. data/app/views/spina/admin/users/index.html.erb +2 -2
  51. data/app/views/spina/sitemaps/show.xml.builder +1 -1
  52. data/config/routes.rb +2 -2
  53. data/db/migrate/13_add_json_attributes_to_spina_accounts.rb +1 -1
  54. data/db/migrate/14_add_json_attributes_to_spina_pages.rb +1 -1
  55. data/db/migrate/15_add_slug_to_spina_resources.rb +1 -1
  56. data/db/migrate/18_change_default_spina_resources_slug.rb +2 -2
  57. data/db/migrate/7_create_spina_settings.rb +1 -1
  58. data/lib/generators/spina/tailwind_config_generator.rb +1 -1
  59. data/lib/generators/spina/templates/app/assets/stylesheets/spina/application.tailwind.css.tt +232 -0
  60. data/lib/generators/spina/templates/app/views/demo/shared/_languages.html.erb +2 -2
  61. data/lib/spina/engine.rb +1 -1
  62. data/lib/spina/version.rb +1 -1
  63. data/lib/spina.rb +63 -83
  64. data/lib/tasks/install.rake +1 -1
  65. data/lib/tasks/tailwind.rake +2 -3
  66. metadata +8 -24
  67. data/lib/generators/spina/templates/app/assets/config/spina/tailwind.config.js.tt +0 -23
@@ -11,7 +11,7 @@ module Spina
11
11
  private
12
12
 
13
13
  def current_account
14
- ActiveSupport::Deprecation.warn(
14
+ Spina.deprecator.warn(
15
15
  "#current_account is deprecated, due to a common authentication namespace conflict. \n" \
16
16
  "Please use #current_spina_account instead."
17
17
  )
@@ -15,7 +15,7 @@ module Spina
15
15
  end
16
16
 
17
17
  @pages ||= Page.all
18
- @pages = @pages.joins(:translations).where("spina_page_translations.title ILIKE :query OR materialized_path ILIKE :query", query: "%#{params[:search]}%").order(created_at: :desc).distinct.page(params[:page]).per(20)
18
+ @pages = @pages.joins(:translations).where("LOWER(spina_page_translations.title) LIKE LOWER(:query) OR LOWER(materialized_path) LIKE LOWER(:query)", query: "%#{params[:search]}%").order(created_at: :desc).distinct.page(params[:page]).per(20)
19
19
  render :index
20
20
  end
21
21
 
@@ -11,7 +11,7 @@ module Spina
11
11
 
12
12
  def search
13
13
  @resources ||= Resource.all
14
- @resources = @resources.where("name ILIKE :query OR label ILIKE :query", query: "%#{params[:search]}%").order(created_at: :desc).distinct.page(params[:page]).per(20)
14
+ @resources = @resources.where("LOWER(name) LIKE LOWER(:query) OR LOWER(label) LIKE LOWER(:query)", query: "%#{params[:search]}%").order(created_at: :desc).distinct.page(params[:page]).per(20)
15
15
  render :index
16
16
  end
17
17
 
@@ -1,4 +1,4 @@
1
- class Spina::ApplicationController < Spina.frontend_parent_controller.constantize
1
+ class Spina::ApplicationController < Spina.config.frontend_parent_controller.constantize
2
2
  include Spina.config.authentication.constantize
3
3
  include Spina::CurrentTheme
4
4
  include Spina::CurrentSpinaAccount
@@ -5,19 +5,22 @@ module Spina
5
5
  def perform(old_signed_id, new_signed_id)
6
6
  return if old_signed_id.blank? || new_signed_id.blank?
7
7
 
8
- pages = get_pages(old_signed_id)
9
- accounts = Spina::Account.all
10
-
11
- [pages, accounts].each do |records|
12
- records.update_all("json_attributes = REGEXP_REPLACE(json_attributes::text, '#{old_signed_id}', '#{new_signed_id}', 'g')::jsonb")
13
- end
8
+ replace_in_records(Spina::Page, old_signed_id, new_signed_id)
9
+ replace_in_records(Spina::Account, old_signed_id, new_signed_id)
14
10
  end
15
11
 
16
12
  private
17
13
 
18
- def get_pages(signed_id)
19
- return Spina::Page.none unless signed_id.present?
20
- Spina::Page.where("json_attributes::text LIKE ?", "%#{signed_id}%")
14
+ def replace_in_records(model, old_signed_id, new_signed_id)
15
+ model.find_each(batch_size: 100) do |record|
16
+ next unless record.json_attributes.present?
17
+
18
+ json_string = record.json_attributes.to_json
19
+ next unless json_string.include?(old_signed_id)
20
+
21
+ updated_json = json_string.gsub(old_signed_id, new_signed_id)
22
+ record.update_column(:json_attributes, JSON.parse(updated_json))
23
+ end
21
24
  end
22
25
  end
23
26
  end
@@ -7,7 +7,7 @@ module Spina
7
7
 
8
8
  scope :with_filename, ->(query) do
9
9
  joins(:file_blob).where(
10
- "active_storage_blobs.filename ILIKE ?",
10
+ "LOWER(active_storage_blobs.filename) LIKE LOWER(?)",
11
11
  "%" + Image.sanitize_sql_like(query) + "%"
12
12
  )
13
13
  end
@@ -6,7 +6,7 @@ module Spina
6
6
 
7
7
  included do
8
8
  # Store each locale's content in [locale]_content as an array of parts
9
- Spina.locales.each do |locale|
9
+ Spina.config.locales.each do |locale|
10
10
  attr_json "#{locale}_content".to_sym, AttrJson::Type::SpinaPartsModel.new, array: true, default: -> { [] }
11
11
  attr_json_setter_monkeypatch "#{locale}_content".to_sym
12
12
  attr_json_accepts_nested_attributes_for "#{locale}_content".to_sym
@@ -23,7 +23,7 @@ module Spina
23
23
  args.each do |method_name|
24
24
  define_method method_name do
25
25
  if preferences.try(:[], method_name.to_sym).present?
26
- ActiveSupport::Deprecation.warn("#{method_name} is stored as a symbol. Please set and save it again using #{method_name}= on your Spina::Account model to store it as a string. You can do this from the UI by saving your account preferences.")
26
+ Spina.deprecator.warn("#{method_name} is stored as a symbol. Please set and save it again using #{method_name}= on your Spina::Account model to store it as a string. You can do this from the UI by saving your account preferences.")
27
27
  end
28
28
 
29
29
  preferences.try(:[], method_name.to_s) ||
@@ -78,7 +78,7 @@ module Spina
78
78
  parent_page = Page.find_by(name: page[:parent])
79
79
  ancestry = [parent_page&.ancestry, parent_page&.id].compact.join("/")
80
80
  end
81
-
81
+
82
82
  Page.where(name: page[:name])
83
83
  .first_or_create(title: page[:title])
84
84
  .update(view_template: page[:view_template], deletable: page[:deletable], ancestry: ancestry)
@@ -2,11 +2,13 @@ module Spina
2
2
  class Resource < ApplicationRecord
3
3
  extend Mobility
4
4
 
5
+ attribute :slug, :json, default: -> { {} }
6
+
5
7
  has_many :pages, dependent: :restrict_with_exception
6
8
 
7
9
  after_commit :update_resource_pages, on: [:update]
8
10
 
9
- translates :slug, backend: :jsonb
11
+ translates :slug, backend: :json
10
12
 
11
13
  def pages
12
14
  case order_by
@@ -1,5 +1,7 @@
1
1
  module Spina
2
2
  class Setting < ApplicationRecord
3
+ attribute :preferences, :json, default: -> { {} }
4
+
3
5
  validates :plugin, presence: true
4
6
  end
5
7
  end
@@ -2,12 +2,9 @@ module Spina
2
2
  class MenuPresenter
3
3
  include ActionView::Helpers::TagHelper
4
4
  include ActionView::Helpers::UrlHelper
5
- include ActiveSupport::Configurable
6
5
 
7
- attr_accessor :collection, :output_buffer
8
-
9
- # Configuration
10
- config_accessor :menu_tag, :menu_css,
6
+ attr_accessor :collection, :output_buffer,
7
+ :menu_tag, :menu_css, :menu_id,
11
8
  :list_tag, :list_css,
12
9
  :list_item_tag, :list_item_css,
13
10
  :link_tag_css,
@@ -16,14 +13,12 @@ module Spina
16
13
  :include_drafts,
17
14
  :depth # root nodes are at depth 0
18
15
 
19
- # Default configuration
20
- self.menu_tag = :nav
21
- self.list_tag = :ul
22
- self.list_item_tag = :li
23
- self.include_drafts = false
24
-
25
16
  def initialize(collection)
26
17
  @collection = collection
18
+ @menu_tag = :nav
19
+ @list_tag = :ul
20
+ @list_item_tag = :li
21
+ @include_drafts = false
27
22
  end
28
23
 
29
24
  def to_html
@@ -38,7 +33,7 @@ module Spina
38
33
  end
39
34
 
40
35
  def render_menu(collection)
41
- content_tag(menu_tag, class: menu_css) do
36
+ content_tag(menu_tag, class: menu_css, id: menu_id) do
42
37
  render_items(scoped_collection(collection))
43
38
  end
44
39
  end
@@ -4,15 +4,15 @@
4
4
 
5
5
  <%= turbo_frame_tag :embeddable_form do %>
6
6
  <div class="flex h-full">
7
- <div class="p-4 w-64 bg-gray-100 md:bg-opacity-50">
7
+ <div class="p-4 w-64 bg-gray-100 md:bg-gray-100/50">
8
8
  <div class="text-xs font-medium text-gray-600 mb-2">
9
9
  <%=t "spina.embeds.embed_a_component" %>
10
10
  </div>
11
11
  <% embeddables.each do |embeddable| %>
12
12
  <% if embeddable.name == @embeddable.class.name %>
13
- <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-900 bg-spina-dark bg-opacity-20" %>
13
+ <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-900 bg-spina-dark/20" %>
14
14
  <% else %>
15
- <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-600 hover:bg-gray-200 bg-opacity-100 hover:bg-gray-200" %>
15
+ <% classes = "font-medium w-full text-sm px-3 py-2 rounded-lg flex items-center text-gray-600 hover:bg-gray-200 hover:bg-gray-200" %>
16
16
  <% end %>
17
17
 
18
18
  <%= link_to spina.new_admin_embed_path(embed_type: embeddable.name), class: classes, data: {turbo_frame: :embeddable_form} do %>
@@ -44,4 +44,4 @@
44
44
  <% end %>
45
45
 
46
46
  </div>
47
- <% end %>
47
+ <% end %>
@@ -1,7 +1,7 @@
1
1
  <%= turbo_frame_tag dom_id(image) do %>
2
2
  <div class="flex items-center h-12 border-b border-gray-200 px-8 hover:bg-white group">
3
3
  <div class="w-8 mr-4 h-12 flex justify-center">
4
- <%= link_to spina.admin_image_path(image), class: "flex items-center cursor-zoom-in", data: {turbo_frame: "modal"} do %>
4
+ <%= link_to spina.admin_image_path(image), class: "flex flex-1 items-center cursor-zoom-in", data: {turbo_frame: "modal"} do %>
5
5
  <%= image_tag thumbnail_url(image), class: "object-contain" %>
6
6
  <% end %>
7
7
  </div>
@@ -1,4 +1,4 @@
1
- <div data-controller="tabs" data-tabs-active="cursor-default text-gray-900 bg-spina-dark bg-opacity-10" data-tabs-inactive="cursor-pointer bg-transparent text-gray-400 border-transparent">
1
+ <div data-controller="tabs" data-tabs-active="cursor-default text-gray-900 bg-spina-dark/10" data-tabs-inactive="cursor-pointer bg-transparent text-gray-400 border-transparent">
2
2
  <%= render Spina::UserInterface::HeaderComponent.new do |header| %>
3
3
  <% header.with_actions do %>
4
4
  <%= render Spina::UserInterface::TranslationsComponent.new(@account, label: @locale.upcase) %>
@@ -42,4 +42,4 @@
42
42
  </div>
43
43
 
44
44
  <% end %>
45
- </div>
45
+ </div>
@@ -15,13 +15,13 @@
15
15
  </div>
16
16
  </div>
17
17
  <div class="px-4 py-6 sm:px-6 sm:flex sm:flex-row-reverse">
18
- <span class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
18
+ <span class="flex w-full rounded-md shadow-xs sm:ml-3 sm:w-auto">
19
19
  <button type="submit" class="btn btn-primary">
20
20
  <%=t 'spina.pages.move_page' %>
21
21
  <%= heroicon('arrow-right', style: :solid, class: 'w-4 h-4 ml-1') %>
22
22
  </button>
23
23
  </span>
24
- <span class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
24
+ <span class="mt-3 flex w-full rounded-md shadow-xs sm:mt-0 sm:w-auto">
25
25
  <button type="button" class="btn btn-default" data-action="modal#close">
26
26
  <%=t 'spina.ui.cancel' %>
27
27
  </button>
@@ -1,5 +1,5 @@
1
1
  <li data-id="<%= navigation_item.id %>" id="<%= dom_id(navigation_item, :container) %>">
2
- <div class="btn w-56 px-0 text-gray-700 bg-white shadow-sm border-gray-300 cursor-default justify-start">
2
+ <div class="btn w-56 px-0 text-gray-700 bg-white shadow-xs border-gray-300 cursor-default justify-start">
3
3
  <div data-sortable-handle class="cursor-move px-2 pl-4 h-full flex items-center text-gray-400 hover:text-gray-700">
4
4
  <%= heroicon('menu-alt-4', style: :solid, class: 'w-4 h-4 -ml-1') %>
5
5
  </div>
@@ -21,17 +21,17 @@
21
21
 
22
22
  <div hidden data-reveal data-transition class="origin-top-right absolute left-0 z-10 mt-1 w-48 rounded-md shadow-lg">
23
23
  <div class="rounded-md bg-gray-700 shadow-xs py-1">
24
- <%= link_to spina.new_admin_navigation_navigation_item_path(@navigation, parent_id: navigation_item.id), class: "px-3 py-1 text-xs leading-5 text-gray-200 hover:bg-gray-800 hover:text-white focus:outline-none flex items-center", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
24
+ <%= link_to spina.new_admin_navigation_navigation_item_path(@navigation, parent_id: navigation_item.id), class: "px-3 py-1 text-xs leading-5 text-gray-200 hover:bg-gray-800 hover:text-white focus:outline-hidden flex items-center", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
25
25
  <%= heroicon('plus', style: :mini, class: 'w-4 h-4 mr-2') %>
26
26
  <%=t 'spina.navigations.add_sub_item' %>
27
27
  <% end %>
28
28
 
29
- <%= link_to spina.edit_admin_navigation_navigation_item_path(@navigation, id: navigation_item.id, locale: @locale), class: "px-3 py-1 text-xs leading-5 text-gray-200 hover:bg-gray-800 hover:text-white focus:outline-none flex items-center", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
29
+ <%= link_to spina.edit_admin_navigation_navigation_item_path(@navigation, id: navigation_item.id, locale: @locale), class: "px-3 py-1 text-xs leading-5 text-gray-200 hover:bg-gray-800 hover:text-white focus:outline-hidden flex items-center", data: {turbo_frame: "modal", action: "reveal#hide"} do %>
30
30
  <%= heroicon('pencil-square', style: :mini, class: 'w-4 h-4 mr-2') %>
31
31
  <%=t 'spina.navigations.edit_item' %>
32
32
  <% end %>
33
33
 
34
- <%= button_to spina.admin_navigation_navigation_item_path(@navigation, navigation_item), method: :delete, class: "bg-transparent w-full text-left cursor-pointer font-medium px-3 py-1 text-xs leading-5 text-red-400 hover:bg-gray-800 hover:text-red-400 focus:outline-none flex items-center", form: {data: {action: "reveal#hide", controller: "confirm", confirm_message: t('spina.navigations.delete_item_confirmation_html')}} do %>
34
+ <%= button_to spina.admin_navigation_navigation_item_path(@navigation, navigation_item), method: :delete, class: "bg-transparent w-full text-left cursor-pointer font-medium px-3 py-1 text-xs leading-5 text-red-400 hover:bg-gray-800 hover:text-red-400 focus:outline-hidden flex items-center", form: {data: {action: "reveal#hide", controller: "confirm", confirm_message: t('spina.navigations.delete_item_confirmation_html')}} do %>
35
35
  <%= heroicon('trash', class: 'w-4 h-4 mr-2') %>
36
36
  <%=t 'spina.navigations.delete_item' %>
37
37
  <% end %>
@@ -46,4 +46,4 @@
46
46
 
47
47
  <%= render navigation_item.children.sorted %>
48
48
  </ul>
49
- </li>
49
+ </li>
@@ -1,4 +1,4 @@
1
- <div data-controller="tabs" data-tabs-active="cursor-default text-gray-900 bg-spina-dark bg-opacity-10" data-tabs-inactive="cursor-pointer bg-transparent text-gray-400 border-transparent">
1
+ <div data-controller="tabs" data-tabs-active="cursor-default text-gray-900 bg-spina-dark/10" data-tabs-inactive="cursor-pointer bg-transparent text-gray-400 border-transparent">
2
2
  <%= render Spina::UserInterface::HeaderComponent.new do |header| %>
3
3
  <% header.with_after_breadcrumbs do %>
4
4
  <% if @page.draft? %>
@@ -37,7 +37,7 @@
37
37
  </div>
38
38
 
39
39
  <div class="col-span-2">
40
- <%= f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder), value: f.object.menu_title(fallback: false, default: nil), class: "form-input shadow-sm text-sm w-full" %>
40
+ <%= f.text_field :menu_title, placeholder: Spina::Page.human_attribute_name(:show_in_menu_placeholder), value: f.object.menu_title(fallback: false, default: nil), class: "form-input shadow-xs text-sm w-full" %>
41
41
  </div>
42
42
 
43
43
  <div class="col-span-1 mt-6 md:mt-0">
@@ -21,12 +21,12 @@
21
21
  </div>
22
22
  </div>
23
23
  <div class="px-4 py-6 sm:px-6 sm:flex sm:flex-row-reverse">
24
- <span class="flex w-full rounded-md shadow-sm sm:ml-3 sm:w-auto">
24
+ <span class="flex w-full rounded-md shadow-xs sm:ml-3 sm:w-auto">
25
25
  <button type="submit" class="btn btn-primary">
26
26
  <%=t 'spina.pages.change_view_template' %>
27
27
  </button>
28
28
  </span>
29
- <span class="mt-3 flex w-full rounded-md shadow-sm sm:mt-0 sm:w-auto">
29
+ <span class="mt-3 flex w-full rounded-md shadow-xs sm:mt-0 sm:w-auto">
30
30
  <button type="button" class="btn btn-default" data-action="modal#close">
31
31
  <%=t 'spina.ui.cancel' %>
32
32
  </button>
@@ -42,7 +42,7 @@
42
42
 
43
43
  <% if @pages.any? %>
44
44
 
45
- <div class="my-6 md:m-8 bg-white md:rounded-lg border-l-0 border-r-0 border md:border-r md:border-l border-gray-200 border-b-0 shadow-sm">
45
+ <div class="my-6 md:m-8 bg-white md:rounded-lg border-l-0 border-r-0 border md:border-r md:border-l border-gray-200 border-b-0 shadow-xs">
46
46
  <%= render Spina::Pages::ListComponent.new(pages: @pages, sortable: @resource.nil? || @resource&.order_by.blank?) %>
47
47
  </div>
48
48
 
@@ -5,7 +5,7 @@
5
5
 
6
6
  <div class="h-28 w-28 rounded-lg shadow-md overflow-hidden relative mr-3">
7
7
 
8
- <button class="absolute top-0 left-0 mt-2 ml-2 z-10 cursor-pointer flex items-center h-9 px-2 rounded-md bg-gray-700 bg-opacity-50 border-gray-300 active:shadow-inner text-gray-200 hover:text-white text-sm font-medium leading-none leading-none shadow-sm" data-action="image-collection#removeImage" data-id="<%= f.object.object_id %>" type="button">
8
+ <button class="absolute top-0 left-0 mt-2 ml-2 z-10 cursor-pointer flex items-center h-9 px-2 rounded-md bg-gray-700/50 border-gray-300 active:shadow-inner text-gray-200 hover:text-white text-sm font-medium leading-none leading-none shadow-xs" data-action="image-collection#removeImage" data-id="<%= f.object.object_id %>" type="button">
9
9
  <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
10
10
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
11
11
  </svg>
@@ -8,7 +8,7 @@
8
8
  <%= f.hidden_field :filename, data: {media_picker_target: "filename"} %>
9
9
  <%= f.hidden_field :image_id, data: {media_picker_target: "imageId"} %>
10
10
 
11
- <button class="absolute mt-3 ml-2 z-10 cursor-pointer flex items-center h-9 px-2 rounded-md bg-gray-700 bg-opacity-50 border-gray-300 active:shadow-inner text-gray-200 hover:text-white text-sm font-medium leading-none leading-none shadow-sm" data-action="media-picker#removeImage" data-media-picker-target="clearButton" type="button">
11
+ <button class="absolute mt-3 ml-2 z-10 cursor-pointer flex items-center h-9 px-2 rounded-md bg-gray-700/50 border-gray-300 active:shadow-inner text-gray-200 hover:text-white text-sm font-medium leading-none leading-none shadow-xs" data-action="media-picker#removeImage" data-media-picker-target="clearButton" type="button">
12
12
  <svg class="w-5 h-5" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor">
13
13
  <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
14
14
  </svg>
@@ -4,7 +4,7 @@
4
4
  <div data-controller="select reveal data-binding" data-placeholder="<%=t "spina.pages.select_page" %>" class="relative mt-1" data-reveal-away-value>
5
5
  <%= f.hidden_field :page_id, data: { select_target: "input", action: 'change->data-binding#update', binding_target: 'label', binding_condition: "$source.value == ''", binding_attribute: 'hidden' } %>
6
6
  <div class="flex">
7
- <div class="rounded-md border text-gray-700 bg-white shadow-sm border-gray-300">
7
+ <div class="rounded-md border text-gray-700 bg-white shadow-xs border-gray-300">
8
8
  <button type="button" class="w-full py-1.5 px-3 inline-flex items-center text-sm font-medium" data-action="reveal#toggle select#autofocus">
9
9
  <%= heroicon("link", style: :mini, class: "w-4 h-4 mr-1 text-gray-600") %>
10
10
  <div data-select-target="label">
@@ -19,7 +19,7 @@
19
19
  </div>
20
20
  </div>
21
21
  <div class="relative mt-1">
22
- <div data-reveal data-transition hidden class="absolute shadow-lg border border-gray-200 origin-top-right rounded-md z-10 top-0">
22
+ <div data-reveal data-transition hidden class="absolute shadow-lg border border-gray-200 origin-top-right rounded-md z-50 top-0">
23
23
  <div class="rounded-md bg-white shadow-xs">
24
24
  <%= form_with url: spina.search_admin_page_select_options_path, data: {turbo_frame: "page_select_options_#{f.object.object_id}", controller: "form", debounce_time: 100} do |ff| %>
25
25
  <%= ff.hidden_field :object_id, value: f.object.object_id %>
@@ -2,7 +2,7 @@
2
2
  <label class="block text-sm leading-5 font-medium text-gray-700"><%= f.object.title %></label>
3
3
  <div class="text-gray-400 text-sm"><%= f.object.hint %></div>
4
4
 
5
- <div class="-mt-4 flex flex-col md:flex-row" data-controller="tabs" data-tabs-active="bg-spina-dark bg-opacity-10 text-gray-900" data-tabs-inactive="text-gray-500">
5
+ <div class="-mt-4 flex flex-col md:flex-row" data-controller="tabs" data-tabs-active="bg-spina-dark/10 text-gray-900" data-tabs-inactive="text-gray-500">
6
6
  <div class="md:w-64 md:pr-6">
7
7
  <%
8
8
  # Fields
@@ -12,7 +12,7 @@
12
12
  </div>
13
13
  </button>
14
14
  <div class="relative mt-1">
15
- <div data-reveal data-transition hidden class="absolute shadow-lg border border-gray-200 origin-top-right rounded-md z-10 top-0">
15
+ <div data-reveal data-transition hidden class="absolute shadow-lg border border-gray-200 origin-top-right rounded-md z-50 top-0">
16
16
  <div class="rounded-md bg-white shadow-xs">
17
17
  <%= form_with url: spina.search_admin_resource_select_options_path, data: {turbo_frame: "resource_select_options_#{f.object.object_id}", controller: "form", debounce_time: 100} do |ff| %>
18
18
  <%= ff.hidden_field :object_id, value: f.object.object_id %>
@@ -4,10 +4,10 @@
4
4
  <div class="mt-1 relative">
5
5
  <%= f.hidden_field :content, id: "#{f.object.object_id}_input" %>
6
6
 
7
- <div class="relative form-textarea p-4 pt-0 shadow-sm max-w-5xl" data-controller="trix" id="<%= "insert_#{f.object.object_id}_trix-toolbar" %>" data-action="media-picker:done->trix#insertAttachment trix-file-accept->trix#fileAccept">
7
+ <div class="relative form-textarea p-4 pt-0 shadow-xs max-w-5xl" data-controller="trix" id="<%= "insert_#{f.object.object_id}_trix-toolbar" %>" data-action="media-picker:done->trix#insertAttachment trix-file-accept->trix#fileAccept">
8
8
  <%= render Spina::Forms::TrixToolbarComponent.new("#{f.object.object_id}_trix-toolbar") %>
9
9
 
10
- <trix-editor class="prose prose-sm focus:outline-none max-w-3xl xl:border-r border-dashed border-gray-200 pr-3" toolbar="<%= f.object.object_id %>_trix-toolbar" input="<%= f.object.object_id %>_input" data-trix-target="editor" data-action="trix-file-accept->trix#preventDefault"></trix-editor>
10
+ <trix-editor class="prose prose-sm focus:outline-hidden max-w-3xl xl:border-r border-dashed border-gray-200 pr-3" toolbar="<%= f.object.object_id %>_trix-toolbar" input="<%= f.object.object_id %>_input" data-trix-target="editor" data-action="trix-file-accept->trix#preventDefault"></trix-editor>
11
11
  </div>
12
12
  </div>
13
13
  </div>
@@ -4,10 +4,10 @@
4
4
  <div class="mt-1 relative">
5
5
  <%= f.hidden_field attribute, id: "#{f.object.object_id}_input" %>
6
6
 
7
- <div class="relative form-textarea p-4 pt-0 shadow-sm max-w-5xl" data-controller="trix" id="<%= "insert_#{f.object.object_id}_trix-toolbar" %>" data-action="media-picker:done->trix#insertAttachment">
7
+ <div class="relative form-textarea p-4 pt-0 shadow-xs max-w-5xl" data-controller="trix" id="<%= "insert_#{f.object.object_id}_trix-toolbar" %>" data-action="media-picker:done->trix#insertAttachment">
8
8
  <%= render Spina::Forms::TrixToolbarComponent.new("#{f.object.object_id}_trix-toolbar") %>
9
9
 
10
- <trix-editor class="prose prose-sm focus:outline-none max-w-3xl xl:border-r border-dashed border-gray-200 pr-3" toolbar="<%= f.object.object_id %>_trix-toolbar" input="<%= f.object.object_id %>_input" data-trix-target="editor" data-action="trix-file-accept->trix#preventDefault"></trix-editor>
10
+ <trix-editor class="prose prose-sm focus:outline-hidden max-w-3xl xl:border-r border-dashed border-gray-200 pr-3" toolbar="<%= f.object.object_id %>_trix-toolbar" input="<%= f.object.object_id %>_input" data-trix-target="editor" data-action="trix-file-accept->trix#preventDefault"></trix-editor>
11
11
  </div>
12
12
  </div>
13
- <% end %>
13
+ <% end %>
@@ -1,5 +1,5 @@
1
1
  <nav class="w-full md:max-w-xs bg-spina-dark md:bg-gradient-to-b from-spina-dark to-spina-light relative md:overflow-hidden" data-controller="navigation">
2
- <div class="flex flex-row md:flex-col justify-between h-full w-full bg-black p-1 md:p-3 bg-opacity-0 duration-300 ease-in-out transition-colors md:bg-opacity-50" data-navigation-target="primary">
2
+ <div class="flex flex-row md:flex-col justify-between h-full w-full bg-black/0 p-1 md:p-3 duration-300 ease-in-out transition-colors md:bg-black/50" data-navigation-target="primary">
3
3
 
4
4
  <ul class="flex md:flex-col">
5
5
  <%= render Spina::MainNavigation::SubNavComponent.new(:content) do |nav| %>
@@ -9,7 +9,7 @@
9
9
  <% end %>
10
10
 
11
11
  <div class="p-8">
12
- <div class="shadow-sm border border-gray-200 bg-white rounded-lg">
12
+ <div class="shadow-xs border border-gray-200 bg-white rounded-lg">
13
13
  <%= render partial: 'user', collection: @users %>
14
14
  </div>
15
- </div>
15
+ </div>
@@ -7,7 +7,7 @@ xml.urlset "xmlns" => "http://www.google.com/schemas/sitemap/0.9", "xmlns:xhtml"
7
7
 
8
8
  # Translations
9
9
  page.translations.each do |translation|
10
- if translation.locale.in? Spina.locales.map(&:to_s)
10
+ if translation.locale.in? Spina.config.locales.map(&:to_s)
11
11
  Mobility.with_locale(translation.locale) do
12
12
  xml.xhtml(:link, rel: "alternate", hreflang: translation.locale, href: "#{request.protocol}#{request.host}#{page.materialized_path}")
13
13
  end
data/config/routes.rb CHANGED
@@ -96,8 +96,8 @@ Spina::Engine.routes.draw do
96
96
  root to: "pages#homepage"
97
97
 
98
98
  # Pages
99
- get "/:locale/*id" => "pages#show", :constraints => {locale: /#{Spina.locales.join('|')}/}
100
- get "/:locale/" => "pages#homepage", :constraints => {locale: /#{Spina.locales.join('|')}/}
99
+ get "/:locale/*id" => "pages#show", :constraints => {locale: /#{Spina.config.locales.join('|')}/}
100
+ get "/:locale/" => "pages#homepage", :constraints => {locale: /#{Spina.config.locales.join('|')}/}
101
101
  get "/*id" => "pages#show", :as => "page", :controller => "pages", :constraints => ->(request) {
102
102
  request.path.exclude?(ActiveStorage.routes_prefix) &&
103
103
  !(Rails.env.development? && request.path.starts_with?("/rails/"))
@@ -1,5 +1,5 @@
1
1
  class AddJsonAttributesToSpinaAccounts < ActiveRecord::Migration[5.2]
2
2
  def change
3
- add_column :spina_accounts, :json_attributes, :jsonb
3
+ add_column :spina_accounts, :json_attributes, :json
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class AddJsonAttributesToSpinaPages < ActiveRecord::Migration[5.2]
2
2
  def change
3
- add_column :spina_pages, :json_attributes, :jsonb
3
+ add_column :spina_pages, :json_attributes, :json
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  class AddSlugToSpinaResources < ActiveRecord::Migration[5.2]
2
2
  def change
3
- add_column :spina_resources, :slug, :jsonb
3
+ add_column :spina_resources, :slug, :json
4
4
  end
5
5
  end
@@ -1,9 +1,9 @@
1
1
  class ChangeDefaultSpinaResourcesSlug < ActiveRecord::Migration[7.0]
2
2
  def up
3
- change_column :spina_resources, :slug, :jsonb, default: {}
3
+ # Default handled in model layer for MySQL compatibility
4
4
  end
5
5
 
6
6
  def down
7
- change_column :spina_resources, :slug, :jsonb, default: nil
7
+ # Default handled in model layer for MySQL compatibility
8
8
  end
9
9
  end
@@ -2,7 +2,7 @@ class CreateSpinaSettings < ActiveRecord::Migration[5.0]
2
2
  def change
3
3
  create_table :spina_settings do |t|
4
4
  t.string :plugin
5
- t.jsonb :preferences, default: {}
5
+ t.json :preferences
6
6
  t.timestamps
7
7
  end
8
8
 
@@ -3,7 +3,7 @@ module Spina
3
3
  source_root File.expand_path("../templates", __FILE__)
4
4
 
5
5
  def create_tailwind_config_file
6
- filename = "app/assets/config/spina/tailwind.config.js"
6
+ filename = "app/assets/stylesheets/spina/application.tailwind.css"
7
7
  template filename
8
8
  insert_into_file ".gitignore", <<~TEXT
9
9