super 0.19.0.rc1 → 0.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.
- checksums.yaml +4 -4
- data/README.md +5 -5
- data/app/controllers/super/application_controller.rb +10 -19
- data/app/controllers/super/sitewide_controller.rb +33 -0
- data/app/controllers/super/substructure_controller.rb +63 -85
- data/app/controllers/super/view_controller.rb +55 -0
- data/app/views/super/application/_batch_checkbox.html.erb +4 -0
- data/app/views/super/application/_display_index.html.erb +8 -2
- data/app/views/super/application/_display_show.html.erb +10 -2
- data/app/views/super/application/_filter.html.erb +63 -59
- data/app/views/super/application/_form.html.erb +1 -1
- data/app/views/super/application/_layout.html.erb +0 -2
- data/app/views/super/application/_pagination.html.erb +1 -4
- data/app/views/super/application/_query.html.erb +13 -12
- data/app/views/super/application/_site_footer.html.erb +1 -1
- data/app/views/super/application/_sort.html.erb +18 -14
- data/app/views/super/application/_view_chain.html.erb +23 -4
- data/config/locales/en.yml +10 -1
- data/frontend/super-frontend/dist/application.js +6276 -6286
- data/frontend/super-frontend/dist/package.json +2 -2
- data/lib/super/action_inquirer.rb +3 -0
- data/lib/super/badge.rb +11 -2
- data/lib/super/cheat.rb +6 -1
- data/lib/super/display/schema_types.rb +37 -14
- data/lib/super/display.rb +5 -4
- data/lib/super/error.rb +3 -2
- data/lib/super/form/schema_types.rb +8 -36
- data/lib/super/form_builder/action_text_methods.rb +16 -0
- data/lib/super/form_builder/base_methods.rb +73 -0
- data/lib/super/form_builder/flatpickr_methods.rb +75 -0
- data/lib/super/form_builder/option_methods.rb +73 -0
- data/lib/super/form_builder.rb +143 -0
- data/{app/helpers → lib}/super/form_builder_helper.rb +15 -4
- data/lib/super/link.rb +47 -63
- data/lib/super/link_builder.rb +24 -43
- data/lib/super/navigation.rb +40 -40
- data/lib/super/query.rb +61 -0
- data/lib/super/{engine.rb → railtie.rb} +7 -1
- data/lib/super/reset.rb +7 -0
- data/lib/super/schema.rb +8 -2
- data/lib/super/sort.rb +1 -3
- data/lib/super/useful/deprecations.rb +18 -0
- data/lib/super/useful/i19.rb +35 -0
- data/lib/super/version.rb +1 -1
- data/lib/super/view_chain.rb +14 -4
- data/lib/super.rb +14 -3
- metadata +21 -56
- data/config/routes.rb +0 -4
- data/lib/super/form/builder.rb +0 -289
- data/lib/super/query/form_object.rb +0 -48
@@ -1,18 +1,22 @@
|
|
1
1
|
<h1 class="text-lg mt-6">Sort</h1>
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
<%=
|
2
|
+
<%= super_fields_for(query.namespace_for(sort), sort) do |form| %>
|
3
|
+
<div data-controller="apply-template">
|
4
|
+
<% sort.exprs.each.with_index do |expr, index| %>
|
5
|
+
<%= form.fields_for("exprs[]", expr.with_index(index)) do |expr_fields| %>
|
6
|
+
<%= render "sort_expression", expr_fields: expr_fields, sort: sort %>
|
7
|
+
<% end %>
|
6
8
|
<% end %>
|
7
|
-
<% end %>
|
8
9
|
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
10
|
+
<%= form.fields_for("exprs[]", sort.new_expr.with_index("TEMPLATEINDEX")) do |expr_fields| %>
|
11
|
+
<template data-apply-template-target="template">
|
12
|
+
<%= render "sort_expression", expr_fields: expr_fields, sort: sort %>
|
13
|
+
</template>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<a href="#" data-action="apply-template#call" class="block mt-2 text-sm">
|
17
|
+
Add
|
18
|
+
</a>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
14
21
|
|
15
|
-
|
16
|
-
Add
|
17
|
-
</a>
|
18
|
-
</div>
|
22
|
+
<%= yield if block_given? %>
|
@@ -1,5 +1,24 @@
|
|
1
|
-
<%
|
2
|
-
|
3
|
-
|
4
|
-
|
1
|
+
<%
|
2
|
+
name, current = view_chain.shift
|
3
|
+
current =
|
4
|
+
if current.kind_of?(Symbol)
|
5
|
+
instance_variable_get(current)
|
6
|
+
else
|
7
|
+
current
|
8
|
+
end
|
9
|
+
|
10
|
+
if !current
|
11
|
+
Rails.logger.warn do
|
12
|
+
"Super::ViewChain encountered a nil view: #{name.inspect}."
|
13
|
+
end
|
14
|
+
end
|
15
|
+
%>
|
16
|
+
<% if current %>
|
17
|
+
<% if view_chain.empty? %>
|
18
|
+
<%= render(current) %>
|
19
|
+
<% else %>
|
20
|
+
<%= render(current) do %>
|
21
|
+
<%= render(view_chain) %>
|
22
|
+
<% end %>
|
23
|
+
<% end %>
|
5
24
|
<% end %>
|
data/config/locales/en.yml
CHANGED
@@ -1,6 +1,12 @@
|
|
1
1
|
---
|
2
2
|
en:
|
3
3
|
super:
|
4
|
+
actions:
|
5
|
+
new: New
|
6
|
+
index: Index
|
7
|
+
show: View
|
8
|
+
edit: Edit
|
9
|
+
destroy: Delete
|
4
10
|
batch:
|
5
11
|
none_error: This batch action received no items to act upon
|
6
12
|
csv:
|
@@ -9,5 +15,8 @@ en:
|
|
9
15
|
download_current_cta: Download current view
|
10
16
|
download_all_cta: Download all matching query
|
11
17
|
layout:
|
12
|
-
|
18
|
+
powered_by_html: "%{env} environment. Powered by Super %{version}. <a href='https://superadministration.github.io/v%{version}/'>Developer docs.</a>"
|
13
19
|
mismatching_package_json_gemfile_versions: "The version of Super specified in your package.json file does not match the version specified in your Gemfile.lock."
|
20
|
+
destroy_error:
|
21
|
+
invalid_foreign_key: Couldn't delete record because other records still refer to this one
|
22
|
+
generic: Couldn't delete record
|