marty 0.5.41 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile +3 -2
- data/app/components/marty/api_auth_view.rb +5 -8
- data/app/components/marty/auth_app.rb +8 -9
- data/app/components/marty/auth_app/{javascripts → client}/auth_app.js +4 -4
- data/app/components/marty/config_view.rb +7 -9
- data/app/components/marty/extras/misc.rb +14 -1
- data/app/components/marty/form.rb +1 -1
- data/app/components/marty/grid.rb +27 -14
- data/app/components/marty/grid_append_only.rb +3 -5
- data/app/components/marty/import_type_view.rb +8 -11
- data/app/components/marty/live_search_grid_panel.rb +3 -3
- data/app/components/marty/main_auth_app.rb +17 -19
- data/app/components/marty/mcfly_grid_panel.rb +13 -15
- data/app/components/marty/new_posting_form.rb +5 -5
- data/app/components/marty/new_posting_window.rb +1 -1
- data/app/components/marty/panel.rb +2 -2
- data/app/components/marty/posting_grid.rb +19 -28
- data/app/components/marty/posting_window.rb +6 -7
- data/app/components/marty/promise_view.rb +23 -24
- data/app/components/marty/promise_view/{stylesheets → client}/promise_view.css +0 -0
- data/app/components/marty/report_form.rb +11 -10
- data/app/components/marty/report_select.rb +17 -15
- data/app/components/marty/reporting.rb +2 -2
- data/app/components/marty/script_form.rb +34 -38
- data/app/components/marty/script_form/{javascripts → client}/Ext.ux.form.field.CodeMirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/codemirror.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/codemirror.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/delorean.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/clike.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clike/scala.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/clojure.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/clojure/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/coffeescript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/coffeescript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/commonlisp.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/commonlisp/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/css.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/css/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/delorean/delorean.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/diff.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/diff/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/ecl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ecl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/erlang.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/erlang/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/gfm.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/gfm/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/go.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/go/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/groovy.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/groovy/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/haskell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haskell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/haxe.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/haxe/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/htmlembedded.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlembedded/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/htmlmixed.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/htmlmixed/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/javascript/javascript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/jinja2/jinja2.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/less/less.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/lua/lua.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/markdown.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/markdown/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/mysql/mysql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ntriples/ntriples.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ocaml/ocaml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pascal/pascal.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/perl/perl.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/php/php.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/pig/pig.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/plsql/plsql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/properties/properties.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/python/python.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/r/r.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/changes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/changes/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rpm/spec/spec.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rst/rst.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/ruby/ruby.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/rust/rust.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/scheme/scheme.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/shell/shell.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sieve/sieve.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smalltalk/smalltalk.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/smarty/smarty.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/sparql/sparql.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/stex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/stex/test.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiddlywiki/tiddlywiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/tiki/tiki.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/LICENSE.txt +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vb/vb.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/vbscript/vbscript.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/velocity/velocity.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/verilog/verilog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xml/xml.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/LICENSE +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testBase.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testEmptySequenceKeyword.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testMultiAttr.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testNamespaces.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testProcessingInstructions.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/test/testQuotes.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/xquery/xquery.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/index.html +0 -0
- data/app/components/marty/script_form/{javascripts → client}/mode/yaml/yaml.js +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/ambiance.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/blackboard.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/cobalt.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/eclipse.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/elegant.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/erlang-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/lesser-dark.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/monokai.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/neat.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/night.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/rubyblue.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/vibrant-ink.css +0 -0
- data/app/components/marty/script_form/{stylesheets → client}/theme/xq-dark.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/closetag.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/dialog.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/foldcode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/formatting.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/javascript-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/loadmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/match-highlighter.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/multiplex.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/overlay.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/pig-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode-standalone.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/runmode.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/search.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/searchcursor.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.css +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/simple-hint.js +0 -0
- data/app/components/marty/script_form/{javascripts → client}/util/xml-hint.js +0 -0
- data/app/components/marty/script_grid.rb +24 -32
- data/app/components/marty/script_tester.rb +11 -11
- data/app/components/marty/scripting.rb +12 -12
- data/app/components/marty/simple_app.rb +2 -2
- data/app/components/marty/simple_app/{javascripts → client}/simple_app.js +0 -0
- data/app/components/marty/simple_app/{javascripts → client}/statusbar_ext.js +0 -0
- data/app/components/marty/tag_grid.rb +15 -21
- data/app/components/marty/user_view.rb +41 -57
- data/lib/marty/monkey.rb +1 -1
- data/lib/marty/version.rb +1 -1
- data/marty.gemspec +3 -2
- data/spec/dummy/app/assets/{stylesheets → client}/application.css +0 -0
- data/spec/dummy/app/assets/client/application.js +15 -0
- data/spec/features/scripting_spec.rb +17 -0
- data/spec/features/user_view_spec.rb +15 -15
- data/spec/spec_helper.rb +9 -0
- metadata +189 -174
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f0f6b19ce2c15e5918e27386f89e6bf83bc3738
|
4
|
+
data.tar.gz: 3da45154c7ad5476a9748af3b11ac158bbdf12d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44bd77724a580c2bd0ea7cbf22db382135dfe8bd4f853a9ca9c5299edfd25daa2f1a79421f4b85accd8364711a4183ccaa844a6c99be710d14b28f5a2cc16a60
|
7
|
+
data.tar.gz: 28623145da5a246f826bd5879e2b1c5dab4a39fb73af9e45ce65e48c448dadb8bdb97746b1aacfac38672ef4ef0ef6c98a755238ef3c438730b3dbdb3745afea
|
data/Gemfile
CHANGED
@@ -18,10 +18,11 @@ group :development, :test do
|
|
18
18
|
gem 'selenium-webdriver'
|
19
19
|
gem 'timecop'
|
20
20
|
gem 'database_cleaner'
|
21
|
+
|
21
22
|
gem 'netzke-core'
|
22
23
|
gem 'netzke-basepack'
|
23
|
-
gem 'netzke-testing'
|
24
|
+
gem 'netzke-testing'
|
24
25
|
|
25
|
-
#gem 'marty_rspec', path: File.expand_path('../../marty_rspec', __FILE__)
|
26
26
|
gem 'marty_rspec'
|
27
|
+
|
27
28
|
end
|
@@ -9,22 +9,19 @@ class Marty::ApiAuthView < Marty::McflyGridPanel
|
|
9
9
|
|
10
10
|
c.title = I18n.t('api_auth', default: "API Authorization")
|
11
11
|
c.model = "Marty::ApiAuth"
|
12
|
-
c.
|
13
|
-
|
14
|
-
c.enable_extended_search = false
|
15
|
-
|
16
|
-
c.data_store.sorters = {property: :app_name, direction: 'ASC'}
|
12
|
+
c.attributes = [:app_name, :api_key, :script_name]
|
13
|
+
c.store_config.merge!({sorters: [{property: :app_name, direction: 'ASC'}]})
|
17
14
|
end
|
18
15
|
|
19
|
-
|
16
|
+
attribute :app_name do |c|
|
20
17
|
c.flex = 1
|
21
18
|
end
|
22
19
|
|
23
|
-
|
20
|
+
attribute :api_key do |c|
|
24
21
|
c.flex = 1
|
25
22
|
end
|
26
23
|
|
27
|
-
|
24
|
+
attribute :script_name do |c|
|
28
25
|
c.flex = 1
|
29
26
|
end
|
30
27
|
end
|
@@ -3,8 +3,8 @@
|
|
3
3
|
# == Extending Marty::AuthApp
|
4
4
|
# DOCFIX
|
5
5
|
class Marty::AuthApp < Marty::SimpleApp
|
6
|
-
|
7
|
-
c.
|
6
|
+
client_class do |c|
|
7
|
+
c.include :auth_app
|
8
8
|
end
|
9
9
|
|
10
10
|
# Set the Logout button if current_user is set
|
@@ -37,20 +37,19 @@ class Marty::AuthApp < Marty::SimpleApp
|
|
37
37
|
c.text = "Sign out #{Mcfly.whodunnit.name}" if Mcfly.whodunnit
|
38
38
|
end
|
39
39
|
|
40
|
-
endpoint :sign_in do |params
|
40
|
+
endpoint :sign_in do |params|
|
41
41
|
user = Marty::User.try_to_login(params[:login], params[:password])
|
42
|
-
|
43
42
|
if user
|
44
43
|
Netzke::Base.controller.set_user(user)
|
45
|
-
|
44
|
+
client.netzke_set_result(true)
|
46
45
|
else
|
47
|
-
|
48
|
-
|
46
|
+
client.netzke_set_result(false)
|
47
|
+
client.netzke_notify("Wrong credentials")
|
49
48
|
end
|
50
49
|
end
|
51
50
|
|
52
|
-
endpoint :sign_out do
|
51
|
+
endpoint :sign_out do
|
53
52
|
Netzke::Base.controller.logout_user
|
54
|
-
|
53
|
+
client.netzke_set_result(true)
|
55
54
|
end
|
56
55
|
end
|
@@ -1,5 +1,5 @@
|
|
1
1
|
{
|
2
|
-
|
2
|
+
netzkeOnSignIn: function() {
|
3
3
|
var me = this;
|
4
4
|
this.signinWin = this.signinWin || Ext.create('Ext.Window', {
|
5
5
|
width: 300,
|
@@ -12,7 +12,7 @@
|
|
12
12
|
var values = form.getForm().getValues();
|
13
13
|
|
14
14
|
// calling the endpoint
|
15
|
-
me.signIn(values, function(res) {
|
15
|
+
me.server.signIn(values, function(res) {
|
16
16
|
if (res) {
|
17
17
|
if (!me.authSpecMode) { this.signinWin.close(); }
|
18
18
|
Ext.Msg.show({
|
@@ -75,8 +75,8 @@
|
|
75
75
|
this.signinWin.down('textfield').focus(false, 100);
|
76
76
|
},
|
77
77
|
|
78
|
-
|
79
|
-
this.signOut(null, function(success) {
|
78
|
+
netzkeOnSignOut: function() {
|
79
|
+
this.server.signOut(null, function(success) {
|
80
80
|
if (success) {
|
81
81
|
Ext.Msg.show({
|
82
82
|
title: "Signed out",
|
@@ -12,10 +12,9 @@ class Marty::ConfigView < Marty::Grid
|
|
12
12
|
|
13
13
|
c.title = I18n.t('config', default: "Config")
|
14
14
|
c.model = "Marty::Config"
|
15
|
-
c.
|
16
|
-
|
17
|
-
c.
|
18
|
-
c.data_store.sorters = {property: :key, direction: 'ASC'}
|
15
|
+
c.attributes = [:key, :value, :description]
|
16
|
+
c.store_config.merge!({sorters: [{property: :key, direction: 'ASC'}]})
|
17
|
+
c.editing = :both
|
19
18
|
end
|
20
19
|
|
21
20
|
# need a getter / setter to call the []= and [] methods now
|
@@ -31,7 +30,7 @@ class Marty::ConfigView < Marty::Grid
|
|
31
30
|
}
|
32
31
|
end
|
33
32
|
|
34
|
-
def
|
33
|
+
def default_form_items
|
35
34
|
[
|
36
35
|
:key,
|
37
36
|
{
|
@@ -53,18 +52,17 @@ class Marty::ConfigView < Marty::Grid
|
|
53
52
|
]
|
54
53
|
end
|
55
54
|
|
56
|
-
|
55
|
+
attribute :key do |c|
|
57
56
|
c.flex = 1
|
58
57
|
end
|
59
58
|
|
60
|
-
|
59
|
+
attribute :value do |c|
|
61
60
|
c.flex = 3
|
62
61
|
c.getter = my_jsonb_getter
|
63
62
|
c.setter = my_jsonb_setter
|
64
63
|
end
|
65
|
-
|
64
|
+
attribute :description do |c|
|
66
65
|
c.flex = 1
|
67
|
-
c.width = 200
|
68
66
|
end
|
69
67
|
|
70
68
|
end
|
@@ -1,6 +1,6 @@
|
|
1
1
|
module Marty::Extras::Misc
|
2
2
|
MM_OPTIONS = {
|
3
|
-
|
3
|
+
editor_config: {
|
4
4
|
trigger_action: :all,
|
5
5
|
xtype: :combo,
|
6
6
|
store: (1..12).map {|x| [x, "%02d" % x]},
|
@@ -15,4 +15,17 @@ module Marty::Extras::Misc
|
|
15
15
|
# didn't work.
|
16
16
|
default_value: Date.today.month
|
17
17
|
}
|
18
|
+
def self.numberfield_cfg(decimal_places)
|
19
|
+
{
|
20
|
+
format: "0." + "0"*decimal_places,
|
21
|
+
xtype: 'numbercolumn',
|
22
|
+
editor_config: { hide_trigger: true,
|
23
|
+
decimal_precision: decimal_places },
|
24
|
+
field_config: { decimal_precision: decimal_places,
|
25
|
+
xtype: :numberfield,
|
26
|
+
hide_trigger: true,
|
27
|
+
key_nav_enabled: false,
|
28
|
+
mouse_wheel_enabled: false }
|
29
|
+
}
|
30
|
+
end
|
18
31
|
end
|
@@ -1,9 +1,10 @@
|
|
1
|
-
class Marty::Grid < ::Netzke::
|
1
|
+
class Marty::Grid < ::Netzke::Grid::Base
|
2
|
+
|
2
3
|
extend ::Marty::Permissions
|
3
4
|
|
4
5
|
has_marty_permissions read: :any
|
5
6
|
|
6
|
-
def
|
7
|
+
def configure_form_window(c)
|
7
8
|
super
|
8
9
|
# Fix Add in form/Edit in form modal popup width
|
9
10
|
# Netzke 0.10.1 defaults width to 80% of screen which is too wide
|
@@ -12,30 +13,42 @@ class Marty::Grid < ::Netzke::Basepack::Grid
|
|
12
13
|
c.width = 475
|
13
14
|
end
|
14
15
|
|
15
|
-
|
16
|
+
client_class do |c|
|
16
17
|
# For some reason the grid update function was removed in Netzke
|
17
18
|
# 0.10.1. So, add it here.
|
18
|
-
c.cm_update = <<-JS
|
19
|
+
c.cm_update = l(<<-JS)
|
19
20
|
function() {
|
20
21
|
this.store.load();
|
21
22
|
}
|
22
23
|
JS
|
24
|
+
|
25
|
+
end
|
26
|
+
|
27
|
+
def class_can?(op)
|
28
|
+
self.class.can_perform_action?(op)
|
23
29
|
end
|
24
30
|
|
25
31
|
def configure(c)
|
26
32
|
super
|
27
33
|
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
34
|
+
c.permissions = {
|
35
|
+
create: class_can?(:create),
|
36
|
+
read: class_can?(:read),
|
37
|
+
update: class_can?(:update),
|
38
|
+
delete: class_can?(:delete)
|
39
|
+
}
|
40
|
+
c.editing = :both
|
41
|
+
c.store_config = {page_size: 30}
|
42
|
+
end
|
32
43
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
c.prohibit_delete = !delete
|
44
|
+
def has_search_action?
|
45
|
+
false
|
46
|
+
end
|
37
47
|
|
38
|
-
|
39
|
-
|
48
|
+
def get_json_sorter(json_col, field)
|
49
|
+
lambda do |r, dir|
|
50
|
+
r.order("#{json_col} ->> '#{field}' " + dir.to_s)
|
51
|
+
end
|
40
52
|
end
|
53
|
+
|
41
54
|
end
|
@@ -2,11 +2,9 @@ class Marty::GridAppendOnly < Marty::McflyGridPanel
|
|
2
2
|
def configure(c)
|
3
3
|
super
|
4
4
|
|
5
|
-
c.
|
6
|
-
c.
|
5
|
+
c.paging = :pagination
|
6
|
+
c.editing = :in_form
|
7
|
+
c.permissions[:update] = false
|
7
8
|
end
|
8
9
|
|
9
|
-
def default_bbar
|
10
|
-
[:del, :add_in_form]
|
11
|
-
end
|
12
10
|
end
|
@@ -10,7 +10,7 @@ class Marty::ImportTypeView < Marty::Grid
|
|
10
10
|
|
11
11
|
c.title = I18n.t('import_type', default: "ImportType")
|
12
12
|
c.model = "Marty::ImportType"
|
13
|
-
c.
|
13
|
+
c.attributes =
|
14
14
|
[
|
15
15
|
:name,
|
16
16
|
:role__name,
|
@@ -19,33 +19,30 @@ class Marty::ImportTypeView < Marty::Grid
|
|
19
19
|
:validation_function,
|
20
20
|
:preprocess_function,
|
21
21
|
]
|
22
|
-
|
23
|
-
c.enable_extended_search = false
|
24
|
-
|
25
|
-
c.data_store.sorters = {property: :name, direction: 'ASC'}
|
22
|
+
c.store_config.merge!({sorters: [{property: :name, direction: 'ASC'}]})
|
26
23
|
end
|
27
24
|
|
28
|
-
|
25
|
+
attribute :name do |c|
|
29
26
|
c.flex = 1
|
30
27
|
end
|
31
28
|
|
32
|
-
|
29
|
+
attribute :role__name do |c|
|
33
30
|
c.width = 150
|
34
31
|
end
|
35
32
|
|
36
|
-
|
33
|
+
attribute :db_model_name do |c|
|
37
34
|
c.flex = 1
|
38
35
|
end
|
39
36
|
|
40
|
-
|
37
|
+
attribute :cleaner_function do |c|
|
41
38
|
c.flex = 1
|
42
39
|
end
|
43
40
|
|
44
|
-
|
41
|
+
attribute :validation_function do |c|
|
45
42
|
c.flex = 1
|
46
43
|
end
|
47
44
|
|
48
|
-
|
45
|
+
attribute :preprocess_function do |c|
|
49
46
|
c.flex = 1
|
50
47
|
end
|
51
48
|
end
|
@@ -13,8 +13,8 @@
|
|
13
13
|
#
|
14
14
|
|
15
15
|
class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
|
16
|
-
|
17
|
-
c.listen_fn = <<-JS
|
16
|
+
client_class do |c|
|
17
|
+
c.listen_fn = l(<<-JS)
|
18
18
|
function(obj, search_text) {
|
19
19
|
var lg = this.ownerCt.ownerCt;
|
20
20
|
lg.getStore().getProxy().extraParams.live_search = search_text;
|
@@ -39,7 +39,7 @@ class Marty::LiveSearchGridPanel < Marty::McflyGridPanel
|
|
39
39
|
|
40
40
|
def get_records(params)
|
41
41
|
search_scope = config[:live_search_scope] || :live_search
|
42
|
-
|
42
|
+
model.send(search_scope, params && params[:live_search] || '').scoping do
|
43
43
|
super
|
44
44
|
end
|
45
45
|
end
|
@@ -183,38 +183,36 @@ class Marty::MainAuthApp < Marty::AuthApp
|
|
183
183
|
a.disabled = Marty::Util.warped? || !self.class.has_posting_perm?
|
184
184
|
end
|
185
185
|
|
186
|
-
|
187
|
-
c.
|
186
|
+
client_class do |c|
|
187
|
+
c.netzke_on_new_posting = l(<<-JS)
|
188
188
|
function(params) {
|
189
|
-
this.netzkeLoadComponent(
|
190
|
-
|
191
|
-
callback: function(w) { w.show(); },
|
189
|
+
this.netzkeLoadComponent("new_posting_window",
|
190
|
+
{ callback: function(w) { w.show(); },
|
192
191
|
});
|
193
192
|
}
|
194
193
|
JS
|
195
194
|
|
196
|
-
c.
|
195
|
+
c.netzke_on_select_posting = l(<<-JS)
|
197
196
|
function(params) {
|
198
|
-
this.netzkeLoadComponent(
|
199
|
-
|
200
|
-
callback: function(w) { w.show(); },
|
197
|
+
this.netzkeLoadComponent("posting_window",
|
198
|
+
{ callback: function(w) { w.show(); },
|
201
199
|
});
|
202
200
|
}
|
203
201
|
JS
|
204
202
|
|
205
|
-
c.
|
203
|
+
c.netzke_on_reload = l(<<-JS)
|
206
204
|
function(params) {
|
207
205
|
window.location.reload();
|
208
206
|
}
|
209
207
|
JS
|
210
208
|
|
211
|
-
c.
|
209
|
+
c.netzke_on_select_now = l(<<-JS)
|
212
210
|
function(params) {
|
213
|
-
this.
|
211
|
+
this.server.selectPosting({});
|
214
212
|
}
|
215
213
|
JS
|
216
214
|
|
217
|
-
c.
|
215
|
+
c.netzke_on_reload_scripts = l(<<-JS)
|
218
216
|
function(params) {
|
219
217
|
var me = this;
|
220
218
|
Ext.Msg.show({
|
@@ -224,7 +222,7 @@ class Marty::MainAuthApp < Marty::AuthApp
|
|
224
222
|
buttons: Ext.Msg.OKCANCEL,
|
225
223
|
prompt: true,
|
226
224
|
fn: function (btn, value) {
|
227
|
-
btn == "ok" && value == "RELOAD" && me.
|
225
|
+
btn == "ok" && value == "RELOAD" && me.server.reloadScripts({});
|
228
226
|
}
|
229
227
|
});
|
230
228
|
}
|
@@ -237,13 +235,13 @@ class Marty::MainAuthApp < Marty::AuthApp
|
|
237
235
|
a.icon = :timeline_marker
|
238
236
|
end
|
239
237
|
|
240
|
-
endpoint :
|
238
|
+
endpoint :select_posting do |params|
|
241
239
|
sid = params && params[0]
|
242
240
|
Marty::Util.set_posting_id(sid)
|
243
241
|
posting = sid && Marty::Posting.find(sid)
|
244
242
|
|
245
|
-
|
246
|
-
|
243
|
+
client.netzke_notify "Selected '#{posting ? posting.name : 'NOW'}'"
|
244
|
+
client.netzke_on_reload 1
|
247
245
|
end
|
248
246
|
|
249
247
|
action :select_now do |a|
|
@@ -270,9 +268,9 @@ class Marty::MainAuthApp < Marty::AuthApp
|
|
270
268
|
c.disabled = Marty::Util.warped?
|
271
269
|
end
|
272
270
|
|
273
|
-
endpoint :
|
271
|
+
endpoint :reload_scripts do |params|
|
274
272
|
Marty::Script.load_scripts
|
275
|
-
|
273
|
+
client.netzke_notify 'Scripts have been reloaded'
|
276
274
|
end
|
277
275
|
end
|
278
276
|
|
@@ -4,22 +4,21 @@ class Marty::McflyGridPanel < Marty::Grid
|
|
4
4
|
|
5
5
|
warped = Marty::Util.warped?
|
6
6
|
|
7
|
-
c.
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
#c.prohibit_read ||= !self.class.has_any_perm?
|
7
|
+
c.editing = !warped && c.editing || :none
|
8
|
+
|
9
|
+
[:update, :delete, :create].each do |perm|
|
10
|
+
c.permissions[perm] = false if warped
|
11
|
+
end
|
13
12
|
|
14
13
|
# default sort all Mcfly grids with id
|
15
|
-
c.
|
14
|
+
c.store_config.merge!({sorters: [{property: :id, direction: 'ASC'}]})
|
16
15
|
end
|
17
16
|
|
18
17
|
def get_records(params)
|
19
18
|
ts = Mcfly.normalize_infinity(Marty::Util.get_posting_time)
|
20
|
-
tb =
|
19
|
+
tb = model.table_name
|
21
20
|
|
22
|
-
|
21
|
+
model.where("#{tb}.obsoleted_dt >= ? AND #{tb}.created_dt < ?",
|
23
22
|
ts, ts).scoping do
|
24
23
|
super
|
25
24
|
end
|
@@ -27,21 +26,20 @@ class Marty::McflyGridPanel < Marty::Grid
|
|
27
26
|
|
28
27
|
######################################################################
|
29
28
|
|
30
|
-
def
|
29
|
+
def augment_attribute_config(c)
|
31
30
|
super
|
32
31
|
|
33
32
|
# Set mcfly_scope if the attribute is a mcfly association
|
34
|
-
if !c[:scope] &&
|
33
|
+
if !c[:scope] && model_adapter.association_attr?(c)
|
35
34
|
assoc_name, assoc_method = c[:name].split('__')
|
36
35
|
begin
|
37
|
-
aklass =
|
36
|
+
aklass = model.reflect_on_association(assoc_name.to_sym).klass
|
38
37
|
rescue
|
39
|
-
raise "trouble finding #{assoc_name} assoc class on #{
|
38
|
+
raise "trouble finding #{assoc_name} assoc class on #{model}"
|
40
39
|
end
|
41
|
-
|
42
40
|
c[:scope] = Mcfly.has_mcfly?(aklass) ?
|
43
41
|
self.class.mcfly_scope(assoc_method || 'id') :
|
44
|
-
|
42
|
+
self.class.sorted_scope(assoc_method || 'id')
|
45
43
|
end
|
46
44
|
end
|
47
45
|
|