marty 2.4.7 → 2.4.8
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/Dockerfile.dummy +8 -5
- data/Gemfile.lock +1 -1
- data/README.md +8 -0
- data/app/assets/javascripts/marty/application.js +1 -0
- data/app/assets/javascripts/marty/codemirror/codemirror.js +9730 -0
- data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/delorean/delorean.js +0 -0
- data/app/assets/javascripts/marty/codemirror/mode/javascript/javascript.js +900 -0
- data/app/assets/javascripts/marty/codemirror/mode/python/python.js +399 -0
- data/app/{components/marty/script_form/client → assets/javascripts/marty/codemirror}/mode/ruby/ruby.js +135 -34
- data/app/{components/marty/script_form/client/Ext.ux.form.field.CodeMirror.js → assets/javascripts/marty/extjs/extensions/marty.js} +87 -6
- data/app/assets/stylesheets/marty/application.css +1 -13
- data/app/assets/stylesheets/marty/codemirror/codemirror.css +346 -0
- data/app/{components/marty/script_form/client → assets/stylesheets/marty/codemirror}/delorean.css +0 -0
- data/app/components/marty/auth_app/client/auth_app.js +82 -80
- data/app/components/marty/data_grid_view.rb +1 -54
- data/app/components/marty/data_grid_view/client/data_grid_view.js +49 -0
- data/app/components/marty/form.rb +1 -5
- data/app/components/marty/form/client/form.js +5 -0
- data/app/components/marty/grid.rb +1 -146
- data/app/components/marty/grid/client/grid.js +146 -0
- data/app/components/marty/import_view.rb +1 -32
- data/app/components/marty/import_view/client/import_view.js +32 -0
- data/app/components/marty/live_search_grid_panel.rb +1 -21
- data/app/components/marty/live_search_grid_panel/client/live_search_grid_panel.js +27 -0
- data/app/components/marty/main_auth_app.rb +4 -145
- data/app/components/marty/main_auth_app/client/main_auth_app.js +124 -0
- data/app/components/marty/mcfly_grid_panel.rb +1 -17
- data/app/components/marty/mcfly_grid_panel/client/mcfly_grid_panel.js +37 -0
- data/app/components/marty/new_posting_form.rb +1 -6
- data/app/components/marty/new_posting_form/client/new_posting_form.js +6 -0
- data/app/components/marty/panel.rb +1 -5
- data/app/components/marty/panel/client/panel.js +5 -0
- data/app/components/marty/posting_grid.rb +4 -55
- data/app/components/marty/posting_grid/client/posting_grid.js +50 -0
- data/app/components/marty/promise_view.rb +2 -75
- data/app/components/marty/promise_view/client/promise_view.css +12 -9
- data/app/components/marty/promise_view/client/promise_view.js +57 -0
- data/app/components/marty/report_form.rb +3 -69
- data/app/components/marty/report_form/client/report_form.js +78 -0
- data/app/components/marty/report_select.rb +1 -45
- data/app/components/marty/report_select/client/report_select.js +50 -0
- data/app/components/marty/reporting.rb +1 -8
- data/app/components/marty/reporting/client/reporting.js +8 -0
- data/app/components/marty/script_form.rb +2 -63
- data/app/components/marty/script_form/client/script_form.js +44 -0
- data/app/components/marty/script_tester.rb +1 -7
- data/app/components/marty/script_tester/client/script_tester.js +7 -0
- data/app/components/marty/scripting.rb +1 -55
- data/app/components/marty/scripting/client/scripting.js +62 -0
- data/app/components/marty/simple_app/client/simple_app.js +21 -13
- data/app/models/marty/promise.rb +22 -1
- data/app/views/layouts/marty/application.html.erb +8 -6
- data/docker-compose.dummy.yml +2 -0
- data/lib/marty/monkey.rb +0 -16
- data/lib/marty/version.rb +1 -1
- data/spec/dummy/config/initializers/assets.rb +1 -0
- data/spec/features/reporting_spec.rb +1 -0
- data/spec/features/scripting_spec.rb +4 -4
- data/spec/spec_helper.rb +1 -0
- data/spec/support/chromedriver.rb +5 -1
- data/spec/support/shared_connection_db_helpers.rb +42 -2
- metadata +29 -168
- data/app/assets/images/marty/.gitkeep +0 -0
- data/app/components/marty/mcfly_grid_panel/client/dup_in_form.js +0 -20
- data/app/components/marty/script_form/client/codemirror.css +0 -172
- data/app/components/marty/script_form/client/codemirror.js +0 -3130
- data/app/components/marty/script_form/client/mode/clike/clike.js +0 -284
- data/app/components/marty/script_form/client/mode/clike/index.html +0 -102
- data/app/components/marty/script_form/client/mode/clike/scala.html +0 -766
- data/app/components/marty/script_form/client/mode/clojure/clojure.js +0 -206
- data/app/components/marty/script_form/client/mode/clojure/index.html +0 -67
- data/app/components/marty/script_form/client/mode/coffeescript/LICENSE +0 -22
- data/app/components/marty/script_form/client/mode/coffeescript/coffeescript.js +0 -346
- data/app/components/marty/script_form/client/mode/coffeescript/index.html +0 -728
- data/app/components/marty/script_form/client/mode/commonlisp/commonlisp.js +0 -101
- data/app/components/marty/script_form/client/mode/commonlisp/index.html +0 -165
- data/app/components/marty/script_form/client/mode/css/css.js +0 -448
- data/app/components/marty/script_form/client/mode/css/index.html +0 -58
- data/app/components/marty/script_form/client/mode/css/test.js +0 -501
- data/app/components/marty/script_form/client/mode/diff/diff.js +0 -32
- data/app/components/marty/script_form/client/mode/diff/index.html +0 -105
- data/app/components/marty/script_form/client/mode/ecl/ecl.js +0 -203
- data/app/components/marty/script_form/client/mode/ecl/index.html +0 -42
- data/app/components/marty/script_form/client/mode/erlang/erlang.js +0 -463
- data/app/components/marty/script_form/client/mode/erlang/index.html +0 -63
- data/app/components/marty/script_form/client/mode/gfm/gfm.js +0 -150
- data/app/components/marty/script_form/client/mode/gfm/index.html +0 -48
- data/app/components/marty/script_form/client/mode/go/go.js +0 -170
- data/app/components/marty/script_form/client/mode/go/index.html +0 -73
- data/app/components/marty/script_form/client/mode/groovy/groovy.js +0 -210
- data/app/components/marty/script_form/client/mode/groovy/index.html +0 -72
- data/app/components/marty/script_form/client/mode/haskell/haskell.js +0 -242
- data/app/components/marty/script_form/client/mode/haskell/index.html +0 -61
- data/app/components/marty/script_form/client/mode/haxe/haxe.js +0 -429
- data/app/components/marty/script_form/client/mode/haxe/index.html +0 -91
- data/app/components/marty/script_form/client/mode/htmlembedded/htmlembedded.js +0 -72
- data/app/components/marty/script_form/client/mode/htmlembedded/index.html +0 -50
- data/app/components/marty/script_form/client/mode/htmlmixed/htmlmixed.js +0 -84
- data/app/components/marty/script_form/client/mode/htmlmixed/index.html +0 -52
- data/app/components/marty/script_form/client/mode/javascript/index.html +0 -78
- data/app/components/marty/script_form/client/mode/javascript/javascript.js +0 -361
- data/app/components/marty/script_form/client/mode/jinja2/index.html +0 -38
- data/app/components/marty/script_form/client/mode/jinja2/jinja2.js +0 -42
- data/app/components/marty/script_form/client/mode/less/index.html +0 -740
- data/app/components/marty/script_form/client/mode/less/less.js +0 -266
- data/app/components/marty/script_form/client/mode/lua/index.html +0 -73
- data/app/components/marty/script_form/client/mode/lua/lua.js +0 -140
- data/app/components/marty/script_form/client/mode/markdown/index.html +0 -343
- data/app/components/marty/script_form/client/mode/markdown/markdown.js +0 -382
- data/app/components/marty/script_form/client/mode/markdown/test.js +0 -1084
- data/app/components/marty/script_form/client/mode/mysql/index.html +0 -42
- data/app/components/marty/script_form/client/mode/mysql/mysql.js +0 -186
- data/app/components/marty/script_form/client/mode/ntriples/index.html +0 -33
- data/app/components/marty/script_form/client/mode/ntriples/ntriples.js +0 -172
- data/app/components/marty/script_form/client/mode/ocaml/index.html +0 -130
- data/app/components/marty/script_form/client/mode/ocaml/ocaml.js +0 -114
- data/app/components/marty/script_form/client/mode/pascal/LICENSE +0 -7
- data/app/components/marty/script_form/client/mode/pascal/index.html +0 -49
- data/app/components/marty/script_form/client/mode/pascal/pascal.js +0 -94
- data/app/components/marty/script_form/client/mode/perl/LICENSE +0 -19
- data/app/components/marty/script_form/client/mode/perl/index.html +0 -63
- data/app/components/marty/script_form/client/mode/perl/perl.js +0 -816
- data/app/components/marty/script_form/client/mode/php/index.html +0 -49
- data/app/components/marty/script_form/client/mode/php/php.js +0 -148
- data/app/components/marty/script_form/client/mode/pig/index.html +0 -43
- data/app/components/marty/script_form/client/mode/pig/pig.js +0 -172
- data/app/components/marty/script_form/client/mode/plsql/index.html +0 -63
- data/app/components/marty/script_form/client/mode/plsql/plsql.js +0 -217
- data/app/components/marty/script_form/client/mode/properties/index.html +0 -41
- data/app/components/marty/script_form/client/mode/properties/properties.js +0 -63
- data/app/components/marty/script_form/client/mode/python/LICENSE.txt +0 -21
- data/app/components/marty/script_form/client/mode/python/index.html +0 -123
- data/app/components/marty/script_form/client/mode/python/python.js +0 -338
- data/app/components/marty/script_form/client/mode/r/LICENSE +0 -24
- data/app/components/marty/script_form/client/mode/r/index.html +0 -74
- data/app/components/marty/script_form/client/mode/r/r.js +0 -141
- data/app/components/marty/script_form/client/mode/rpm/changes/changes.js +0 -19
- data/app/components/marty/script_form/client/mode/rpm/changes/index.html +0 -54
- data/app/components/marty/script_form/client/mode/rpm/spec/index.html +0 -100
- data/app/components/marty/script_form/client/mode/rpm/spec/spec.css +0 -5
- data/app/components/marty/script_form/client/mode/rpm/spec/spec.js +0 -66
- data/app/components/marty/script_form/client/mode/rst/index.html +0 -526
- data/app/components/marty/script_form/client/mode/rst/rst.js +0 -326
- data/app/components/marty/script_form/client/mode/ruby/LICENSE +0 -24
- data/app/components/marty/script_form/client/mode/ruby/index.html +0 -172
- data/app/components/marty/script_form/client/mode/rust/index.html +0 -49
- data/app/components/marty/script_form/client/mode/rust/rust.js +0 -432
- data/app/components/marty/script_form/client/mode/scheme/index.html +0 -65
- data/app/components/marty/script_form/client/mode/scheme/scheme.js +0 -230
- data/app/components/marty/script_form/client/mode/shell/index.html +0 -50
- data/app/components/marty/script_form/client/mode/shell/shell.js +0 -118
- data/app/components/marty/script_form/client/mode/sieve/LICENSE +0 -23
- data/app/components/marty/script_form/client/mode/sieve/index.html +0 -81
- data/app/components/marty/script_form/client/mode/sieve/sieve.js +0 -156
- data/app/components/marty/script_form/client/mode/smalltalk/index.html +0 -56
- data/app/components/marty/script_form/client/mode/smalltalk/smalltalk.js +0 -139
- data/app/components/marty/script_form/client/mode/smarty/index.html +0 -83
- data/app/components/marty/script_form/client/mode/smarty/smarty.js +0 -148
- data/app/components/marty/script_form/client/mode/sparql/index.html +0 -41
- data/app/components/marty/script_form/client/mode/sparql/sparql.js +0 -143
- data/app/components/marty/script_form/client/mode/stex/index.html +0 -98
- data/app/components/marty/script_form/client/mode/stex/stex.js +0 -182
- data/app/components/marty/script_form/client/mode/stex/test.js +0 -343
- data/app/components/marty/script_form/client/mode/tiddlywiki/index.html +0 -141
- data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.css +0 -14
- data/app/components/marty/script_form/client/mode/tiddlywiki/tiddlywiki.js +0 -384
- data/app/components/marty/script_form/client/mode/tiki/index.html +0 -83
- data/app/components/marty/script_form/client/mode/tiki/tiki.css +0 -26
- data/app/components/marty/script_form/client/mode/tiki/tiki.js +0 -309
- data/app/components/marty/script_form/client/mode/vb/LICENSE.txt +0 -21
- data/app/components/marty/script_form/client/mode/vb/index.html +0 -89
- data/app/components/marty/script_form/client/mode/vb/vb.js +0 -260
- data/app/components/marty/script_form/client/mode/vbscript/index.html +0 -43
- data/app/components/marty/script_form/client/mode/vbscript/vbscript.js +0 -26
- data/app/components/marty/script_form/client/mode/velocity/index.html +0 -104
- data/app/components/marty/script_form/client/mode/velocity/velocity.js +0 -146
- data/app/components/marty/script_form/client/mode/verilog/index.html +0 -211
- data/app/components/marty/script_form/client/mode/verilog/verilog.js +0 -194
- data/app/components/marty/script_form/client/mode/xml/index.html +0 -45
- data/app/components/marty/script_form/client/mode/xml/xml.js +0 -318
- data/app/components/marty/script_form/client/mode/xquery/LICENSE +0 -20
- data/app/components/marty/script_form/client/mode/xquery/index.html +0 -223
- data/app/components/marty/script_form/client/mode/xquery/test/index.html +0 -27
- data/app/components/marty/script_form/client/mode/xquery/test/testBase.js +0 -42
- data/app/components/marty/script_form/client/mode/xquery/test/testEmptySequenceKeyword.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testMultiAttr.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testNamespaces.js +0 -91
- data/app/components/marty/script_form/client/mode/xquery/test/testProcessingInstructions.js +0 -16
- data/app/components/marty/script_form/client/mode/xquery/test/testQuotes.js +0 -19
- data/app/components/marty/script_form/client/mode/xquery/xquery.js +0 -451
- data/app/components/marty/script_form/client/mode/yaml/index.html +0 -68
- data/app/components/marty/script_form/client/mode/yaml/yaml.js +0 -95
- data/app/components/marty/script_form/client/theme/ambiance.css +0 -81
- data/app/components/marty/script_form/client/theme/blackboard.css +0 -25
- data/app/components/marty/script_form/client/theme/cobalt.css +0 -18
- data/app/components/marty/script_form/client/theme/eclipse.css +0 -25
- data/app/components/marty/script_form/client/theme/elegant.css +0 -10
- data/app/components/marty/script_form/client/theme/erlang-dark.css +0 -21
- data/app/components/marty/script_form/client/theme/lesser-dark.css +0 -44
- data/app/components/marty/script_form/client/theme/monokai.css +0 -28
- data/app/components/marty/script_form/client/theme/neat.css +0 -9
- data/app/components/marty/script_form/client/theme/night.css +0 -21
- data/app/components/marty/script_form/client/theme/rubyblue.css +0 -21
- data/app/components/marty/script_form/client/theme/vibrant-ink.css +0 -27
- data/app/components/marty/script_form/client/theme/xq-dark.css +0 -46
- data/app/components/marty/script_form/client/util/closetag.js +0 -164
- data/app/components/marty/script_form/client/util/dialog.css +0 -27
- data/app/components/marty/script_form/client/util/dialog.js +0 -70
- data/app/components/marty/script_form/client/util/foldcode.js +0 -196
- data/app/components/marty/script_form/client/util/formatting.js +0 -193
- data/app/components/marty/script_form/client/util/javascript-hint.js +0 -134
- data/app/components/marty/script_form/client/util/loadmode.js +0 -51
- data/app/components/marty/script_form/client/util/match-highlighter.js +0 -44
- data/app/components/marty/script_form/client/util/multiplex.js +0 -77
- data/app/components/marty/script_form/client/util/overlay.js +0 -54
- data/app/components/marty/script_form/client/util/pig-hint.js +0 -123
- data/app/components/marty/script_form/client/util/runmode-standalone.js +0 -90
- data/app/components/marty/script_form/client/util/runmode.js +0 -53
- data/app/components/marty/script_form/client/util/search.js +0 -118
- data/app/components/marty/script_form/client/util/searchcursor.js +0 -119
- data/app/components/marty/script_form/client/util/simple-hint.css +0 -16
- data/app/components/marty/script_form/client/util/simple-hint.js +0 -97
- data/app/components/marty/script_form/client/util/xml-hint.js +0 -137
- data/lib/marty/javascript/grid_view_in_form.js +0 -81
|
@@ -44,23 +44,7 @@ class Marty::McflyGridPanel < Marty::Grid
|
|
|
44
44
|
end
|
|
45
45
|
|
|
46
46
|
client_class do |c|
|
|
47
|
-
c.
|
|
48
|
-
function() {
|
|
49
|
-
this.callParent();
|
|
50
|
-
|
|
51
|
-
// dup is a non standard button, so we have to explicitly manage
|
|
52
|
-
// its clickability
|
|
53
|
-
this.getSelectionModel().on('selectionchange', function(selModel) {
|
|
54
|
-
this.actions.dupInForm &&
|
|
55
|
-
this.actions.dupInForm.setDisabled(!selModel.hasSelection() ||
|
|
56
|
-
!this.permissions.create);
|
|
57
|
-
}, this);
|
|
58
|
-
}
|
|
59
|
-
JS
|
|
60
|
-
end
|
|
61
|
-
|
|
62
|
-
client_class do |c|
|
|
63
|
-
c.include :dup_in_form
|
|
47
|
+
c.include :mcfly_grid_panel
|
|
64
48
|
end
|
|
65
49
|
|
|
66
50
|
action :dup_in_form do |a|
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
{
|
|
2
|
+
initComponent: function () {
|
|
3
|
+
this.callParent();
|
|
4
|
+
|
|
5
|
+
// dup is a non standard button, so we have to explicitly manage
|
|
6
|
+
// its clickability
|
|
7
|
+
this.getSelectionModel().on('selectionchange', function (selModel) {
|
|
8
|
+
this.actions.dupInForm &&
|
|
9
|
+
this.actions.dupInForm.setDisabled(!selModel.hasSelection() ||
|
|
10
|
+
!this.permissions.create);
|
|
11
|
+
}, this);
|
|
12
|
+
},
|
|
13
|
+
// copied from basepack grid's onEditInForm
|
|
14
|
+
netzkeOnDupInForm: function () {
|
|
15
|
+
var selModel = this.getSelectionModel();
|
|
16
|
+
var recordId = selModel.getSelection()[0].getId();
|
|
17
|
+
this.netzkeLoadComponent("edit_window", {
|
|
18
|
+
title: "Duplicate in Form",
|
|
19
|
+
serverConfig: {
|
|
20
|
+
record_id: recordId
|
|
21
|
+
},
|
|
22
|
+
callback: function (w) {
|
|
23
|
+
w.show();
|
|
24
|
+
var form = w.items.first();
|
|
25
|
+
form.baseParams = {
|
|
26
|
+
dup: true
|
|
27
|
+
};
|
|
28
|
+
w.on('close', function () {
|
|
29
|
+
if (w.closeRes === "ok") {
|
|
30
|
+
this.store.load();
|
|
31
|
+
}
|
|
32
|
+
}, this);
|
|
33
|
+
},
|
|
34
|
+
scope: this
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
}
|
|
@@ -5,12 +5,7 @@ class Marty::NewPostingForm < Marty::Form
|
|
|
5
5
|
has_marty_permissions read: :any
|
|
6
6
|
|
|
7
7
|
client_class do |c|
|
|
8
|
-
c.
|
|
9
|
-
function() {
|
|
10
|
-
// assume we're embedded in a window
|
|
11
|
-
this.netzkeGetParentComponent().close();
|
|
12
|
-
}
|
|
13
|
-
JS
|
|
8
|
+
c.include :new_posting_form
|
|
14
9
|
end
|
|
15
10
|
|
|
16
11
|
action :apply do |a|
|
|
@@ -13,6 +13,10 @@ class Marty::PostingGrid < Marty::Grid
|
|
|
13
13
|
page_size: 12})
|
|
14
14
|
end
|
|
15
15
|
|
|
16
|
+
client_class do |c|
|
|
17
|
+
c.include :posting_grid
|
|
18
|
+
end
|
|
19
|
+
|
|
16
20
|
# hijacking delete button
|
|
17
21
|
action :delete do |a|
|
|
18
22
|
a.text = "Select"
|
|
@@ -21,61 +25,6 @@ class Marty::PostingGrid < Marty::Grid
|
|
|
21
25
|
a.disabled = true
|
|
22
26
|
end
|
|
23
27
|
|
|
24
|
-
client_class do |c|
|
|
25
|
-
c.init_component = l(<<-JS)
|
|
26
|
-
function() {
|
|
27
|
-
this.callParent();
|
|
28
|
-
|
|
29
|
-
this.getSelectionModel().on('selectionchange', function(selModel) {
|
|
30
|
-
this.actions.detail &&
|
|
31
|
-
this.actions.detail.setDisabled(!selModel.hasSelection());
|
|
32
|
-
}, this);
|
|
33
|
-
}
|
|
34
|
-
JS
|
|
35
|
-
|
|
36
|
-
c.detail = l(<<-JS)
|
|
37
|
-
function() {
|
|
38
|
-
record_id = this.getSelectionModel().getSelection()[0].getId();
|
|
39
|
-
this.server.detail({record_id: record_id});
|
|
40
|
-
}
|
|
41
|
-
JS
|
|
42
|
-
|
|
43
|
-
c.netzke_show_detail = l(<<-JS)
|
|
44
|
-
function(details) {
|
|
45
|
-
Ext.create('Ext.Window', {
|
|
46
|
-
height: 150,
|
|
47
|
-
minWidth: 250,
|
|
48
|
-
autoWidth: true,
|
|
49
|
-
modal: true,
|
|
50
|
-
autoScroll: true,
|
|
51
|
-
html: details,
|
|
52
|
-
title: "Posting Details"
|
|
53
|
-
}).show();
|
|
54
|
-
}
|
|
55
|
-
JS
|
|
56
|
-
|
|
57
|
-
c.netzke_on_delete = l(<<-JS)
|
|
58
|
-
function() {
|
|
59
|
-
var records = [];
|
|
60
|
-
var me = this;
|
|
61
|
-
me.getSelectionModel().selected.each(function(r) {
|
|
62
|
-
records.push(r.getId());
|
|
63
|
-
}, me);
|
|
64
|
-
|
|
65
|
-
// find the root component (main application)
|
|
66
|
-
var main_app = me;
|
|
67
|
-
while (1) {
|
|
68
|
-
var p = main_app.netzkeGetParentComponent();
|
|
69
|
-
if (!p) { break; }
|
|
70
|
-
main_app = p;
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
// assumes main_app has serverSelectPosting method
|
|
74
|
-
main_app.server.selectPosting(records);
|
|
75
|
-
}
|
|
76
|
-
JS
|
|
77
|
-
end
|
|
78
|
-
|
|
79
28
|
def default_bbar
|
|
80
29
|
[:delete, :detail]
|
|
81
30
|
end
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
{
|
|
2
|
+
initComponent: function () {
|
|
3
|
+
this.callParent();
|
|
4
|
+
|
|
5
|
+
this.getSelectionModel().on('selectionchange', function (selModel) {
|
|
6
|
+
this.actions.detail &&
|
|
7
|
+
this.actions.detail.setDisabled(!selModel.hasSelection());
|
|
8
|
+
}, this);
|
|
9
|
+
},
|
|
10
|
+
|
|
11
|
+
detail: function () {
|
|
12
|
+
record_id = this.getSelectionModel().getSelection()[0].getId();
|
|
13
|
+
this.server.detail({
|
|
14
|
+
record_id: record_id
|
|
15
|
+
});
|
|
16
|
+
},
|
|
17
|
+
|
|
18
|
+
netzkeShowDetail: function (details) {
|
|
19
|
+
Ext.create('Ext.Window', {
|
|
20
|
+
height: 150,
|
|
21
|
+
minWidth: 250,
|
|
22
|
+
autoWidth: true,
|
|
23
|
+
modal: true,
|
|
24
|
+
autoScroll: true,
|
|
25
|
+
html: details,
|
|
26
|
+
title: "Posting Details"
|
|
27
|
+
}).show();
|
|
28
|
+
},
|
|
29
|
+
|
|
30
|
+
netzkeOnDelete: function () {
|
|
31
|
+
var records = [];
|
|
32
|
+
var me = this;
|
|
33
|
+
me.getSelectionModel().selected.each(function (r) {
|
|
34
|
+
records.push(r.getId());
|
|
35
|
+
}, me);
|
|
36
|
+
|
|
37
|
+
// find the root component (main application)
|
|
38
|
+
var main_app = me;
|
|
39
|
+
while (1) {
|
|
40
|
+
var p = main_app.netzkeGetParentComponent();
|
|
41
|
+
if (!p) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
main_app = p;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
// assumes main_app has serverSelectPosting method
|
|
48
|
+
main_app.server.selectPosting(records);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -5,38 +5,8 @@ class Marty::PromiseView < Netzke::Tree::Base
|
|
|
5
5
|
config.require :promise_view
|
|
6
6
|
end
|
|
7
7
|
|
|
8
|
-
client_class do |
|
|
9
|
-
|
|
10
|
-
function(record, index, rowParams, ds) {
|
|
11
|
-
var status = record.get('status');
|
|
12
|
-
if (status === false) return "red-row";
|
|
13
|
-
if (status === true) return "green-row";
|
|
14
|
-
return "orange-row";
|
|
15
|
-
}
|
|
16
|
-
JS
|
|
17
|
-
|
|
18
|
-
config.listen_fn = l(<<-JS)
|
|
19
|
-
function(obj, search_text) {
|
|
20
|
-
var lg = this.ownerCt.ownerCt;
|
|
21
|
-
lg.getStore().getProxy().extraParams.live_search = search_text;
|
|
22
|
-
lg.getStore().load();
|
|
23
|
-
}
|
|
24
|
-
JS
|
|
25
|
-
|
|
26
|
-
# Live search box -- direct copy from Marty::LiveSearchGridPanel
|
|
27
|
-
config.tbar = ['->', {
|
|
28
|
-
name: 'live_search_text',
|
|
29
|
-
xtype: 'textfield',
|
|
30
|
-
enable_key_events: true,
|
|
31
|
-
ref: '../live_search_field',
|
|
32
|
-
empty_text: 'Search',
|
|
33
|
-
listeners: {
|
|
34
|
-
change: {
|
|
35
|
-
fn: config.listen_fn,
|
|
36
|
-
buffer: 500,
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
}]
|
|
8
|
+
client_class do |c|
|
|
9
|
+
c.include :promise_view
|
|
40
10
|
end
|
|
41
11
|
|
|
42
12
|
def configure(config)
|
|
@@ -69,49 +39,6 @@ class Marty::PromiseView < Netzke::Tree::Base
|
|
|
69
39
|
[:clear, '->', :refresh, :download]
|
|
70
40
|
end
|
|
71
41
|
|
|
72
|
-
client_class do |config|
|
|
73
|
-
config.init_component = l(<<-JS)
|
|
74
|
-
function() {
|
|
75
|
-
this.callParent();
|
|
76
|
-
this.getSelectionModel().on('selectionchange', function(selModel) {
|
|
77
|
-
this.actions.download &&
|
|
78
|
-
this.actions.download.setDisabled(!selModel.hasSelection());
|
|
79
|
-
}, this);
|
|
80
|
-
this.getView().getRowClass = this.defaultGetRowClass;
|
|
81
|
-
}
|
|
82
|
-
JS
|
|
83
|
-
|
|
84
|
-
config.netzke_on_download = l(<<-JS)
|
|
85
|
-
function() {
|
|
86
|
-
var jid = this.getSelectionModel().getSelection()[0].getId();
|
|
87
|
-
// FIXME: seems pretty hacky
|
|
88
|
-
window.location = "#{Marty::Util.marty_path}/job/download?job_id=" + jid;
|
|
89
|
-
}
|
|
90
|
-
JS
|
|
91
|
-
|
|
92
|
-
config.netzke_on_refresh = l(<<-JS)
|
|
93
|
-
function() {
|
|
94
|
-
this.store.load();
|
|
95
|
-
}
|
|
96
|
-
JS
|
|
97
|
-
|
|
98
|
-
config.netzke_on_clear = l(<<-JS)
|
|
99
|
-
function(params) {
|
|
100
|
-
var me = this;
|
|
101
|
-
Ext.Msg.show({
|
|
102
|
-
title: 'Clear All Jobs',
|
|
103
|
-
msg: 'Enter CLEAR and press OK to clear all previous jobs',
|
|
104
|
-
width: 375,
|
|
105
|
-
buttons: Ext.Msg.OKCANCEL,
|
|
106
|
-
prompt: true,
|
|
107
|
-
fn: function (btn, value) {
|
|
108
|
-
(btn == "ok" && value == "CLEAR") && me.server.clear({});
|
|
109
|
-
}
|
|
110
|
-
});
|
|
111
|
-
}
|
|
112
|
-
JS
|
|
113
|
-
end
|
|
114
|
-
|
|
115
42
|
action :clear do |a|
|
|
116
43
|
a.text = a.tooltip = 'Clear'
|
|
117
44
|
a.disabled = false
|
|
@@ -1,26 +1,29 @@
|
|
|
1
1
|
.green-row {
|
|
2
|
-
|
|
2
|
+
background-color: #91FF91;
|
|
3
3
|
}
|
|
4
4
|
|
|
5
5
|
.red-row {
|
|
6
|
-
|
|
6
|
+
background-color: #FF4545;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
.orange-row {
|
|
10
|
-
|
|
10
|
+
background-color: #FF9D5C;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
.x-grid-item-selected .green-row {
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
background-color: #549454;
|
|
15
|
+
/* V: 58 */
|
|
16
|
+
font-weight: bold;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
.x-grid-item-selected .red-row {
|
|
19
|
-
|
|
20
|
-
|
|
20
|
+
background-color: #bd3333;
|
|
21
|
+
/* V: 74 */
|
|
22
|
+
font-weight: bold;
|
|
21
23
|
}
|
|
22
24
|
|
|
23
25
|
.x-grid-item-selected .orange-row {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
background-color: #b87243;
|
|
27
|
+
/* V: 74 */
|
|
28
|
+
font-weight: bold;
|
|
26
29
|
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
initComponent: function () {
|
|
3
|
+
var me = this;
|
|
4
|
+
me.tbar = ['->',
|
|
5
|
+
{
|
|
6
|
+
name: 'live_search_text',
|
|
7
|
+
xtype: 'textfield',
|
|
8
|
+
enable_key_events: true,
|
|
9
|
+
ref: '../live_search_field',
|
|
10
|
+
empty_text: 'Search',
|
|
11
|
+
listeners: {
|
|
12
|
+
change: {
|
|
13
|
+
fn: me.listenFn,
|
|
14
|
+
buffer: 500,
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
]
|
|
19
|
+
this.callParent();
|
|
20
|
+
this.getSelectionModel().on('selectionchange', function (selModel) {
|
|
21
|
+
this.actions.download && this.actions.download.setDisabled(!selModel.hasSelection());
|
|
22
|
+
}, this);
|
|
23
|
+
this.getView().getRowClass = this.defaultGetRowClass;
|
|
24
|
+
},
|
|
25
|
+
defaultGetRowClass: function (record, index, rowParams, ds) {
|
|
26
|
+
var status = record.get('status');
|
|
27
|
+
if (status === false) return "red-row";
|
|
28
|
+
if (status === true) return "green-row";
|
|
29
|
+
return "orange-row";
|
|
30
|
+
},
|
|
31
|
+
listenFn: function (obj, search_text) {
|
|
32
|
+
var lg = this.ownerCt.ownerCt;
|
|
33
|
+
lg.getStore().getProxy().extraParams.live_search = search_text;
|
|
34
|
+
lg.getStore().load();
|
|
35
|
+
},
|
|
36
|
+
netzkeOnDownload: function () {
|
|
37
|
+
var jid = this.getSelectionModel().getSelection()[0].getId();
|
|
38
|
+
// FIXME: seems pretty hacky
|
|
39
|
+
window.location = "#{Marty::Util.marty_path}/job/download?job_id=" + jid;
|
|
40
|
+
},
|
|
41
|
+
netzkeOnRefresh: function () {
|
|
42
|
+
this.store.load();
|
|
43
|
+
},
|
|
44
|
+
netzkeOnClear: function (params) {
|
|
45
|
+
var me = this;
|
|
46
|
+
Ext.Msg.show({
|
|
47
|
+
title: 'Clear All Jobs',
|
|
48
|
+
msg: 'Enter CLEAR and press OK to clear all previous jobs',
|
|
49
|
+
width: 375,
|
|
50
|
+
buttons: Ext.Msg.OKCANCEL,
|
|
51
|
+
prompt: true,
|
|
52
|
+
fn: function (btn, value) {
|
|
53
|
+
(btn == "ok" && value == "CLEAR") && me.server.clear({});
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -98,79 +98,13 @@ class Marty::ReportForm < Marty::Form
|
|
|
98
98
|
|r| r.app.app == Marty::Engine
|
|
99
99
|
}.format({})
|
|
100
100
|
|
|
101
|
-
c.
|
|
101
|
+
c.mount_path = l(<<-JS)
|
|
102
102
|
function() {
|
|
103
|
-
|
|
104
|
-
var data = Ext.encode(values);
|
|
105
|
-
|
|
106
|
-
var params = {data: data, reptitle: this.reptitle};
|
|
107
|
-
|
|
108
|
-
// very hacky -- when selected_testing is set, we assume we're
|
|
109
|
-
// testing and try to inline the result.
|
|
110
|
-
if (values["selected_testing"]) {
|
|
111
|
-
this.repformat = "txt";
|
|
112
|
-
params["disposition"] = "inline";
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
var form = document.createElement("form");
|
|
116
|
-
|
|
117
|
-
form.setAttribute("method", "post");
|
|
118
|
-
form.setAttribute("action", "#{@@mount_path}/report."+this.repformat);
|
|
119
|
-
|
|
120
|
-
// set authenticity token
|
|
121
|
-
var hiddenField = document.createElement("input");
|
|
122
|
-
hiddenField.setAttribute("type", "hidden");
|
|
123
|
-
hiddenField.setAttribute("name", "authenticity_token");
|
|
124
|
-
hiddenField.setAttribute("value", this.authenticityToken);
|
|
125
|
-
form.appendChild(hiddenField);
|
|
126
|
-
|
|
127
|
-
for (var key in params) {
|
|
128
|
-
if (params.hasOwnProperty(key)) {
|
|
129
|
-
var hiddenField = document.createElement("input");
|
|
130
|
-
hiddenField.setAttribute("type", "hidden");
|
|
131
|
-
hiddenField.setAttribute("name", key);
|
|
132
|
-
hiddenField.setAttribute("value", params[key]);
|
|
133
|
-
|
|
134
|
-
form.appendChild(hiddenField);
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
document.body.appendChild(form);
|
|
139
|
-
form.submit();
|
|
140
|
-
document.body.removeChild(form);
|
|
103
|
+
return "#{@@mount_path}"
|
|
141
104
|
}
|
|
142
105
|
JS
|
|
143
106
|
|
|
144
|
-
c.
|
|
145
|
-
function() {
|
|
146
|
-
var values = this.getForm().getValues();
|
|
147
|
-
|
|
148
|
-
// check for early url generation and exit with error message
|
|
149
|
-
if (values['selected_script_name'] == null) {
|
|
150
|
-
alert("Please select a report before generating url.");
|
|
151
|
-
return;
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
params = {
|
|
155
|
-
"format": this.repformat,
|
|
156
|
-
"reptitle": this.reptitle
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
for (var key in values) {if (values[key] == "") {delete values[key]}}
|
|
160
|
-
data = Ext.encode(values)
|
|
161
|
-
|
|
162
|
-
// construct url
|
|
163
|
-
var proto_host = location.protocol + '//' + location.host
|
|
164
|
-
var url = proto_host + '/report?data=' + data
|
|
165
|
-
for (var key in params) {
|
|
166
|
-
if (params[key] == "") continue;
|
|
167
|
-
url += '&' + key + '=' + params[key];
|
|
168
|
-
}
|
|
169
|
-
url = encodeURI(url)
|
|
170
|
-
var win = window.open('');
|
|
171
|
-
win.document.write(url.link(url));
|
|
172
|
-
}
|
|
173
|
-
JS
|
|
107
|
+
c.include :report_form
|
|
174
108
|
end
|
|
175
109
|
|
|
176
110
|
endpoint :netzke_load do |params|
|