radiant-fabulator_exhibit-extension 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- data/History.txt +4 -0
- data/VERSION +1 -1
- data/app/controllers/api/exhibits_controller.rb +1 -1
- data/app/models/fabulator_exhibit.rb +0 -4
- data/app/models/fabulator_exhibit_property.rb +0 -2
- data/app/models/fabulator_exhibit_type.rb +0 -2
- data/db/migrate/002_create_fabulator_exhibit_content_tables.rb +24 -18
- data/fabulator_exhibit_extension.rb +1 -1
- data/public/javascripts/fabulator/exhibit/data.js +20 -1
- data/public/stylesheets/fabulator/exhibit/exhibit.css +6 -0
- metadata +3 -3
data/History.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.5
|
@@ -6,7 +6,7 @@ class Api::ExhibitsController < ApplicationController
|
|
6
6
|
def show
|
7
7
|
@exhibit = FabulatorExhibit.find(:first, :conditions => [ "name = ?", params[:id] ])
|
8
8
|
respond_to do |format|
|
9
|
-
format.json { render :json => @exhibit.
|
9
|
+
format.json { render :json => @exhibit.database.to_json }
|
10
10
|
end
|
11
11
|
end
|
12
12
|
end
|
@@ -9,10 +9,6 @@ class FabulatorExhibit < ActiveRecord::Base
|
|
9
9
|
belongs_to :updated_by, :class_name => 'User'
|
10
10
|
belongs_to :created_by, :class_name => 'User'
|
11
11
|
|
12
|
-
def data
|
13
|
-
self.database.to_json
|
14
|
-
end
|
15
|
-
|
16
12
|
def database
|
17
13
|
FabulatorExhibitExtension::Database.new(self)
|
18
14
|
end
|
@@ -27,30 +27,36 @@ class CreateFabulatorExhibitContentTables < ActiveRecord::Migration
|
|
27
27
|
FabulatorExhibit.find(:all).each do |db|
|
28
28
|
data = (JSON.parse(db.data) rescue { 'items' => [], 'types' => {}, 'properties' => {} })
|
29
29
|
data['types'].each_pair do |k,t|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
30
|
+
if !k.nil? && k != ""
|
31
|
+
t_ob = FabulatorExhibitType.create({
|
32
|
+
:fabulator_exhibit_id => db.id,
|
33
|
+
:name => k,
|
34
|
+
:data => t.to_json
|
35
|
+
})
|
36
|
+
t_ob.save!
|
37
|
+
end
|
36
38
|
end
|
37
39
|
|
38
40
|
data['properties'].each_pair do |k,p|
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
41
|
+
if !k.nil? && k != ""
|
42
|
+
p_ob = FabulatorExhibitProperty.create({
|
43
|
+
:fabulator_exhibit_id => db.id,
|
44
|
+
:name => k,
|
45
|
+
:data => p.to_json
|
46
|
+
})
|
47
|
+
p_ob.save!
|
48
|
+
end
|
45
49
|
end
|
46
50
|
|
47
51
|
data['items'].each do |i|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
52
|
+
if !i['id'].nil? && i['id'] != ""
|
53
|
+
i_ob = FabulatorExhibitItem.create({
|
54
|
+
:fabulator_exhibit_id => db.id,
|
55
|
+
:uuid => i['id'],
|
56
|
+
:data => i.to_json
|
57
|
+
});
|
58
|
+
i_ob.save!
|
59
|
+
end
|
54
60
|
end
|
55
61
|
end
|
56
62
|
end
|
@@ -615,7 +615,7 @@ Fabulator.namespace('Exhibit');
|
|
615
615
|
};
|
616
616
|
|
617
617
|
that.loadItems = function(items, baseURI) {
|
618
|
-
var spo, ops, indexTriple, i, entry, n;
|
618
|
+
var spo, ops, indexTriple, i, entry, n, progress, percent, old_percent;
|
619
619
|
|
620
620
|
var indexPut = function(index, x, y, z) {
|
621
621
|
var hash = index[x],
|
@@ -642,6 +642,18 @@ Fabulator.namespace('Exhibit');
|
|
642
642
|
|
643
643
|
|
644
644
|
that.events.onBeforeLoadingItems.fire(that);
|
645
|
+
$("<div id='progress-items-" + options.source + "'>" +
|
646
|
+
"<div class='flc-progress progress-pop-up exhibit-progress-pop-up'><h3>Loading " + items.length + " Item" + (items.length == 1 ? "" : "s") + "</h3>" +
|
647
|
+
"<div class='flc-progress-bar progress-bar'>" +
|
648
|
+
"<div class='flc-progress-indicator progress-indicator'></div>" +
|
649
|
+
"</div>" +
|
650
|
+
"<p class='flc-progress-label progress-label'>0% Complete</p>" +
|
651
|
+
"</div></div>").appendTo($("html > body"));
|
652
|
+
|
653
|
+
progress = fluid.progress("#progress-items-" + options.source);
|
654
|
+
progress.show();
|
655
|
+
old_percent = 0;
|
656
|
+
|
645
657
|
try {
|
646
658
|
baseURI = canonicalBaseURI(baseURI);
|
647
659
|
|
@@ -651,6 +663,11 @@ Fabulator.namespace('Exhibit');
|
|
651
663
|
};
|
652
664
|
|
653
665
|
for(i = 0, n = items.length; i < n; i++) {
|
666
|
+
percent = (i * 100 / n);
|
667
|
+
if( percent > old_percent ) {
|
668
|
+
old_percent = percent;
|
669
|
+
progress.update(percent, percent + "% Complete");
|
670
|
+
}
|
654
671
|
entry = items[i];
|
655
672
|
if( typeof(entry) == "object" ) {
|
656
673
|
that.loadItem(entry, indexTriple, baseURI);
|
@@ -661,6 +678,8 @@ Fabulator.namespace('Exhibit');
|
|
661
678
|
catch(e) {
|
662
679
|
Exhibit.debug("loadItems failed: ", e);
|
663
680
|
}
|
681
|
+
progress.update(100, "100% Complete");
|
682
|
+
progress.hide();
|
664
683
|
};
|
665
684
|
|
666
685
|
that.loadItem = function(item, indexFn, baseURI) {
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: radiant-fabulator_exhibit-extension
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 5
|
10
|
+
version: 0.0.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- James Smith
|