liquidum 1.4.1 → 1.4.3
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/.shipkit.yml +1 -1
- data/CHANGELOG.md +9 -0
- data/Gemfile +8 -0
- data/README.md +48 -1
- data/app/controllers/liquidum/filters_controller.rb +13 -0
- data/app/controllers/liquidum/sandbox_controller.rb +23 -23
- data/app/controllers/liquidum/tags_controller.rb +13 -0
- data/app/helpers/liquidum/application_helper.rb +1 -1
- data/app/models/liquidum/sandbox.rb +19 -1
- data/app/views/liquidum/conversions/index.html.slim +5 -5
- data/app/views/liquidum/sandbox/edit.html.slim +2 -2
- data/app/views/liquidum/sandbox/index.html.slim +2 -2
- data/config/locales/en.yml +140 -0
- data/config/locales/nl.yml +140 -0
- data/config/routes.rb +4 -3
- data/db/migrate/20261108090000_change_liquidum_sandboxes_to_text.rb +11 -0
- data/lib/liquidum/drop.rb +22 -4
- data/lib/liquidum/filters.rb +78 -0
- data/lib/liquidum/liquid/filters/array_wrap_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/encode_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/format_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/localize_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/max_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/min_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/strptime_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/sum_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/timezone_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/to_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/translate_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/unescape_html_filter.rb +1 -1
- data/lib/liquidum/liquid/filters/where_exp_filter.rb +1 -1
- data/lib/liquidum/liquid/tags/helper_tag.rb +1 -1
- data/lib/liquidum/liquid/tags/render_tag.rb +1 -1
- data/lib/liquidum/tags.rb +51 -0
- data/lib/liquidum/variable.rb +9 -3
- data/lib/liquidum/version.rb +1 -1
- data/lib/liquidum.rb +2 -0
- data/liquidum.gemspec +1 -1
- metadata +14 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 96d0ead154fefe58f08b4f87c9981cf141ae8b149a740bb02b30550fca32137c
|
|
4
|
+
data.tar.gz: 2bfceaf7029f7a3d9675424197b90e8f54ce14820a0eecda3ef58a3d72c3826a
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 199d3b0735522241c505b79e095b257bf5013f417d4daa947ae94490d35dcf4adf5d6c852c1329225c29d8e4dbe29e58a2b5fdd0e4449451cd4397cd307cc521
|
|
7
|
+
data.tar.gz: bdd601cb35ccee0d7cba791ddc2b7201399074cbb53e45564f7469442ea158c0f8f9f9cdc1cbc9fc37430a8baa2c643bb70a0c0c624083f4263aa2b6e86f635a
|
data/.shipkit.yml
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
---
|
|
2
|
-
previous_version: 1.4.
|
|
2
|
+
previous_version: 1.4.2
|
data/CHANGELOG.md
CHANGED
|
@@ -6,6 +6,15 @@
|
|
|
6
6
|
start with a dot, from the Liquid context. Those keys had no scope before.
|
|
7
7
|
- The `t` filter translates with the app's own translations when
|
|
8
8
|
`config.i18n_store` isn't set, instead of failing.
|
|
9
|
+
- The sandbox works again: a `liquidum_sandboxes` migration makes the
|
|
10
|
+
template and context `text` (copy it in with
|
|
11
|
+
`bin/rails liquidum:install:migrations`), Render no longer saves, a context
|
|
12
|
+
that isn't a JSON object is an error on the form, and its pages and the
|
|
13
|
+
conversions page are translated (English and Dutch).
|
|
14
|
+
- Routes only for the actions that exist: no `show` or `destroy` for the
|
|
15
|
+
sandbox, only `index` and `create` for conversions, and no `render_only`
|
|
16
|
+
route.
|
|
17
|
+
- The sandbox no longer needs the responders gem.
|
|
9
18
|
|
|
10
19
|
- Allow Liquid 5.4 and later (up to 6).
|
|
11
20
|
- Drops describe their variables for editors: `Drop.variables`, the
|
data/Gemfile
CHANGED
|
@@ -9,3 +9,11 @@ gemspec
|
|
|
9
9
|
source "https://rubygems.pkg.github.com/entdec" do
|
|
10
10
|
gem "shipkit"
|
|
11
11
|
end
|
|
12
|
+
|
|
13
|
+
# The sandbox and conversion pages use Satis, as host apps do (and Satis's
|
|
14
|
+
# tailwindcss-rails an asset pipeline)
|
|
15
|
+
gem "satis"
|
|
16
|
+
gem "propshaft"
|
|
17
|
+
# The sandboxes table is a Mensa table
|
|
18
|
+
git_source(:entdec) { |repo_name| "git@github.com:entdec/#{repo_name}.git" }
|
|
19
|
+
gem "mensa", entdec: "mensa"
|
data/README.md
CHANGED
|
@@ -57,7 +57,12 @@ OrderDrop.variables # => [#<data Liquidum::Variable name="customer", label="Cust
|
|
|
57
57
|
```
|
|
58
58
|
|
|
59
59
|
`describe` takes `label:`, `type:`, `hint:` (a string, or a proc to translate
|
|
60
|
-
it),
|
|
60
|
+
it), `drop:` and `collection:` for a method that returns other drops, and
|
|
61
|
+
`values:`, the values a variable can have, by their labels
|
|
62
|
+
(`values: -> { {"account" => "Club", "sponsor" => "Sponsor"} }`), for an editor
|
|
63
|
+
to complete `{% if line.party == "` or `| where: "party", "` with. A model's
|
|
64
|
+
enum has its values already, labelled as
|
|
65
|
+
`activerecord.attributes.<model>.<enum, plural>.<value>`. A
|
|
61
66
|
drop is for the model with its name (`OrderDrop` is for `Order`); override
|
|
62
67
|
`self.model` when that's not so.
|
|
63
68
|
|
|
@@ -81,6 +86,31 @@ GET /liquidum/variables?roots=…&path=order.customer
|
|
|
81
86
|
```
|
|
82
87
|
|
|
83
88
|
In a collection the path goes into its elements (`order.order_lines.product`).
|
|
89
|
+
|
|
90
|
+
And for what can follow a `|`, the filters Liquid has (its own, Liquidum's and
|
|
91
|
+
the app's), each with its arguments and, for one on a collection, what it
|
|
92
|
+
leaves: the same items (`where`, `sort`) or one of them (`first`):
|
|
93
|
+
|
|
94
|
+
```
|
|
95
|
+
GET /liquidum/filters
|
|
96
|
+
{"filters": [{"name": "where", "label": "Those whose property has the value", "arguments": [{"name": "property", "kind": "property"}, {"name": "value", "kind": "value"}], "keeps": "collection"}, …]}
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
An argument's kind is `property`, `value` (of the property before it),
|
|
100
|
+
`format` (a date's), `key` (a translation's) or `any`. An app describes its own
|
|
101
|
+
filters with `Liquidum::Filters.describe :money, arguments: [[:currency]]`, and
|
|
102
|
+
labels them as `liquidum.filters.<name>`.
|
|
103
|
+
|
|
104
|
+
And for what can follow `{%`, the tags, each with how it's written and whether
|
|
105
|
+
it's a block, which an editor writes with its closing tag:
|
|
106
|
+
|
|
107
|
+
```
|
|
108
|
+
GET /liquidum/tags
|
|
109
|
+
{"tags": [{"name": "if", "label": "Only when a condition holds", "syntax": "if condition", "block": true}, …]}
|
|
110
|
+
```
|
|
111
|
+
|
|
112
|
+
An app describes its own with `Liquidum::Tags.describe :signature_field, syntax: "signature_field kind signer"`,
|
|
113
|
+
labelled as `liquidum.tags.<name>`.
|
|
84
114
|
The endpoint only describes variables and never reads a record. Its
|
|
85
115
|
controllers inherit from `::ApplicationController`; to choose another one:
|
|
86
116
|
|
|
@@ -110,6 +140,23 @@ Or install it yourself as:
|
|
|
110
140
|
$ gem install liquidum
|
|
111
141
|
```
|
|
112
142
|
|
|
143
|
+
Mount the engine for the variables endpoint, the sandbox and the conversions,
|
|
144
|
+
and copy in its migrations for the sandbox:
|
|
145
|
+
|
|
146
|
+
```ruby
|
|
147
|
+
mount Liquidum::Engine, at: "/liquidum", as: "liquidum"
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
$ bin/rails liquidum:install:migrations
|
|
152
|
+
$ bin/rails db:migrate
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The sandbox (`/liquidum/sandbox`) renders a template with a JSON context, and
|
|
156
|
+
saves the ones worth coming back to. Its pages use Satis. Its controllers
|
|
157
|
+
inherit from `config.parent_controller`, so set that to decide who may use
|
|
158
|
+
them.
|
|
159
|
+
|
|
113
160
|
## Contributing
|
|
114
161
|
|
|
115
162
|
Contribution directions go here.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_dependency "liquidum/application_controller"
|
|
2
|
+
|
|
3
|
+
module Liquidum
|
|
4
|
+
# The filters a template can use, for an editor's completion after a |
|
|
5
|
+
# (Liquidum::Filters), labelled in the request's locale:
|
|
6
|
+
#
|
|
7
|
+
# GET /liquidum/filters → {filters: [{name, label, arguments: [{name, kind}], keeps}]}
|
|
8
|
+
class FiltersController < ApplicationController
|
|
9
|
+
def index
|
|
10
|
+
render json: {filters: Filters.all}
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
require_dependency "liquidum/application_controller"
|
|
2
|
-
|
|
3
1
|
module Liquidum
|
|
2
|
+
# Try out Liquid: a template rendered with a JSON context, saved to come
|
|
3
|
+
# back to
|
|
4
4
|
class SandboxController < ApplicationController
|
|
5
5
|
before_action :set_objects, except: %i[index]
|
|
6
6
|
|
|
@@ -12,40 +12,40 @@ module Liquidum
|
|
|
12
12
|
end
|
|
13
13
|
|
|
14
14
|
def create
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
@sandbox.update(sandbox_attributes)
|
|
18
|
-
|
|
19
|
-
respond_with @sandbox,
|
|
20
|
-
collection_location: -> { edit_sandbox_path(@sandbox) },
|
|
21
|
-
action: :edit
|
|
15
|
+
save
|
|
22
16
|
end
|
|
23
17
|
|
|
24
18
|
def edit
|
|
25
|
-
|
|
26
|
-
@sandbox.result = Liquidum.render(@sandbox.template, assigns: JSON.parse(@sandbox.context))
|
|
27
|
-
end
|
|
19
|
+
render_result
|
|
28
20
|
end
|
|
29
21
|
|
|
30
22
|
def update
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
@sandbox.update(sandbox_attributes)
|
|
34
|
-
|
|
35
|
-
respond_with @sandbox,
|
|
36
|
-
collection_location: -> { edit_sandbox_path(@sandbox) },
|
|
37
|
-
action: :edit
|
|
23
|
+
save
|
|
38
24
|
end
|
|
39
25
|
|
|
40
26
|
private
|
|
41
27
|
|
|
42
|
-
|
|
28
|
+
# "Render" shows the result without saving, "Save" saves and comes back
|
|
29
|
+
def save
|
|
43
30
|
@sandbox.assign_attributes(sandbox_attributes)
|
|
31
|
+
return render_edit if params.key?(:render_only)
|
|
44
32
|
|
|
45
|
-
if @sandbox.
|
|
46
|
-
|
|
33
|
+
if @sandbox.save
|
|
34
|
+
redirect_to edit_sandbox_path(@sandbox), notice: t("liquidum.sandbox.saved")
|
|
35
|
+
else
|
|
36
|
+
render :edit, status: :unprocessable_entity
|
|
47
37
|
end
|
|
48
|
-
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def render_edit
|
|
41
|
+
render_result
|
|
42
|
+
render :edit, status: @sandbox.errors.any? ? :unprocessable_entity : :ok
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
def render_result
|
|
46
|
+
return unless @sandbox.valid?
|
|
47
|
+
|
|
48
|
+
@sandbox.result = Liquidum.render(@sandbox.template, assigns: @sandbox.assigns)
|
|
49
49
|
end
|
|
50
50
|
|
|
51
51
|
def set_objects
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
require_dependency "liquidum/application_controller"
|
|
2
|
+
|
|
3
|
+
module Liquidum
|
|
4
|
+
# The tags a template can use, for an editor's completion after {%
|
|
5
|
+
# (Liquidum::Tags), labelled in the request's locale:
|
|
6
|
+
#
|
|
7
|
+
# GET /liquidum/tags → {tags: [{name, label, syntax, block}]}
|
|
8
|
+
class TagsController < ApplicationController
|
|
9
|
+
def index
|
|
10
|
+
render json: {tags: Tags.all}
|
|
11
|
+
end
|
|
12
|
+
end
|
|
13
|
+
end
|
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
module Liquidum
|
|
2
2
|
class Sandbox < ApplicationRecord
|
|
3
|
-
attribute :result, default:
|
|
3
|
+
attribute :result, default: ""
|
|
4
4
|
|
|
5
5
|
validates :context, presence: true
|
|
6
6
|
validates :template, presence: true
|
|
7
|
+
validate :context_is_a_json_object
|
|
8
|
+
|
|
9
|
+
# The context as the template's variables
|
|
10
|
+
def assigns
|
|
11
|
+
JSON.parse(context.to_s)
|
|
12
|
+
rescue JSON::ParserError
|
|
13
|
+
{}
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
private
|
|
17
|
+
|
|
18
|
+
def context_is_a_json_object
|
|
19
|
+
return if context.blank?
|
|
20
|
+
|
|
21
|
+
errors.add(:context, :not_a_json_object) unless JSON.parse(context).is_a?(Hash)
|
|
22
|
+
rescue JSON::ParserError => e
|
|
23
|
+
errors.add(:context, :invalid_json, message: e.message)
|
|
24
|
+
end
|
|
7
25
|
end
|
|
8
26
|
end
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
= sts.form_for(@conversion, url: conversions_path, data: { turbo: false }) do |f|
|
|
2
|
-
= sts.card(title: '
|
|
2
|
+
= sts.card(:liquidum_conversions, title: t('.title')) do |card|
|
|
3
3
|
- card.with_action
|
|
4
|
-
= f.submit
|
|
5
|
-
= f.submit
|
|
6
|
-
= f.submit
|
|
4
|
+
= f.submit t('.json_to_yaml'), name: "json_to_yaml"
|
|
5
|
+
= f.submit t('.yaml_to_json'), name: "yaml_to_json"
|
|
6
|
+
= f.submit t('.slim_to_html'), name: "slim_to_html"
|
|
7
7
|
- card.with_tab :main, padding: true
|
|
8
8
|
.grid.grid-cols-12.gap-4
|
|
9
9
|
.col-span-12
|
|
10
10
|
= f.editor :source, mode: "application/json"
|
|
11
11
|
.col-span-12
|
|
12
|
-
= f.editor :result, mode: "text/plain", read_only: true
|
|
12
|
+
= f.editor :result, mode: "text/plain", read_only: true
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
= sts.form_for(@sandbox, url: @sandbox.persisted? ? sandbox_path(@sandbox) : sandbox_index_path) do |f|
|
|
2
|
-
= sts.card(title: '
|
|
2
|
+
= sts.card(:liquidum_sandbox, title: t('.title'), icon: 'fad fa-toolbox') do |card|
|
|
3
3
|
- card.with_action
|
|
4
|
-
= f.submit
|
|
4
|
+
= f.submit t('.save'), name: "save"
|
|
5
5
|
- card.with_action
|
|
6
6
|
= f.submit t('.render'), name: "render_only"
|
|
7
7
|
- card.with_tab :main, padding: true
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
= sts.card title: t('.sandboxes'), icon: 'fad fa-toolbox', content_padding: false, menu: liquidum_sandboxes_menu do |card|
|
|
2
|
-
= sts.table 'liquidum/sandboxes', parameters: { search_placeholder:
|
|
1
|
+
= sts.card :liquidum_sandboxes, title: t('.sandboxes'), icon: 'fad fa-toolbox', content_padding: false, menu: liquidum_sandboxes_menu do |card|
|
|
2
|
+
= sts.table 'liquidum/sandboxes', parameters: { search_placeholder: t('.search') }
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
en:
|
|
2
|
+
menu:
|
|
3
|
+
liquidum_sandboxes:
|
|
4
|
+
create: New sandbox
|
|
5
|
+
activemodel:
|
|
6
|
+
attributes:
|
|
7
|
+
liquidum/conversions_controller/conversion:
|
|
8
|
+
source: Source
|
|
9
|
+
result: Result
|
|
10
|
+
activerecord:
|
|
11
|
+
models:
|
|
12
|
+
liquidum/sandbox:
|
|
13
|
+
one: Sandbox
|
|
14
|
+
other: Sandboxes
|
|
15
|
+
attributes:
|
|
16
|
+
liquidum/sandbox:
|
|
17
|
+
context: Context (JSON)
|
|
18
|
+
created_at: Created
|
|
19
|
+
description: Description
|
|
20
|
+
result: Result
|
|
21
|
+
template: Template
|
|
22
|
+
updated_at: Updated
|
|
23
|
+
errors:
|
|
24
|
+
models:
|
|
25
|
+
liquidum/sandbox:
|
|
26
|
+
attributes:
|
|
27
|
+
context:
|
|
28
|
+
not_a_json_object: 'must be a JSON object, like {"name": "value"}'
|
|
29
|
+
liquidum:
|
|
30
|
+
tags:
|
|
31
|
+
assign: "Sets a variable"
|
|
32
|
+
attach: "Attaches a file"
|
|
33
|
+
break: "Stops the loop"
|
|
34
|
+
capture: "Sets a variable to its text"
|
|
35
|
+
case: "One of several, by a variable's value"
|
|
36
|
+
comment: "Not shown"
|
|
37
|
+
continue: "Goes on with the loop's next item"
|
|
38
|
+
cycle: "Each time the next of its values"
|
|
39
|
+
decrement: "Counts down"
|
|
40
|
+
echo: "Shows a value"
|
|
41
|
+
for: "For each item"
|
|
42
|
+
helper: "A helper's output"
|
|
43
|
+
if: "Only when a condition holds"
|
|
44
|
+
ifchanged: "Only when it changed"
|
|
45
|
+
include: "Another template, sharing variables"
|
|
46
|
+
increment: "Counts up"
|
|
47
|
+
raw: "Liquid shown as it is"
|
|
48
|
+
render: "Another template"
|
|
49
|
+
tablerow: "A table row for each item"
|
|
50
|
+
unless: "Only when a condition doesn't hold"
|
|
51
|
+
filters:
|
|
52
|
+
abs: "Absolute value"
|
|
53
|
+
append: "Text added after it"
|
|
54
|
+
array_wrap: "As a list"
|
|
55
|
+
at_least: "At least a number"
|
|
56
|
+
at_most: "At most a number"
|
|
57
|
+
base64_decode: "Decoded from Base64"
|
|
58
|
+
base64_encode: "Encoded as Base64"
|
|
59
|
+
base64_url_safe_decode: "Decoded from URL-safe Base64"
|
|
60
|
+
base64_url_safe_encode: "Encoded as URL-safe Base64"
|
|
61
|
+
capitalize: "First letter a capital"
|
|
62
|
+
ceil: "Rounded up"
|
|
63
|
+
compact: "Without empty items"
|
|
64
|
+
concat: "Joined with another list"
|
|
65
|
+
date: "Date in a format"
|
|
66
|
+
default: "Another value when empty"
|
|
67
|
+
divided_by: "Divided by a number"
|
|
68
|
+
downcase: "In lower case"
|
|
69
|
+
encode: "In another encoding"
|
|
70
|
+
escape: "HTML escaped"
|
|
71
|
+
escape_once: "HTML escaped, once"
|
|
72
|
+
find: "The first whose property has the value"
|
|
73
|
+
find_index: "Where the first whose property has the value is"
|
|
74
|
+
first: "The first item"
|
|
75
|
+
floor: "Rounded down"
|
|
76
|
+
format: "In a format"
|
|
77
|
+
h: "HTML escaped"
|
|
78
|
+
has: "Whether one's property has the value"
|
|
79
|
+
join: "Items joined into text"
|
|
80
|
+
last: "The last item"
|
|
81
|
+
localize: "Date in a language and format"
|
|
82
|
+
lstrip: "Without spaces at the start"
|
|
83
|
+
map: "Each item's property"
|
|
84
|
+
max: "The largest"
|
|
85
|
+
min: "The smallest"
|
|
86
|
+
minus: "Minus a number"
|
|
87
|
+
modulo: "Remainder after dividing"
|
|
88
|
+
newline_to_br: "Line breaks as <br>"
|
|
89
|
+
plus: "Plus a number"
|
|
90
|
+
prepend: "Text added before it"
|
|
91
|
+
reject: "Those whose property hasn't the value"
|
|
92
|
+
remove: "Without a text"
|
|
93
|
+
remove_first: "Without a text's first time"
|
|
94
|
+
remove_last: "Without a text's last time"
|
|
95
|
+
replace: "A text replaced"
|
|
96
|
+
replace_first: "A text replaced the first time"
|
|
97
|
+
replace_last: "A text replaced the last time"
|
|
98
|
+
reverse: "In reverse order"
|
|
99
|
+
round: "Rounded"
|
|
100
|
+
rstrip: "Without spaces at the end"
|
|
101
|
+
size: "Number of items or characters"
|
|
102
|
+
slice: "A part of it"
|
|
103
|
+
sort: "Sorted"
|
|
104
|
+
sort_natural: "Sorted, ignoring case"
|
|
105
|
+
split: "Text split into a list"
|
|
106
|
+
squish: "Spaces collapsed"
|
|
107
|
+
strip: "Without spaces around it"
|
|
108
|
+
strip_html: "Without HTML"
|
|
109
|
+
strip_newlines: "Without line breaks"
|
|
110
|
+
strptime: "Date read from text"
|
|
111
|
+
sum: "Sum of the items"
|
|
112
|
+
t: "Translated"
|
|
113
|
+
times: "Times a number"
|
|
114
|
+
timezone: "In a time zone"
|
|
115
|
+
to: "As JSON, YAML or a date"
|
|
116
|
+
translate: "Translated"
|
|
117
|
+
truncate: "Cut to a length"
|
|
118
|
+
truncatewords: "Cut to a number of words"
|
|
119
|
+
unescape_html: "HTML unescaped"
|
|
120
|
+
uniq: "Without duplicates"
|
|
121
|
+
upcase: "In capitals"
|
|
122
|
+
url_decode: "Decoded from a URL"
|
|
123
|
+
url_encode: "Encoded for a URL"
|
|
124
|
+
where: "Those whose property has the value"
|
|
125
|
+
where_exp: "Those for which a condition holds"
|
|
126
|
+
sandbox:
|
|
127
|
+
saved: The sandbox has been saved
|
|
128
|
+
index:
|
|
129
|
+
sandboxes: Liquid sandboxes
|
|
130
|
+
search: Search by description or template
|
|
131
|
+
edit:
|
|
132
|
+
title: Liquid sandbox
|
|
133
|
+
save: Save
|
|
134
|
+
render: Render
|
|
135
|
+
conversions:
|
|
136
|
+
index:
|
|
137
|
+
title: Conversions
|
|
138
|
+
json_to_yaml: JSON → YAML
|
|
139
|
+
yaml_to_json: YAML → JSON
|
|
140
|
+
slim_to_html: Slim → HTML
|
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
nl:
|
|
2
|
+
menu:
|
|
3
|
+
liquidum_sandboxes:
|
|
4
|
+
create: Nieuwe zandbak
|
|
5
|
+
activemodel:
|
|
6
|
+
attributes:
|
|
7
|
+
liquidum/conversions_controller/conversion:
|
|
8
|
+
source: Bron
|
|
9
|
+
result: Resultaat
|
|
10
|
+
activerecord:
|
|
11
|
+
models:
|
|
12
|
+
liquidum/sandbox:
|
|
13
|
+
one: Zandbak
|
|
14
|
+
other: Zandbakken
|
|
15
|
+
attributes:
|
|
16
|
+
liquidum/sandbox:
|
|
17
|
+
context: Context (JSON)
|
|
18
|
+
created_at: Aangemaakt
|
|
19
|
+
description: Omschrijving
|
|
20
|
+
result: Resultaat
|
|
21
|
+
template: Sjabloon
|
|
22
|
+
updated_at: Gewijzigd
|
|
23
|
+
errors:
|
|
24
|
+
models:
|
|
25
|
+
liquidum/sandbox:
|
|
26
|
+
attributes:
|
|
27
|
+
context:
|
|
28
|
+
not_a_json_object: 'moet een JSON-object zijn, zoals {"naam": "waarde"}'
|
|
29
|
+
liquidum:
|
|
30
|
+
tags:
|
|
31
|
+
assign: "Zet een variabele"
|
|
32
|
+
attach: "Voegt een bestand toe"
|
|
33
|
+
break: "Stopt de lus"
|
|
34
|
+
capture: "Zet een variabele op de tekst erin"
|
|
35
|
+
case: "Een van meerdere, naar de waarde van een variabele"
|
|
36
|
+
comment: "Niet getoond"
|
|
37
|
+
continue: "Gaat door met het volgende item"
|
|
38
|
+
cycle: "Telkens de volgende van de waarden"
|
|
39
|
+
decrement: "Telt af"
|
|
40
|
+
echo: "Toont een waarde"
|
|
41
|
+
for: "Voor elk item"
|
|
42
|
+
helper: "De uitvoer van een helper"
|
|
43
|
+
if: "Alleen als een voorwaarde geldt"
|
|
44
|
+
ifchanged: "Alleen als het veranderde"
|
|
45
|
+
include: "Een ander sjabloon, met dezelfde variabelen"
|
|
46
|
+
increment: "Telt op"
|
|
47
|
+
raw: "Liquid getoond zoals het is"
|
|
48
|
+
render: "Een ander sjabloon"
|
|
49
|
+
tablerow: "Een tabelrij voor elk item"
|
|
50
|
+
unless: "Alleen als een voorwaarde niet geldt"
|
|
51
|
+
filters:
|
|
52
|
+
abs: "Absolute waarde"
|
|
53
|
+
append: "Tekst erachter"
|
|
54
|
+
array_wrap: "Als lijst"
|
|
55
|
+
at_least: "Minstens een getal"
|
|
56
|
+
at_most: "Hoogstens een getal"
|
|
57
|
+
base64_decode: "Gedecodeerd uit Base64"
|
|
58
|
+
base64_encode: "Gecodeerd als Base64"
|
|
59
|
+
base64_url_safe_decode: "Gedecodeerd uit URL-veilig Base64"
|
|
60
|
+
base64_url_safe_encode: "Gecodeerd als URL-veilig Base64"
|
|
61
|
+
capitalize: "Eerste letter een hoofdletter"
|
|
62
|
+
ceil: "Naar boven afgerond"
|
|
63
|
+
compact: "Zonder lege items"
|
|
64
|
+
concat: "Samengevoegd met een andere lijst"
|
|
65
|
+
date: "Datum in een formaat"
|
|
66
|
+
default: "Andere waarde als het leeg is"
|
|
67
|
+
divided_by: "Gedeeld door een getal"
|
|
68
|
+
downcase: "In kleine letters"
|
|
69
|
+
encode: "In een andere codering"
|
|
70
|
+
escape: "HTML-veilig gemaakt"
|
|
71
|
+
escape_once: "Eenmaal HTML-veilig gemaakt"
|
|
72
|
+
find: "De eerste waarvan de eigenschap de waarde heeft"
|
|
73
|
+
find_index: "Plaats van de eerste waarvan de eigenschap de waarde heeft"
|
|
74
|
+
first: "Het eerste item"
|
|
75
|
+
floor: "Naar beneden afgerond"
|
|
76
|
+
format: "In een formaat"
|
|
77
|
+
h: "HTML-veilig gemaakt"
|
|
78
|
+
has: "Of er een is waarvan de eigenschap de waarde heeft"
|
|
79
|
+
join: "Items samengevoegd tot tekst"
|
|
80
|
+
last: "Het laatste item"
|
|
81
|
+
localize: "Datum in een taal en formaat"
|
|
82
|
+
lstrip: "Zonder spaties aan het begin"
|
|
83
|
+
map: "De eigenschap van elk item"
|
|
84
|
+
max: "De grootste"
|
|
85
|
+
min: "De kleinste"
|
|
86
|
+
minus: "Min een getal"
|
|
87
|
+
modulo: "Rest na delen"
|
|
88
|
+
newline_to_br: "Regeleinden als <br>"
|
|
89
|
+
plus: "Plus een getal"
|
|
90
|
+
prepend: "Tekst ervoor"
|
|
91
|
+
reject: "Die waarvan de eigenschap de waarde niet heeft"
|
|
92
|
+
remove: "Zonder een tekst"
|
|
93
|
+
remove_first: "Zonder de eerste keer van een tekst"
|
|
94
|
+
remove_last: "Zonder de laatste keer van een tekst"
|
|
95
|
+
replace: "Een tekst vervangen"
|
|
96
|
+
replace_first: "Een tekst de eerste keer vervangen"
|
|
97
|
+
replace_last: "Een tekst de laatste keer vervangen"
|
|
98
|
+
reverse: "In omgekeerde volgorde"
|
|
99
|
+
round: "Afgerond"
|
|
100
|
+
rstrip: "Zonder spaties aan het eind"
|
|
101
|
+
size: "Aantal items of tekens"
|
|
102
|
+
slice: "Een deel ervan"
|
|
103
|
+
sort: "Gesorteerd"
|
|
104
|
+
sort_natural: "Gesorteerd, hoofdletters genegeerd"
|
|
105
|
+
split: "Tekst gesplitst tot een lijst"
|
|
106
|
+
squish: "Spaties samengevoegd"
|
|
107
|
+
strip: "Zonder spaties eromheen"
|
|
108
|
+
strip_html: "Zonder HTML"
|
|
109
|
+
strip_newlines: "Zonder regeleinden"
|
|
110
|
+
strptime: "Datum gelezen uit tekst"
|
|
111
|
+
sum: "Som van de items"
|
|
112
|
+
t: "Vertaald"
|
|
113
|
+
times: "Maal een getal"
|
|
114
|
+
timezone: "In een tijdzone"
|
|
115
|
+
to: "Als JSON, YAML of datum"
|
|
116
|
+
translate: "Vertaald"
|
|
117
|
+
truncate: "Ingekort tot een lengte"
|
|
118
|
+
truncatewords: "Ingekort tot een aantal woorden"
|
|
119
|
+
unescape_html: "HTML-tekens hersteld"
|
|
120
|
+
uniq: "Zonder dubbele"
|
|
121
|
+
upcase: "In hoofdletters"
|
|
122
|
+
url_decode: "Gedecodeerd uit een URL"
|
|
123
|
+
url_encode: "Gecodeerd voor een URL"
|
|
124
|
+
where: "Die waarvan de eigenschap de waarde heeft"
|
|
125
|
+
where_exp: "Die waarvoor een voorwaarde geldt"
|
|
126
|
+
sandbox:
|
|
127
|
+
saved: De zandbak is opgeslagen
|
|
128
|
+
index:
|
|
129
|
+
sandboxes: Liquid-zandbakken
|
|
130
|
+
search: Zoek op omschrijving of sjabloon
|
|
131
|
+
edit:
|
|
132
|
+
title: Liquid-zandbak
|
|
133
|
+
save: Opslaan
|
|
134
|
+
render: Renderen
|
|
135
|
+
conversions:
|
|
136
|
+
index:
|
|
137
|
+
title: Conversies
|
|
138
|
+
json_to_yaml: JSON → YAML
|
|
139
|
+
yaml_to_json: YAML → JSON
|
|
140
|
+
slim_to_html: Slim → HTML
|
data/config/routes.rb
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
Liquidum::Engine.routes.draw do
|
|
2
2
|
resources :variables, only: :index
|
|
3
|
-
resources :
|
|
4
|
-
resources :
|
|
5
|
-
|
|
3
|
+
resources :filters, only: :index
|
|
4
|
+
resources :tags, only: :index
|
|
5
|
+
resources :conversions, only: %i[index create]
|
|
6
|
+
resources :sandbox, except: %i[show destroy]
|
|
6
7
|
end
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
class ChangeLiquidumSandboxesToText < ActiveRecord::Migration[7.0]
|
|
2
|
+
def up
|
|
3
|
+
change_column :liquidum_sandboxes, :context, :text
|
|
4
|
+
change_column :liquidum_sandboxes, :template, :text
|
|
5
|
+
end
|
|
6
|
+
|
|
7
|
+
def down
|
|
8
|
+
change_column :liquidum_sandboxes, :context, :string
|
|
9
|
+
change_column :liquidum_sandboxes, :template, :string
|
|
10
|
+
end
|
|
11
|
+
end
|
data/lib/liquidum/drop.rb
CHANGED
|
@@ -74,10 +74,13 @@ module Liquidum
|
|
|
74
74
|
# describe :portal_url, label: -> { I18n.t("orders.portal_url") }
|
|
75
75
|
# describe :owner, drop: "UserDrop"
|
|
76
76
|
# describe :tags, drop: "TagDrop", collection: true
|
|
77
|
+
# describe :party, values: -> { {"account" => I18n.t("…"), "sponsor" => I18n.t("…")} }
|
|
77
78
|
#
|
|
78
|
-
# A label or
|
|
79
|
-
|
|
80
|
-
|
|
79
|
+
# A label, hint or values can be a proc, to translate them in the current
|
|
80
|
+
# locale. Values are the values the variable can have, by their labels
|
|
81
|
+
# (or a list of them); an enum of the model has its own already.
|
|
82
|
+
def describe(name, label: nil, type: nil, hint: nil, drop: nil, collection: nil, values: nil)
|
|
83
|
+
descriptions[name.to_s] = {label: label, type: type, hint: hint, drop: drop, collection: collection, values: values}.compact
|
|
81
84
|
end
|
|
82
85
|
|
|
83
86
|
def descriptions
|
|
@@ -122,10 +125,25 @@ module Liquidum
|
|
|
122
125
|
type: (description[:type] || (drop ? :object : attribute_type(name)))&.to_s,
|
|
123
126
|
hint: resolve(description[:hint]),
|
|
124
127
|
drop: drop,
|
|
125
|
-
collection: description.fetch(:collection) { relation&.collection? || false }
|
|
128
|
+
collection: description.fetch(:collection) { relation&.collection? || false },
|
|
129
|
+
values: values_for(name, description[:values])
|
|
126
130
|
)
|
|
127
131
|
end
|
|
128
132
|
|
|
133
|
+
# [{value, label}]: as described, else the model's enum's values, each
|
|
134
|
+
# labelled as activerecord.attributes.<model>.<enum, plural>.<value>
|
|
135
|
+
def values_for(name, described)
|
|
136
|
+
values = resolve(described)
|
|
137
|
+
if values.nil? && model.respond_to?(:defined_enums) && model.defined_enums.key?(name)
|
|
138
|
+
scope = "activerecord.attributes.#{model.model_name.i18n_key}.#{name.pluralize}"
|
|
139
|
+
values = model.defined_enums[name].keys.to_h { |value| [value, I18n.t(value, scope: scope, default: value.humanize)] }
|
|
140
|
+
end
|
|
141
|
+
case values
|
|
142
|
+
when Hash then values.map { |value, label| {value: value.to_s, label: label.to_s} }
|
|
143
|
+
when Array then values.map { |value| {value: value.to_s, label: value.to_s.humanize} }
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
129
147
|
def label_for(name)
|
|
130
148
|
model.respond_to?(:human_attribute_name) ? model.human_attribute_name(name) : name.humanize
|
|
131
149
|
end
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Liquidum
|
|
4
|
+
# The filters a template can use, for an editor's completion after a |:
|
|
5
|
+
# those Liquid has registered (its own, Liquidum's and the host's), each
|
|
6
|
+
# with what it's for and its arguments, and what a filter on a collection
|
|
7
|
+
# leaves (`keeps`), so an editor knows `lines | where: "party", "sponsor"`
|
|
8
|
+
# is still a collection of lines.
|
|
9
|
+
#
|
|
10
|
+
# Liquidum::Filters.all
|
|
11
|
+
# # => [{name: "where", label: "Those whose property has the value",
|
|
12
|
+
# # arguments: [{name: "property", kind: "property"}, {name: "value", kind: "value"}],
|
|
13
|
+
# # keeps: "collection"}, …]
|
|
14
|
+
#
|
|
15
|
+
# An argument's kind says what goes there: a property of the collection's
|
|
16
|
+
# items ("property"), a value a property can have ("value", the property
|
|
17
|
+
# being the argument before), a date format ("format"), a translation's key
|
|
18
|
+
# ("key"), or anything ("any"). `keeps` is "collection" (the same items),
|
|
19
|
+
# "item" (one of them) or nil. Labels are liquidum.filters.<name>, in the
|
|
20
|
+
# current locale; a host describes its own filters the same way:
|
|
21
|
+
#
|
|
22
|
+
# Liquidum::Filters.describe :money, arguments: [], keeps: nil
|
|
23
|
+
#
|
|
24
|
+
# and labels them in its locale files.
|
|
25
|
+
module Filters
|
|
26
|
+
DESCRIPTIONS = {}
|
|
27
|
+
|
|
28
|
+
module_function
|
|
29
|
+
|
|
30
|
+
def describe(name, arguments: [], keeps: nil)
|
|
31
|
+
DESCRIPTIONS[name.to_s] = {arguments: arguments.map { |argument| Array(argument) }, keeps: keeps}
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def all
|
|
35
|
+
names = Liquid::Environment.default.strainer_template.filter_method_names.map(&:to_s).sort
|
|
36
|
+
names.map do |name|
|
|
37
|
+
description = DESCRIPTIONS.fetch(name, {arguments: [], keeps: nil})
|
|
38
|
+
{
|
|
39
|
+
name: name,
|
|
40
|
+
label: I18n.t(name, scope: "liquidum.filters", default: name.humanize),
|
|
41
|
+
arguments: description[:arguments].map { |argument, kind| {name: argument.to_s, kind: (kind || :any).to_s} },
|
|
42
|
+
keeps: description[:keeps]&.to_s
|
|
43
|
+
}.compact
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
property = [:property, :property]
|
|
48
|
+
value = [:value, :value]
|
|
49
|
+
{
|
|
50
|
+
# On collections
|
|
51
|
+
"compact" => [[], :collection], "concat" => [[[:items]], :collection], "first" => [[], :item], "last" => [[], :item],
|
|
52
|
+
"join" => [[[:separator]]], "map" => [[property]], "reverse" => [[], :collection], "size" => [[]],
|
|
53
|
+
"sort" => [[property], :collection], "sort_natural" => [[property], :collection], "uniq" => [[], :collection],
|
|
54
|
+
"where" => [[property, value], :collection], "reject" => [[property, value], :collection],
|
|
55
|
+
"where_exp" => [[[:item], [:condition]], :collection], "find" => [[property, value], :item],
|
|
56
|
+
"find_index" => [[property, value]], "has" => [[property, value]], "sum" => [[]], "min" => [[]], "max" => [[]],
|
|
57
|
+
"array_wrap" => [[], :collection],
|
|
58
|
+
# Text
|
|
59
|
+
"append" => [[[:text]]], "prepend" => [[[:text]]], "capitalize" => [[]], "downcase" => [[]], "upcase" => [[]],
|
|
60
|
+
"default" => [[[:value]]], "escape" => [[]], "escape_once" => [[]], "h" => [[]], "strip" => [[]], "lstrip" => [[]],
|
|
61
|
+
"rstrip" => [[]], "squish" => [[]], "strip_html" => [[]], "strip_newlines" => [[]], "newline_to_br" => [[]],
|
|
62
|
+
"remove" => [[[:text]]], "remove_first" => [[[:text]]], "remove_last" => [[[:text]]],
|
|
63
|
+
"replace" => [[[:text], [:replacement]]], "replace_first" => [[[:text], [:replacement]]], "replace_last" => [[[:text], [:replacement]]],
|
|
64
|
+
"slice" => [[[:start], [:length]]], "split" => [[[:separator]]], "truncate" => [[[:length], [:ellipsis]]],
|
|
65
|
+
"truncatewords" => [[[:words], [:ellipsis]]], "url_encode" => [[]], "url_decode" => [[]], "base64_encode" => [[]],
|
|
66
|
+
"base64_decode" => [[]], "base64_url_safe_encode" => [[]], "base64_url_safe_decode" => [[]],
|
|
67
|
+
"unescape_html" => [[]], "encode" => [[[:encoding]]], "format" => [[[:format]]],
|
|
68
|
+
"t" => [[[:key, :key]]], "translate" => [[[:key, :key]]],
|
|
69
|
+
# Numbers
|
|
70
|
+
"abs" => [[]], "ceil" => [[]], "floor" => [[]], "round" => [[[:decimals]]], "plus" => [[[:number]]],
|
|
71
|
+
"minus" => [[[:number]]], "times" => [[[:number]]], "divided_by" => [[[:number]]], "modulo" => [[[:number]]],
|
|
72
|
+
"at_least" => [[[:number]]], "at_most" => [[[:number]]],
|
|
73
|
+
# Dates
|
|
74
|
+
"date" => [[[:format, :format]]], "localize" => [[[:locale], [:format, :format]]], "strptime" => [[[:format, :format]]],
|
|
75
|
+
"timezone" => [[[:zone]]], "to" => [[[:type]]]
|
|
76
|
+
}.each { |name, (arguments, keeps)| describe(name, arguments: arguments, keeps: keeps) }
|
|
77
|
+
end
|
|
78
|
+
end
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
module Liquidum
|
|
4
|
+
# The tags a template can use, for an editor's completion after {%: those
|
|
5
|
+
# Liquid has registered (its own, Liquidum's and the host's), each with how
|
|
6
|
+
# it's written and whether it's a block, which the editor writes with its
|
|
7
|
+
# closing tag ({% if … %}{% endif %}).
|
|
8
|
+
#
|
|
9
|
+
# Liquidum::Tags.all
|
|
10
|
+
# # => [{name: "if", label: "Only when a condition holds", syntax: "if condition", block: true}, …]
|
|
11
|
+
#
|
|
12
|
+
# The tags inside a block (elsif, else, when) are Liquid's syntax, which the
|
|
13
|
+
# editor knows. Labels are liquidum.tags.<name>, in the current locale; a
|
|
14
|
+
# host describes its own tags the same way:
|
|
15
|
+
#
|
|
16
|
+
# Liquidum::Tags.describe :signature_field, syntax: "signature_field kind signer"
|
|
17
|
+
module Tags
|
|
18
|
+
SYNTAX = {}
|
|
19
|
+
# Not for writing by hand: an inline comment, documentation
|
|
20
|
+
HIDDEN = %w[# doc].freeze
|
|
21
|
+
|
|
22
|
+
module_function
|
|
23
|
+
|
|
24
|
+
def describe(name, syntax:)
|
|
25
|
+
SYNTAX[name.to_s] = syntax
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
def all
|
|
29
|
+
Liquid::Environment.default.tags.to_h.filter_map do |name, tag|
|
|
30
|
+
next if HIDDEN.include?(name)
|
|
31
|
+
|
|
32
|
+
tag = tag.safe_constantize if tag.is_a?(String)
|
|
33
|
+
{
|
|
34
|
+
name: name,
|
|
35
|
+
label: I18n.t(name, scope: "liquidum.tags", default: name.humanize),
|
|
36
|
+
syntax: SYNTAX.fetch(name, name),
|
|
37
|
+
block: !!(tag && tag < Liquid::Block)
|
|
38
|
+
}
|
|
39
|
+
end.sort_by { |tag| tag[:name] }
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
{
|
|
43
|
+
"assign" => "assign variable = value", "capture" => "capture variable", "case" => "case variable",
|
|
44
|
+
"cycle" => "cycle value, value", "decrement" => "decrement variable", "echo" => "echo value",
|
|
45
|
+
"for" => "for item in collection", "if" => "if condition", "ifchanged" => "ifchanged",
|
|
46
|
+
"include" => "include 'name'", "increment" => "increment variable", "render" => "render 'name'",
|
|
47
|
+
"tablerow" => "tablerow item in collection", "unless" => "unless condition", "attach" => "attach value",
|
|
48
|
+
"helper" => "helper name"
|
|
49
|
+
}.each { |name, syntax| describe(name, syntax: syntax) }
|
|
50
|
+
end
|
|
51
|
+
end
|
data/lib/liquidum/variable.rb
CHANGED
|
@@ -3,10 +3,16 @@
|
|
|
3
3
|
module Liquidum
|
|
4
4
|
# A variable a template can use, as the editor's variable picker shows it.
|
|
5
5
|
# A variable with a drop has variables of its own; a collection is a list
|
|
6
|
-
# of them, to loop over.
|
|
7
|
-
|
|
6
|
+
# of them, to loop over. A variable with values has those only, each
|
|
7
|
+
# [{value, label}], for the editor to complete a comparison with it or a
|
|
8
|
+
# where filter on it ({% if line.party == "sponsor" %}).
|
|
9
|
+
Variable = Data.define(:name, :label, :type, :hint, :drop, :collection, :values) do
|
|
10
|
+
def initialize(values: nil, **attributes)
|
|
11
|
+
super
|
|
12
|
+
end
|
|
13
|
+
|
|
8
14
|
def as_json(*)
|
|
9
|
-
{name: name, label: label, type: type, hint: hint, collection: collection, children: !drop.nil
|
|
15
|
+
{name: name, label: label, type: type, hint: hint, collection: collection, children: !drop.nil?, values: values}.compact
|
|
10
16
|
end
|
|
11
17
|
end
|
|
12
18
|
end
|
data/lib/liquidum/version.rb
CHANGED
data/lib/liquidum.rb
CHANGED
|
@@ -11,6 +11,8 @@ require "liquidum/configuration"
|
|
|
11
11
|
require "liquidum/drop"
|
|
12
12
|
require "liquidum/variable"
|
|
13
13
|
require "liquidum/variables"
|
|
14
|
+
require "liquidum/filters"
|
|
15
|
+
require "liquidum/tags"
|
|
14
16
|
|
|
15
17
|
require "liquidum/liquid/liquid_helpers"
|
|
16
18
|
require "liquidum/liquid/liquid_template_extensions"
|
data/liquidum.gemspec
CHANGED
|
@@ -28,7 +28,7 @@ Gem::Specification.new do |spec|
|
|
|
28
28
|
spec.add_runtime_dependency("i18n", ["~> 1.8"])
|
|
29
29
|
spec.add_runtime_dependency("kramdown", ["~> 2.1"])
|
|
30
30
|
spec.add_runtime_dependency("kramdown-parser-gfm", ["~> 1.0"])
|
|
31
|
-
spec.add_runtime_dependency("liquid", ["< 6"])
|
|
31
|
+
spec.add_runtime_dependency("liquid", [">= 5.5", "< 6"])
|
|
32
32
|
spec.add_runtime_dependency("parslet", [">= 0"])
|
|
33
33
|
spec.add_runtime_dependency("pg", [">= 0"])
|
|
34
34
|
spec.add_runtime_dependency("rails", [">= 5.2"])
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: liquidum
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.4.
|
|
4
|
+
version: 1.4.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tom de Grunt
|
|
@@ -83,6 +83,9 @@ dependencies:
|
|
|
83
83
|
name: liquid
|
|
84
84
|
requirement: !ruby/object:Gem::Requirement
|
|
85
85
|
requirements:
|
|
86
|
+
- - ">="
|
|
87
|
+
- !ruby/object:Gem::Version
|
|
88
|
+
version: '5.5'
|
|
86
89
|
- - "<"
|
|
87
90
|
- !ruby/object:Gem::Version
|
|
88
91
|
version: '6'
|
|
@@ -90,6 +93,9 @@ dependencies:
|
|
|
90
93
|
prerelease: false
|
|
91
94
|
version_requirements: !ruby/object:Gem::Requirement
|
|
92
95
|
requirements:
|
|
96
|
+
- - ">="
|
|
97
|
+
- !ruby/object:Gem::Version
|
|
98
|
+
version: '5.5'
|
|
93
99
|
- - "<"
|
|
94
100
|
- !ruby/object:Gem::Version
|
|
95
101
|
version: '6'
|
|
@@ -286,7 +292,9 @@ files:
|
|
|
286
292
|
- TODO.md
|
|
287
293
|
- app/controllers/liquidum/application_controller.rb
|
|
288
294
|
- app/controllers/liquidum/conversions_controller.rb
|
|
295
|
+
- app/controllers/liquidum/filters_controller.rb
|
|
289
296
|
- app/controllers/liquidum/sandbox_controller.rb
|
|
297
|
+
- app/controllers/liquidum/tags_controller.rb
|
|
290
298
|
- app/controllers/liquidum/variables_controller.rb
|
|
291
299
|
- app/helpers/liquidum/application_helper.rb
|
|
292
300
|
- app/jobs/liquidum/application_job.rb
|
|
@@ -300,12 +308,16 @@ files:
|
|
|
300
308
|
- bin/de
|
|
301
309
|
- bin/rails
|
|
302
310
|
- bin/rubocop
|
|
311
|
+
- config/locales/en.yml
|
|
312
|
+
- config/locales/nl.yml
|
|
303
313
|
- config/routes.rb
|
|
304
314
|
- db/migrate/20230202121357_create_liquidum_sandboxes.rb
|
|
315
|
+
- db/migrate/20261108090000_change_liquidum_sandboxes_to_text.rb
|
|
305
316
|
- lib/liquidum.rb
|
|
306
317
|
- lib/liquidum/configuration.rb
|
|
307
318
|
- lib/liquidum/drop.rb
|
|
308
319
|
- lib/liquidum/engine.rb
|
|
320
|
+
- lib/liquidum/filters.rb
|
|
309
321
|
- lib/liquidum/liquid/drops/active_storage_attached_many_drop.rb
|
|
310
322
|
- lib/liquidum/liquid/drops/active_storage_attached_one_drop.rb
|
|
311
323
|
- lib/liquidum/liquid/drops/active_storage_attachment_drop.rb
|
|
@@ -330,6 +342,7 @@ files:
|
|
|
330
342
|
- lib/liquidum/liquid/parser.rb
|
|
331
343
|
- lib/liquidum/liquid/tags/helper_tag.rb
|
|
332
344
|
- lib/liquidum/liquid/tags/render_tag.rb
|
|
345
|
+
- lib/liquidum/tags.rb
|
|
333
346
|
- lib/liquidum/variable.rb
|
|
334
347
|
- lib/liquidum/variables.rb
|
|
335
348
|
- lib/liquidum/version.rb
|