spina 2.7.0 → 2.8.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of spina might be problematic. Click here for more details.
- checksums.yaml +4 -4
- data/README.md +0 -2
- data/Rakefile +2 -1
- data/app/assets/builds/spina/tailwind.css +3460 -0
- data/app/assets/config/spina/manifest.js +3 -1
- data/app/assets/javascripts/spina/controllers/image_collection_controller.js +5 -3
- data/app/assets/stylesheets/spina/{_animate.css → animate.css} +0 -0
- data/app/assets/stylesheets/spina/{tailwind/custom.css → application.tailwind.css} +40 -46
- data/app/assets/stylesheets/spina/{_fonts.css.erb → fonts.css.erb} +0 -0
- data/app/components/spina/accounts/translations_component.html.erb +21 -0
- data/app/components/spina/accounts/translations_component.rb +26 -0
- data/app/components/spina/forms/trix_toolbar_component.html.erb +1 -1
- data/app/controllers/spina/admin/layout_controller.rb +1 -1
- data/app/controllers/spina/admin/navigation_items_controller.rb +1 -1
- data/app/views/layouts/spina/admin/application.html.erb +2 -2
- data/app/views/spina/admin/layout/edit.html.erb +2 -0
- data/app/views/spina/admin/navigation_items/_form.html.erb +5 -1
- data/config/locales/fr.yml +190 -152
- data/lib/generators/spina/install_generator.rb +4 -0
- data/lib/generators/spina/tailwind_config_generator.rb +10 -0
- data/{app/assets/config/spina/tailwind.config.js → lib/generators/spina/templates/app/assets/config/spina/tailwind.config.js.tt} +5 -7
- data/lib/spina/version.rb +1 -1
- data/lib/spina.rb +22 -11
- data/lib/tasks/install.rake +39 -0
- data/lib/tasks/tailwind.rake +22 -0
- metadata +26 -10
- data/app/assets/stylesheets/spina/_tailwind.css +0 -203643
- data/app/assets/stylesheets/spina/application.css +0 -6
- data/lib/spina/tailwind_purger.rb +0 -147
- data/lib/tasks/spina_tasks.rake +0 -75
@@ -4,6 +4,8 @@
|
|
4
4
|
//= link_directory ../../javascripts/spina/controllers
|
5
5
|
//= link_directory ../../javascripts/spina/libraries
|
6
6
|
|
7
|
-
//= link spina/
|
7
|
+
//= link spina/animate.css
|
8
|
+
//= link spina/fonts.css
|
9
|
+
//= link spina/tailwind.css
|
8
10
|
|
9
11
|
//= link spina/application.js
|
@@ -7,9 +7,11 @@ export default class extends Controller {
|
|
7
7
|
}
|
8
8
|
|
9
9
|
connect() {
|
10
|
-
|
11
|
-
|
12
|
-
|
10
|
+
setTimeout(function() {
|
11
|
+
this.sortable = Sortable.create(this.collectionTarget, {
|
12
|
+
animation: 150
|
13
|
+
})
|
14
|
+
}.bind(this), 250)
|
13
15
|
}
|
14
16
|
|
15
17
|
removeImage(event) {
|
File without changes
|
@@ -138,58 +138,52 @@
|
|
138
138
|
@apply border border-gray-400;
|
139
139
|
}
|
140
140
|
|
141
|
-
/* Trix */
|
142
|
-
.trix-toolbar {
|
143
|
-
|
144
|
-
|
145
|
-
}
|
141
|
+
/* Trix */
|
142
|
+
.trix-toolbar button[data-trix-active] {
|
143
|
+
@apply text-white bg-spina;
|
144
|
+
}
|
146
145
|
|
147
|
-
|
148
|
-
|
149
|
-
}
|
146
|
+
.trix-toolbar button[disabled] {
|
147
|
+
@apply bg-gray-100 text-gray-400;
|
150
148
|
}
|
151
149
|
|
152
|
-
trix-editor {
|
153
|
-
|
154
|
-
|
155
|
-
@apply select-none
|
156
|
-
}
|
157
|
-
|
158
|
-
figure.attachment {
|
159
|
-
@apply m-0 inline-block
|
160
|
-
}
|
161
|
-
|
162
|
-
figure.attachment[data-trix-content-type="Spina::Image"] {
|
163
|
-
max-height: 150px;
|
164
|
-
max-width: 200px;
|
165
|
-
}
|
166
|
-
|
167
|
-
figure.attachment[data-trix-content-type="Spina::Image"] img {
|
168
|
-
@apply m-0 rounded-md object-contain;
|
169
|
-
}
|
170
|
-
|
171
|
-
figure.attachment[data-trix-content-type="Spina::Image"] [data-label]:after {
|
172
|
-
content: attr(data-label);
|
173
|
-
@apply italic text-gray-500 h-8 flex items-center px-2 mt-1 text-sm;
|
174
|
-
}
|
175
|
-
|
176
|
-
figure[data-trix-mutable].attachment[data-trix-content-type="Spina::Image"] img {
|
177
|
-
@apply shadow-lg ring ring-spina-light
|
178
|
-
}
|
150
|
+
trix-editor [data-trix-mutable]:not(.attachment__captain-editor) {
|
151
|
+
@apply select-none
|
152
|
+
}
|
179
153
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
154
|
+
trix-editor figure.attachment {
|
155
|
+
@apply m-0 inline-block
|
156
|
+
}
|
157
|
+
|
158
|
+
trix-editor figure.attachment[data-trix-content-type="Spina::Image"] {
|
159
|
+
max-height: 150px;
|
160
|
+
max-width: 200px;
|
161
|
+
}
|
162
|
+
|
163
|
+
trix-editor figure.attachment[data-trix-content-type="Spina::Image"] img {
|
164
|
+
@apply m-0 rounded-md object-contain;
|
165
|
+
}
|
188
166
|
|
189
|
-
|
190
|
-
|
191
|
-
|
167
|
+
trix-editor figure.attachment[data-trix-content-type="Spina::Image"] [data-label]:after {
|
168
|
+
content: attr(data-label);
|
169
|
+
@apply italic text-gray-500 h-8 flex items-center px-2 mt-1 text-sm;
|
170
|
+
}
|
171
|
+
|
172
|
+
trix-editor figure[data-trix-mutable].attachment[data-trix-content-type="Spina::Image"] img {
|
173
|
+
@apply shadow-lg ring ring-spina-light
|
174
|
+
}
|
192
175
|
|
176
|
+
trix-editor figure[data-trix-mutable][data-trix-content-type="application/vnd+spina.embed+html"].attachment > spina-embed {
|
177
|
+
@apply block;
|
178
|
+
@apply shadow-lg ring ring-spina-light rounded-md;
|
179
|
+
}
|
180
|
+
|
181
|
+
trix-editor figure .attachment__caption {
|
182
|
+
@apply hidden
|
183
|
+
}
|
184
|
+
|
185
|
+
trix-editor figure .attachment__toolbar {
|
186
|
+
@apply hidden
|
193
187
|
}
|
194
188
|
|
195
189
|
trix-editor [data-trix-mutable]::-moz-selection,
|
File without changes
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="relative" data-controller="reveal" data-reveal-away-value>
|
2
|
+
<button type="button" class="btn btn-default px-3" data-action="reveal#toggle">
|
3
|
+
<%= helpers.heroicon("chat-alt", style: :solid, class: 'w-4 h-4 text-gray-300') %>
|
4
|
+
|
5
|
+
<span class="ml-1 font-semibold"><%= @label %></span>
|
6
|
+
</button>
|
7
|
+
|
8
|
+
<div hidden data-reveal data-transition class="origin-top-right absolute right-0 mt-2 w-56 rounded-md shadow-lg border border-gray-200 z-20">
|
9
|
+
<div class="rounded-md bg-white shadow-xs">
|
10
|
+
<div class="py-1">
|
11
|
+
<% locales.each do |locale| %>
|
12
|
+
<%= link_to helpers.spina.edit_admin_layout_path(locale: locale), class: "block px-3 py-2 text-sm leading-4 text-gray-700 hover:bg-gray-100 hover:text-gray-900 focus:outline-none focus:bg-gray-100 focus:text-gray-900 font-medium" do %>
|
13
|
+
<div class="text-gray-700">
|
14
|
+
<%=t('spina.pages.edit_translation', language: '<span class="font-semibold">' + t("spina.languages.#{locale}") + '</span>').html_safe %>
|
15
|
+
</div>
|
16
|
+
<% end %>
|
17
|
+
<% end %>
|
18
|
+
</div>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
@@ -0,0 +1,26 @@
|
|
1
|
+
module Spina
|
2
|
+
module Accounts
|
3
|
+
class TranslationsComponent < ApplicationComponent
|
4
|
+
|
5
|
+
def initialize(account, label: nil)
|
6
|
+
@account = account
|
7
|
+
@label = label
|
8
|
+
end
|
9
|
+
|
10
|
+
def render?
|
11
|
+
spina_locales.many?
|
12
|
+
end
|
13
|
+
|
14
|
+
def locales
|
15
|
+
spina_locales
|
16
|
+
end
|
17
|
+
|
18
|
+
private
|
19
|
+
|
20
|
+
def spina_locales
|
21
|
+
Spina.config.locales.map(&:to_sym)
|
22
|
+
end
|
23
|
+
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
@@ -1,4 +1,4 @@
|
|
1
|
-
<div class="relative sticky top-0 pt-4 bg-white trix-toolbar" id="<%= @trix_id %>">
|
1
|
+
<div class="relative sticky z-10 top-0 pt-4 bg-white trix-toolbar" id="<%= @trix_id %>">
|
2
2
|
<div class="flex items-center flex-wrap" data-controller="reveal">
|
3
3
|
<div class="flex items-center bg-gray-200 rounded overflow-hidden mb-3 mr-3">
|
4
4
|
<button type="button" class="hover:bg-gray-300 text-gray-700 w-9 h-9 flex items-center justify-center" data-trix-attribute="bold" data-trix-key="b" title="${Trix.config.lang.bold}" tabindex="-1">
|
@@ -11,7 +11,7 @@ module Spina::Admin
|
|
11
11
|
|
12
12
|
def update
|
13
13
|
if @account.update(layout_params)
|
14
|
-
redirect_to spina.edit_admin_layout_path, flash: {success: t('spina.layout.saved')}
|
14
|
+
redirect_to spina.edit_admin_layout_path(locale: @locale), flash: {success: t('spina.layout.saved')}
|
15
15
|
else
|
16
16
|
flash.now[:error] = t('spina.layout.couldnt_be_saved')
|
17
17
|
render partial: 'error', status: :unprocessable_entity
|
@@ -10,8 +10,8 @@
|
|
10
10
|
|
11
11
|
<title>Spina CMS</title>
|
12
12
|
|
13
|
-
<!--
|
14
|
-
<%= stylesheet_link_tag
|
13
|
+
<!-- Stylesheets -->
|
14
|
+
<%= stylesheet_link_tag "spina/tailwind", "spina/fonts", "spina/animate", "data-turbo-track": "reload" %>
|
15
15
|
|
16
16
|
<!-- Spina's importmap -->
|
17
17
|
<%= spina_importmap_tags %>
|
@@ -1,5 +1,7 @@
|
|
1
1
|
<%= render Spina::UserInterface::HeaderComponent.new do |header| %>
|
2
2
|
<% header.actions do %>
|
3
|
+
<%= render Spina::Accounts::TranslationsComponent.new(@account, label: @locale.upcase) %>
|
4
|
+
|
3
5
|
<% if Spina::Current.theme.layout_parts.any? %>
|
4
6
|
<%= button_tag type: :submit, form: dom_id(@account), class: 'btn btn-primary', data: {controller: "button hotkeys", hotkeys: "command+s, ctrl+s", hotkeys_target: "button", action: "button#loading", loading_message: t('spina.ui.saving')} do %>
|
5
7
|
<%= heroicon('check', style: :solid, class: 'w-5 h-5 mr-1 -ml-2') %>
|
@@ -10,7 +10,11 @@
|
|
10
10
|
</h3>
|
11
11
|
|
12
12
|
<div class="mt-3">
|
13
|
-
|
13
|
+
|
14
|
+
<div class="border border-gray-300 rounded-md bg-white">
|
15
|
+
<%= render Spina::Pages::PageSelectComponent.new("navigation_item[page_id]", @pages, include_blank: t("spina.navigations.choose_page"), disabled: @navigation.navigation_items.pluck(:page_id)) %>
|
16
|
+
</div>
|
17
|
+
|
14
18
|
</div>
|
15
19
|
</div>
|
16
20
|
</div>
|