bowtie 0.5.4 → 0.5.5
Sign up to get free protection for your applications and to get access to all the features.
- data/bowtie.gemspec +1 -1
- data/lib/bowtie/admin.rb +2 -1
- data/lib/bowtie/core_extensions.rb +1 -5
- data/lib/bowtie/public/css/bowtie.css +23 -23
- data/lib/bowtie/public/js/bowtie.js +12 -6
- data/lib/bowtie/views/layout.erb +6 -6
- metadata +3 -3
data/bowtie.gemspec
CHANGED
data/lib/bowtie/admin.rb
CHANGED
@@ -70,13 +70,14 @@ module Bowtie
|
|
70
70
|
@title = "#{params[:association].titleize} for #{model.to_s.titleize} ##{params[:id]}"
|
71
71
|
res = Bowtie.get_associated(model, params)
|
72
72
|
|
73
|
-
@model = get_model_class(params[:association])
|
74
73
|
redirect referer + '?error=doesnt+exist' if res.nil? or (res.is_a?(Array) and res.empty?)
|
75
74
|
|
76
75
|
if res.is_a?(Array)
|
76
|
+
@model = res.first.class
|
77
77
|
@resources = Bowtie.add_paging(res, params[:page])
|
78
78
|
erb :index
|
79
79
|
else
|
80
|
+
@model = res.class
|
80
81
|
@resource = res
|
81
82
|
erb :show
|
82
83
|
end
|
@@ -1,7 +1,7 @@
|
|
1
1
|
/*
|
2
2
|
CSS for Bowtie Datamapper Admin
|
3
3
|
By Tomas Pollak - Fork Limited
|
4
|
-
http://
|
4
|
+
http://forkhq.com
|
5
5
|
----------------------------------------- */
|
6
6
|
|
7
7
|
*{
|
@@ -86,45 +86,45 @@ h2 { margin:10px 0; font-size:130%;}
|
|
86
86
|
-moz-border-top-left-radius: 6px;
|
87
87
|
}
|
88
88
|
|
89
|
-
#header ul li a:hover {
|
89
|
+
#header ul li a:hover {
|
90
90
|
background:#333;
|
91
91
|
}
|
92
92
|
|
93
|
-
#header ul li.current a {
|
94
|
-
background: #528e00;
|
95
|
-
font-weight:bold;
|
93
|
+
#header ul li.current a {
|
94
|
+
background: #528e00;
|
95
|
+
font-weight:bold;
|
96
96
|
color:#fff;
|
97
97
|
}
|
98
98
|
|
99
|
-
.subnav {
|
100
|
-
padding: 2px 50px 7px 50px;
|
101
|
-
background:#528e00;
|
102
|
-
font-size:90%;
|
103
|
-
margin: -20px -50px 20px;
|
99
|
+
.subnav {
|
100
|
+
padding: 2px 50px 7px 50px;
|
101
|
+
background:#528e00;
|
102
|
+
font-size:90%;
|
103
|
+
margin: -20px -50px 20px;
|
104
104
|
}
|
105
105
|
|
106
|
-
.subnav li {
|
106
|
+
.subnav li {
|
107
107
|
display:inline;
|
108
108
|
}
|
109
109
|
|
110
|
-
.subnav li a {
|
111
|
-
color:#fff;
|
112
|
-
text-decoration:none;
|
113
|
-
margin-right:10px;
|
114
|
-
display:inline-block;
|
115
|
-
background:#89bf41;
|
116
|
-
padding:5px;
|
117
|
-
-webkit-border-radius:3px;
|
110
|
+
.subnav li a {
|
111
|
+
color:#fff;
|
112
|
+
text-decoration:none;
|
113
|
+
margin-right:10px;
|
114
|
+
display:inline-block;
|
115
|
+
background:#89bf41;
|
116
|
+
padding:5px;
|
117
|
+
-webkit-border-radius:3px;
|
118
118
|
-moz-border-radius:3px;
|
119
119
|
}
|
120
120
|
|
121
|
-
.subnav li.current a {
|
122
|
-
background: #fff;
|
123
|
-
font-weight:bold;
|
121
|
+
.subnav li.current a {
|
122
|
+
background: #fff;
|
123
|
+
font-weight:bold;
|
124
124
|
color:#528e00;
|
125
125
|
}
|
126
126
|
|
127
|
-
.subnav li a:active {
|
127
|
+
.subnav li a:active {
|
128
128
|
background:#8def08;
|
129
129
|
}
|
130
130
|
|
@@ -7,14 +7,17 @@ var Bowtie = {
|
|
7
7
|
toggleEditableMode: function(a){
|
8
8
|
|
9
9
|
if ($(a).hasClass('active')){
|
10
|
+
|
10
11
|
$('table td.editable').data('disabled.editable', true);
|
11
12
|
html = 'Edit Mode OFF';
|
13
|
+
|
12
14
|
} else {
|
13
|
-
|
15
|
+
|
16
|
+
if ($('table td.editable').data('disabled.editable'))
|
14
17
|
$('table td.editable').data('disabled.editable', false);
|
15
|
-
|
18
|
+
else
|
16
19
|
this.activateEditables();
|
17
|
-
|
20
|
+
|
18
21
|
html = 'Edit Mode ON';
|
19
22
|
}
|
20
23
|
|
@@ -36,15 +39,18 @@ var Bowtie = {
|
|
36
39
|
submitdata[field] = value;
|
37
40
|
|
38
41
|
$.post(current_path + '/' + id, submitdata, function(response){
|
39
|
-
|
42
|
+
|
43
|
+
if(response)
|
40
44
|
$(self).removeClass('error').html(value);
|
41
|
-
|
45
|
+
else
|
42
46
|
$(self).addClass('error').html(self.revert)
|
43
|
-
|
47
|
+
|
44
48
|
// callback.apply(self, [self.innerHTML, settings]);
|
45
49
|
self.editing = false;
|
46
50
|
});
|
51
|
+
|
47
52
|
return false;
|
53
|
+
|
48
54
|
}, {
|
49
55
|
event : "dblclick",
|
50
56
|
indicator : 'Saving...',
|
data/lib/bowtie/views/layout.erb
CHANGED
@@ -4,11 +4,6 @@
|
|
4
4
|
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
|
5
5
|
<title><%= action_name %> - <%= app_name %></title>
|
6
6
|
<link rel="stylesheet" href="<%= base_path %>/css/bowtie.css" type="text/css" media="screen" charset="utf-8" />
|
7
|
-
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
8
|
-
<script type="text/javascript" src="<%= base_path %>/js/jquery.jeditable.pack.js"></script>
|
9
|
-
<script type="text/javascript" src="<%= base_path %>/js/jquery.tablesorter.pack.js"></script>
|
10
|
-
<script type="text/javascript" src="<%= base_path %>/js/bowtie.js">
|
11
|
-
</script>
|
12
7
|
</head>
|
13
8
|
|
14
9
|
<body>
|
@@ -34,8 +29,13 @@
|
|
34
29
|
</div><!-- /container -->
|
35
30
|
|
36
31
|
<div id="footer">
|
37
|
-
<p>(c) <a href="http://
|
32
|
+
<p>(c) <a href="http://forkhq.com">Fork Ltd.</a></p>
|
38
33
|
</div><!-- /footer -->
|
39
34
|
|
35
|
+
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
|
36
|
+
<script type="text/javascript" src="<%= base_path %>/js/jquery.jeditable.pack.js"></script>
|
37
|
+
<script type="text/javascript" src="<%= base_path %>/js/jquery.tablesorter.pack.js"></script>
|
38
|
+
<script type="text/javascript" src="<%= base_path %>/js/bowtie.js"></script>
|
39
|
+
|
40
40
|
</body>
|
41
41
|
</html>
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bowtie
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 1
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 5
|
10
|
+
version: 0.5.5
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- "Tom\xC3\xA1s Pollak"
|