card-mod-history 0.18.1 → 0.19.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 14b000c818d4e928c00b9599251244525653a78f44842986e536b503e5311d49
4
- data.tar.gz: 94b4fcf68548ae1b070402f73dca6c50a6e0c12e7b204fb22868ce14e8be97a5
3
+ metadata.gz: aad29d5ab8235acbae498c0237bebfb3e28f2821d73575a57572a7e40efb10b9
4
+ data.tar.gz: aa516afaa78b852815f601fdd2acb989a428ad5a14311c057d4c212619cf2984
5
5
  SHA512:
6
- metadata.gz: 22dea11654d68b02724fa7f952bd6700b721334e54e165c584058197a3c0f65f23f5f41964f158baf3e86093deb12f8d854e98d6979edf2b09d5557eef990796
7
- data.tar.gz: 2fdfd6b5d9f3b3042c1fafc9924ff77b6e7610c02dd83fc8fa498c39bb8015801fa333f1cc57ab574a76482175f2f5d5a1b76bbf6e95e16190d1b4686ca4b06b
6
+ metadata.gz: 752b0801833b06a47a75e7ca99760392b4bdbe1ccdf7235166865024fab8f8ffff42f8b2fbcc1792f4aec2c5510ce3bf6d9275c7e78c9a183541052371217069
7
+ data.tar.gz: c1ff8ee19037ce71b323e69ba7054fc7d97f0f9ce9108def8745285a24e390ce2fc9b629c247bd57c3ac0e690b396105cb4066df736d78bd9216ef0303ea90d6
@@ -38,7 +38,7 @@ class Card
38
38
  end
39
39
 
40
40
  def current_act?
41
- return unless @format.card.last_act && @act
41
+ return false unless @format.card.last_act && @act
42
42
 
43
43
  @act.id == @format.card.last_act.id
44
44
  end
@@ -1,5 +1,6 @@
1
1
  class Card
2
2
  class Act
3
+ # supports rendering act details within ui
3
4
  class ActRenderer
4
5
  def initialize format, act, args
5
6
  @format = format
@@ -1,5 +1,6 @@
1
1
  class Card
2
2
  class Action
3
+ # supports rendering action details within ui
3
4
  class ActionRenderer
4
5
  attr_reader :action, :header
5
6
 
@@ -59,6 +60,7 @@ class Card
59
60
 
60
61
  def name_diff
61
62
  return relative_name if @action.card.name.compound?
63
+
62
64
  # TODO: handle compound names better
63
65
 
64
66
  # if @action.card == @format.card
@@ -76,7 +76,7 @@ class Card
76
76
  end
77
77
 
78
78
  def content_diff_object opts=nil
79
- @diff ||= begin
79
+ @content_diff_object ||= begin
80
80
  diff_args = opts || card.include_set_modules.diff_args
81
81
  previous_value = previous_value(:content)
82
82
  previous = previous_value ? raw_view(previous_value) : ""
data/lib/card/change.rb CHANGED
@@ -29,7 +29,7 @@ class Card
29
29
  # (janitorial)
30
30
  def delete_actionless
31
31
  joins(
32
- "LEFT JOIN card_actions "\
32
+ "LEFT JOIN card_actions " \
33
33
  "ON card_changes.card_action_id = card_actions.id "
34
34
  ).where(
35
35
  "card_actions.id is null"
@@ -1,10 +1,15 @@
1
+ ACTION_ICONS = {
2
+ create: :create_action,
3
+ update: :update_action,
4
+ delete: :delete_action,
5
+ draft: :draft
6
+ }.freeze
7
+
1
8
  format :html do
2
9
  def act_from_context
3
- if (act_id = params["act_id"])
4
- Act.find(act_id) || raise(Card::NotFound, "act not found")
5
- else
6
- card.last_action.act
7
- end
10
+ return card.last_action.act unless (act_id = params["act_id"])
11
+
12
+ Act.find(act_id) || raise(Card::NotFound, "act not found")
8
13
  end
9
14
 
10
15
  # used (by history and recent)for rendering act lists with legend and paging
@@ -30,7 +35,7 @@ format :html do
30
35
  # TODO: consider putting all these under one top-level param, eg:
31
36
  # act: { seq: X, diff: [show/hide], action_view: Y }
32
37
  def act_listing_opts_from_params seq
33
- { act_seq: (seq || params["act_seq"]),
38
+ { act_seq: seq || params["act_seq"],
34
39
  action_view: (params["action_view"] || "summary").to_sym,
35
40
  hide_diff: params["hide_diff"].to_s.strip == "true" }
36
41
  end
@@ -62,7 +67,7 @@ format :html do
62
67
  end
63
68
 
64
69
  def act_list_starting_seq acts
65
- acts.size - (acts_page_from_params - 1) * acts_per_page
70
+ acts.size - ((acts_page_from_params - 1) * acts_per_page)
66
71
  end
67
72
 
68
73
  def acts_per_page
@@ -74,12 +79,7 @@ format :html do
74
79
  end
75
80
 
76
81
  def action_icon action_type, extra_class=nil
77
- icon = case action_type
78
- when :create then :create_action
79
- when :update then :update_action
80
- when :delete then :delete_action
81
- when :draft then :draft
82
- end
82
+ icon = ACTION_ICONS[action_type]
83
83
  icon_tag icon, extra_class
84
84
  end
85
85
 
@@ -75,6 +75,7 @@ end
75
75
 
76
76
  def action_from_id action_id
77
77
  return unless action_id.is_a?(Integer) || action_id =~ /^\d+$/
78
+
78
79
  # if not an integer, action_id is probably a mod (e.g. if you request
79
80
  # files/:logo/standard.png)
80
81
 
@@ -3,8 +3,8 @@ format :html do
3
3
  wrap: { div: { class: "text-muted creator-credit" } }, cache: :never do
4
4
  return "" unless card.real?
5
5
 
6
- "Created by #{nest card.creator, view: :link} "\
7
- "#{time_ago_in_words(card.created_at)} ago"
6
+ "Created by #{nest card.creator, view: :link} " \
7
+ "#{time_ago_in_words(card.created_at)} ago"
8
8
  end
9
9
 
10
10
  view :updated_by, wrap: { div: { class: "text-muted" } } do
metadata CHANGED
@@ -1,16 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: card-mod-history
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.18.1
4
+ version: 0.19.0
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: 2024-11-22 00:00:00.000000000 Z
12
+ date: 1980-01-02 00:00:00.000000000 Z
14
13
  dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: card
@@ -18,14 +17,14 @@ dependencies:
18
17
  requirements:
19
18
  - - '='
20
19
  - !ruby/object:Gem::Version
21
- version: 1.108.1
20
+ version: 1.109.0
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.108.1
27
+ version: 1.109.0
29
28
  description: ''
30
29
  email:
31
30
  - info@decko.org
@@ -74,7 +73,6 @@ metadata:
74
73
  documentation_url: http://docs.decko.org/
75
74
  card-mod: history
76
75
  card-mod-group: gem-defaults
77
- post_install_message:
78
76
  rdoc_options: []
79
77
  require_paths:
80
78
  - lib
@@ -82,15 +80,14 @@ required_ruby_version: !ruby/object:Gem::Requirement
82
80
  requirements:
83
81
  - - ">="
84
82
  - !ruby/object:Gem::Version
85
- version: '3.0'
83
+ version: '3.2'
86
84
  required_rubygems_version: !ruby/object:Gem::Requirement
87
85
  requirements:
88
86
  - - ">="
89
87
  - !ruby/object:Gem::Version
90
88
  version: '0'
91
89
  requirements: []
92
- rubygems_version: 3.5.10
93
- signing_key:
90
+ rubygems_version: 3.6.8
94
91
  specification_version: 4
95
92
  summary: Revision histories in acts, actions, and changes
96
93
  test_files: []