card-mod-history 0.14.2 → 0.15.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/assets/style/history.scss +92 -0
- data/data/test.yml +11 -0
- data/lib/card/act/act_renderer/absolute_act_renderer.rb +1 -7
- data/lib/card/act/act_renderer/bridge_act_renderer.rb +3 -3
- data/lib/card/act/act_renderer/relative_act_renderer.rb +27 -5
- data/lib/card/act/act_renderer.rb +34 -110
- data/lib/card/action/action_renderer.rb +4 -1
- data/lib/card/action/differ.rb +18 -18
- data/lib/card/action.rb +0 -17
- data/lib/card/mod/history.rb +1 -0
- data/set/all/history/act_listing.rb +8 -6
- data/set/all/history/actions.rb +3 -28
- data/set/all/history/events.rb +3 -2
- data/set/all/history/selected.rb +27 -3
- data/set/all/history/views.rb +8 -4
- metadata +11 -7
- /data/{locales → config/locales}/de.yml +0 -0
- /data/{locales → config/locales}/en.yml +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a606a572b68b98bddd7dd1c0b66b305973568563e10313bb1606552a3edcbd28
|
4
|
+
data.tar.gz: 524823e9fd9881733620b6d84b4299f2b14e9e97e26f07e7d62b54b94c91bf8c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 62a0a2b2aadde8097310d918f3ff52664138d33807eeba577b63756c14934f6f7c3a5ceb1c80eafa097da303e38ab5a5430ba8d15279290f8623208e97c8fd40
|
7
|
+
data.tar.gz: c6a0344f4580149810ecab2652e481a154ec6ad0f58709079adaf79c824f50bee04320feae1659a61c1b4d2c98e7168c54166cc55bcbba2ba0b2784803c60bdc
|
@@ -0,0 +1,92 @@
|
|
1
|
+
.history-slot {
|
2
|
+
overflow: hidden;
|
3
|
+
clear: both;
|
4
|
+
}
|
5
|
+
|
6
|
+
ul.action-list {
|
7
|
+
list-style-type: none;
|
8
|
+
padding-left: 15px;
|
9
|
+
li {
|
10
|
+
border: 1px solid $border-color;
|
11
|
+
}
|
12
|
+
li:before {
|
13
|
+
font-family: 'Material Icons';
|
14
|
+
font-weight: normal;
|
15
|
+
font-style: normal;
|
16
|
+
display: inline-block;
|
17
|
+
line-height: 1;
|
18
|
+
text-transform: none;
|
19
|
+
letter-spacing: normal;
|
20
|
+
word-wrap: normal;
|
21
|
+
white-space: nowrap;
|
22
|
+
direction: ltr;
|
23
|
+
-webkit-font-smoothing: antialiased;
|
24
|
+
text-rendering: optimizeLegibility;
|
25
|
+
-moz-osx-font-smoothing: grayscale;
|
26
|
+
font-feature-settings: 'liga';
|
27
|
+
|
28
|
+
|
29
|
+
float: left;
|
30
|
+
margin-top: 8px;
|
31
|
+
margin-left: -2rem;
|
32
|
+
font-size: 120%;
|
33
|
+
padding-left: 4px;
|
34
|
+
max-height: 30px;
|
35
|
+
}
|
36
|
+
|
37
|
+
li.update:before {
|
38
|
+
content: "edit";
|
39
|
+
color: $gray-600;
|
40
|
+
}
|
41
|
+
|
42
|
+
li.create:before {
|
43
|
+
content: "add_circle";
|
44
|
+
color: $green;
|
45
|
+
}
|
46
|
+
|
47
|
+
li.delete:before {
|
48
|
+
content: "remove_circle";
|
49
|
+
color: $red;
|
50
|
+
}
|
51
|
+
|
52
|
+
li.draft:before {
|
53
|
+
content: "build";
|
54
|
+
color: $gray-600;
|
55
|
+
}
|
56
|
+
}
|
57
|
+
|
58
|
+
|
59
|
+
/*----------- Change View ---------*/
|
60
|
+
|
61
|
+
.change-view {
|
62
|
+
padding: 5px 0px;
|
63
|
+
clear: both;
|
64
|
+
.change-card{
|
65
|
+
font-weight: bold;
|
66
|
+
}
|
67
|
+
.last-update {
|
68
|
+
float:right;
|
69
|
+
text-align: right;
|
70
|
+
a {
|
71
|
+
white-space: nowrap;
|
72
|
+
}
|
73
|
+
}
|
74
|
+
}
|
75
|
+
|
76
|
+
.diff-deleted {
|
77
|
+
text-decoration: line-through;
|
78
|
+
color: $red;
|
79
|
+
background: $red-200;
|
80
|
+
img {
|
81
|
+
border: 2px solid $red;
|
82
|
+
}
|
83
|
+
}
|
84
|
+
.diff-added {
|
85
|
+
color: $green;
|
86
|
+
background: $green-200;
|
87
|
+
text-decoration: none;
|
88
|
+
img {
|
89
|
+
margin: 0px 4px 0px 4px;
|
90
|
+
border: 2px solid $green;
|
91
|
+
}
|
92
|
+
}
|
data/data/test.yml
ADDED
@@ -9,13 +9,7 @@ class Card
|
|
9
9
|
end
|
10
10
|
|
11
11
|
def subtitle
|
12
|
-
|
13
|
-
[
|
14
|
-
@format.link_to_card(@act.actor, nil, class: "_stop_propagation"),
|
15
|
-
edited_ago,
|
16
|
-
rollback_link
|
17
|
-
]
|
18
|
-
end
|
12
|
+
actor_and_ago
|
19
13
|
end
|
20
14
|
|
21
15
|
# FIXME: how do we know we need main here??
|
@@ -4,8 +4,8 @@ class Card
|
|
4
4
|
# Used for the bridge
|
5
5
|
class BridgeActRenderer < RelativeActRenderer
|
6
6
|
def title
|
7
|
-
wrap_with(:div, left_title, class: "
|
8
|
-
wrap_with(:div, right_title, class: "
|
7
|
+
wrap_with(:div, left_title, class: "me-2") +
|
8
|
+
wrap_with(:div, right_title, class: "ms-auto act-summary")
|
9
9
|
end
|
10
10
|
|
11
11
|
def left_title
|
@@ -25,7 +25,7 @@ class Card
|
|
25
25
|
def bridge_link
|
26
26
|
opts = @format.bridge_link_opts(
|
27
27
|
path: { act_id: @act.id, view: :bridge_act, act_seq: @args[:act_seq] },
|
28
|
-
"data-toggle": "pill"
|
28
|
+
"data-bs-toggle": "pill"
|
29
29
|
)
|
30
30
|
add_class opts, "d-flex nav-link"
|
31
31
|
opts[:path].delete :layout
|
@@ -6,9 +6,7 @@ class Card
|
|
6
6
|
# for the card of the format that renders the act.
|
7
7
|
class RelativeActRenderer < ActRenderer
|
8
8
|
def title
|
9
|
-
%(<span class="nr">##{@args[:act_seq]}</span>)
|
10
|
-
accordion_expand_link(@act.actor.name) +
|
11
|
-
wrap_with(:small, edited_ago)
|
9
|
+
%(<span class="nr">##{@args[:act_seq]}</span> #{actor_and_ago})
|
12
10
|
end
|
13
11
|
|
14
12
|
def subtitle
|
@@ -25,8 +23,7 @@ class Card
|
|
25
23
|
|
26
24
|
def rollback_or_edit_link
|
27
25
|
if @act.draft?
|
28
|
-
autosaved_draft_link text: "continue editing"
|
29
|
-
class: "collapse #{collapse_id}"
|
26
|
+
autosaved_draft_link text: "continue editing"
|
30
27
|
elsif show_rollback_link?
|
31
28
|
rollback_link
|
32
29
|
end
|
@@ -52,6 +49,31 @@ class Card
|
|
52
49
|
{ class: "_close-modal",
|
53
50
|
"data-slotter-mode": "update-modal-origin" }
|
54
51
|
end
|
52
|
+
|
53
|
+
# Revert:
|
54
|
+
# current update
|
55
|
+
# Restore:
|
56
|
+
# current deletion
|
57
|
+
# Revert and Restore:
|
58
|
+
# old deletions
|
59
|
+
# blank:
|
60
|
+
# current create
|
61
|
+
# save as current:
|
62
|
+
# not current, not deletion
|
63
|
+
def rollback_link
|
64
|
+
return unless @card.ok? :update
|
65
|
+
|
66
|
+
wrap_with :div, class: "act-link float-end" do
|
67
|
+
content_tag(:small, revert_link)
|
68
|
+
|
69
|
+
# link_to "Save as current",
|
70
|
+
# class: "slotter", remote: true,
|
71
|
+
# method: :post, rel: "nofollow",
|
72
|
+
# "data-slot-selector" => ".card-slot.history-view",
|
73
|
+
# path: { action: :update, action_ids: prior,
|
74
|
+
# view: :open, look_in_trash: true }
|
75
|
+
end
|
76
|
+
end
|
55
77
|
end
|
56
78
|
end
|
57
79
|
end
|
@@ -25,44 +25,50 @@ class Card
|
|
25
25
|
end
|
26
26
|
|
27
27
|
def render
|
28
|
-
|
29
|
-
|
30
|
-
act_accordion
|
28
|
+
@act_card ? accordion_item : ""
|
31
29
|
end
|
32
30
|
|
33
31
|
def header
|
34
32
|
# Card::Bootstrap.new(self).render do
|
35
33
|
bs_layout do
|
36
|
-
row xs: [
|
34
|
+
row xs: [8, 4], class: "w-100" do
|
37
35
|
column do
|
38
36
|
html title
|
39
|
-
tag(:span, "text-muted
|
37
|
+
tag(:span, "text-muted ps-1 badge") { summary }
|
40
38
|
end
|
41
|
-
column
|
39
|
+
column subtitle, class: "text-end"
|
42
40
|
end
|
43
41
|
end
|
44
42
|
# end
|
45
43
|
end
|
46
44
|
|
47
45
|
def absolute_title
|
48
|
-
|
46
|
+
@act_card.name
|
47
|
+
end
|
48
|
+
|
49
|
+
def actor_and_ago
|
50
|
+
wrap_with(:small) { [@format.link_to_card(@act.actor), edited_ago] }
|
49
51
|
end
|
50
52
|
|
51
53
|
def details
|
52
54
|
approved_actions[0..20].map do |action|
|
53
|
-
Action::ActionRenderer.new(@format, action,
|
54
|
-
:summary).render
|
55
|
+
Action::ActionRenderer.new(@format, action, true, :summary).render
|
55
56
|
end.join
|
56
57
|
end
|
57
58
|
|
58
59
|
def summary
|
59
60
|
%i[create update delete draft].map do |type|
|
60
|
-
|
61
|
-
|
62
|
-
"#{@format.action_icon type}<small> #{count_types[type]}</small>"
|
61
|
+
action_summary type
|
63
62
|
end.compact.join "<small class='text-muted'> | </small>"
|
64
63
|
end
|
65
64
|
|
65
|
+
def action_summary type
|
66
|
+
count = count_types[type]
|
67
|
+
return unless count.positive?
|
68
|
+
|
69
|
+
"#{@format.action_icon type}<small> #{count if count > 1}</small>"
|
70
|
+
end
|
71
|
+
|
66
72
|
def act_links
|
67
73
|
[
|
68
74
|
link_to_history,
|
@@ -86,12 +92,6 @@ class Card
|
|
86
92
|
# FIXME: should not need to test for presence of card here.
|
87
93
|
end
|
88
94
|
|
89
|
-
def action_header?
|
90
|
-
true
|
91
|
-
# @action_header ||= approved_actions.size != 1 ||
|
92
|
-
# approved_actions[0].card_id != @format.card.id
|
93
|
-
end
|
94
|
-
|
95
95
|
def count_types
|
96
96
|
@count_types ||=
|
97
97
|
approved_actions.each_with_object(
|
@@ -107,104 +107,28 @@ class Card
|
|
107
107
|
"#{time_ago_in_words(@act.acted_at)} ago"
|
108
108
|
end
|
109
109
|
|
110
|
-
def
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
<<-HTML
|
116
|
-
<a>
|
117
|
-
#{text}
|
118
|
-
</a>
|
119
|
-
HTML
|
120
|
-
end
|
121
|
-
|
122
|
-
# TODO: change accordion API in bootstrap/helper.rb so that it can be used
|
123
|
-
# here. The problem is that here we have extra links in the title
|
124
|
-
# that are not supposed to expand the accordion
|
125
|
-
def act_accordion
|
126
|
-
context = @act.main_action&.draft ? :warning : :default
|
127
|
-
<<-HTML
|
128
|
-
<div class="card card-#{context} nodblclick">
|
129
|
-
#{act_accordion_panel}
|
130
|
-
</div>
|
131
|
-
HTML
|
132
|
-
end
|
133
|
-
|
134
|
-
def accordion_expand_options
|
135
|
-
{
|
136
|
-
"data-toggle" => "collapse",
|
137
|
-
"data-target" => ".#{collapse_id}",
|
138
|
-
"aria-expanded" => true,
|
139
|
-
"aria-controls" => collapse_id
|
140
|
-
}
|
141
|
-
end
|
142
|
-
|
143
|
-
def act_panel_options
|
144
|
-
{ class: "card-header", role: "tab", id: "heading-#{collapse_id}" }
|
145
|
-
end
|
146
|
-
|
147
|
-
def act_accordion_panel
|
148
|
-
act_accordion_heading + act_accordion_body
|
149
|
-
end
|
150
|
-
|
151
|
-
def act_accordion_heading
|
152
|
-
wrap_with :div, act_panel_options.merge(accordion_expand_options) do
|
153
|
-
wrap_with(:h5, header, class: "mb-0") + subtitle
|
154
|
-
end
|
155
|
-
end
|
156
|
-
|
157
|
-
def act_accordion_body
|
158
|
-
wrap_with :div, id: collapse_id,
|
159
|
-
class: "collapse #{collapse_id}",
|
160
|
-
"data-parent": ".act-accordion-group" do
|
161
|
-
wrap_with :div, details, class: "card-body"
|
162
|
-
end
|
163
|
-
end
|
164
|
-
|
165
|
-
# Revert:
|
166
|
-
# current update
|
167
|
-
# Restore:
|
168
|
-
# current deletion
|
169
|
-
# Revert and Restore:
|
170
|
-
# old deletions
|
171
|
-
# blank:
|
172
|
-
# current create
|
173
|
-
# save as current:
|
174
|
-
# not current, not deletion
|
175
|
-
def rollback_link
|
176
|
-
return unless @card.ok? :update
|
177
|
-
|
178
|
-
wrap_with :div, class: "act-link collapse #{collapse_id} float-right" do
|
179
|
-
content_tag(:small, revert_link)
|
180
|
-
|
181
|
-
# link_to "Save as current",
|
182
|
-
# class: "slotter", remote: true,
|
183
|
-
# method: :post, rel: "nofollow",
|
184
|
-
# "data-slot-selector" => ".card-slot.history-view",
|
185
|
-
# path: { action: :update, action_ids: prior,
|
186
|
-
# view: :open, look_in_trash: true }
|
187
|
-
end
|
188
|
-
end
|
189
|
-
|
190
|
-
def deletion_act?
|
191
|
-
act_type == :delete
|
110
|
+
def accordion_item
|
111
|
+
# context = @act.main_action&.draft ? :warning : :default
|
112
|
+
@format.accordion_item header,
|
113
|
+
subheader: act_links,
|
114
|
+
body: details, collapse_id: "act-id-#{@act.id}"
|
192
115
|
end
|
193
116
|
|
194
117
|
def act_type
|
195
118
|
@act.main_action.action_type
|
196
119
|
end
|
197
120
|
|
198
|
-
|
199
|
-
|
200
|
-
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
end
|
121
|
+
# TODO: get this working again, perhaps in action
|
122
|
+
# def show_or_hide_changes_link
|
123
|
+
# wrap_with :div, class: "act-link" do
|
124
|
+
# @format.link_to_view(
|
125
|
+
# :act, "#{@args[:hide_diff] ? 'Show' : 'Hide'} changes",
|
126
|
+
# path: { act_id: @act.id, act_seq: @args[:act_seq],
|
127
|
+
# hide_diff: !@args[:hide_diff], action_view: :expanded,
|
128
|
+
# act_context: @args[:act_context], look_in_trash: true }
|
129
|
+
# )
|
130
|
+
# end
|
131
|
+
# end
|
208
132
|
|
209
133
|
def autosaved_draft_link opts={}
|
210
134
|
text = opts.delete(:text) || "autosaved draft"
|
@@ -43,7 +43,7 @@ class Card
|
|
43
43
|
bs_panel do
|
44
44
|
if header
|
45
45
|
heading do
|
46
|
-
div type_diff, class: "float-
|
46
|
+
div type_diff, class: "float-end"
|
47
47
|
div name_diff
|
48
48
|
end
|
49
49
|
end
|
@@ -54,6 +54,9 @@ class Card
|
|
54
54
|
end
|
55
55
|
|
56
56
|
def name_diff
|
57
|
+
return @action.card.name if @action.card.name.compound?
|
58
|
+
# TODO: handle compound names better
|
59
|
+
|
57
60
|
if @action.card == @format.card
|
58
61
|
name_changes
|
59
62
|
else
|
data/lib/card/action/differ.rb
CHANGED
@@ -2,13 +2,13 @@ class Card
|
|
2
2
|
class Action
|
3
3
|
# a collection of methods for comparing actions
|
4
4
|
module Differ
|
5
|
-
# compare action's name value with previous name value
|
6
|
-
# @return [rendered diff]
|
7
|
-
def name_diff opts={}
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
end
|
5
|
+
# # compare action's name value with previous name value
|
6
|
+
# # @return [rendered diff]
|
7
|
+
# def name_diff opts={}
|
8
|
+
# return unless new_name?
|
9
|
+
#
|
10
|
+
# diff_object(:name, opts).complete
|
11
|
+
# end
|
12
12
|
|
13
13
|
# does action change card's name?
|
14
14
|
# @return [true/false]
|
@@ -45,17 +45,17 @@ class Card
|
|
45
45
|
!value(:db_content).nil?
|
46
46
|
end
|
47
47
|
|
48
|
-
# test whether content was visibly removed
|
49
|
-
# @return [true/false]
|
50
|
-
def red?
|
51
|
-
|
52
|
-
end
|
53
|
-
|
54
|
-
# test whether content was visibly added
|
55
|
-
# @return [true/false]
|
56
|
-
def green?
|
57
|
-
|
58
|
-
end
|
48
|
+
# # test whether content was visibly removed
|
49
|
+
# # @return [true/false]
|
50
|
+
# def red?
|
51
|
+
# content_diff_object.red?
|
52
|
+
# end
|
53
|
+
#
|
54
|
+
# # test whether content was visibly added
|
55
|
+
# # @return [true/false]
|
56
|
+
# def green?
|
57
|
+
# content_diff_object.green?
|
58
|
+
# end
|
59
59
|
|
60
60
|
def raw_view content=nil
|
61
61
|
original_content = card.db_content
|
data/lib/card/action.rb
CHANGED
@@ -77,23 +77,6 @@ class Card
|
|
77
77
|
# @return [Card]
|
78
78
|
def card
|
79
79
|
Card.fetch card_id, look_in_trash: true
|
80
|
-
|
81
|
-
# I'm not sure what the rationale for the following was/is, but it was causing
|
82
|
-
# problems in cases where slot attributes are overridden (eg see #wrap_data in
|
83
|
-
# sources on wikirate). The problem is the format object had the set modules but
|
84
|
-
# the card didn't.
|
85
|
-
#
|
86
|
-
# My guess is that the need for the following had something to do with errors
|
87
|
-
# associated with changed types. If so, the solution probably needs to handle
|
88
|
-
# including the set modules associated with the type at the time of the action
|
89
|
-
# rather than including no set modules at all.
|
90
|
-
#
|
91
|
-
# What's more, we _definitely_ don't want to hard code special behavior for
|
92
|
-
# specific types in here!
|
93
|
-
|
94
|
-
# , skip_modules: true
|
95
|
-
# return res unless res && res.type_id.in?([Card::FileID, Card::ImageID])
|
96
|
-
# res.include_set_modules
|
97
80
|
end
|
98
81
|
|
99
82
|
# remove action from action cache
|
@@ -0,0 +1 @@
|
|
1
|
+
Cardio::Railtie.config.acts_per_page = 10
|
@@ -16,7 +16,7 @@ format :html do
|
|
16
16
|
bs_layout container: false, fluid: false do
|
17
17
|
html _render_act_legend(draft_legend => :draft_legend)
|
18
18
|
row(12) { act_list acts, context }
|
19
|
-
row(12) { act_paging acts, context }
|
19
|
+
# row(12) { act_paging acts, context }
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
@@ -43,7 +43,9 @@ format :html do
|
|
43
43
|
end
|
44
44
|
|
45
45
|
def act_accordion acts, context, &block
|
46
|
-
|
46
|
+
accordion do
|
47
|
+
acts_for_accordion(acts, context, &block).join
|
48
|
+
end
|
47
49
|
end
|
48
50
|
|
49
51
|
def acts_for_accordion acts, context
|
@@ -106,10 +108,10 @@ format :html do
|
|
106
108
|
|
107
109
|
def action_icon action_type, extra_class=nil
|
108
110
|
icon = case action_type
|
109
|
-
when :create then :
|
110
|
-
when :update then :
|
111
|
-
when :delete then :
|
112
|
-
when :draft then :
|
111
|
+
when :create then :create_action
|
112
|
+
when :update then :update_action
|
113
|
+
when :delete then :delete_action
|
114
|
+
when :draft then :draft
|
113
115
|
end
|
114
116
|
icon_tag icon, extra_class
|
115
117
|
end
|
data/set/all/history/actions.rb
CHANGED
@@ -4,21 +4,6 @@ def all_action_ids
|
|
4
4
|
Card::Action.where(card_id: id).pluck :id
|
5
5
|
end
|
6
6
|
|
7
|
-
def action_from_id action_id
|
8
|
-
return unless action_id.is_a?(Integer) || action_id =~ /^\d+$/
|
9
|
-
|
10
|
-
# if not an integer, action_id is probably a mod (e.g. if you request
|
11
|
-
# files/:logo/standard.png)
|
12
|
-
|
13
|
-
action_if_on_self Action.fetch(action_id)
|
14
|
-
end
|
15
|
-
|
16
|
-
def action_if_on_self action
|
17
|
-
return unless action.is_a? Action
|
18
|
-
|
19
|
-
action if action.card_id == id
|
20
|
-
end
|
21
|
-
|
22
7
|
def old_actions
|
23
8
|
actions.where("id != ?", last_action_id)
|
24
9
|
end
|
@@ -35,16 +20,6 @@ def nth_action index
|
|
35
20
|
.order(:id).limit(1).offset(index - 1).first
|
36
21
|
end
|
37
22
|
|
38
|
-
def new_content_action_id
|
39
|
-
return unless @current_action && current_action_changes_content?
|
40
|
-
|
41
|
-
@current_action.id
|
42
|
-
end
|
43
|
-
|
44
|
-
def current_action_changes_content?
|
45
|
-
new_card? || @current_action.new_content? || db_content_is_changing?
|
46
|
-
end
|
47
|
-
|
48
23
|
format :html do
|
49
24
|
def action_from_context
|
50
25
|
if (action_id = voo.action_id || params[:action_id])
|
@@ -82,15 +57,15 @@ format :html do
|
|
82
57
|
|
83
58
|
def toggle_action_content_link action, view_type
|
84
59
|
other_view_type = view_type == :expanded ? :summary : :expanded
|
85
|
-
css_class = "revision-#{action.card_act_id} float-
|
60
|
+
css_class = "revision-#{action.card_act_id} float-end"
|
86
61
|
link_to_view "action_#{other_view_type}",
|
87
|
-
icon_tag(action_arrow_dir(view_type)
|
62
|
+
icon_tag(action_arrow_dir(view_type)),
|
88
63
|
class: css_class,
|
89
64
|
path: { action_id: action.id, look_in_trash: true }
|
90
65
|
end
|
91
66
|
|
92
67
|
def action_arrow_dir view_type
|
93
|
-
view_type == :expanded ? :
|
68
|
+
view_type == :expanded ? :collapse : :expand
|
94
69
|
end
|
95
70
|
|
96
71
|
def revert_actions_link link_text, path_args, html_args={}
|
data/set/all/history/events.rb
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
# must be called on all actions and before :set_name, :process_subcards and
|
2
|
-
# :
|
2
|
+
# :delete_children
|
3
3
|
event :assign_action, :initialize, when: :actionable? do
|
4
4
|
act = director.need_act
|
5
5
|
@current_action = Card::Action.create(
|
@@ -90,7 +90,8 @@ event :finalize_act, after: :finalize_action, when: :act_card? do
|
|
90
90
|
Card::Director.act.update! card_id: id
|
91
91
|
end
|
92
92
|
|
93
|
-
event :remove_empty_act, :integrate_with_delay_final,
|
93
|
+
event :remove_empty_act, :integrate_with_delay_final,
|
94
|
+
priority: 100, when: :remove_empty_act? do
|
94
95
|
# Card::Director.act.delete
|
95
96
|
# Card::Director.act = nil
|
96
97
|
end
|
data/set/all/history/selected.rb
CHANGED
@@ -12,9 +12,7 @@ end
|
|
12
12
|
|
13
13
|
def select_action_by_params params
|
14
14
|
action = nth_action(params[:rev]) || action_from_id(params[:rev_id])
|
15
|
-
|
16
|
-
|
17
|
-
select_action action.id
|
15
|
+
select_action action.id if action
|
18
16
|
end
|
19
17
|
|
20
18
|
def select_action action_id
|
@@ -62,3 +60,29 @@ end
|
|
62
60
|
def selected_content_action_id
|
63
61
|
@selected_action_id || new_content_action_id || last_content_action_id
|
64
62
|
end
|
63
|
+
|
64
|
+
private
|
65
|
+
|
66
|
+
def new_content_action_id
|
67
|
+
return unless @current_action && current_action_changes_content?
|
68
|
+
|
69
|
+
@current_action.id
|
70
|
+
end
|
71
|
+
|
72
|
+
def current_action_changes_content?
|
73
|
+
new_card? || @current_action.new_content? || db_content_is_changing?
|
74
|
+
end
|
75
|
+
|
76
|
+
def action_from_id action_id
|
77
|
+
return unless action_id.is_a?(Integer) || action_id =~ /^\d+$/
|
78
|
+
# if not an integer, action_id is probably a mod (e.g. if you request
|
79
|
+
# files/:logo/standard.png)
|
80
|
+
|
81
|
+
action_if_on_self Action.fetch(action_id)
|
82
|
+
end
|
83
|
+
|
84
|
+
def action_if_on_self action
|
85
|
+
return unless action.is_a? Action
|
86
|
+
|
87
|
+
action if action.card_id == id
|
88
|
+
end
|
data/set/all/history/views.rb
CHANGED
@@ -1,22 +1,26 @@
|
|
1
1
|
# History views
|
2
2
|
|
3
3
|
format :html do
|
4
|
-
view :history, cache: :never do
|
4
|
+
view :history, cache: :never do # why no cache?
|
5
5
|
frame do
|
6
6
|
class_up "d0-card-body", "history-slot"
|
7
|
-
|
7
|
+
render_relative_history
|
8
8
|
end
|
9
9
|
end
|
10
10
|
|
11
|
+
view :relative_history do
|
12
|
+
acts_layout card.history_acts, :relative, :show
|
13
|
+
end
|
14
|
+
|
11
15
|
view :act, cache: :never do
|
12
16
|
act_listing act_from_context
|
13
17
|
end
|
14
18
|
|
15
19
|
view :act_legend do
|
16
20
|
bs_layout do
|
17
|
-
row md: [12, 12], lg: [7, 5] do
|
21
|
+
row md: [12, 12], lg: [7, 5], class: "pb-3" do
|
18
22
|
col action_legend
|
19
|
-
col content_legend, class: "text-
|
23
|
+
col content_legend, class: "text-end"
|
20
24
|
end
|
21
25
|
end
|
22
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: card-mod-history
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.15.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ethan McCutchen
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2023-03-29 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: card
|
@@ -18,14 +18,14 @@ dependencies:
|
|
18
18
|
requirements:
|
19
19
|
- - '='
|
20
20
|
- !ruby/object:Gem::Version
|
21
|
-
version: 1.
|
21
|
+
version: 1.105.1
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
24
|
version_requirements: !ruby/object:Gem::Requirement
|
25
25
|
requirements:
|
26
26
|
- - '='
|
27
27
|
- !ruby/object:Gem::Version
|
28
|
-
version: 1.
|
28
|
+
version: 1.105.1
|
29
29
|
description: ''
|
30
30
|
email:
|
31
31
|
- info@decko.org
|
@@ -33,6 +33,10 @@ executables: []
|
|
33
33
|
extensions: []
|
34
34
|
extra_rdoc_files: []
|
35
35
|
files:
|
36
|
+
- assets/style/history.scss
|
37
|
+
- config/locales/de.yml
|
38
|
+
- config/locales/en.yml
|
39
|
+
- data/test.yml
|
36
40
|
- lib/card/act.rb
|
37
41
|
- lib/card/act/act_renderer.rb
|
38
42
|
- lib/card/act/act_renderer/absolute_act_renderer.rb
|
@@ -44,8 +48,7 @@ files:
|
|
44
48
|
- lib/card/action/changes.rb
|
45
49
|
- lib/card/action/differ.rb
|
46
50
|
- lib/card/change.rb
|
47
|
-
-
|
48
|
-
- locales/en.yml
|
51
|
+
- lib/card/mod/history.rb
|
49
52
|
- set/all/history.rb
|
50
53
|
- set/all/history/act_listing.rb
|
51
54
|
- set/all/history/actions.rb
|
@@ -66,6 +69,7 @@ metadata:
|
|
66
69
|
wiki_uri: https://decko.org
|
67
70
|
documentation_url: http://docs.decko.org/
|
68
71
|
card-mod: history
|
72
|
+
card-mod-group: gem-defaults
|
69
73
|
post_install_message:
|
70
74
|
rdoc_options: []
|
71
75
|
require_paths:
|
@@ -81,7 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
81
85
|
- !ruby/object:Gem::Version
|
82
86
|
version: '0'
|
83
87
|
requirements: []
|
84
|
-
rubygems_version: 3.
|
88
|
+
rubygems_version: 3.3.11
|
85
89
|
signing_key:
|
86
90
|
specification_version: 4
|
87
91
|
summary: Revision histories in acts, actions, and changes
|
File without changes
|
File without changes
|