historiqueux 0.0.6 → 0.0.7
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7aa6f9d9801fa2574d312fa9cb6bc7f4f966f4bc
|
4
|
+
data.tar.gz: ebc4bdcfffa41ceaa805d1dd81b5b1a142208ea6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f1a2060b331a4b3b1b8af3bcd5bf367f71cacf189807c0321ce1a66f34ba780c113883229f3b9fd971b1b5ea9423a767a98e61eff9e61fc3476c5ee615f9f0c
|
7
|
+
data.tar.gz: 8e494d6a0ac76ee393f2caa67850acebc7ddc8a3650a77012eb10033365072f2b1eb93d1878992a338499705c49e5bef283c1a73277bc2872b965a9cc9c41eab
|
data/README.rdoc
CHANGED
@@ -2,8 +2,8 @@
|
|
2
2
|
|
3
3
|
This is a mountable gem that add a bootstrap presentation layer to paper_trail.
|
4
4
|
|
5
|
-
Inject some routes in your app that provides screens
|
6
|
-
Provide the ability no navigate related entities versions details.
|
5
|
+
Inject some routes in your app that provides screens to help visualize any ressource versions, values and differences.
|
6
|
+
Provide the ability no navigate related entities versions details.
|
7
7
|
|
8
8
|
|
9
9
|
== Installation :
|
@@ -71,7 +71,7 @@ module Historiqueux
|
|
71
71
|
|
72
72
|
def fetch_relation_resource(relation_resource, resource)
|
73
73
|
@relation_resource = relation_resource
|
74
|
-
@relation_resource_list = resource.send(@relation_resource)
|
74
|
+
@relation_resource_list = ensure_enumerable(resource.send(@relation_resource))
|
75
75
|
if @relation_resource_list.first.respond_to?('versions')
|
76
76
|
namespaced_class_name = @relation_resource_list.first.versions.first.item_type
|
77
77
|
@relation_class_name = classify_namespace(namespaced_class_name)
|
@@ -79,6 +79,14 @@ module Historiqueux
|
|
79
79
|
end
|
80
80
|
end
|
81
81
|
|
82
|
+
def ensure_enumerable(object)
|
83
|
+
enum_object = object
|
84
|
+
unless object.respond_to?(:each)
|
85
|
+
enum_object = [object]
|
86
|
+
end
|
87
|
+
enum_object
|
88
|
+
end
|
89
|
+
|
82
90
|
def classify_namespace(const)
|
83
91
|
const = const.classify
|
84
92
|
if const.include?('::')
|
@@ -10,16 +10,16 @@
|
|
10
10
|
<div class="box_content">
|
11
11
|
|
12
12
|
<div>
|
13
|
-
<a role="button" id="
|
13
|
+
<a role="button" id="toggler_relations" href="#" data-toggle="collapse" class="btn btn-primary btn-xs" data-target="#relations_list">
|
14
14
|
Relations
|
15
15
|
</a>
|
16
16
|
</div>
|
17
17
|
|
18
|
-
<div id="
|
18
|
+
<div id="relations_list" class="collapse">
|
19
19
|
<% @relations.each do |relation| %>
|
20
20
|
<ul class="nav nav-list">
|
21
21
|
|
22
|
-
<%= link_to relation, "#", :class => 'event_open_relation',
|
22
|
+
<%= link_to relation, "#", :class => 'event_open_relation', :id => "#{relation}_relation_link",
|
23
23
|
:data => {:parent => @parent_div,
|
24
24
|
:resource => @resource.downcase,
|
25
25
|
:id => @resource_id,
|
@@ -11,20 +11,20 @@
|
|
11
11
|
<div class="col-md-2">
|
12
12
|
|
13
13
|
<div>
|
14
|
-
<a role="button" id="
|
14
|
+
<a role="button" id="toggler_relations<%= idx %>" href="#" data-toggle="collapse" class="btn btn-primary btn-xs" data-target="#relations_list<%= idx %>">
|
15
15
|
Relations
|
16
16
|
</a>
|
17
17
|
</div>
|
18
18
|
|
19
19
|
<% if @relations %>
|
20
|
-
<div id="
|
20
|
+
<div id="relations_list<%= idx %>" class="collapse">
|
21
21
|
<% @relations.each do |relation| %>
|
22
22
|
<ul class="nav nav-list">
|
23
23
|
|
24
|
-
<%= link_to relation, "#", :id => "
|
24
|
+
<%= link_to relation, "#", :id => "#{relation}_open_relation#{idx}", :class => 'event_open_relation',
|
25
25
|
:data => {:parent => @parent_div,
|
26
|
-
:resource => @
|
27
|
-
:id =>
|
26
|
+
:resource => @relation_resource,
|
27
|
+
:id => relation_resource.id,
|
28
28
|
:relation => relation} %>
|
29
29
|
|
30
30
|
|
@@ -54,11 +54,12 @@
|
|
54
54
|
<% @history_relations[relation_resource.id].each_with_index do |event, idx| %>
|
55
55
|
|
56
56
|
|
57
|
-
<tr
|
57
|
+
<tr class="event_open_details"
|
58
|
+
id="row<%= idx + 1 %>"
|
58
59
|
data-event-id="<%= event.id %>"
|
59
60
|
data-parent-div="<%= @parent_div %>"
|
60
|
-
data-resource="<%= @
|
61
|
-
data-resource-id="<%=
|
61
|
+
data-resource="<%= @relation_resource.downcase %>"
|
62
|
+
data-resource-id="<%= relation_resource.id %>">
|
62
63
|
|
63
64
|
<td>
|
64
65
|
<%= event.event %>
|
data/lib/historiqueux/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: historiqueux
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.7
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Groupe Fungo inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-03-
|
11
|
+
date: 2014-03-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|