card-mod-format 0.18.1 → 0.19.1
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/assets/script/decko/decko.js.coffee +1 -1
- data/assets/script/decko/slot.js.coffee +4 -6
- data/assets/script/decko/slotter.js.coffee +9 -4
- data/data/real.yml +5 -0
- data/lib/card/format/css_format.rb +1 -0
- data/lib/card/format/csv_format.rb +1 -0
- data/lib/card/format/html_format.rb +6 -4
- data/lib/card/format/js_format.rb +1 -0
- data/lib/card/format/json_format.rb +1 -0
- data/lib/card/format/rss_format.rb +1 -0
- data/lib/card/format/text_format.rb +1 -0
- data/lib/card/format/xml_format.rb +1 -0
- data/lib/card/path/cast_params.rb +1 -0
- data/set/all/content.rb +2 -2
- data/set/all/csv.rb +2 -2
- data/set/all/data.rb +1 -1
- data/set/all/demo.rb +1 -1
- data/set/all/error.rb +5 -5
- data/set/all/haml.rb +1 -1
- data/set/all/html/error.rb +27 -6
- data/set/all/html/head.rb +18 -5
- data/set/all/html/menu.rb +2 -1
- data/set/all/html/meta_tags.haml +1 -1
- data/set/all/html/show.rb +12 -2
- data/set/all/html/wrap.rb +8 -8
- data/set/all/links.rb +2 -2
- data/set/all/title.rb +2 -2
- metadata +8 -12
- data/data/files/mod_format_script_asset_output/file.js +0 -66
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8fc4d1dcf48d5a8967ef40a89fbe5eb1039de00f4a262434014a4e4a23c716f2
|
4
|
+
data.tar.gz: 69df359302308e13aef004d1ec0c7caa0f73551d8aeac49527cf66077c88d46a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3777d94b13161662a563486a9c8c24ead1475db20b5257fa5aa78169a8e1911bc36025c2e5de0e65d2839499cfb9e9405aee30f2300b3b86b2655008c44232c4
|
7
|
+
data.tar.gz: 662c4507e8bf881665850be12882e08c350f874fd8e60a20bda1931bcbe388ba40dda963799fa7b9768a07ed82c24224be85c838b95e3377c57e7affe7ff9a2d
|
@@ -61,11 +61,9 @@ jQuery.fn.extend
|
|
61
61
|
slotReload: (url) ->
|
62
62
|
@each -> $(this)._slotReloadSingle url
|
63
63
|
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
slotLoadingComplete: ()->
|
68
|
-
# TODO: add default spinner behavior
|
64
|
+
startLoading: () ->
|
65
|
+
stopLoading: () ->
|
66
|
+
# TODO: add default spinner behavior
|
69
67
|
|
70
68
|
slotUpdate: (newContent, mode) ->
|
71
69
|
mode ||= "replace"
|
@@ -120,7 +118,7 @@ jQuery.fn.extend
|
|
120
118
|
# that's where handleRemote gets the url from
|
121
119
|
# .attr(href, url) only works for anchors
|
122
120
|
$.rails.handleRemote $slot
|
123
|
-
$slot.
|
121
|
+
$slot.startLoading()
|
124
122
|
|
125
123
|
# ~~~~~~~~~~~~~~~~~~~~~~~~
|
126
124
|
# "private" helper methods
|
@@ -65,8 +65,10 @@
|
|
65
65
|
#
|
66
66
|
#
|
67
67
|
$(window).ready ->
|
68
|
-
$('body').on 'ajax:send', '.slotter', (
|
69
|
-
$(this).slot()
|
68
|
+
$('body').on 'ajax:send', '.slotter', () ->
|
69
|
+
slot = $(this).slot()
|
70
|
+
slot.hideErrorResponse()
|
71
|
+
slot.startLoading()
|
70
72
|
|
71
73
|
$('body').on 'ajax:success', '.slotter', (event, data) ->
|
72
74
|
$(this).slotterSuccess event, data
|
@@ -74,8 +76,8 @@ $(window).ready ->
|
|
74
76
|
$('body').on 'ajax:error', '.slotter', (event, xhr) ->
|
75
77
|
$(this).showErrorResponse xhr.status, xhr.responseText
|
76
78
|
|
77
|
-
$('body').on 'ajax:complete', '.slotter', (
|
78
|
-
$(this).slot().
|
79
|
+
$('body').on 'ajax:complete', '.slotter', () ->
|
80
|
+
$(this).slot().stopLoading()
|
79
81
|
|
80
82
|
$('body').on 'click', 'button.slotter', ->
|
81
83
|
return false if !$.rails.allowAction $(this)
|
@@ -184,6 +186,9 @@ jQuery.fn.extend
|
|
184
186
|
@slot().find('.new-current-revision-id').text()
|
185
187
|
)
|
186
188
|
|
189
|
+
hideErrorResponse: () ->
|
190
|
+
$(this).find(".card-notice").hide()
|
191
|
+
|
187
192
|
updateModalOrigin: () ->
|
188
193
|
if @overlaySlot()
|
189
194
|
overlayOrigin = @slotOrigin("overlay")
|
data/data/real.yml
CHANGED
@@ -25,14 +25,16 @@ class Card
|
|
25
25
|
"text/html"
|
26
26
|
end
|
27
27
|
|
28
|
+
def stylesheet_link_tag path
|
29
|
+
tag "link", href: path, media: "all", rel: "stylesheet", type: "text/css"
|
30
|
+
end
|
31
|
+
|
32
|
+
private
|
33
|
+
|
28
34
|
def final_render_call method
|
29
35
|
rendered = super
|
30
36
|
rendered.is_a?(Array) ? output(rendered) : rendered
|
31
37
|
end
|
32
|
-
|
33
|
-
def stylesheet_link_tag path
|
34
|
-
tag "link", href: path, media: "all", rel: "stylesheet", type: "text/css"
|
35
|
-
end
|
36
38
|
end
|
37
39
|
end
|
38
40
|
end
|
data/set/all/content.rb
CHANGED
data/set/all/csv.rb
CHANGED
@@ -3,7 +3,7 @@ require "csv"
|
|
3
3
|
format :csv do
|
4
4
|
def show view, args
|
5
5
|
view ||= :titled
|
6
|
-
super
|
6
|
+
super
|
7
7
|
end
|
8
8
|
|
9
9
|
def nests
|
@@ -24,7 +24,7 @@ format :csv do
|
|
24
24
|
end
|
25
25
|
|
26
26
|
view :body do
|
27
|
-
item_cards.map { |item_card| nest item_card }
|
27
|
+
card.item_cards.map { |item_card| nest item_card }
|
28
28
|
end
|
29
29
|
|
30
30
|
view :row do
|
data/set/all/data.rb
CHANGED
@@ -68,7 +68,7 @@ format :data do
|
|
68
68
|
# NOCACHE because sometimes item_cards is dynamic.
|
69
69
|
# could be safely cached for non-dynamic lists
|
70
70
|
view :items, cache: :never do
|
71
|
-
|
71
|
+
listing_list item_cards, view: voo_items_view || :atom
|
72
72
|
end
|
73
73
|
|
74
74
|
view :links do
|
data/set/all/demo.rb
CHANGED
data/set/all/error.rb
CHANGED
@@ -55,17 +55,17 @@ format do
|
|
55
55
|
end
|
56
56
|
|
57
57
|
format :json do
|
58
|
-
view :errors do
|
58
|
+
view :errors, perms: :none do
|
59
59
|
{
|
60
60
|
error_status: error_status,
|
61
61
|
errors: card.errors.each_with_object({}) { |e, h| h[e.attribute] = e.message }
|
62
62
|
}
|
63
63
|
end
|
64
64
|
|
65
|
-
view :server_error, :errors
|
66
|
-
view :denial, :errors
|
67
|
-
view :not_found, :errors
|
68
|
-
view :bad_address do
|
65
|
+
view :server_error, :errors, perms: :none
|
66
|
+
view :denial, :errors, perms: :none
|
67
|
+
view :not_found, :errors, perms: :none
|
68
|
+
view :bad_address, perms: :none do
|
69
69
|
card.errors.add :address, super()
|
70
70
|
render_errors
|
71
71
|
end
|
data/set/all/haml.rb
CHANGED
data/set/all/html/error.rb
CHANGED
@@ -76,8 +76,14 @@ format :html do
|
|
76
76
|
focal? ? loud_denial : quiet_denial
|
77
77
|
end
|
78
78
|
|
79
|
-
|
80
|
-
|
79
|
+
private
|
80
|
+
|
81
|
+
def page_view_for_unknown
|
82
|
+
ok?(:create) ? :new : super
|
83
|
+
end
|
84
|
+
|
85
|
+
def page_status_for_unknown
|
86
|
+
ok?(:create) ? 200 : 404
|
81
87
|
end
|
82
88
|
|
83
89
|
def show_all_errors?
|
@@ -94,9 +100,9 @@ format :html do
|
|
94
100
|
wrap_with(:span, class: "render-error alert alert-danger") { super }
|
95
101
|
end
|
96
102
|
|
97
|
-
def error_modal_id
|
98
|
-
|
99
|
-
end
|
103
|
+
# def error_modal_id
|
104
|
+
# @error_modal_id ||= unique_id
|
105
|
+
# end
|
100
106
|
|
101
107
|
def error_message exception
|
102
108
|
%{
|
@@ -147,7 +153,22 @@ format :html do
|
|
147
153
|
|
148
154
|
def signin_link
|
149
155
|
link_to_card :signin, t(:account_sign_in)&.downcase,
|
150
|
-
class: "signin-link", path:
|
156
|
+
class: "signin-link", path: signin_link_path
|
157
|
+
end
|
158
|
+
|
159
|
+
def signin_link_path
|
160
|
+
{ view: :titled }.tap do |path|
|
161
|
+
unless Cardio.config.allow_anonymous_cookies
|
162
|
+
# cookie handles where to go after signin if we have it. if not...
|
163
|
+
|
164
|
+
target = signin_link_success_target
|
165
|
+
path[:success] = { mark: target } if target.present?
|
166
|
+
end
|
167
|
+
end
|
168
|
+
end
|
169
|
+
|
170
|
+
def signin_link_success_target
|
171
|
+
Env.ajax? ? request.referer : request.original_url
|
151
172
|
end
|
152
173
|
|
153
174
|
def signup_link
|
data/set/all/html/head.rb
CHANGED
@@ -9,9 +9,14 @@ basket[:cache_seed_names] += [
|
|
9
9
|
%i[all style],
|
10
10
|
%i[all style asset_output],
|
11
11
|
%i[all script],
|
12
|
-
%i[script right content_options]
|
12
|
+
%i[script right content_options],
|
13
|
+
:noindex
|
13
14
|
]
|
14
15
|
|
16
|
+
def noindex?
|
17
|
+
unknown? || :noindex.card.include_item?(name)
|
18
|
+
end
|
19
|
+
|
15
20
|
format do
|
16
21
|
view :page_title, unknown: true, perms: :none do
|
17
22
|
title_parts = [Card::Rule.global_setting(:title)]
|
@@ -21,6 +26,8 @@ format do
|
|
21
26
|
end
|
22
27
|
|
23
28
|
format :html do
|
29
|
+
delegate :noindex?, to: :card
|
30
|
+
|
24
31
|
view :head, unknown: true, perms: :none, cache: :yes do
|
25
32
|
basket[:head_views].map { |viewname| render viewname }.flatten.compact.join "\n"
|
26
33
|
end
|
@@ -52,15 +59,21 @@ format :html do
|
|
52
59
|
# it would then be safe to cache if combined with param handling
|
53
60
|
# (but note that machine clearing would need to reset card cache...)
|
54
61
|
view :stylesheet_tags, cache: :never, unknown: true, perms: :none do
|
55
|
-
[nest(:style_mods, view: :remote_style_tags),
|
62
|
+
[nest(:style_mods, view: :remote_style_tags), main_stylesheet_tag]
|
56
63
|
end
|
57
64
|
|
58
|
-
|
59
|
-
|
65
|
+
private
|
66
|
+
|
67
|
+
def main_stylesheet_tag
|
68
|
+
@main_stylesheet_tag ||=
|
60
69
|
tag "link", media: "all",
|
61
70
|
rel: "stylesheet",
|
62
71
|
type: "text/css",
|
63
|
-
href:
|
72
|
+
href: main_stylesheet_path
|
73
|
+
end
|
74
|
+
|
75
|
+
def main_stylesheet_path
|
76
|
+
nest(param_or_rule_card(:style), view: :stylesheet_path)
|
64
77
|
end
|
65
78
|
|
66
79
|
def param_or_rule_card setting
|
data/set/all/html/menu.rb
CHANGED
@@ -7,6 +7,7 @@ format :html do
|
|
7
7
|
|
8
8
|
view :menu, denial: :blank, unknown: true do
|
9
9
|
return "" unless card.known?
|
10
|
+
|
10
11
|
# would be preferable to do this with unknown: :blank, but that fails with view
|
11
12
|
# caching on, because voo always thinks it's the root.
|
12
13
|
wrap_with(:div, class: "card-menu #{menu_link_classes}") { menu_items }
|
@@ -149,7 +150,7 @@ format :html do
|
|
149
150
|
|
150
151
|
def edit_link view=:edit, link_text: nil, text: "", modal: nil
|
151
152
|
link_to_view view, link_text || "#{menu_icon} #{text}",
|
152
|
-
edit_link_opts(modal:
|
153
|
+
edit_link_opts(modal: modal || :lg)
|
153
154
|
end
|
154
155
|
|
155
156
|
# Generates options hash for an edit link with optional parameters.
|
data/set/all/html/meta_tags.haml
CHANGED
data/set/all/html/show.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
format :html do
|
2
2
|
def show view, args
|
3
3
|
content = send show_method, view, args
|
4
|
-
Env.ajax? ? content : wrap_with_html_page(content)
|
4
|
+
Env.ajax? || no_layout? ? content : wrap_with_html_page(content)
|
5
5
|
end
|
6
6
|
|
7
7
|
wrapper :html_page do
|
@@ -9,7 +9,7 @@ format :html do
|
|
9
9
|
<!DOCTYPE HTML>
|
10
10
|
<html class="h-100">
|
11
11
|
<head>
|
12
|
-
#{
|
12
|
+
#{head_content}
|
13
13
|
</head>
|
14
14
|
#{interior}
|
15
15
|
</html>
|
@@ -18,6 +18,10 @@ format :html do
|
|
18
18
|
|
19
19
|
private
|
20
20
|
|
21
|
+
def head_content
|
22
|
+
nest card.rule_card(:head), view: :head_content
|
23
|
+
end
|
24
|
+
|
21
25
|
def show_without_page_layout view, args
|
22
26
|
@main = true if params[:is_main] || args[:main]
|
23
27
|
args.delete(:layout)
|
@@ -34,6 +38,12 @@ format :html do
|
|
34
38
|
end
|
35
39
|
|
36
40
|
def show_layout?
|
41
|
+
return false if no_layout?
|
42
|
+
|
37
43
|
!Env.ajax? || params[:layout]
|
38
44
|
end
|
45
|
+
|
46
|
+
def no_layout?
|
47
|
+
params[:layout] == "none"
|
48
|
+
end
|
39
49
|
end
|
data/set/all/html/wrap.rb
CHANGED
@@ -49,7 +49,7 @@ format :html do
|
|
49
49
|
|
50
50
|
def slot_cardname
|
51
51
|
name = card.name
|
52
|
-
name = card.new? && name.compound?
|
52
|
+
name = name.url_key if card.new? && name.compound?
|
53
53
|
h name
|
54
54
|
end
|
55
55
|
|
@@ -122,7 +122,7 @@ format :html do
|
|
122
122
|
end
|
123
123
|
|
124
124
|
def no_main_wrap?
|
125
|
-
Env.ajax? ||
|
125
|
+
Env.ajax? || no_layout?
|
126
126
|
end
|
127
127
|
|
128
128
|
def wrap_with tag, content_or_args={}, html_args={}, &block
|
@@ -140,21 +140,21 @@ format :html do
|
|
140
140
|
private
|
141
141
|
|
142
142
|
def content_items_within_wrap content, args
|
143
|
-
content =
|
143
|
+
content = yield(args) if block_given?
|
144
144
|
content.compact
|
145
145
|
end
|
146
146
|
|
147
147
|
def content_within_wrap content
|
148
|
-
content =
|
148
|
+
content = yield if block_given?
|
149
149
|
output(content).to_s.html_safe
|
150
150
|
end
|
151
151
|
|
152
152
|
def html_escape_except_quotes string
|
153
153
|
# to be used inside single quotes (makes for readable json attributes)
|
154
|
-
string.to_s.gsub(
|
155
|
-
.gsub(
|
156
|
-
.gsub(
|
157
|
-
.gsub(
|
154
|
+
string.to_s.gsub("&", "&")
|
155
|
+
.gsub("'", "'")
|
156
|
+
.gsub(">", ">")
|
157
|
+
.gsub("<", "<")
|
158
158
|
end
|
159
159
|
|
160
160
|
wrapper :div, :div
|
data/set/all/links.rb
CHANGED
@@ -112,13 +112,13 @@ format :html do
|
|
112
112
|
name = Card::Name[cardish]
|
113
113
|
slotterify opts if opts[:slotter]
|
114
114
|
add_known_or_wanted_class opts, name
|
115
|
-
super
|
115
|
+
super(name, text || name, opts)
|
116
116
|
end
|
117
117
|
|
118
118
|
# in HTML, #link_to_view defaults to a remote link with rel="nofollow".
|
119
119
|
def link_to_view view, text=nil, opts={}
|
120
120
|
slotterify opts
|
121
|
-
super
|
121
|
+
super(view, text || view, opts)
|
122
122
|
end
|
123
123
|
|
124
124
|
# in HTML, #link_to_resource automatically adds a target to external resources
|
data/set/all/title.rb
CHANGED
@@ -32,7 +32,7 @@ format :html do
|
|
32
32
|
def title_in_context title=nil
|
33
33
|
title = title&.html_safe
|
34
34
|
# escape titles generated from card names, but not those set explicitly
|
35
|
-
h super
|
35
|
+
h super
|
36
36
|
end
|
37
37
|
|
38
38
|
def wrapped_title title
|
@@ -42,6 +42,6 @@ format :html do
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def wrapped_joint
|
45
|
-
wrap_with :span, "+", classy("joint")
|
45
|
+
wrap_with :span, (voo.joint || "+"), classy("joint")
|
46
46
|
end
|
47
47
|
end
|
metadata
CHANGED
@@ -1,16 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-format
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.19.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
8
8
|
- Philipp Kühl
|
9
9
|
- Gerry Gleason
|
10
|
-
autorequire:
|
11
10
|
bindir: bin
|
12
11
|
cert_chain: []
|
13
|
-
date:
|
12
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
14
13
|
dependencies:
|
15
14
|
- !ruby/object:Gem::Dependency
|
16
15
|
name: card
|
@@ -18,28 +17,28 @@ dependencies:
|
|
18
17
|
requirements:
|
19
18
|
- - '='
|
20
19
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
20
|
+
version: 1.109.1
|
22
21
|
type: :runtime
|
23
22
|
prerelease: false
|
24
23
|
version_requirements: !ruby/object:Gem::Requirement
|
25
24
|
requirements:
|
26
25
|
- - '='
|
27
26
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
27
|
+
version: 1.109.1
|
29
28
|
- !ruby/object:Gem::Dependency
|
30
29
|
name: card-mod-content
|
31
30
|
requirement: !ruby/object:Gem::Requirement
|
32
31
|
requirements:
|
33
32
|
- - '='
|
34
33
|
- !ruby/object:Gem::Version
|
35
|
-
version: 0.
|
34
|
+
version: 0.19.1
|
36
35
|
type: :runtime
|
37
36
|
prerelease: false
|
38
37
|
version_requirements: !ruby/object:Gem::Requirement
|
39
38
|
requirements:
|
40
39
|
- - '='
|
41
40
|
- !ruby/object:Gem::Version
|
42
|
-
version: 0.
|
41
|
+
version: 0.19.1
|
43
42
|
description: ''
|
44
43
|
email:
|
45
44
|
- info@decko.org
|
@@ -69,7 +68,6 @@ files:
|
|
69
68
|
- config/locales/de.yml
|
70
69
|
- config/locales/en.yml
|
71
70
|
- data/files/credit_image.svg
|
72
|
-
- data/files/mod_format_script_asset_output/file.js
|
73
71
|
- data/real.yml
|
74
72
|
- lib/card/format/css_format.rb
|
75
73
|
- lib/card/format/csv_format.rb
|
@@ -216,7 +214,6 @@ metadata:
|
|
216
214
|
documentation_url: http://docs.decko.org/
|
217
215
|
card-mod: format
|
218
216
|
card-mod-group: gem-defaults
|
219
|
-
post_install_message:
|
220
217
|
rdoc_options: []
|
221
218
|
require_paths:
|
222
219
|
- lib
|
@@ -224,15 +221,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
224
221
|
requirements:
|
225
222
|
- - ">="
|
226
223
|
- !ruby/object:Gem::Version
|
227
|
-
version: '3.
|
224
|
+
version: '3.2'
|
228
225
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
229
226
|
requirements:
|
230
227
|
- - ">="
|
231
228
|
- !ruby/object:Gem::Version
|
232
229
|
version: '0'
|
233
230
|
requirements: []
|
234
|
-
rubygems_version: 3.
|
235
|
-
signing_key:
|
231
|
+
rubygems_version: 3.6.8
|
236
232
|
specification_version: 4
|
237
233
|
summary: format
|
238
234
|
test_files: []
|