super 0.21.0 → 0.22.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.
- checksums.yaml +4 -4
- data/README.md +35 -47
- data/app/assets/javascripts/super/application.js +1201 -2092
- data/app/assets/stylesheets/super/application.css +54 -6569
- data/app/controllers/super/application_controller.rb +44 -30
- data/app/controllers/super/foundation_controller.rb +30 -0
- data/app/controllers/super/sitewide_controller.rb +6 -3
- data/app/controllers/super/substructure_controller.rb +40 -47
- data/app/controllers/super/view_controller.rb +5 -1
- data/app/views/layouts/super/application.html.erb +3 -3
- data/app/views/super/application/_batch_checkbox.csv.erb +1 -1
- data/app/views/super/application/_batch_checkbox.html.erb +1 -1
- data/app/views/super/application/_collection_header.html.erb +1 -1
- data/app/views/super/application/_csv_button.html.erb +1 -1
- data/app/views/super/application/_display_actions.html.erb +1 -1
- data/app/views/super/application/_display_rich_text.html.erb +1 -1
- data/app/views/super/application/_form.html.erb +1 -1
- data/app/views/super/application/_form_fieldset.html.erb +1 -1
- data/app/views/super/application/_form_has_many.html.erb +2 -2
- data/app/views/super/application/_form_has_one.html.erb +1 -1
- data/app/views/super/application/_layout.html.erb +6 -6
- data/app/views/super/application/_link.html.erb +1 -6
- data/app/views/super/application/_member_header.html.erb +1 -1
- data/app/views/super/application/_panel.html.erb +1 -1
- data/app/views/super/application/_query.html.erb +2 -2
- data/app/views/super/application/_site_header.html.erb +2 -2
- data/app/views/super/application/_sort.html.erb +2 -2
- data/app/views/super/application/_sort_expression.html.erb +1 -1
- data/app/views/super/application/_view_chain.html.erb +1 -24
- data/app/views/super/application/edit.html.erb +1 -1
- data/app/views/super/application/index.html.erb +1 -1
- data/app/views/super/application/new.html.erb +1 -1
- data/app/views/super/application/show.html.erb +1 -1
- data/frontend/super-frontend/dist/application.css +54 -6569
- data/frontend/super-frontend/dist/application.js +1201 -2092
- data/lib/super/action_inquirer.rb +28 -8
- data/lib/super/assets.rb +2 -2
- data/lib/super/badge.rb +8 -32
- data/lib/super/cheat.rb +6 -5
- data/lib/super/client_error.rb +4 -0
- data/lib/super/compatibility.rb +4 -0
- data/lib/super/configuration.rb +3 -0
- data/lib/super/display/schema_types.rb +38 -82
- data/lib/super/display.rb +13 -13
- data/lib/super/error.rb +14 -0
- data/lib/super/filter/form_object.rb +2 -2
- data/lib/super/filter/operator.rb +1 -1
- data/lib/super/filter/schema_types.rb +1 -1
- data/lib/super/form/field_transcript.rb +4 -0
- data/lib/super/form/schema_types.rb +2 -2
- data/lib/super/form/strong_params.rb +1 -1
- data/lib/super/form_builder/base_methods.rb +3 -9
- data/lib/super/form_builder/flatpickr_methods.rb +3 -3
- data/lib/super/form_builder.rb +19 -21
- data/lib/super/form_builder_helper.rb +3 -3
- data/lib/super/link.rb +15 -6
- data/lib/super/link_builder.rb +4 -4
- data/lib/super/navigation.rb +12 -8
- data/lib/super/partial.rb +0 -12
- data/lib/super/plugin.rb +2 -2
- data/lib/super/railtie.rb +1 -0
- data/lib/super/render_helper.rb +31 -0
- data/lib/super/reset.rb +1 -6
- data/lib/super/schema/guesser.rb +5 -5
- data/lib/super/schema.rb +2 -2
- data/lib/super/sort.rb +1 -1
- data/lib/super/useful/deprecations.rb +1 -3
- data/lib/super/useful/enum.rb +1 -1
- data/lib/super/useful/i19.rb +1 -1
- data/lib/super/version.rb +1 -1
- data/lib/super/view_chain.rb +19 -0
- data/lib/super.rb +1 -0
- metadata +4 -2
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
module Super
|
4
4
|
# Provides a default implementation for each of the resourceful actions
|
5
|
-
class ApplicationController <
|
5
|
+
class ApplicationController < ViewController
|
6
6
|
include ClientError::Handling
|
7
7
|
|
8
8
|
before_action do
|
@@ -12,6 +12,8 @@ module Super
|
|
12
12
|
end
|
13
13
|
|
14
14
|
# Displays a list of records to the user
|
15
|
+
#
|
16
|
+
# @return [void]
|
15
17
|
def index
|
16
18
|
if request.format.ref == :csv && !csv_enabled?
|
17
19
|
params_for_rebuilding_url = params.to_unsafe_hash
|
@@ -28,6 +30,8 @@ module Super
|
|
28
30
|
end
|
29
31
|
|
30
32
|
# Displays a specific record to the user
|
33
|
+
#
|
34
|
+
# @return [void]
|
31
35
|
def show
|
32
36
|
@record = load_record
|
33
37
|
@display = display_schema.apply(action: current_action, format: request.format)
|
@@ -35,6 +39,8 @@ module Super
|
|
35
39
|
end
|
36
40
|
|
37
41
|
# Displays a form to allow the user to create a new record
|
42
|
+
#
|
43
|
+
# @return [void]
|
38
44
|
def new
|
39
45
|
@record = build_record
|
40
46
|
@form = form_schema
|
@@ -42,6 +48,8 @@ module Super
|
|
42
48
|
end
|
43
49
|
|
44
50
|
# Creates a record, or shows the validation errors
|
51
|
+
#
|
52
|
+
# @return [void]
|
45
53
|
def create
|
46
54
|
@record = build_record
|
47
55
|
set_record_attributes
|
@@ -54,6 +62,8 @@ module Super
|
|
54
62
|
end
|
55
63
|
|
56
64
|
# Displays a form to allow the user to update an existing record
|
65
|
+
#
|
66
|
+
# @return [void]
|
57
67
|
def edit
|
58
68
|
@record = load_record
|
59
69
|
@form = form_schema
|
@@ -61,6 +71,8 @@ module Super
|
|
61
71
|
end
|
62
72
|
|
63
73
|
# Updates a record, or shows validation errors
|
74
|
+
#
|
75
|
+
# @return [void]
|
64
76
|
def update
|
65
77
|
@record = load_record
|
66
78
|
set_record_attributes
|
@@ -73,6 +85,8 @@ module Super
|
|
73
85
|
end
|
74
86
|
|
75
87
|
# Deletes a record, or shows validation errors
|
88
|
+
#
|
89
|
+
# @return [void]
|
76
90
|
def destroy
|
77
91
|
@record = load_record
|
78
92
|
|
@@ -87,43 +101,43 @@ module Super
|
|
87
101
|
|
88
102
|
private
|
89
103
|
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
ActionInquirer.default_for_resources,
|
94
|
-
params[:action]
|
95
|
-
)
|
104
|
+
# @return [void]
|
105
|
+
def redirect_to_record
|
106
|
+
redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
|
96
107
|
end
|
97
108
|
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
ActionInquirer.default_for_resources,
|
102
|
-
action
|
103
|
-
)
|
104
|
-
yield
|
105
|
-
ensure
|
106
|
-
@current_action = original
|
109
|
+
# @return [void]
|
110
|
+
def redirect_to_records
|
111
|
+
redirect_to polymorphic_path(Super::Link.polymorphic_parts(model))
|
107
112
|
end
|
108
113
|
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
114
|
+
# @return [void]
|
115
|
+
def redirect_to_record_with_destroy_failure_message(error = nil)
|
116
|
+
flash.alert =
|
117
|
+
case error
|
118
|
+
when ActiveRecord::InvalidForeignKey
|
119
|
+
I18n.t("super.destroy_error.invalid_foreign_key")
|
113
120
|
else
|
114
|
-
|
121
|
+
I18n.t("super.destroy_error.generic")
|
115
122
|
end
|
116
|
-
|
123
|
+
|
124
|
+
redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
|
117
125
|
end
|
118
126
|
|
119
|
-
|
120
|
-
|
121
|
-
|
122
|
-
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
127
|
+
# @return [void]
|
128
|
+
def render_new_as_bad_request
|
129
|
+
@current_action = ActionInquirer.new!
|
130
|
+
@form = form_schema
|
131
|
+
@view = new_view
|
132
|
+
render :new, status: :bad_request
|
133
|
+
end
|
134
|
+
|
135
|
+
# @return [void]
|
136
|
+
def render_edit_as_bad_request
|
137
|
+
@current_action = ActionInquirer.edit!
|
138
|
+
@form = form_schema
|
139
|
+
@view = edit_view
|
140
|
+
render :edit, status: :bad_request
|
127
141
|
end
|
128
142
|
end
|
129
143
|
end
|
@@ -0,0 +1,30 @@
|
|
1
|
+
# typed: true
|
2
|
+
# frozen_string_literal: true
|
3
|
+
|
4
|
+
module Super
|
5
|
+
# These methods could be useful for any Super controller, resourceful or not.
|
6
|
+
class FoundationController < ActionController::Base
|
7
|
+
private
|
8
|
+
|
9
|
+
# @return [Super::ActionInquirer]
|
10
|
+
helper_method def current_action
|
11
|
+
@current_action ||=
|
12
|
+
ActionInquirer.new(
|
13
|
+
ActionInquirer.default_for_resources,
|
14
|
+
params[:action]
|
15
|
+
)
|
16
|
+
end
|
17
|
+
|
18
|
+
# @return [void]
|
19
|
+
def with_current_action(action)
|
20
|
+
original = @current_action
|
21
|
+
@current_action = ActionInquirer.new(
|
22
|
+
ActionInquirer.default_for_resources,
|
23
|
+
action
|
24
|
+
)
|
25
|
+
yield
|
26
|
+
ensure
|
27
|
+
@current_action = original
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
@@ -1,19 +1,21 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Super
|
4
|
-
#
|
5
|
-
|
6
|
-
class SitewideController < ActionController::Base
|
4
|
+
# These methods could be useful for any Super controller, resourceful or not.
|
5
|
+
class SitewideController < SubstructureController
|
7
6
|
private
|
8
7
|
|
8
|
+
# @return [String]
|
9
9
|
helper_method def site_title
|
10
10
|
Super.configuration.title
|
11
11
|
end
|
12
12
|
|
13
|
+
# @return [Super::Navigation]
|
13
14
|
helper_method def site_navigation
|
14
15
|
Super::Navigation.new(&:all)
|
15
16
|
end
|
16
17
|
|
18
|
+
# @return [String]
|
17
19
|
helper_method def document_title
|
18
20
|
if instance_variable_defined?(:@document_title)
|
19
21
|
return @document_title
|
@@ -26,6 +28,7 @@ module Super
|
|
26
28
|
@document_title_segments ||= [page_title, site_title]
|
27
29
|
end
|
28
30
|
|
31
|
+
# @return [String]
|
29
32
|
def document_title_separator
|
30
33
|
@document_title_separator ||= " - "
|
31
34
|
end
|
@@ -1,9 +1,9 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
3
|
module Super
|
4
|
-
#
|
5
|
-
# methods can and should be overridden.
|
6
|
-
class SubstructureController <
|
4
|
+
# These methods determine the behavior of your resourceful Super controllers.
|
5
|
+
# These methods can and should be overridden.
|
6
|
+
class SubstructureController < FoundationController
|
7
7
|
def self.batch(action_name)
|
8
8
|
mod = Module.new do
|
9
9
|
define_method(action_name) do
|
@@ -42,7 +42,7 @@ module Super
|
|
42
42
|
helper_method def page_title
|
43
43
|
model.name.pluralize
|
44
44
|
rescue Error::NotImplementedError, NameError
|
45
|
-
|
45
|
+
nil
|
46
46
|
end
|
47
47
|
|
48
48
|
# Configures what database records are visible on load. This is an optional
|
@@ -143,25 +143,24 @@ module Super
|
|
143
143
|
action.resolve(params: params, record: record)
|
144
144
|
end
|
145
145
|
|
146
|
+
# @return [Boolean]
|
146
147
|
helper_method def filters_enabled?
|
147
148
|
true
|
148
149
|
end
|
149
150
|
|
151
|
+
# @return [Super::Filter]
|
150
152
|
helper_method def filter_schema
|
151
153
|
Super::Filter.new do |fields, type|
|
152
154
|
Super::Filter::Guesser.new(model: model, fields: fields, type: type).call
|
153
155
|
end
|
154
156
|
end
|
155
157
|
|
158
|
+
# @return [Boolean]
|
156
159
|
helper_method def sort_enabled?
|
157
160
|
true
|
158
161
|
end
|
159
162
|
|
160
163
|
helper_method def sortable_columns
|
161
|
-
action = ActionInquirer.new(
|
162
|
-
ActionInquirer.default_for_resources,
|
163
|
-
"index"
|
164
|
-
)
|
165
164
|
attribute_names =
|
166
165
|
display_schema.each_attribute.map do |key, val|
|
167
166
|
val = val.build if val.respond_to?(:build)
|
@@ -172,23 +171,23 @@ module Super
|
|
172
171
|
end
|
173
172
|
|
174
173
|
helper_method def default_sort
|
175
|
-
{
|
174
|
+
{id: :desc}
|
176
175
|
end
|
177
176
|
|
178
177
|
# Specifies how many records to show per page
|
179
178
|
#
|
180
|
-
# @return [
|
179
|
+
# @return [Integer]
|
181
180
|
helper_method def records_per_page
|
182
181
|
Super.configuration.index_records_per_page
|
183
182
|
end
|
184
183
|
|
184
|
+
# @return [Boolean]
|
185
185
|
helper_method def batch_actions_enabled?
|
186
186
|
true
|
187
187
|
end
|
188
188
|
|
189
189
|
helper_method def batch_actions
|
190
|
-
[
|
191
|
-
]
|
190
|
+
[]
|
192
191
|
end
|
193
192
|
|
194
193
|
def load_records
|
@@ -203,6 +202,7 @@ module Super
|
|
203
202
|
base_scope.build
|
204
203
|
end
|
205
204
|
|
205
|
+
# @return [void]
|
206
206
|
def set_record_attributes
|
207
207
|
@record.attributes = permitted_params
|
208
208
|
end
|
@@ -215,52 +215,21 @@ module Super
|
|
215
215
|
@record.destroy
|
216
216
|
end
|
217
217
|
|
218
|
-
|
219
|
-
redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
|
220
|
-
end
|
221
|
-
|
222
|
-
def redirect_to_records
|
223
|
-
redirect_to polymorphic_path(Super::Link.polymorphic_parts(model))
|
224
|
-
end
|
225
|
-
|
226
|
-
def redirect_to_record_with_destroy_failure_message(error = nil)
|
227
|
-
flash.alert =
|
228
|
-
case error
|
229
|
-
when ActiveRecord::InvalidForeignKey
|
230
|
-
I18n.t("super.destroy_error.invalid_foreign_key")
|
231
|
-
else
|
232
|
-
I18n.t("super.destroy_error.generic")
|
233
|
-
end
|
234
|
-
|
235
|
-
redirect_to polymorphic_path(Super::Link.polymorphic_parts(@record))
|
236
|
-
end
|
237
|
-
|
238
|
-
def render_new_as_bad_request
|
239
|
-
@current_action = ActionInquirer.new!
|
240
|
-
@form = form_schema
|
241
|
-
@view = new_view
|
242
|
-
render :new, status: :bad_request
|
243
|
-
end
|
244
|
-
|
245
|
-
def render_edit_as_bad_request
|
246
|
-
@current_action = ActionInquirer.edit!
|
247
|
-
@form = form_schema
|
248
|
-
@view = edit_view
|
249
|
-
render :edit, status: :bad_request
|
250
|
-
end
|
251
|
-
|
218
|
+
# @return [Super::Query]
|
252
219
|
helper_method def query
|
253
220
|
@query ||= Super::Query.new(
|
254
221
|
model: model,
|
255
222
|
params: request.GET,
|
256
|
-
current_path: request.path
|
223
|
+
current_path: request.path
|
257
224
|
)
|
258
225
|
end
|
259
226
|
|
227
|
+
# @return [ActiveRecord::Relation]
|
260
228
|
def apply_queries
|
261
229
|
query.apply_changes(@records)
|
262
230
|
end
|
263
231
|
|
232
|
+
# @return [Super::Filter::FormObject, nil]
|
264
233
|
def initialize_filter_form
|
265
234
|
if filters_enabled?
|
266
235
|
@filter_form = query.build(
|
@@ -271,6 +240,7 @@ module Super
|
|
271
240
|
end
|
272
241
|
end
|
273
242
|
|
243
|
+
# @return [Super::Sort::FormObject, nil]
|
274
244
|
def initialize_sort_form
|
275
245
|
if sort_enabled?
|
276
246
|
@sort_form = query.build(
|
@@ -282,10 +252,12 @@ module Super
|
|
282
252
|
end
|
283
253
|
end
|
284
254
|
|
255
|
+
# @return [Symbol, String]
|
285
256
|
helper_method def pagination_disabled_param
|
286
257
|
:_all_pages
|
287
258
|
end
|
288
259
|
|
260
|
+
# @return [Boolean]
|
289
261
|
def pagination_enabled?
|
290
262
|
!params.key?(pagination_disabled_param)
|
291
263
|
end
|
@@ -320,8 +292,29 @@ module Super
|
|
320
292
|
)
|
321
293
|
end
|
322
294
|
|
295
|
+
# @return [Boolean]
|
323
296
|
helper_method def csv_enabled?
|
324
297
|
true
|
325
298
|
end
|
299
|
+
|
300
|
+
helper_method def resolved_member_actions(record)
|
301
|
+
member_actions(record).map do |action|
|
302
|
+
if action.respond_to?(:resolve)
|
303
|
+
resolve_member_action(action, record)
|
304
|
+
else
|
305
|
+
action
|
306
|
+
end
|
307
|
+
end
|
308
|
+
end
|
309
|
+
|
310
|
+
helper_method def resolved_collection_actions
|
311
|
+
collection_actions.map do |action|
|
312
|
+
if action.respond_to?(:resolve)
|
313
|
+
resolve_collection_action(action)
|
314
|
+
else
|
315
|
+
action
|
316
|
+
end
|
317
|
+
end
|
318
|
+
end
|
326
319
|
end
|
327
320
|
end
|
@@ -7,6 +7,7 @@ module Super
|
|
7
7
|
class ViewController < SitewideController
|
8
8
|
private
|
9
9
|
|
10
|
+
# @return [#to_partial_path]
|
10
11
|
def index_view
|
11
12
|
Super::Layout.new(
|
12
13
|
main: Super::ViewChain.new(
|
@@ -17,11 +18,12 @@ module Super
|
|
17
18
|
),
|
18
19
|
aside: Super::ViewChain.new(
|
19
20
|
query_panel: Super::Panel.new,
|
20
|
-
query: query
|
21
|
+
query: query
|
21
22
|
)
|
22
23
|
)
|
23
24
|
end
|
24
25
|
|
26
|
+
# @return [#to_partial_path]
|
25
27
|
def show_view
|
26
28
|
Super::Layout.new(
|
27
29
|
main: Super::ViewChain.new(
|
@@ -32,6 +34,7 @@ module Super
|
|
32
34
|
)
|
33
35
|
end
|
34
36
|
|
37
|
+
# @return [#to_partial_path]
|
35
38
|
def new_view
|
36
39
|
Super::Layout.new(
|
37
40
|
main: Super::ViewChain.new(
|
@@ -42,6 +45,7 @@ module Super
|
|
42
45
|
)
|
43
46
|
end
|
44
47
|
|
48
|
+
# @return [#to_partial_path]
|
45
49
|
def edit_view
|
46
50
|
Super::Layout.new(
|
47
51
|
main: Super::ViewChain.new(
|
@@ -28,15 +28,15 @@
|
|
28
28
|
|
29
29
|
<body class="font-sans pb-4">
|
30
30
|
<div class="px-4">
|
31
|
-
<%=
|
31
|
+
<%= super_render "site_header" %>
|
32
32
|
|
33
|
-
<%=
|
33
|
+
<%= super_render "flash" %>
|
34
34
|
|
35
35
|
<div class="pt-4"></div>
|
36
36
|
|
37
37
|
<%= yield %>
|
38
38
|
|
39
|
-
<%=
|
39
|
+
<%= super_render "site_footer" %>
|
40
40
|
</div>
|
41
41
|
</body>
|
42
42
|
</html>
|
@@ -1 +1 @@
|
|
1
|
-
<%= value -%>
|
1
|
+
<%= batch_checkbox.locals[:value] -%>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if current_action.collection? %>
|
2
2
|
<div class="whitespace-nowrap gap-1">
|
3
3
|
<% html_id = "batch-checkbox-#{value.to_s.gsub(/[^a-z0-9]+/, "-")}" %>
|
4
|
-
<input type="checkbox" name="batch[]" value="<%= value %>" id="<%= html_id %>">
|
4
|
+
<input type="checkbox" name="batch[]" value="<%= batch_checkbox.locals[:value] %>" id="<%= html_id %>">
|
5
5
|
<label for="<%= html_id %>"><%= value %></label>
|
6
6
|
</div>
|
7
7
|
<% else %>
|
@@ -5,7 +5,7 @@
|
|
5
5
|
<details-dialog class="bg-white shadow-md px-4 py-4 rounded-lg">
|
6
6
|
<header class="flex items-center">
|
7
7
|
<h1 class="font-semibold border-b-1 flex-1"><%= t("super.csv.modal_header") %></h1>
|
8
|
-
<button type="button" data-close-dialog class="flex-initial h-4 w-4"><%=
|
8
|
+
<button type="button" data-close-dialog class="flex-initial h-4 w-4"><%= super_render("super/feather/x") %></button>
|
9
9
|
</header>
|
10
10
|
<div class="mt-3">
|
11
11
|
<% linkable_params = params.to_unsafe_hash %>
|
@@ -1 +1 @@
|
|
1
|
-
<%= rich_text %>
|
1
|
+
<%= display_rich_text.locals[:rich_text] %>
|
@@ -3,6 +3,6 @@
|
|
3
3
|
<legend class="bg-white p-1 -mx-1"><%= form_fieldset.label %></legend>
|
4
4
|
<% end %>
|
5
5
|
<% form_fieldset.nested_fields.each do |field, type| %>
|
6
|
-
<%=
|
6
|
+
<%= super_render(type, form: form, column: field) %>
|
7
7
|
<% end %>
|
8
8
|
</fieldset>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<div data-controller="apply-template">
|
2
2
|
<%= form.fields_for(form_has_many.reader) do |ff| %>
|
3
|
-
<%=
|
3
|
+
<%= super_render "form_fieldset", form_fieldset: form_has_many, form: ff %>
|
4
4
|
<% end %>
|
5
5
|
|
6
6
|
<%=
|
@@ -11,7 +11,7 @@
|
|
11
11
|
) do |ff|
|
12
12
|
%>
|
13
13
|
<template data-apply-template-target="template">
|
14
|
-
<%=
|
14
|
+
<%= super_render "form_fieldset", form_fieldset: form_has_many, form: ff %>
|
15
15
|
</template>
|
16
16
|
<% end %>
|
17
17
|
|
@@ -1,26 +1,26 @@
|
|
1
1
|
<% if layout.header %>
|
2
|
-
<%=
|
2
|
+
<%= super_render layout.header %>
|
3
3
|
<% end %>
|
4
4
|
|
5
5
|
<% if layout.aside %>
|
6
6
|
<div class="flow-root -mx-2">
|
7
7
|
<div class="md:float-left md:w-9/12 px-2">
|
8
8
|
<% if layout.main %>
|
9
|
-
<%=
|
9
|
+
<%= super_render layout.main %>
|
10
10
|
<% end %>
|
11
11
|
</div>
|
12
12
|
|
13
13
|
<div class="md:float-right md:w-3/12 px-2">
|
14
|
-
<%=
|
14
|
+
<%= super_render layout.aside %>
|
15
15
|
</div>
|
16
16
|
</div>
|
17
17
|
<% else %>
|
18
18
|
<% if layout.main %>
|
19
|
-
<%=
|
19
|
+
<%= super_render layout.main %>
|
20
20
|
<% end %>
|
21
21
|
<% end %>
|
22
22
|
|
23
23
|
<% if layout.footer %>
|
24
|
-
<%=
|
25
|
-
<%=
|
24
|
+
<%= super_render layout.footer %>
|
25
|
+
<%= super_render(partial) %>
|
26
26
|
<% end %>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
<% if panel.resolve(self, block_given? ? Proc.new { yield } : nil).resolved_parts.any? %>
|
2
2
|
<div class="border rounded shadow border-gray-400 bg-white px-5 pt-4 pb-8 mt-6">
|
3
3
|
<% panel.resolved_parts.each do |partial| %>
|
4
|
-
<%=
|
4
|
+
<%= super_render(partial) %>
|
5
5
|
<% end %>
|
6
6
|
</div>
|
7
7
|
<% end %>
|
@@ -3,13 +3,13 @@
|
|
3
3
|
|
4
4
|
<%= form_tag(query.path, method: :get, data: { controller: "clean-filter-params", action: "submit->clean-filter-params#call" }) do %>
|
5
5
|
<% if filters_enabled? %>
|
6
|
-
<%=
|
6
|
+
<%= super_render @filter_form %>
|
7
7
|
<% end %>
|
8
8
|
<% if sort_enabled? %>
|
9
9
|
<% if filters_enabled? %>
|
10
10
|
<div class="mt-6"></div>
|
11
11
|
<% end %>
|
12
|
-
<%=
|
12
|
+
<%= super_render @sort_form %>
|
13
13
|
<% end %>
|
14
14
|
|
15
15
|
<%= submit_tag("Apply", class: "super-button super-button--border-gray mt-6") %>
|
@@ -2,13 +2,13 @@
|
|
2
2
|
<h1 class="text-lg font-bold mr-6 mb-1"><%= site_title %></h1>
|
3
3
|
<% site_navigation.definition.each do |link_or_menu| %>
|
4
4
|
<% if link_or_menu.is_a?(Super::Link) %>
|
5
|
-
<%=
|
5
|
+
<%= super_render(link_or_menu, default_options: { class: "inline-block mr-6" }) %>
|
6
6
|
<% else %>
|
7
7
|
<details class="details-reset details-backdrop-transparent select-none inline-block mr-6">
|
8
8
|
<summary class="text-blue-700"><%= link_or_menu.title %></summary>
|
9
9
|
<ul class="absolute bg-white shadow-md px-4 py-3 z-20">
|
10
10
|
<% link_or_menu.links.each do |link| %>
|
11
|
-
<li><%=
|
11
|
+
<li><%= super_render(link, default_options: { class: "" }) %></li>
|
12
12
|
<% end %>
|
13
13
|
</ul>
|
14
14
|
</details>
|
@@ -3,13 +3,13 @@
|
|
3
3
|
<div data-controller="apply-template">
|
4
4
|
<% sort.exprs.each.with_index do |expr, index| %>
|
5
5
|
<%= form.fields_for("exprs[]", expr.with_index(index)) do |expr_fields| %>
|
6
|
-
<%=
|
6
|
+
<%= super_render "sort_expression", expr_fields: expr_fields, sort: sort %>
|
7
7
|
<% end %>
|
8
8
|
<% end %>
|
9
9
|
|
10
10
|
<%= form.fields_for("exprs[]", sort.new_expr.with_index("TEMPLATEINDEX")) do |expr_fields| %>
|
11
11
|
<template data-apply-template-target="template">
|
12
|
-
<%=
|
12
|
+
<%= super_render "sort_expression", expr_fields: expr_fields, sort: sort %>
|
13
13
|
</template>
|
14
14
|
<% end %>
|
15
15
|
|
@@ -19,7 +19,7 @@
|
|
19
19
|
) %>
|
20
20
|
</div>
|
21
21
|
<div class="flex-none pl-2">
|
22
|
-
<a href="#" data-action="delete#call" class="block text-black hover:text-red-600 h-4 w-4"><%=
|
22
|
+
<a href="#" data-action="delete#call" class="block text-black hover:text-red-600 h-4 w-4"><%= super_render("super/feather/x") %></a>
|
23
23
|
</div>
|
24
24
|
</div>
|
25
25
|
</div>
|