marty 0.5.18 → 0.5.19
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 +4 -4
- data/app/components/marty/report_form.rb +17 -4
- data/app/models/marty/tag.rb +6 -3
- data/lib/marty/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b041dfaff63f5f2a9252330f8a9899b0f1323ed
|
4
|
+
data.tar.gz: 7dcea16c26b2f970166fa238570d25237120cc29
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 19f4a3eac575745e9f84f45d2816b9a915553e335bfb132f8061e6a2d5e40828ab86b1a7f3511f39919e8f57a860a2f89565018a267be5b571f98065cbe1db56
|
7
|
+
data.tar.gz: baf2d7634667b9a634410102c6b96698bbf1d9165a0015e40f299847f9d7adde9c56f4cb2ed4d5d4c2d132ec02d1b8cc8f2823fd4fa0ebc1b2c2c4f157848ca2
|
@@ -98,13 +98,21 @@ class Marty::ReportForm < Marty::Form
|
|
98
98
|
var values = this.getForm().getValues();
|
99
99
|
var data = Ext.encode(values);
|
100
100
|
|
101
|
+
var params = {data: data, reptitle: this.reptitle};
|
102
|
+
|
103
|
+
// very hacky -- when selected_testing is set, we assume we're
|
104
|
+
// testing and try to inline the result.
|
105
|
+
if (values["selected_testing"]) {
|
106
|
+
this.repformat = "txt";
|
107
|
+
params["disposition"] = "inline";
|
108
|
+
}
|
109
|
+
|
101
110
|
var form = document.createElement("form");
|
111
|
+
|
102
112
|
form.setAttribute("method", "post");
|
103
113
|
form.setAttribute("action", "#{@@mount_path}/report."+this.repformat);
|
104
114
|
|
105
|
-
var params
|
106
|
-
|
107
|
-
for(var key in params) {
|
115
|
+
for (var key in params) {
|
108
116
|
if (params.hasOwnProperty(key)) {
|
109
117
|
var hiddenField = document.createElement("input");
|
110
118
|
hiddenField.setAttribute("type", "hidden");
|
@@ -196,7 +204,12 @@ class Marty::ReportForm < Marty::Form
|
|
196
204
|
items.empty?
|
197
205
|
|
198
206
|
# add hidden fields for selected tag/script/node
|
199
|
-
items += [:selected_tag_id,
|
207
|
+
items += [:selected_tag_id,
|
208
|
+
:selected_script_name,
|
209
|
+
:selected_node,
|
210
|
+
# just for testing
|
211
|
+
:selected_testing,
|
212
|
+
].map { |f|
|
200
213
|
{
|
201
214
|
name: f,
|
202
215
|
xtype: :textfield,
|
data/app/models/marty/tag.rb
CHANGED
@@ -36,7 +36,12 @@ class Marty::Tag < Marty::Base
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def self.map_to_tag(tag_id)
|
39
|
+
# FIXME: this is really hacky. This function should not take so
|
40
|
+
# many different types of arguments.
|
41
|
+
|
39
42
|
case tag_id
|
43
|
+
when Fixnum, /\A[0-9]+\z/
|
44
|
+
tag = find_by_id(tag_id)
|
40
45
|
when String
|
41
46
|
tag = find_by_name(tag_id)
|
42
47
|
# if tag name wasn't found, look for a matching
|
@@ -46,15 +51,13 @@ class Marty::Tag < Marty::Base
|
|
46
51
|
tag = find_match(Mcfly.normalize_infinity(posting.created_dt)) if
|
47
52
|
posting
|
48
53
|
end
|
49
|
-
when Fixnum
|
50
|
-
tag = find_by_id(tag_id)
|
51
54
|
when nil
|
52
55
|
tag = get_latest1
|
53
56
|
else
|
54
57
|
tag = tag_id
|
55
58
|
end
|
56
59
|
|
57
|
-
raise "bad tag identifier #{tag_id
|
60
|
+
raise "bad tag identifier #{tag_id.inspect}" unless tag.is_a? Marty::Tag
|
58
61
|
tag
|
59
62
|
end
|
60
63
|
|
data/lib/marty/version.rb
CHANGED