card-mod-history 0.11.0 → 0.11.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: f748f6e48dcfe648aaa721a41135f026e064752ecf8cdb16f5a9bf2fdf7c845c
4
- data.tar.gz: ab636c41792878cd5196ec6dd019d35b560d72c9ffe0d25e5a3e61b9d026229d
3
+ metadata.gz: e56c80e7368e6e50232d70a870e2fa72741733cce665d369f6152d22ec589005
4
+ data.tar.gz: 915d13a68cf8a78914a6f576788ecb2daf9bb699d98f17161e0cbb5616f66b6e
5
5
  SHA512:
6
- metadata.gz: 42167bcf664c4de96c4966872df4211f5fbbb601ceee045e406b5445fed4ee73223c12712ad9aadd131af4382792702db7567703476559ab878b4bf6af15d092
7
- data.tar.gz: 49a5f66ce214ccd87a86ffa99898267974c859563cf08d1fddb81dfe72422bec73d64694e8babd91ee6b9ced7ff0f33cae84668049519f4ea2cf8d20d3d3173f
6
+ metadata.gz: fcfceefcf692a0e1dc150233f0e12382b965abac9b22f613fc05a9506f93b1a06dd8d86eb958e007cf75fa9b41eb6164795d20ac65da53bcf7c0e1c9401c4a1a
7
+ data.tar.gz: 40a34f8e8d507bf69dbfd377185a884d3fd6ce2d376fc2bd1a8f902af4f6b66af8c0b2e6d56bf4cf05f58cb2d131dfe5ec1ef9d680de09dc32877860148d9a7f
@@ -1,5 +1,3 @@
1
- ACTS_PER_PAGE = Card.config.acts_per_page
2
-
3
1
  format :html do
4
2
  def act_from_context
5
3
  if (act_id = params["act_id"])
@@ -79,7 +77,7 @@ format :html do
79
77
  end
80
78
 
81
79
  def acts_per_page
82
- @acts_per_page || ACTS_PER_PAGE
80
+ @acts_per_page ||= Card.config.acts_per_page || 10
83
81
  end
84
82
 
85
83
  def acts_page_from_params
@@ -87,11 +85,15 @@ format :html do
87
85
  end
88
86
 
89
87
  def act_paging acts, context
88
+ return unless controller.request # paginate requires a request
90
89
  wrap_with :div, class: "slotter btn-sm" do
91
- acts = current_page_acts acts
92
- opts = { remote: true, theme: "twitter-bootstrap-4" }
90
+ paginate current_page_acts(acts), act_paging_opts(context)
91
+ end
92
+ end
93
+
94
+ def act_paging_opts context
95
+ { remote: true, theme: "twitter-bootstrap-4" }.tap do |opts|
93
96
  opts[:total_pages] = 10 if limited_paging? context
94
- paginate acts, opts
95
97
  end
96
98
  end
97
99
 
@@ -32,4 +32,35 @@ format :html do
32
32
  view :action_expanded do
33
33
  action_content action_from_context, :expanded
34
34
  end
35
+
36
+ view :change do
37
+ voo.show :title_link
38
+ voo.hide :menu
39
+ wrap do
40
+ [_render_title,
41
+ _render_menu,
42
+ _render_last_action]
43
+ end
44
+ end
45
+
46
+ view :last_action do
47
+ %(
48
+ <span class="last-update">
49
+ #{render_last_action_verb} #{render_acted_at} ago by
50
+ #{nest card.last_actor, view: :link}
51
+ </span>
52
+ )
53
+ end
54
+
55
+ view :last_action_verb, cache: :never do
56
+ return unless (act = card.last_act)
57
+ return unless (action = act.action_on card.id)
58
+
59
+ case action.action_type
60
+ when :create then "added"
61
+ when :delete then "deleted"
62
+ else
63
+ link_to_view :history, "edited", class: "last-edited", rel: "nofollow"
64
+ end
65
+ end
35
66
  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.11.0
4
+ version: 0.11.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: 2020-12-24 00:00:00.000000000 Z
13
+ date: 2021-03-02 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.101.0
21
+ version: 1.101.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.101.0
28
+ version: 1.101.1
29
29
  description: ''
30
30
  email:
31
31
  - info@decko.org