mongobile 0.1.2 → 0.1.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/mongobile/app.rb +9 -5
- data/lib/mongobile/views/database/collection.haml +2 -6
- data/lib/mongobile/views/layout.haml +4 -0
- data/lib/mongobile/views/shared/values.haml +74 -0
- data/mongobile.gemspec +4 -2
- data/public/javascripts/application.js +1 -0
- data/public/stylesheets/highlight.css +56 -0
- metadata +6 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.1.
|
1
|
+
0.1.3
|
data/lib/mongobile/app.rb
CHANGED
@@ -99,13 +99,17 @@ module Mongobile
|
|
99
99
|
redirect "/database/#{params[:id]}"
|
100
100
|
end
|
101
101
|
|
102
|
-
def humanize(v)
|
103
|
-
if v.
|
104
|
-
|
102
|
+
def humanize(v, quote = true)
|
103
|
+
if v.nil? && quote
|
104
|
+
"null"
|
105
|
+
elsif v.kind_of?(Hash)
|
106
|
+
JSON.pretty_generate(v)
|
105
107
|
elsif v.kind_of?(Array)
|
106
|
-
v
|
108
|
+
JSON.pretty_generate(v)
|
107
109
|
elsif v.kind_of?(Time)
|
108
|
-
v.strftime("%d %B %Y %H:%M:%S")
|
110
|
+
v.strftime("%d %B %Y %H:%M:%S").inspect
|
111
|
+
elsif quote
|
112
|
+
v.inspect
|
109
113
|
else
|
110
114
|
v
|
111
115
|
end
|
@@ -29,12 +29,8 @@
|
|
29
29
|
-count+=1
|
30
30
|
%div(data-role="collapsible" data-collapsed=true)
|
31
31
|
%h1
|
32
|
-
&= document["_id"] +" #{humanize(document["name"] || document["title"] || document["subject"] || document["_type"])}"
|
33
|
-
|
34
|
-
%b
|
35
|
-
&="#{k}="
|
36
|
-
&=humanize v
|
37
|
-
%br
|
32
|
+
&= document["_id"] +" #{humanize(document["name"] || document["title"] || document["subject"] || document["_type"], false)}"
|
33
|
+
=haml :"shared/values", :layout => false, :locals => {:hash => document}
|
38
34
|
|
39
35
|
%div(data-role="footer")
|
40
36
|
-if skip > 0
|
@@ -4,10 +4,14 @@
|
|
4
4
|
%title
|
5
5
|
=@title||"Mongobile"
|
6
6
|
%link(rel="stylesheet" href="/stylesheets/jquery.mobile-1.0a3pre.min.css")
|
7
|
+
%link(rel="stylesheet" href="/stylesheets/highlight.css")
|
8
|
+
|
7
9
|
%script(src="http://code.jquery.com/jquery-1.4.3.min.js")
|
8
10
|
%script(src="/javascripts/jquery.mobile-1.0a3pre.min.js")
|
9
11
|
|
10
12
|
%script(src="/javascripts/status.js")
|
13
|
+
|
14
|
+
%script(src="/javascripts/application.js")
|
11
15
|
%body
|
12
16
|
= yield
|
13
17
|
|
@@ -0,0 +1,74 @@
|
|
1
|
+
-hash.each do |key,value|
|
2
|
+
-k = humanize(key)
|
3
|
+
-v = humanize(value)
|
4
|
+
|
5
|
+
-if value.kind_of?(Hash) && value.size > 5
|
6
|
+
%div(data-role="collapsible" data-collapsed=true data-theme="b")
|
7
|
+
%h2
|
8
|
+
&=k
|
9
|
+
= haml :"shared/values", :layout => false, :locals => {:hash => value}
|
10
|
+
-elsif value.kind_of?(Array) && value.size > 5
|
11
|
+
%div(data-role="collapsible" data-collapsed=true data-theme="b")
|
12
|
+
%h2
|
13
|
+
&=k
|
14
|
+
-tmp = []
|
15
|
+
-value.each_with_index do |element, index|
|
16
|
+
-if element.kind_of?(Hash)
|
17
|
+
%div(data-role="collapsible" data-collapsed=true data-theme="e")
|
18
|
+
%h2
|
19
|
+
&=index
|
20
|
+
= haml :"shared/values", :layout => false, :locals => {:hash => element}
|
21
|
+
-else
|
22
|
+
-tmp << element
|
23
|
+
- if !tmp.empty?
|
24
|
+
=humanize(tmp)
|
25
|
+
%br
|
26
|
+
|
27
|
+
-else
|
28
|
+
%b
|
29
|
+
-if key == "_type"
|
30
|
+
%span.type_key
|
31
|
+
&=k
|
32
|
+
-elsif key == "_id"
|
33
|
+
%span.pk_key
|
34
|
+
&=k
|
35
|
+
-elsif key =~ /_id$/
|
36
|
+
%span.fk_key
|
37
|
+
&=k
|
38
|
+
-elsif key =~ /_at$/
|
39
|
+
%span.date_key
|
40
|
+
&=k
|
41
|
+
-elsif ["name", "title"].include?(key)
|
42
|
+
%span.name_key
|
43
|
+
&=k
|
44
|
+
-elsif key =~ /^_/
|
45
|
+
%span.private_key
|
46
|
+
&=k
|
47
|
+
-else
|
48
|
+
%span.normal_key
|
49
|
+
&=k
|
50
|
+
\=
|
51
|
+
|
52
|
+
-if key == "_type"
|
53
|
+
%span.type_value
|
54
|
+
&=v
|
55
|
+
-elsif key == "_id"
|
56
|
+
%span.pk_value
|
57
|
+
&=v
|
58
|
+
-elsif key =~ /_id$/
|
59
|
+
%span.fk_value
|
60
|
+
&=v
|
61
|
+
-elsif key =~ /_at$/
|
62
|
+
%span.date_value
|
63
|
+
&=v
|
64
|
+
-elsif ["name", "title"].include?(key)
|
65
|
+
%span.name_value
|
66
|
+
&=v
|
67
|
+
-elsif key =~ /^_/
|
68
|
+
%span.private_value
|
69
|
+
&=v
|
70
|
+
-else
|
71
|
+
%span.normal_value
|
72
|
+
&=v
|
73
|
+
%br<
|
74
|
+
|
data/mongobile.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{mongobile}
|
8
|
-
s.version = "0.1.
|
8
|
+
s.version = "0.1.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["David A. Cuadrado"]
|
12
|
-
s.date = %q{2010-12-
|
12
|
+
s.date = %q{2010-12-27}
|
13
13
|
s.default_executable = %q{mongobile}
|
14
14
|
s.description = %q{admin ui for mongodb based on jquery mobile}
|
15
15
|
s.email = %q{krawek@gmail.com}
|
@@ -36,11 +36,13 @@ Gem::Specification.new do |s|
|
|
36
36
|
"lib/mongobile/views/database/show.haml",
|
37
37
|
"lib/mongobile/views/index.haml",
|
38
38
|
"lib/mongobile/views/layout.haml",
|
39
|
+
"lib/mongobile/views/shared/values.haml",
|
39
40
|
"lib/mongobile/views/status.haml",
|
40
41
|
"mongobile.gemspec",
|
41
42
|
"public/javascripts/application.js",
|
42
43
|
"public/javascripts/jquery.mobile-1.0a3pre.min.js",
|
43
44
|
"public/javascripts/status.js",
|
45
|
+
"public/stylesheets/highlight.css",
|
44
46
|
"public/stylesheets/images/ajax-loader.png",
|
45
47
|
"public/stylesheets/images/form-check-off.png",
|
46
48
|
"public/stylesheets/images/form-check-on.png",
|
@@ -0,0 +1,56 @@
|
|
1
|
+
.normal_key {
|
2
|
+
font-weight: bold;
|
3
|
+
}
|
4
|
+
.normal_value {
|
5
|
+
|
6
|
+
}
|
7
|
+
|
8
|
+
.pk_key {
|
9
|
+
font-size: 18px;
|
10
|
+
color: blue;
|
11
|
+
}
|
12
|
+
.pk_value {
|
13
|
+
font-size: 18px;
|
14
|
+
font-weight: bold;
|
15
|
+
}
|
16
|
+
|
17
|
+
.type_key {
|
18
|
+
font-size: 18px;
|
19
|
+
color: blue;
|
20
|
+
}
|
21
|
+
.type_value {
|
22
|
+
font-size: 18px;
|
23
|
+
font-weight: bold;
|
24
|
+
color: magenta
|
25
|
+
}
|
26
|
+
|
27
|
+
.fk_key {
|
28
|
+
color: red;
|
29
|
+
}
|
30
|
+
.fk_value {
|
31
|
+
|
32
|
+
}
|
33
|
+
|
34
|
+
.date_key {
|
35
|
+
color: green;
|
36
|
+
}
|
37
|
+
.date_value {
|
38
|
+
|
39
|
+
}
|
40
|
+
|
41
|
+
.name_key {
|
42
|
+
font-size: 18px;
|
43
|
+
color: blue;
|
44
|
+
}
|
45
|
+
.name_value {
|
46
|
+
font-size: 18px;
|
47
|
+
font-weight: bold;
|
48
|
+
color: magenta
|
49
|
+
}
|
50
|
+
|
51
|
+
.private_key {
|
52
|
+
color: #aaa;
|
53
|
+
}
|
54
|
+
.private_value {
|
55
|
+
color: #aaa;
|
56
|
+
}
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongobile
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease: false
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 1
|
9
|
-
-
|
10
|
-
version: 0.1.
|
9
|
+
- 3
|
10
|
+
version: 0.1.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- David A. Cuadrado
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2010-12-
|
18
|
+
date: 2010-12-27 00:00:00 -05:00
|
19
19
|
default_executable: mongobile
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
@@ -201,11 +201,13 @@ files:
|
|
201
201
|
- lib/mongobile/views/database/show.haml
|
202
202
|
- lib/mongobile/views/index.haml
|
203
203
|
- lib/mongobile/views/layout.haml
|
204
|
+
- lib/mongobile/views/shared/values.haml
|
204
205
|
- lib/mongobile/views/status.haml
|
205
206
|
- mongobile.gemspec
|
206
207
|
- public/javascripts/application.js
|
207
208
|
- public/javascripts/jquery.mobile-1.0a3pre.min.js
|
208
209
|
- public/javascripts/status.js
|
210
|
+
- public/stylesheets/highlight.css
|
209
211
|
- public/stylesheets/images/ajax-loader.png
|
210
212
|
- public/stylesheets/images/form-check-off.png
|
211
213
|
- public/stylesheets/images/form-check-on.png
|