alchemy_cms 8.1.3 → 8.1.4
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.
- checksums.yaml +4 -4
- data/app/assets/builds/alchemy/admin.css +1 -1
- data/app/controllers/alchemy/admin/pages_controller.rb +1 -5
- data/app/javascript/alchemy_admin/components/picture_thumbnail.js +12 -5
- data/app/models/alchemy/page/page_scopes.rb +0 -12
- data/app/stylesheets/alchemy/admin/archive.scss +1 -1
- data/app/stylesheets/alchemy/admin/icons.scss +1 -1
- data/app/stylesheets/alchemy/admin/shoelace.scss +6 -0
- data/app/views/alchemy/_menubar.html.erb +28 -4
- data/app/views/alchemy/admin/pages/_toolbar.html.erb +2 -2
- data/config/locales/alchemy.en.yml +1 -0
- data/lib/alchemy/version.rb +1 -1
- metadata +1 -1
|
@@ -222,11 +222,7 @@ module Alchemy
|
|
|
222
222
|
end
|
|
223
223
|
|
|
224
224
|
def flush
|
|
225
|
-
@current_language.pages.
|
|
226
|
-
# We need to ensure, that also all layoutpages get the +published_at+ timestamp set,
|
|
227
|
-
# but not set to public true, because the cache_key for an element is +published_at+
|
|
228
|
-
# and we don't want the layout pages to be present in +Page.published+ scope.
|
|
229
|
-
@current_language.pages.flushable_layoutpages.update_all(published_at: Time.current)
|
|
225
|
+
PageVersion.where(page_id: @current_language.pages.select(:id)).published.touch_all
|
|
230
226
|
respond_to { |format| format.turbo_stream }
|
|
231
227
|
end
|
|
232
228
|
|
|
@@ -29,9 +29,7 @@ export default class PictureThumbnail extends HTMLElement {
|
|
|
29
29
|
}
|
|
30
30
|
|
|
31
31
|
connectedCallback() {
|
|
32
|
-
|
|
33
|
-
this.replaceChildren(this.image)
|
|
34
|
-
}
|
|
32
|
+
this.#setImage()
|
|
35
33
|
}
|
|
36
34
|
|
|
37
35
|
disconnectedCallback() {
|
|
@@ -77,22 +75,31 @@ export default class PictureThumbnail extends HTMLElement {
|
|
|
77
75
|
|
|
78
76
|
#onError(evt) {
|
|
79
77
|
const message = `Could not load ${this.image.src}`
|
|
78
|
+
const hoist = this.closest(".ingredient-editor")
|
|
80
79
|
this.spinner.stop()
|
|
81
80
|
this.innerHTML = `
|
|
82
|
-
<sl-tooltip content="${message}">
|
|
81
|
+
<sl-tooltip content="${message}" ${hoist ? "hoist" : ""}>
|
|
83
82
|
<alchemy-icon name="alert" class="error"></alchemy-icon>
|
|
84
83
|
</sl-tooltip>
|
|
85
84
|
`
|
|
86
85
|
console.error(message, evt)
|
|
87
86
|
}
|
|
88
87
|
|
|
88
|
+
#setImage() {
|
|
89
|
+
if (this.image?.complete) {
|
|
90
|
+
this.replaceChildren(this.image)
|
|
91
|
+
} else if (this.image) {
|
|
92
|
+
this.append(this.image)
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
89
96
|
set loading(value) {
|
|
90
97
|
value ? this.load() : this.stop()
|
|
91
98
|
}
|
|
92
99
|
|
|
93
100
|
set src(src) {
|
|
94
101
|
this.start(src)
|
|
95
|
-
this
|
|
102
|
+
this.#setImage()
|
|
96
103
|
}
|
|
97
104
|
|
|
98
105
|
get name() {
|
|
@@ -78,18 +78,6 @@ module Alchemy
|
|
|
78
78
|
#
|
|
79
79
|
scope :contentpages, -> { where(layoutpage: [false, nil]) }
|
|
80
80
|
|
|
81
|
-
# Returns all public contentpages that are not locked.
|
|
82
|
-
#
|
|
83
|
-
# Used for flushing all pages caches at once.
|
|
84
|
-
#
|
|
85
|
-
scope :flushables, -> { not_locked.published.contentpages }
|
|
86
|
-
|
|
87
|
-
# Returns all layoutpages that are not locked.
|
|
88
|
-
#
|
|
89
|
-
# Used for flushing all pages caches at once.
|
|
90
|
-
#
|
|
91
|
-
scope :flushable_layoutpages, -> { not_locked.layoutpages }
|
|
92
|
-
|
|
93
81
|
# All searchable pages
|
|
94
82
|
#
|
|
95
83
|
scope :searchables, -> { not_restricted.published.contentpages }
|
|
@@ -35,7 +35,8 @@
|
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
.menubar:hover,
|
|
38
|
-
.menubar:focus-within
|
|
38
|
+
.menubar:focus-within,
|
|
39
|
+
.menubar.is-open {
|
|
39
40
|
left: 0;
|
|
40
41
|
}
|
|
41
42
|
|
|
@@ -121,9 +122,32 @@
|
|
|
121
122
|
}
|
|
122
123
|
|
|
123
124
|
connectedCallback() {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
bar.
|
|
125
|
+
const width = this.bar.offsetWidth
|
|
126
|
+
this.bar.style = `--panel-width: ${width}px; --left-offset: calc(var(--icon-size) + 32px);`
|
|
127
|
+
this.bar.addEventListener("touchstart", this, { passive: false })
|
|
128
|
+
document.addEventListener("touchstart", this, { passive: true })
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
handleEvent(event) {
|
|
132
|
+
// click on menubar
|
|
133
|
+
if (event.currentTarget === this.bar) {
|
|
134
|
+
if (!this.bar.classList.contains("is-open")) {
|
|
135
|
+
event.preventDefault()
|
|
136
|
+
this.bar.classList.add("is-open")
|
|
137
|
+
}
|
|
138
|
+
// click outside of menubar
|
|
139
|
+
} else if (!event.composedPath().includes(this.bar)) {
|
|
140
|
+
this.bar.classList.remove("is-open")
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
disconnectedCallback() {
|
|
145
|
+
this.bar.removeEventListener("touchstart", this)
|
|
146
|
+
document.removeEventListener("touchstart", this)
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
get bar() {
|
|
150
|
+
return this.shadowRoot.querySelector(".menubar")
|
|
127
151
|
}
|
|
128
152
|
}
|
|
129
153
|
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
<%= button_to(
|
|
22
22
|
render_icon(:eraser),
|
|
23
23
|
alchemy.flush_admin_pages_path,
|
|
24
|
-
"turbo-
|
|
25
|
-
class: "icon_button
|
|
24
|
+
"data-turbo-confirm": Alchemy.t(:confirm_to_flush_cache),
|
|
25
|
+
class: "icon_button"
|
|
26
26
|
) %>
|
|
27
27
|
</sl-tooltip>
|
|
28
28
|
</div>
|
|
@@ -399,6 +399,7 @@ en:
|
|
|
399
399
|
confirm_to_delete_menu: "Do you really want to delete this menu?"
|
|
400
400
|
confirm_to_delete_node: "Do you really want to delete this menu node?"
|
|
401
401
|
confirm_to_delete_page: "Do you really want to delete this page?"
|
|
402
|
+
confirm_to_flush_cache: "Do you really want to flush the page cache? This will might take a while and can make first page requests slow."
|
|
402
403
|
ingredient_validations_headline: "Please check marked fields below"
|
|
403
404
|
copy: "copy"
|
|
404
405
|
copy_element: "Copy this element"
|
data/lib/alchemy/version.rb
CHANGED