marty 0.5.12
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +84 -0
- data/Rakefile +29 -0
- data/app/assets/javascripts/marty/application.js +15 -0
- data/app/assets/stylesheets/marty/application.css +13 -0
- data/app/components/marty/api_auth_view.rb +32 -0
- data/app/components/marty/auth_app.rb +55 -0
- data/app/components/marty/auth_app.rb~ +51 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js +91 -0
- data/app/components/marty/auth_app/javascripts/auth_app.js~ +91 -0
- data/app/components/marty/cm_form_panel.rb~ +5 -0
- data/app/components/marty/cm_grid_panel.rb~ +35 -0
- data/app/components/marty/data_import_view.rb~ +142 -0
- data/app/components/marty/extras/layout.rb +46 -0
- data/app/components/marty/extras/layout.rb~ +46 -0
- data/app/components/marty/extras/misc.rb +18 -0
- data/app/components/marty/form.rb +6 -0
- data/app/components/marty/grid.rb +45 -0
- data/app/components/marty/grid_append_only.rb +12 -0
- data/app/components/marty/import_type_view.rb +53 -0
- data/app/components/marty/live_search_grid_panel.rb +46 -0
- data/app/components/marty/live_search_grid_panel.rb~ +49 -0
- data/app/components/marty/main_auth_app.rb +269 -0
- data/app/components/marty/main_auth_app.rb~ +238 -0
- data/app/components/marty/mcfly_grid_panel.rb +62 -0
- data/app/components/marty/mcfly_grid_panel.rb~ +80 -0
- data/app/components/marty/new_posting_form.rb +46 -0
- data/app/components/marty/new_posting_form.rb~ +46 -0
- data/app/components/marty/new_posting_window.rb +21 -0
- data/app/components/marty/new_posting_window.rb~ +21 -0
- data/app/components/marty/panel.rb +12 -0
- data/app/components/marty/pivot_grid.rb +52 -0
- data/app/components/marty/pivot_grid/endpoints.rb +45 -0
- data/app/components/marty/pivot_grid/javascripts/extensions.js +150 -0
- data/app/components/marty/pivot_grid/javascripts/pivot_grid.js +86 -0
- data/app/components/marty/pivot_grid/services.rb +44 -0
- data/app/components/marty/posting_grid.rb +139 -0
- data/app/components/marty/posting_grid.rb~ +140 -0
- data/app/components/marty/posting_window.rb +27 -0
- data/app/components/marty/promise_view.rb +177 -0
- data/app/components/marty/promise_view.rb~ +157 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css +26 -0
- data/app/components/marty/promise_view/stylesheets/promise_view.css~ +15 -0
- data/app/components/marty/report_form.rb +225 -0
- data/app/components/marty/report_form.rb~ +217 -0
- data/app/components/marty/report_select.rb +145 -0
- data/app/components/marty/report_select.rb~ +133 -0
- data/app/components/marty/reporting.rb +39 -0
- data/app/components/marty/reporting.rb~ +39 -0
- data/app/components/marty/script_detail.rb~ +430 -0
- data/app/components/marty/script_form.rb +233 -0
- data/app/components/marty/script_form.rb~ +233 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js +698 -0
- data/app/components/marty/script_form/javascripts/Ext.ux.form.field.CodeMirror.js~ +909 -0
- data/app/components/marty/script_form/javascripts/codemirror.js +3130 -0
- data/app/components/marty/script_form/javascripts/mode/clike/clike.js +284 -0
- data/app/components/marty/script_form/javascripts/mode/clike/index.html +102 -0
- data/app/components/marty/script_form/javascripts/mode/clike/scala.html +766 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/clojure.js +206 -0
- data/app/components/marty/script_form/javascripts/mode/clojure/index.html +67 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/LICENSE +22 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/coffeescript.js +346 -0
- data/app/components/marty/script_form/javascripts/mode/coffeescript/index.html +728 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/commonlisp.js +101 -0
- data/app/components/marty/script_form/javascripts/mode/commonlisp/index.html +165 -0
- data/app/components/marty/script_form/javascripts/mode/css/css.js +448 -0
- data/app/components/marty/script_form/javascripts/mode/css/index.html +58 -0
- data/app/components/marty/script_form/javascripts/mode/css/test.js +501 -0
- data/app/components/marty/script_form/javascripts/mode/delorean/delorean.js +189 -0
- data/app/components/marty/script_form/javascripts/mode/diff/diff.js +32 -0
- data/app/components/marty/script_form/javascripts/mode/diff/index.html +105 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/ecl.js +203 -0
- data/app/components/marty/script_form/javascripts/mode/ecl/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/erlang.js +463 -0
- data/app/components/marty/script_form/javascripts/mode/erlang/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/gfm.js +150 -0
- data/app/components/marty/script_form/javascripts/mode/gfm/index.html +48 -0
- data/app/components/marty/script_form/javascripts/mode/go/go.js +170 -0
- data/app/components/marty/script_form/javascripts/mode/go/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/groovy.js +210 -0
- data/app/components/marty/script_form/javascripts/mode/groovy/index.html +72 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/haskell.js +242 -0
- data/app/components/marty/script_form/javascripts/mode/haskell/index.html +61 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/haxe.js +429 -0
- data/app/components/marty/script_form/javascripts/mode/haxe/index.html +91 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/htmlembedded.js +72 -0
- data/app/components/marty/script_form/javascripts/mode/htmlembedded/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/htmlmixed.js +84 -0
- data/app/components/marty/script_form/javascripts/mode/htmlmixed/index.html +52 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/index.html +78 -0
- data/app/components/marty/script_form/javascripts/mode/javascript/javascript.js +361 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/index.html +38 -0
- data/app/components/marty/script_form/javascripts/mode/jinja2/jinja2.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/less/index.html +740 -0
- data/app/components/marty/script_form/javascripts/mode/less/less.js +266 -0
- data/app/components/marty/script_form/javascripts/mode/lua/index.html +73 -0
- data/app/components/marty/script_form/javascripts/mode/lua/lua.js +140 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/index.html +343 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/markdown.js +382 -0
- data/app/components/marty/script_form/javascripts/mode/markdown/test.js +1084 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/index.html +42 -0
- data/app/components/marty/script_form/javascripts/mode/mysql/mysql.js +186 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/index.html +33 -0
- data/app/components/marty/script_form/javascripts/mode/ntriples/ntriples.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/index.html +130 -0
- data/app/components/marty/script_form/javascripts/mode/ocaml/ocaml.js +114 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/LICENSE +7 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/pascal/pascal.js +94 -0
- data/app/components/marty/script_form/javascripts/mode/perl/LICENSE +19 -0
- data/app/components/marty/script_form/javascripts/mode/perl/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/perl/perl.js +816 -0
- data/app/components/marty/script_form/javascripts/mode/php/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/php/php.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/pig/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/pig/pig.js +172 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/index.html +63 -0
- data/app/components/marty/script_form/javascripts/mode/plsql/plsql.js +217 -0
- data/app/components/marty/script_form/javascripts/mode/properties/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/properties/properties.js +63 -0
- data/app/components/marty/script_form/javascripts/mode/python/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/python/index.html +123 -0
- data/app/components/marty/script_form/javascripts/mode/python/python.js +338 -0
- data/app/components/marty/script_form/javascripts/mode/r/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/r/index.html +74 -0
- data/app/components/marty/script_form/javascripts/mode/r/r.js +141 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/changes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/changes/index.html +54 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/index.html +100 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.css +5 -0
- data/app/components/marty/script_form/javascripts/mode/rpm/spec/spec.js +66 -0
- data/app/components/marty/script_form/javascripts/mode/rst/index.html +526 -0
- data/app/components/marty/script_form/javascripts/mode/rst/rst.js +326 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/LICENSE +24 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/index.html +172 -0
- data/app/components/marty/script_form/javascripts/mode/ruby/ruby.js +195 -0
- data/app/components/marty/script_form/javascripts/mode/rust/index.html +49 -0
- data/app/components/marty/script_form/javascripts/mode/rust/rust.js +432 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/index.html +65 -0
- data/app/components/marty/script_form/javascripts/mode/scheme/scheme.js +230 -0
- data/app/components/marty/script_form/javascripts/mode/shell/index.html +50 -0
- data/app/components/marty/script_form/javascripts/mode/shell/shell.js +118 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/LICENSE +23 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/index.html +81 -0
- data/app/components/marty/script_form/javascripts/mode/sieve/sieve.js +156 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/index.html +56 -0
- data/app/components/marty/script_form/javascripts/mode/smalltalk/smalltalk.js +139 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/smarty/smarty.js +148 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/index.html +41 -0
- data/app/components/marty/script_form/javascripts/mode/sparql/sparql.js +143 -0
- data/app/components/marty/script_form/javascripts/mode/stex/index.html +98 -0
- data/app/components/marty/script_form/javascripts/mode/stex/stex.js +182 -0
- data/app/components/marty/script_form/javascripts/mode/stex/test.js +343 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/index.html +141 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/app/components/marty/script_form/javascripts/mode/tiddlywiki/tiddlywiki.js +384 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/index.html +83 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.css +26 -0
- data/app/components/marty/script_form/javascripts/mode/tiki/tiki.js +309 -0
- data/app/components/marty/script_form/javascripts/mode/vb/LICENSE.txt +21 -0
- data/app/components/marty/script_form/javascripts/mode/vb/index.html +89 -0
- data/app/components/marty/script_form/javascripts/mode/vb/vb.js +260 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/index.html +43 -0
- data/app/components/marty/script_form/javascripts/mode/vbscript/vbscript.js +26 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/index.html +104 -0
- data/app/components/marty/script_form/javascripts/mode/velocity/velocity.js +146 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/index.html +211 -0
- data/app/components/marty/script_form/javascripts/mode/verilog/verilog.js +194 -0
- data/app/components/marty/script_form/javascripts/mode/xml/index.html +45 -0
- data/app/components/marty/script_form/javascripts/mode/xml/xml.js +318 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/LICENSE +20 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/index.html +223 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/index.html +27 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testBase.js +42 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testEmptySequenceKeyword.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testMultiAttr.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testNamespaces.js +91 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testProcessingInstructions.js +16 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/test/testQuotes.js +19 -0
- data/app/components/marty/script_form/javascripts/mode/xquery/xquery.js +451 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/index.html +68 -0
- data/app/components/marty/script_form/javascripts/mode/yaml/yaml.js +95 -0
- data/app/components/marty/script_form/javascripts/util/closetag.js +164 -0
- data/app/components/marty/script_form/javascripts/util/dialog.css +27 -0
- data/app/components/marty/script_form/javascripts/util/dialog.js +70 -0
- data/app/components/marty/script_form/javascripts/util/foldcode.js +196 -0
- data/app/components/marty/script_form/javascripts/util/formatting.js +193 -0
- data/app/components/marty/script_form/javascripts/util/javascript-hint.js +134 -0
- data/app/components/marty/script_form/javascripts/util/loadmode.js +51 -0
- data/app/components/marty/script_form/javascripts/util/match-highlighter.js +44 -0
- data/app/components/marty/script_form/javascripts/util/multiplex.js +77 -0
- data/app/components/marty/script_form/javascripts/util/overlay.js +54 -0
- data/app/components/marty/script_form/javascripts/util/pig-hint.js +123 -0
- data/app/components/marty/script_form/javascripts/util/runmode-standalone.js +90 -0
- data/app/components/marty/script_form/javascripts/util/runmode.js +53 -0
- data/app/components/marty/script_form/javascripts/util/search.js +118 -0
- data/app/components/marty/script_form/javascripts/util/searchcursor.js +119 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.css +16 -0
- data/app/components/marty/script_form/javascripts/util/simple-hint.js +97 -0
- data/app/components/marty/script_form/javascripts/util/xml-hint.js +137 -0
- data/app/components/marty/script_form/stylesheets/codemirror.css +172 -0
- data/app/components/marty/script_form/stylesheets/delorean.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/ambiance.css +81 -0
- data/app/components/marty/script_form/stylesheets/theme/blackboard.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/cobalt.css +18 -0
- data/app/components/marty/script_form/stylesheets/theme/eclipse.css +25 -0
- data/app/components/marty/script_form/stylesheets/theme/elegant.css +10 -0
- data/app/components/marty/script_form/stylesheets/theme/erlang-dark.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/lesser-dark.css +44 -0
- data/app/components/marty/script_form/stylesheets/theme/monokai.css +28 -0
- data/app/components/marty/script_form/stylesheets/theme/neat.css +9 -0
- data/app/components/marty/script_form/stylesheets/theme/night.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/rubyblue.css +21 -0
- data/app/components/marty/script_form/stylesheets/theme/vibrant-ink.css +27 -0
- data/app/components/marty/script_form/stylesheets/theme/xq-dark.css +46 -0
- data/app/components/marty/script_grid.rb +104 -0
- data/app/components/marty/script_grid.rb~ +99 -0
- data/app/components/marty/script_tester.rb +114 -0
- data/app/components/marty/script_tester.rb~ +213 -0
- data/app/components/marty/scripting.rb +132 -0
- data/app/components/marty/scripting.rb~ +124 -0
- data/app/components/marty/select_report.rb~ +143 -0
- data/app/components/marty/simple_app.rb +97 -0
- data/app/components/marty/simple_app.rb~ +101 -0
- data/app/components/marty/simple_app/javascripts/simple_app.js +50 -0
- data/app/components/marty/simple_app/javascripts/statusbar_ext.js +8 -0
- data/app/components/marty/tag_grid.rb +83 -0
- data/app/components/marty/tag_grid.rb~ +89 -0
- data/app/components/marty/tree_panel.rb~ +256 -0
- data/app/components/marty/tree_panel/javascripts/tree_panel.js~ +317 -0
- data/app/components/marty/user_pivot.rb +128 -0
- data/app/components/marty/user_view.rb +181 -0
- data/app/components/marty/user_view.rb~ +188 -0
- data/app/controllers/marty/application_controller.rb +124 -0
- data/app/controllers/marty/application_controller.rb~ +133 -0
- data/app/controllers/marty/components_controller.rb +41 -0
- data/app/controllers/marty/components_controller.rb~ +37 -0
- data/app/controllers/marty/job_controller.rb +28 -0
- data/app/controllers/marty/job_controller.rb~ +28 -0
- data/app/controllers/marty/rpc_controller.rb +64 -0
- data/app/controllers/marty/rpc_controller.rb~ +61 -0
- data/app/helpers/marty/application_helper.rb +4 -0
- data/app/helpers/marty/script_set.rb +57 -0
- data/app/helpers/marty/script_set.rb~ +59 -0
- data/app/models/marty/api_auth.rb +44 -0
- data/app/models/marty/api_auth.rb~ +48 -0
- data/app/models/marty/base.rb +4 -0
- data/app/models/marty/data_change.rb +179 -0
- data/app/models/marty/data_change.rb~ +141 -0
- data/app/models/marty/enum.rb +22 -0
- data/app/models/marty/enum.rb~ +16 -0
- data/app/models/marty/import_type.rb +44 -0
- data/app/models/marty/import_type.rb~ +48 -0
- data/app/models/marty/poop.rb~ +169 -0
- data/app/models/marty/posting.rb +101 -0
- data/app/models/marty/posting.rb~ +86 -0
- data/app/models/marty/posting_type.rb +12 -0
- data/app/models/marty/posting_type.rb~ +21 -0
- data/app/models/marty/promise.rb +252 -0
- data/app/models/marty/promise.rb~ +196 -0
- data/app/models/marty/role.rb +6 -0
- data/app/models/marty/role.rb~ +10 -0
- data/app/models/marty/script.rb +144 -0
- data/app/models/marty/script.rb~ +62 -0
- data/app/models/marty/tag.rb +96 -0
- data/app/models/marty/tag.rb~ +91 -0
- data/app/models/marty/token.rb +30 -0
- data/app/models/marty/user.rb +146 -0
- data/app/models/marty/user.rb~ +148 -0
- data/app/models/marty/user_role.rb +7 -0
- data/app/models/marty/user_role.rb~ +13 -0
- data/app/views/layouts/marty/application.html.erb +12 -0
- data/app/views/layouts/marty/application.html.erb~ +11 -0
- data/config/locales/en.yml +134 -0
- data/config/routes.rb +6 -0
- data/config/routes.rb~ +10 -0
- data/db/migrate/001_create_marty_scripts.rb +14 -0
- data/db/migrate/003_create_marty_users.rb +12 -0
- data/db/migrate/004_create_marty_roles.rb +7 -0
- data/db/migrate/005_create_marty_user_roles.rb +14 -0
- data/db/migrate/006_create_marty_tokens.rb +14 -0
- data/db/migrate/008_create_marty_posting_types.rb +7 -0
- data/db/migrate/019_create_marty_postings.rb +18 -0
- data/db/migrate/019_create_marty_postings.rb~ +19 -0
- data/db/migrate/068_create_marty_import_types.rb +12 -0
- data/db/migrate/069_create_marty_import_synonyms.rb +15 -0
- data/db/migrate/070_create_versions.rb +18 -0
- data/db/migrate/071_add_object_changes_column_to_versions.rb +9 -0
- data/db/migrate/072_add_validation_function_to_import_types.rb +6 -0
- data/db/migrate/073_add_preprocess_function_to_import_types.rb +5 -0
- data/db/migrate/090_create_delayed_jobs.rb +22 -0
- data/db/migrate/091_create_marty_promises.rb +36 -0
- data/db/migrate/095_create_marty_tags.rb +14 -0
- data/db/migrate/095_create_marty_tags.rb~ +19 -0
- data/db/migrate/096_add_user_roles_to_import_types.rb +11 -0
- data/db/migrate/097_drop_versions.rb +9 -0
- data/db/migrate/098_create_marty_api_auths.rb +20 -0
- data/db/seeds.rb +48 -0
- data/lib/marty.rb +18 -0
- data/lib/marty.rb~ +13 -0
- data/lib/marty/content_handler.rb +97 -0
- data/lib/marty/content_handler.rb~ +93 -0
- data/lib/marty/data_conversion.rb +298 -0
- data/lib/marty/data_exporter.rb +150 -0
- data/lib/marty/data_exporter.rb~ +137 -0
- data/lib/marty/data_importer.rb +122 -0
- data/lib/marty/data_importer.rb~ +114 -0
- data/lib/marty/data_row_processor.rb~ +206 -0
- data/lib/marty/drop_folder_hook.rb~ +17 -0
- data/lib/marty/engine.rb +10 -0
- data/lib/marty/folder_hook.rb~ +9 -0
- data/lib/marty/lazy_column_loader.rb +57 -0
- data/lib/marty/lazy_column_loader.rb~ +47 -0
- data/lib/marty/mcfly_query.rb +189 -0
- data/lib/marty/mcfly_query.rb~ +188 -0
- data/lib/marty/migrations.rb +108 -0
- data/lib/marty/migrations.rb~ +65 -0
- data/lib/marty/monkey.rb +163 -0
- data/lib/marty/monkey.rb~ +160 -0
- data/lib/marty/permissions.rb +64 -0
- data/lib/marty/permissions.rb~ +69 -0
- data/lib/marty/promise.rb~ +41 -0
- data/lib/marty/promise_job.rb +123 -0
- data/lib/marty/promise_job.rb~ +121 -0
- data/lib/marty/promise_proxy.rb +94 -0
- data/lib/marty/promise_proxy.rb~ +69 -0
- data/lib/marty/railtie.rb +5 -0
- data/lib/marty/relation.rb +39 -0
- data/lib/marty/util.rb +110 -0
- data/lib/marty/util.rb~ +80 -0
- data/lib/marty/version.rb +3 -0
- data/lib/marty/version.rb~ +3 -0
- data/lib/marty/xl.rb +527 -0
- data/lib/marty/xl.rb~ +526 -0
- data/lib/pyxll/README.txt +19 -0
- data/lib/pyxll/README.txt~ +16 -0
- data/lib/pyxll/gemini.py +155 -0
- data/lib/pyxll/gemini.py~ +110 -0
- data/lib/pyxll/pyxll.cfg +12 -0
- data/lib/pyxll/pyxll.cfg~ +12 -0
- data/lib/pyxll/sample.xlsx +0 -0
- data/lib/tasks/marty_tasks.rake +37 -0
- metadata +517 -0
@@ -0,0 +1,317 @@
|
|
1
|
+
// This is a hacked up version of 0.8.4 grid.js to work with
|
2
|
+
// TreePanel. FIXME: perhaps we can patch up grid.js dynamically
|
3
|
+
// rather than copying all the code?
|
4
|
+
{
|
5
|
+
trackMouseOver: true,
|
6
|
+
loadMask: true,
|
7
|
+
|
8
|
+
componentLoadMask: {msg: "Loading..."},
|
9
|
+
deleteMaskMsg: "Deleting...",
|
10
|
+
|
11
|
+
initComponent: function(){
|
12
|
+
var metaColumn;
|
13
|
+
var fields = this.extraFields; // field configs for the underlying data model
|
14
|
+
|
15
|
+
this.plugins = this.plugins || [];
|
16
|
+
this.features = this.features || [];
|
17
|
+
|
18
|
+
// Run through columns and set up different configuration for each
|
19
|
+
Ext.each(this.columns, function(c, i){
|
20
|
+
|
21
|
+
this.normalizeRenderer(c);
|
22
|
+
|
23
|
+
// Build the field configuration for this column
|
24
|
+
var fieldConfig = {name: c.dataIndex, defaultValue: c.defaultValue, useNull: true};
|
25
|
+
|
26
|
+
if (c.name !== 'meta') fieldConfig.type = this.fieldTypeForAttrType(c.attrType); // field type (grid editors need this to function well)
|
27
|
+
|
28
|
+
if (c.attrType == 'datetime') {
|
29
|
+
fieldConfig.dateFormat = 'Y-m-d H:i:s'; // set the format in which we receive datetime from the server (so that the model can parse it)
|
30
|
+
|
31
|
+
// While for 'date' columns the renderer is set up automatically (through using column's xtype), there's no appropriate xtype for our custom datetime column.
|
32
|
+
// Thus, we need to set the renderer manually.
|
33
|
+
// NOTE: for Ext there's no distinction b/w date and datetime; date fields can include time.
|
34
|
+
if (!c.renderer) {
|
35
|
+
// format in which the data will be rendered; if c.format is nil, Ext.Date.defaultFormat extended with time will be used
|
36
|
+
c.renderer = Ext.util.Format.dateRenderer(c.format || Ext.Date.defaultFormat + " H:i:s");
|
37
|
+
}
|
38
|
+
};
|
39
|
+
|
40
|
+
// because checkcolumn doesn't care about editor (not) being set, we need to explicitely set readOnly here
|
41
|
+
if (c.xtype == 'checkcolumn' && !c.editor) {
|
42
|
+
c.readOnly = true;
|
43
|
+
}
|
44
|
+
|
45
|
+
fields.push(fieldConfig);
|
46
|
+
|
47
|
+
// We will not use meta columns as actual columns (not even hidden) - only to create the records
|
48
|
+
if (c.meta) {
|
49
|
+
metaColumn = c;
|
50
|
+
return;
|
51
|
+
}
|
52
|
+
|
53
|
+
// Set rendeder for association columns (the one displaying associations by the specified method instead of id)
|
54
|
+
if (c.assoc) {
|
55
|
+
// Editor for association column
|
56
|
+
c.editor = Ext.apply({
|
57
|
+
parentId: this.id,
|
58
|
+
name: c.name,
|
59
|
+
selectOnFocus: true // ?
|
60
|
+
}, c.editor);
|
61
|
+
|
62
|
+
// Renderer for association column
|
63
|
+
this.normalizeAssociationRenderer(c);
|
64
|
+
}
|
65
|
+
|
66
|
+
if (c.editor) {
|
67
|
+
Ext.applyIf(c.editor, {selectOnFocus: true});
|
68
|
+
}
|
69
|
+
|
70
|
+
// Setting the default filter type
|
71
|
+
if (c.filterable && !c.filter) {
|
72
|
+
c.filter = {type: this.fieldTypeForAttrType(c.attrType)};
|
73
|
+
}
|
74
|
+
|
75
|
+
// HACK: somehow this is not set by Ext (while it should be)
|
76
|
+
// if (c.xtype == 'datecolumn') c.format = c.format || Ext.util.Format.dateFormat;
|
77
|
+
// setting dataIndex
|
78
|
+
// c.dataIndex = c.name;
|
79
|
+
|
80
|
+
}, this);
|
81
|
+
/* ... and done with the columns */
|
82
|
+
|
83
|
+
// Define the model
|
84
|
+
Ext.define(this.id, {
|
85
|
+
extend: 'Ext.data.Model',
|
86
|
+
idProperty: this.pri, // Primary key
|
87
|
+
fields: fields
|
88
|
+
});
|
89
|
+
|
90
|
+
// After we created the record (model), we can get rid of the meta column
|
91
|
+
Ext.Array.remove(this.columns, metaColumn);
|
92
|
+
|
93
|
+
// Prepare column model config with columns in the correct order; columns out of order go to the end.
|
94
|
+
var colModelConfig = [];
|
95
|
+
var columns = this.columns;
|
96
|
+
|
97
|
+
Ext.each(this.columns, function(c) {
|
98
|
+
var mainColConfig;
|
99
|
+
Ext.each(this.columns, function(oc) {
|
100
|
+
if (c.name === oc.name) {
|
101
|
+
mainColConfig = Ext.apply({}, oc);
|
102
|
+
return false;
|
103
|
+
}
|
104
|
+
});
|
105
|
+
|
106
|
+
colModelConfig.push(Ext.apply(mainColConfig, c));
|
107
|
+
}, this);
|
108
|
+
|
109
|
+
// We don't need original columns any longer
|
110
|
+
delete this.columns;
|
111
|
+
|
112
|
+
// ... instead, define own column model
|
113
|
+
this.columns = colModelConfig;
|
114
|
+
|
115
|
+
// DirectProxy that uses our Ext.direct provider
|
116
|
+
var proxy = Ext.create('Ext.data.proxy.Direct', {
|
117
|
+
|
118
|
+
directFn: Netzke.providers[this.id].getData,
|
119
|
+
// reader: Ext.create('Ext.data.reader.Array', {root: 'data', totalProperty: 'total'}),
|
120
|
+
reader: {
|
121
|
+
type: 'json',
|
122
|
+
root: 'data'
|
123
|
+
},
|
124
|
+
listeners: {
|
125
|
+
exception: {
|
126
|
+
fn: this.loadExceptionHandler,
|
127
|
+
scope: this
|
128
|
+
},
|
129
|
+
load: { // Netzke-introduced event; this will also be fired when an exception occurs.
|
130
|
+
fn: function(proxy, response, operation) {
|
131
|
+
// besides getting data into the store, we may also get commands to execute
|
132
|
+
response = response.result;
|
133
|
+
|
134
|
+
if (response) { // or did we have an exception?
|
135
|
+
Ext.each(['data', 'total', 'success'], function(property){delete response[property];});
|
136
|
+
this.netzkeBulkExecute(response);
|
137
|
+
}
|
138
|
+
},
|
139
|
+
scope: this
|
140
|
+
}
|
141
|
+
}
|
142
|
+
})
|
143
|
+
|
144
|
+
// Create the netzke PagingTreeStore
|
145
|
+
|
146
|
+
this.store = Ext.create('Ext.data.TreeStore', Ext.apply({
|
147
|
+
model: this.id,
|
148
|
+
proxy: proxy,
|
149
|
+
autoLoad: !this.loadInlineData,
|
150
|
+
// root: this.inlineData || {data: [{tree:'root', id:0}]}
|
151
|
+
}, this.dataStore));
|
152
|
+
delete this.dataStore;
|
153
|
+
|
154
|
+
this.store.load();
|
155
|
+
// HACK: we must let the store now totalCount
|
156
|
+
// this.store.setTotalCount(this.inlineData && this.inlineData[this.store.getProxy().getReader().totalProperty]);
|
157
|
+
|
158
|
+
// Drag'n'Drop
|
159
|
+
if (this.enableRowsReordering){
|
160
|
+
this.ddPlugin = new Ext.ux.dd.GridDragDropRowOrder({
|
161
|
+
scrollable: true // enable scrolling support (default is false)
|
162
|
+
});
|
163
|
+
this.plugins.push(this.ddPlugin);
|
164
|
+
}
|
165
|
+
|
166
|
+
// Cell editing
|
167
|
+
if (!this.prohibitUpdate) {
|
168
|
+
this.plugins.push(Ext.create('Ext.grid.plugin.CellEditing', {pluginId: 'celleditor'}));
|
169
|
+
}
|
170
|
+
|
171
|
+
// Toolbar
|
172
|
+
this.dockedItems = this.dockedItems || [];
|
173
|
+
if (this.enablePagination) {
|
174
|
+
this.dockedItems.push({
|
175
|
+
xtype: 'pagingtoolbar',
|
176
|
+
dock: 'bottom',
|
177
|
+
store: this.store,
|
178
|
+
// append the old bbar. TODO: get rid of it.
|
179
|
+
items: this.bbar && ["-"].concat(this.bbar)
|
180
|
+
});
|
181
|
+
} else if (this.bbar) {
|
182
|
+
this.dockedItems.push({
|
183
|
+
xtype: 'toolbar',
|
184
|
+
dock: 'bottom',
|
185
|
+
items: this.bbar
|
186
|
+
});
|
187
|
+
}
|
188
|
+
|
189
|
+
delete this.bbar;
|
190
|
+
|
191
|
+
// Now let Ext.grid.EditorGridPanel do the rest (original initComponent)
|
192
|
+
this.callParent();
|
193
|
+
|
194
|
+
// Context menu
|
195
|
+
if (this.contextMenu) {
|
196
|
+
this.on('itemcontextmenu', this.onItemContextMenu, this);
|
197
|
+
}
|
198
|
+
|
199
|
+
// Disabling/enabling editInForm button according to current selection
|
200
|
+
if (this.enableEditInForm && !this.prohibitUpdate) {
|
201
|
+
this.getSelectionModel().on('selectionchange', function(selModel, selected){
|
202
|
+
var disabled;
|
203
|
+
if (selected.length === 0) { // empty?
|
204
|
+
disabled = true;
|
205
|
+
} else {
|
206
|
+
// Disable "edit in form" button if new record is present in selection
|
207
|
+
Ext.each(selected, function(r){
|
208
|
+
if (r.isNew) { disabled = true; return false; }
|
209
|
+
});
|
210
|
+
};
|
211
|
+
this.actions.editInForm.setDisabled(disabled);
|
212
|
+
}, this);
|
213
|
+
}
|
214
|
+
|
215
|
+
|
216
|
+
// Drag n Drop event
|
217
|
+
if (this.enableRowsReordering){
|
218
|
+
this.ddPlugin.on('afterrowmove', this.onAfterRowMove, this);
|
219
|
+
}
|
220
|
+
|
221
|
+
// WIP: GridView
|
222
|
+
this.getView().getRowClass = this.defaultGetRowClass;
|
223
|
+
|
224
|
+
// When starting editing as assocition column, pre-load the combobox store from the meta column, so that we don't see the real value of this cell (the id of the associated record), but rather the associated record by the configured method.
|
225
|
+
this.on('beforeedit', function(e){
|
226
|
+
return false;
|
227
|
+
}, this);
|
228
|
+
|
229
|
+
this.on('afterrender', function() {
|
230
|
+
// Persistence-related events (afterrender to avoid blank event firing on render)
|
231
|
+
if (this.persistence) {
|
232
|
+
// Inform the server part about column operations
|
233
|
+
this.on('columnresize', this.onColumnResize, this);
|
234
|
+
this.on('columnmove', this.onColumnMove, this);
|
235
|
+
this.on('columnhide', this.onColumnHide, this);
|
236
|
+
this.on('columnshow', this.onColumnShow, this);
|
237
|
+
}
|
238
|
+
}, this);
|
239
|
+
},
|
240
|
+
|
241
|
+
fieldTypeForAttrType: function(attrType){
|
242
|
+
var map = {
|
243
|
+
integer : 'int',
|
244
|
+
decimal : 'float',
|
245
|
+
datetime : 'date',
|
246
|
+
date : 'date',
|
247
|
+
string : 'string',
|
248
|
+
text : 'string',
|
249
|
+
'boolean' : 'boolean'
|
250
|
+
};
|
251
|
+
return map[attrType] || 'string';
|
252
|
+
},
|
253
|
+
|
254
|
+
// Normalizes the renderer for a column.
|
255
|
+
// Renderer may be:
|
256
|
+
// 1) a string that contains the name of the function to be used as renderer.
|
257
|
+
// 2) an array, where the first element is the function name, and the rest - the arguments
|
258
|
+
// that will be passed to that function along with the value to be rendered.
|
259
|
+
// The function is searched in the following objects: 1) Ext.util.Format, 2) this.
|
260
|
+
// If not found, it is simply evaluated. Handy, when as renderer we receive an inline JS function,
|
261
|
+
// or reference to a function in some other scope.
|
262
|
+
// So, these will work:
|
263
|
+
// * "uppercase"
|
264
|
+
// * ["ellipsis", 10]
|
265
|
+
// * ["substr", 3, 5]
|
266
|
+
// * "myRenderer" (if this.myRenderer is a function)
|
267
|
+
// * ["Some.scope.Format.customRenderer", 10, 20, 30] (if Some.scope.Format.customRenderer is a function)
|
268
|
+
// * "function(v){ return 'Value: ' + v; }"
|
269
|
+
normalizeRenderer: function(c) {
|
270
|
+
if (!c.renderer) return;
|
271
|
+
|
272
|
+
var name, args = [];
|
273
|
+
|
274
|
+
if ('string' === typeof c.renderer) {
|
275
|
+
name = c.renderer.camelize(true);
|
276
|
+
} else {
|
277
|
+
name = c.renderer[0];
|
278
|
+
args = c.renderer.slice(1);
|
279
|
+
}
|
280
|
+
|
281
|
+
// First check whether Ext.util.Format has it
|
282
|
+
if (Ext.isFunction(Ext.util.Format[name])) {
|
283
|
+
c.renderer = Ext.Function.bind(Ext.util.Format[name], this, args, 1);
|
284
|
+
} else if (Ext.isFunction(this[name])) {
|
285
|
+
// ... then if our own class has it
|
286
|
+
c.renderer = Ext.Function.bind(this[name], this, args, 1);
|
287
|
+
} else {
|
288
|
+
// ... and, as last resort, evaluate it (allows passing inline javascript function as renderer)
|
289
|
+
eval("c.renderer = " + c.renderer + ";");
|
290
|
+
}
|
291
|
+
},
|
292
|
+
|
293
|
+
/*
|
294
|
+
Set a renderer that displayes association values instead of association record ID.
|
295
|
+
The association values are passed in the meta-column under associationValues hash.
|
296
|
+
*/
|
297
|
+
normalizeAssociationRenderer: function(c) {
|
298
|
+
c.scope = this;
|
299
|
+
var passedRenderer = c.renderer; // renderer we got from normalizeRenderer
|
300
|
+
c.renderer = function(value, a, r, ri, ci){
|
301
|
+
var column = this.headerCt.items.getAt(ci),
|
302
|
+
editor = column.getEditor && column.getEditor(),
|
303
|
+
recordFromStore = editor && editor.isXType('combobox') && editor.getStore().findRecord('value', value),
|
304
|
+
renderedValue;
|
305
|
+
|
306
|
+
if (recordFromStore) {
|
307
|
+
renderedValue = recordFromStore.get('text');
|
308
|
+
} else if (c.assoc && r.get('meta')) {
|
309
|
+
renderedValue = r.get('meta').associationValues[c.name] || c.emptyText;
|
310
|
+
} else {
|
311
|
+
renderedValue = value;
|
312
|
+
}
|
313
|
+
|
314
|
+
return passedRenderer ? passedRenderer.call(this, renderedValue) : renderedValue;
|
315
|
+
};
|
316
|
+
}
|
317
|
+
}
|
@@ -0,0 +1,128 @@
|
|
1
|
+
class Marty::UserPivot < Marty::PivotGrid
|
2
|
+
def configure(c)
|
3
|
+
super
|
4
|
+
|
5
|
+
c.title ||= I18n.t('users', default: "Users")
|
6
|
+
c.model = "Marty::User"
|
7
|
+
|
8
|
+
c.columns = [
|
9
|
+
:id,
|
10
|
+
:login,
|
11
|
+
:firstname,
|
12
|
+
:lastname,
|
13
|
+
:active,
|
14
|
+
:roles,
|
15
|
+
]
|
16
|
+
end
|
17
|
+
|
18
|
+
js_configure do |c|
|
19
|
+
|
20
|
+
c.aggregate = [
|
21
|
+
{
|
22
|
+
data_index: 'id',
|
23
|
+
header: 'Sum of id',
|
24
|
+
aggregator: 'sum',
|
25
|
+
},
|
26
|
+
{
|
27
|
+
data_index: 'id',
|
28
|
+
header: '# records',
|
29
|
+
aggregator: 'count',
|
30
|
+
align: 'right',
|
31
|
+
rederer: <<-JS
|
32
|
+
Ext.util.Format.numberRenderer("0")
|
33
|
+
JS
|
34
|
+
},
|
35
|
+
]
|
36
|
+
|
37
|
+
c.left_axis = [
|
38
|
+
{
|
39
|
+
data_index: 'firstname',
|
40
|
+
header: 'First Name',
|
41
|
+
sortable: false
|
42
|
+
},
|
43
|
+
{
|
44
|
+
data_index: 'login',
|
45
|
+
header: 'Login',
|
46
|
+
sortable: false
|
47
|
+
}
|
48
|
+
]
|
49
|
+
|
50
|
+
c.top_axis = [
|
51
|
+
{
|
52
|
+
width: 120,
|
53
|
+
data_index: 'lastname'
|
54
|
+
}
|
55
|
+
]
|
56
|
+
|
57
|
+
c.init_component = <<-JS
|
58
|
+
function() {
|
59
|
+
var me = this;
|
60
|
+
me.callParent();
|
61
|
+
|
62
|
+
YYY = me;
|
63
|
+
|
64
|
+
var view = this.getView();
|
65
|
+
|
66
|
+
view.getSelectionModel().on('selectionchange', function(selModel) {
|
67
|
+
var has_sel = selModel.hasSelection();
|
68
|
+
var rec_id =
|
69
|
+
has_sel ? view.getSelectionModel().selected.first().getId() : null;
|
70
|
+
XXX = view.getSelectionModel().selected.first();
|
71
|
+
console.log("Selection:", rec_id);
|
72
|
+
});
|
73
|
+
}
|
74
|
+
JS
|
75
|
+
end
|
76
|
+
|
77
|
+
def get_records(params)
|
78
|
+
require 'ostruct'
|
79
|
+
|
80
|
+
(1..10000).map {|i|
|
81
|
+
p = OpenStruct.new
|
82
|
+
p.id = i
|
83
|
+
p.login = (i % 5).to_s
|
84
|
+
p.firstname = (i % 21).to_s
|
85
|
+
p.lastname = (i % 10).to_s
|
86
|
+
p.active = (i%3 == 0)
|
87
|
+
p.roles = []
|
88
|
+
p
|
89
|
+
}
|
90
|
+
end
|
91
|
+
|
92
|
+
column :login do |c|
|
93
|
+
c.width = 100
|
94
|
+
c.text = I18n.t("user_grid.login")
|
95
|
+
end
|
96
|
+
|
97
|
+
column :firstname do |c|
|
98
|
+
c.width = 100
|
99
|
+
c.text = I18n.t("user_grid.firstname")
|
100
|
+
end
|
101
|
+
|
102
|
+
column :lastname do |c|
|
103
|
+
c.width = 100
|
104
|
+
c.text = I18n.t("user_grid.lastname")
|
105
|
+
end
|
106
|
+
|
107
|
+
column :active do |c|
|
108
|
+
c.width = 60
|
109
|
+
c.text = I18n.t("user_grid.active")
|
110
|
+
end
|
111
|
+
|
112
|
+
column :roles do |c|
|
113
|
+
c.width = 100
|
114
|
+
c.flex = 1
|
115
|
+
c.text = I18n.t("user_grid.roles")
|
116
|
+
c.getter = lambda do |r|
|
117
|
+
r.roles.map { |ur| I18n.t("roles.#{ur.name}") }.sort
|
118
|
+
end
|
119
|
+
end
|
120
|
+
|
121
|
+
column :created_dt do |c|
|
122
|
+
c.text = I18n.t("user_grid.created_dt")
|
123
|
+
c.format = "Y-m-d H:i"
|
124
|
+
c.read_only = true
|
125
|
+
end
|
126
|
+
end
|
127
|
+
|
128
|
+
UserPivot = Marty::UserPivot
|
@@ -0,0 +1,181 @@
|
|
1
|
+
class Marty::UserView < Marty::Grid
|
2
|
+
has_marty_permissions \
|
3
|
+
create: [:admin, :user_manager],
|
4
|
+
read: :any,
|
5
|
+
update: [:admin, :user_manager],
|
6
|
+
delete: [:admin, :user_manager]
|
7
|
+
|
8
|
+
# list of columns to be displayed in the grid view
|
9
|
+
def self.user_columns
|
10
|
+
[
|
11
|
+
:login,
|
12
|
+
:firstname,
|
13
|
+
:lastname,
|
14
|
+
:active,
|
15
|
+
:roles,
|
16
|
+
]
|
17
|
+
end
|
18
|
+
|
19
|
+
def configure(c)
|
20
|
+
super
|
21
|
+
|
22
|
+
c.title ||= I18n.t('users', default: "Users")
|
23
|
+
c.model = "Marty::User"
|
24
|
+
c.enable_extended_search = false
|
25
|
+
c.enable_edit_inline = false
|
26
|
+
c.multi_select = false
|
27
|
+
|
28
|
+
c.columns ||= self.class.user_columns
|
29
|
+
|
30
|
+
c.data_store.sorters = {
|
31
|
+
property: :login,
|
32
|
+
direction: 'ASC',
|
33
|
+
} if c.columns.include?(:login)
|
34
|
+
end
|
35
|
+
|
36
|
+
def self.set_roles(roles, user)
|
37
|
+
roles ||= []
|
38
|
+
|
39
|
+
# Destroy old roles (must call destroy for auditing to work properly)
|
40
|
+
user.user_roles.each do |ur|
|
41
|
+
ur.destroy unless roles.include?(I18n.t("roles.#{ur.role.name}"))
|
42
|
+
end
|
43
|
+
|
44
|
+
# set new roles
|
45
|
+
user.roles = Marty::Role.select {
|
46
|
+
|r| roles.include? I18n.t("roles.#{r.name}")
|
47
|
+
}
|
48
|
+
end
|
49
|
+
|
50
|
+
def self.create_edit_user(data)
|
51
|
+
# Creates initial place-holder user object and validate
|
52
|
+
user = data["id"].nil? ? Marty::User.new : Marty::User.find(data["id"])
|
53
|
+
|
54
|
+
self.user_columns.each {
|
55
|
+
|c| user.send("#{c}=", data[c.to_s]) unless c == :roles
|
56
|
+
}
|
57
|
+
|
58
|
+
if user.valid?
|
59
|
+
user.save
|
60
|
+
set_roles(data["roles"], user)
|
61
|
+
end
|
62
|
+
|
63
|
+
user
|
64
|
+
end
|
65
|
+
|
66
|
+
# override the add_in_form and edit_in_form endpoint. User creation/update
|
67
|
+
# needs to use the create_edit_user method.
|
68
|
+
|
69
|
+
endpoint :add_window__add_form__netzke_submit do |params, this|
|
70
|
+
data = ActiveSupport::JSON.decode(params[:data])
|
71
|
+
|
72
|
+
data["id"] = nil
|
73
|
+
|
74
|
+
unless self.class.can_perform_action?(:create)
|
75
|
+
this.netzke_feedback "Permission Denied"
|
76
|
+
return
|
77
|
+
end
|
78
|
+
|
79
|
+
user = self.class.create_edit_user(data)
|
80
|
+
if user.valid?
|
81
|
+
this.success = true
|
82
|
+
this.on_submit_success
|
83
|
+
else
|
84
|
+
data_adapter.errors_array(user).each do |error|
|
85
|
+
flash :error => error
|
86
|
+
end
|
87
|
+
this.netzke_feedback(@flash)
|
88
|
+
end
|
89
|
+
end
|
90
|
+
|
91
|
+
endpoint :edit_window__edit_form__netzke_submit do |params, this|
|
92
|
+
data = ActiveSupport::JSON.decode(params[:data])
|
93
|
+
unless self.class.can_perform_action?(:update)
|
94
|
+
this.netzke_feedback "Permission Denied"
|
95
|
+
return
|
96
|
+
end
|
97
|
+
|
98
|
+
user = self.class.create_edit_user(data)
|
99
|
+
if user.valid?
|
100
|
+
this.success = true
|
101
|
+
this.on_submit_success
|
102
|
+
else
|
103
|
+
data_adapter.errors_array(user).each do |error|
|
104
|
+
flash :error => error
|
105
|
+
end
|
106
|
+
this.netzke_feedback(@flash)
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
110
|
+
action :add_in_form do |a|
|
111
|
+
a.text = I18n.t("user_grid.new")
|
112
|
+
a.tooltip = I18n.t("user_grid.new")
|
113
|
+
a.icon = :user_add
|
114
|
+
a.disabled = !self.class.can_perform_action?(:create)
|
115
|
+
end
|
116
|
+
|
117
|
+
action :edit_in_form do |a|
|
118
|
+
a.disabled = !self.class.can_perform_action?(:update)
|
119
|
+
a.icon = :user_edit
|
120
|
+
end
|
121
|
+
|
122
|
+
action :del do |a|
|
123
|
+
a.icon = :user_delete
|
124
|
+
end
|
125
|
+
|
126
|
+
def default_bbar
|
127
|
+
[:add_in_form, :edit_in_form, :del]
|
128
|
+
end
|
129
|
+
|
130
|
+
def default_context_menu
|
131
|
+
[]
|
132
|
+
end
|
133
|
+
|
134
|
+
column :login do |c|
|
135
|
+
c.width = 100
|
136
|
+
c.text = I18n.t("user_grid.login")
|
137
|
+
end
|
138
|
+
|
139
|
+
column :firstname do |c|
|
140
|
+
c.width = 100
|
141
|
+
c.text = I18n.t("user_grid.firstname")
|
142
|
+
end
|
143
|
+
|
144
|
+
column :lastname do |c|
|
145
|
+
c.width = 100
|
146
|
+
c.text = I18n.t("user_grid.lastname")
|
147
|
+
end
|
148
|
+
|
149
|
+
column :active do |c|
|
150
|
+
c.width = 60
|
151
|
+
c.text = I18n.t("user_grid.active")
|
152
|
+
end
|
153
|
+
|
154
|
+
column :roles do |c|
|
155
|
+
c.width = 100
|
156
|
+
c.flex = 1
|
157
|
+
c.text = I18n.t("user_grid.roles")
|
158
|
+
c.editor = {
|
159
|
+
trigger_action: :all,
|
160
|
+
name: "roles",
|
161
|
+
attr_type: :string,
|
162
|
+
xtype: :combo,
|
163
|
+
store: Marty::Role.pluck(:name).map {|n| I18n.t("roles.#{n}")}.sort,
|
164
|
+
empty_text: I18n.t("user_grid.select_roles"),
|
165
|
+
multi_select: true,
|
166
|
+
}
|
167
|
+
|
168
|
+
c.getter = lambda do |r|
|
169
|
+
r.roles.map { |ur| I18n.t("roles.#{ur.name}") }.sort
|
170
|
+
end
|
171
|
+
end
|
172
|
+
|
173
|
+
column :created_dt do |c|
|
174
|
+
c.text = I18n.t("user_grid.created_dt")
|
175
|
+
c.format = "Y-m-d H:i"
|
176
|
+
c.read_only = true
|
177
|
+
end
|
178
|
+
|
179
|
+
end
|
180
|
+
|
181
|
+
UserView = Marty::UserView
|