locomotivecms 4.1.1 → 4.2.0.alpha2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/MIT-LICENSE +1 -1
- data/README.md +4 -3
- data/Rakefile +4 -0
- data/app/api/locomotive/api.rb +1 -1
- data/app/assets/config/locomotive_manifest.js +2 -0
- data/app/assets/javascripts/locomotive.js +2 -2
- data/app/assets/stylesheets/locomotive/account.scss +0 -1
- data/app/assets/stylesheets/locomotive/application.scss +0 -1
- data/app/assets/stylesheets/locomotive/live_editing_error.scss +0 -1
- data/app/assets/stylesheets/locomotive/live_editing_iframe.scss +0 -1
- data/app/controllers/locomotive/base_controller.rb +1 -1
- data/app/controllers/locomotive/concerns/authorization_controller.rb +1 -1
- data/app/controllers/locomotive/concerns/redirect_to_main_host_controller.rb +1 -1
- data/app/controllers/locomotive/concerns/site_dispatcher_controller.rb +1 -1
- data/app/controllers/locomotive/errors_controller.rb +1 -1
- data/app/controllers/locomotive/my_account_controller.rb +1 -1
- data/app/controllers/locomotive/passwords_controller.rb +3 -1
- data/app/controllers/locomotive/registrations_controller.rb +3 -1
- data/app/controllers/locomotive/sessions_controller.rb +3 -1
- data/app/controllers/locomotive/sites_controller.rb +1 -1
- data/app/helpers/locomotive/base_helper.rb +2 -2
- data/app/helpers/locomotive/custom_fields_helper.rb +2 -2
- data/app/helpers/locomotive/shared/activities_helper.rb +1 -1
- data/app/inputs/locomotive/api_key_input.rb +1 -1
- data/app/mailers/locomotive/notifications.rb +1 -1
- data/app/models/locomotive/account.rb +1 -1
- data/app/models/locomotive/concerns/account/api_key.rb +1 -1
- data/app/models/locomotive/concerns/content_entry/csv.rb +1 -1
- data/app/models/locomotive/concerns/content_entry/slug.rb +5 -5
- data/app/models/locomotive/concerns/content_type/entry_template.rb +3 -3
- data/app/models/locomotive/concerns/page/templatized.rb +1 -1
- data/app/models/locomotive/concerns/shared/json_attribute.rb +21 -2
- data/app/models/locomotive/concerns/site/routes.rb +1 -1
- data/app/models/locomotive/content_entry.rb +2 -2
- data/app/models/locomotive/page.rb +3 -3
- data/app/models/locomotive/section.rb +1 -1
- data/app/models/locomotive/snippet.rb +1 -1
- data/app/models/locomotive/translation.rb +1 -1
- data/app/services/locomotive/content_entry_import_service.rb +1 -1
- data/app/services/locomotive/content_entry_service.rb +2 -2
- data/app/services/locomotive/content_type_service.rb +13 -3
- data/app/services/locomotive/custom_field_service.rb +2 -2
- data/app/services/locomotive/editor_service.rb +1 -1
- data/app/uploaders/locomotive/base_uploader.rb +0 -10
- data/app/views/locomotive/dashboard/_activity.html.slim +1 -1
- data/app/views/locomotive/page_content/_edit.json.jbuilder +50 -0
- data/app/views/locomotive/page_content/edit.html.erb +1 -1
- data/app/views/locomotive/page_content/edit.json.jbuilder +52 -50
- data/config/initializers/devise.rb +5 -2
- data/lib/generators/locomotive/install/templates/locomotive.rb +0 -5
- data/lib/locomotive/action_controller/responder.rb +1 -1
- data/lib/locomotive/configuration.rb +2 -2
- data/lib/locomotive/dependencies.rb +0 -2
- data/lib/locomotive/engine.rb +14 -2
- data/lib/locomotive/mongoid/patches.rb +47 -65
- data/lib/locomotive/steam/services/api_entry_submission_service.rb +1 -0
- data/lib/locomotive/version.rb +1 -1
- data/vendor/assets/javascripts/locomotive/codemirror/addons/comment/comment.js +203 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/comment/continuecomment.js +85 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/dialog/dialog.js +157 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/display/autorefresh.js +47 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/display/fullscreen.js +41 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/display/panel.js +112 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/display/placeholder.js +62 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/display/rulers.js +51 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/closebrackets.js +195 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/closetag.js +169 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/continuelist.js +51 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/matchbrackets.js +120 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/matchtags.js +66 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/edit/trailingspace.js +27 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/brace-fold.js +105 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/comment-fold.js +59 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/foldcode.js +150 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/foldgutter.js +146 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/indent-fold.js +44 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/markdown-fold.js +49 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/fold/xml-fold.js +182 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/anyword-hint.js +41 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/css-hint.js +60 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/html-hint.js +348 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/javascript-hint.js +146 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/show-hint.js +437 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/sql-hint.js +271 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/hint/xml-hint.js +110 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/coffeescript-lint.js +41 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/css-lint.js +35 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/html-lint.js +46 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/javascript-lint.js +136 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/json-lint.js +31 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/lint.js +239 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/lint/yaml-lint.js +28 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/merge/merge.js +773 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/loadmode.js +64 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/multiplex.js +123 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/overlay.js +85 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/mode/simple.js +213 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/colorize.js +40 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode-standalone.js +157 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode.js +72 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/runmode/runmode.node.js +179 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/annotatescrollbar.js +118 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/scrollpastend.js +48 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/scroll/simplescrollbars.js +152 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/search/jump-to-line.js +49 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/search/match-highlighter.js +146 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/search/matchesonscrollbar.js +97 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/search/search.js +249 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/search/searchcursor.js +189 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/active-line.js +74 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/mark-selection.js +118 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/selection/selection-pointer.js +98 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/tern/tern.js +701 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/tern/worker.js +44 -0
- data/vendor/assets/javascripts/locomotive/codemirror/addons/wrap/hardwrap.js +144 -0
- data/vendor/assets/javascripts/locomotive/codemirror/keymaps/emacs.js +412 -0
- data/vendor/assets/javascripts/locomotive/codemirror/keymaps/sublime.js +580 -0
- data/vendor/assets/javascripts/locomotive/codemirror/keymaps/vim.js +5065 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/apl.js +174 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/asciiarmor.js +73 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/asn.1.js +204 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/asterisk.js +196 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/brainfuck.js +85 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/clike.js +786 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/clojure.js +306 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/cmake.js +97 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/cobol.js +255 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/coffeescript.js +355 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/commonlisp.js +123 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/crystal.js +391 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/css.js +825 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/cypher.js +146 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/d.js +218 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/dart.js +157 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/diff.js +47 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/django.js +356 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/dockerfile.js +79 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/dtd.js +142 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/dylan.js +344 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ebnf.js +195 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ecl.js +206 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/eiffel.js +160 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/elm.js +205 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/erlang.js +618 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/factor.js +83 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/fcl.js +173 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/forth.js +180 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/fortran.js +188 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/gas.js +345 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/gfm.js +130 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/gherkin.js +178 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/go.js +185 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/groovy.js +230 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/haml.js +161 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/handlebars.js +62 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/haskell-literate.js +43 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/haskell.js +267 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/haxe.js +515 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/htmlembedded.js +28 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/htmlmixed.js +152 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/http.js +113 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/idl.js +290 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/jade.js +590 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/javascript.js +748 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/jinja2.js +142 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/jsx.js +147 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/julia.js +392 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/livescript.js +280 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/lua.js +159 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/markdown.js +797 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mathematica.js +176 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mbox.js +129 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mirc.js +193 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mllike.js +205 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/modelica.js +245 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mscgen.js +169 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/mumps.js +148 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/nginx.js +178 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/nsis.js +95 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ntriples.js +186 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/octave.js +135 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/oz.js +252 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/pascal.js +109 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/pegjs.js +114 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/perl.js +837 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/php.js +234 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/pig.js +178 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/powershell.js +396 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/properties.js +78 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/protobuf.js +68 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/puppet.js +220 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/python.js +340 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/q.js +139 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/r.js +164 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/rpm.js +109 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/rst.js +557 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ruby.js +285 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/rust.js +71 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/sas.js +315 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/sass.js +414 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/scheme.js +249 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/shell.js +139 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/sieve.js +193 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/slim.js +575 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/smalltalk.js +168 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/smarty.js +225 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/solr.js +104 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/soy.js +199 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/sparql.js +180 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/spreadsheet.js +112 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/sql.js +413 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/stex.js +251 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/stylus.js +769 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/swift.js +202 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/tcl.js +139 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/textile.js +469 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/tiddlywiki.js +308 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/tiki.js +312 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/toml.js +88 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/tornado.js +68 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/troff.js +84 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ttcn-cfg.js +214 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/ttcn.js +283 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/turtle.js +162 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/twig.js +141 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/vb.js +276 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/vbscript.js +350 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/velocity.js +201 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/verilog.js +537 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/vhdl.js +189 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/vue.js +69 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/webidl.js +195 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/xml.js +394 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/xquery.js +437 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/yacas.js +204 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/yaml-frontmatter.js +68 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/yaml.js +117 -0
- data/vendor/assets/javascripts/locomotive/codemirror/modes/z80.js +116 -0
- data/vendor/assets/javascripts/locomotive/codemirror.js +8922 -0
- data/vendor/assets/javascripts/locomotive/select2.js +436 -175
- data/vendor/assets/javascripts/locomotive/wysihtml5x-toolbar.js +1346 -564
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/dialog/dialog.css +32 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/display/fullscreen.css +6 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/fold/foldgutter.css +20 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/hint/show-hint.css +37 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/lint/lint.css +73 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/merge/merge.css +113 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/addons/tern/tern.css +87 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/modes/tiddlywiki.css +14 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/modes/tiki.css +26 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/3024-day.css +41 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/3024-night.css +39 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/abcdef.css +32 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/ambiance-mobile.css +5 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/ambiance.css +74 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/base16-dark.css +38 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/base16-light.css +38 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/bespin.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/blackboard.css +32 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/cobalt.css +25 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/colorforth.css +33 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/dracula.css +41 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/eclipse.css +23 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/elegant.css +13 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/erlang-dark.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/hopscotch.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/icecoder.css +43 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/isotope.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/lesser-dark.css +47 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/liquibyte.css +95 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/material.css +53 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/mbo.css +37 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/mdn-like.css +46 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/midnight.css +45 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/monokai.css +36 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/neat.css +12 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/neo.css +43 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/night.css +27 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/paraiso-dark.css +38 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/paraiso-light.css +38 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/pastel-on-dark.css +53 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/railscasts.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/rubyblue.css +25 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/seti.css +44 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/solarized.css +169 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/the-matrix.css +30 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/tomorrow-night-bright.css +35 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/tomorrow-night-eighties.css +38 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/ttcn.css +64 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/twilight.css +32 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/vibrant-ink.css +34 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/xq-dark.css +53 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/xq-light.css +43 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/yeti.css +44 -0
- data/vendor/assets/stylesheets/locomotive/codemirror/themes/zenburn.css +37 -0
- data/vendor/assets/stylesheets/locomotive/codemirror.css +347 -0
- data/vendor/assets/stylesheets/locomotive/select2.css +3 -6
- metadata +349 -128
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a6acc9d2e0d4cd3e9cf7d3f8e67c1821bb63d727a95494b6f67d3b417a21d36f
|
4
|
+
data.tar.gz: 8c57132ce3fb4c4a2d0fb057a8c5b2cb290dabe8a98d00540afef80c732ce4be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 16670cae9c6cfdc39093965a0c98851dfb44bbacca1f98287ada5bd64d85828cb005c70b4487d9850b85121dfbb44819969e9ad114f1359896230c6bc8e2b469
|
7
|
+
data.tar.gz: d347dd0116761ea81390523c57fab97ae9dd5e3f7f3223302f8fb103469992291e8f56da22087e7b28fc4cd6f50c85fa184e2d99330ecf5a19fccdc64a8c2803
|
data/MIT-LICENSE
CHANGED
data/README.md
CHANGED
@@ -39,9 +39,10 @@ Have a look at our [Trello](https://trello.com/b/kRiy1dZu/locomotive-v3) board t
|
|
39
39
|
|
40
40
|
Here is a list of the main gems used to power the Locomotive platform:
|
41
41
|
|
42
|
-
-
|
42
|
+
- Ruby 3+
|
43
|
+
- Rails 7 - *web framework*
|
43
44
|
- Bootstrap - *UI framework*
|
44
|
-
- Mongoid
|
45
|
+
- Mongoid 7 - *Object-Document-Mapper for MongoDB 6*
|
45
46
|
- Devise 4 - *Authentication*
|
46
47
|
- Carrierwave - *Upload*
|
47
48
|
- Pundit - *Permissions*
|
@@ -71,4 +72,4 @@ Locomotive is an open source project, we encourage contributions. If you have fo
|
|
71
72
|
|
72
73
|
Feel free to contact me at didier at nocoffee dot fr.
|
73
74
|
|
74
|
-
Copyright (c)
|
75
|
+
Copyright (c) 2010-2024 NoCoffee, released under the MIT license
|
data/Rakefile
CHANGED
@@ -14,6 +14,8 @@ RDoc::Task.new(:rdoc) do |rdoc|
|
|
14
14
|
rdoc.rdoc_files.include('lib/**/*.rb')
|
15
15
|
end
|
16
16
|
|
17
|
+
APP_RAKEFILE = File.expand_path('spec/dummy/Rakefile', __dir__)
|
18
|
+
load 'rails/tasks/engine.rake'
|
17
19
|
load 'rails/tasks/statistics.rake'
|
18
20
|
|
19
21
|
require 'bundler/gem_tasks'
|
@@ -24,6 +26,8 @@ begin
|
|
24
26
|
rescue LoadError
|
25
27
|
end
|
26
28
|
|
29
|
+
# load './lib/tasks/development_tasks.rake'
|
30
|
+
|
27
31
|
require 'webdrivers'
|
28
32
|
load 'webdrivers/Rakefile'
|
29
33
|
|
data/app/api/locomotive/api.rb
CHANGED
@@ -8,8 +8,8 @@
|
|
8
8
|
//= require jquery-ui
|
9
9
|
//= require jquery_ujs
|
10
10
|
//= require bootstrap-sprockets
|
11
|
-
//= require codemirror
|
12
|
-
//= require codemirror/modes/markdown
|
11
|
+
//= require locomotive/codemirror
|
12
|
+
//= require locomotive/codemirror/modes/markdown
|
13
13
|
//= require locomotive/vendor
|
14
14
|
//= require ./locomotive/application
|
15
15
|
|
@@ -9,7 +9,7 @@ module Locomotive
|
|
9
9
|
include Locomotive::Concerns::StoreLocationController
|
10
10
|
include Locomotive::Concerns::WithinSiteController
|
11
11
|
|
12
|
-
layout '
|
12
|
+
layout 'locomotive/layouts/application'
|
13
13
|
|
14
14
|
helper Locomotive::BaseHelper, Locomotive::ErrorsHelper
|
15
15
|
|
@@ -7,10 +7,12 @@ module Locomotive
|
|
7
7
|
|
8
8
|
within_site_only_if_existing true
|
9
9
|
|
10
|
-
layout '
|
10
|
+
layout 'locomotive/layouts/account'
|
11
11
|
|
12
12
|
helper Locomotive::BaseHelper
|
13
13
|
|
14
|
+
respond_to :html, :json
|
15
|
+
|
14
16
|
before_action :set_locale
|
15
17
|
|
16
18
|
def update
|
@@ -4,12 +4,14 @@ module Locomotive
|
|
4
4
|
include Locomotive::Concerns::SslController
|
5
5
|
include Locomotive::Concerns::RedirectToMainHostController
|
6
6
|
|
7
|
-
layout '
|
7
|
+
layout 'locomotive/layouts/account'
|
8
8
|
|
9
9
|
before_action :configure_permitted_parameters
|
10
10
|
|
11
11
|
helper Locomotive::BaseHelper
|
12
12
|
|
13
|
+
respond_to :html, :json
|
14
|
+
|
13
15
|
before_action :set_locale
|
14
16
|
|
15
17
|
private
|
@@ -7,10 +7,12 @@ module Locomotive
|
|
7
7
|
|
8
8
|
within_site_only_if_existing true # Note: do not validate the membership
|
9
9
|
|
10
|
-
layout '
|
10
|
+
layout 'locomotive/layouts/account'
|
11
11
|
|
12
12
|
before_action :set_locale
|
13
13
|
|
14
|
+
respond_to :html, :json
|
15
|
+
|
14
16
|
helper Locomotive::BaseHelper
|
15
17
|
|
16
18
|
private
|
@@ -276,13 +276,13 @@ module Locomotive
|
|
276
276
|
|
277
277
|
def cache_key_for_sidebar_pages
|
278
278
|
count = current_site.pages.count
|
279
|
-
max_updated_at = current_site.pages.max(:updated_at).try(:utc).try(:
|
279
|
+
max_updated_at = current_site.pages.max(:updated_at).try(:utc).try(:to_fs, :number).to_i
|
280
280
|
base_cache_key_for_sidebar + ['pages', count, max_updated_at, current_content_locale]
|
281
281
|
end
|
282
282
|
|
283
283
|
def cache_key_for_sidebar_content_types
|
284
284
|
count = current_site.content_types.count
|
285
|
-
max_updated_at = current_site.content_types.max(:updated_at).try(:utc).try(:
|
285
|
+
max_updated_at = current_site.content_types.max(:updated_at).try(:utc).try(:to_fs, :number).to_i
|
286
286
|
base_cache_key_for_sidebar + ['content_types', count, max_updated_at]
|
287
287
|
end
|
288
288
|
|
@@ -55,7 +55,7 @@ module Locomotive
|
|
55
55
|
{
|
56
56
|
name: field.name,
|
57
57
|
label: label_for_custom_field(form.object, field),
|
58
|
-
hint: field.hint,
|
58
|
+
hint: raw(field.hint),
|
59
59
|
required: field.required,
|
60
60
|
input_html: {
|
61
61
|
class: "#{'input-lg' if highlighted}"
|
@@ -225,7 +225,7 @@ module Locomotive
|
|
225
225
|
end
|
226
226
|
|
227
227
|
def custom_field_t(name, type, interpolation = {})
|
228
|
-
t(name, { scope: ['locomotive.custom_fields.types', type] }.merge(interpolation))
|
228
|
+
t(name, **{ scope: ['locomotive.custom_fields.types', type] }.merge(interpolation))
|
229
229
|
end
|
230
230
|
|
231
231
|
end
|
@@ -42,7 +42,7 @@ module Locomotive
|
|
42
42
|
end
|
43
43
|
|
44
44
|
def activity_key_to_sentence(key, options = nil)
|
45
|
-
I18n.t(key, (options || {}).merge(scope: 'locomotive.activity')).html_safe
|
45
|
+
I18n.t(key, **(options || {}).merge(scope: 'locomotive.activity')).html_safe
|
46
46
|
end
|
47
47
|
|
48
48
|
def activity_emphasize(text)
|
@@ -31,7 +31,7 @@ module Locomotive
|
|
31
31
|
|
32
32
|
def new_content_entry_subject(entry, options)
|
33
33
|
if entry.content_type.public_submission_title_template.blank?
|
34
|
-
t('locomotive.notifications.new_content_entry.subject', options)
|
34
|
+
t('locomotive.notifications.new_content_entry.subject', **options)
|
35
35
|
else
|
36
36
|
entry.content_type.public_submission_title(entry, options)
|
37
37
|
end
|
@@ -4,7 +4,7 @@ module Locomotive
|
|
4
4
|
include Locomotive::Mongoid::Document
|
5
5
|
devise *Locomotive.config.devise_modules
|
6
6
|
acts_as_token_authenticatable
|
7
|
-
include Locomotive::Concerns::Account::
|
7
|
+
include Locomotive::Concerns::Account::APIKey
|
8
8
|
|
9
9
|
## devise fields (need to be declared since 2.x) ##
|
10
10
|
field :remember_created_at, type: Time
|
@@ -68,7 +68,7 @@ module Locomotive
|
|
68
68
|
fields = content_type.ordered_entries_custom_fields
|
69
69
|
labels = fields.map(&:label) << I18n.t('mongoid.attributes.locomotive/content_entry.created_at')
|
70
70
|
|
71
|
-
CSV.generate(csv_options) do |csv|
|
71
|
+
CSV.generate(**csv_options) do |csv|
|
72
72
|
# header
|
73
73
|
csv << labels
|
74
74
|
# body
|
@@ -67,14 +67,14 @@ module Locomotive
|
|
67
67
|
end
|
68
68
|
|
69
69
|
def similar_slug(slug)
|
70
|
-
|
70
|
+
_last_slug = self.class.where(_slug: /^#{slug}-?\d*$/i)
|
71
71
|
.excludes(_id: self._id)
|
72
|
-
.
|
73
|
-
.
|
72
|
+
.order_by(:created_at.desc)
|
73
|
+
.pluck(:_slug)
|
74
74
|
.first
|
75
75
|
|
76
|
-
if
|
77
|
-
|
76
|
+
if _last_slug
|
77
|
+
_last_slug[::Mongoid::Fields::I18n.locale.to_s]
|
78
78
|
else
|
79
79
|
nil
|
80
80
|
end
|
@@ -27,9 +27,9 @@ module Locomotive
|
|
27
27
|
|
28
28
|
steam_repositories.content_entry.with(to_steam).build(entry_attributes).tap do |entity|
|
29
29
|
# copy error messages
|
30
|
-
entry.errors.each do |
|
31
|
-
next if
|
32
|
-
entity.errors.add(
|
30
|
+
entry.errors.each do |error|
|
31
|
+
next if error.attribute == :_slug
|
32
|
+
entity.errors.add(error.attribute, error.message)
|
33
33
|
end
|
34
34
|
end
|
35
35
|
end
|
@@ -188,7 +188,7 @@ module Locomotive
|
|
188
188
|
# attribute got changed.
|
189
189
|
#
|
190
190
|
def propagate_templatized
|
191
|
-
return unless self.
|
191
|
+
return unless self.templatized_previously_changed?
|
192
192
|
|
193
193
|
selector = { 'parent_ids' => { '$in' => [self._id] } }
|
194
194
|
operations = {
|
@@ -9,7 +9,10 @@ module Locomotive
|
|
9
9
|
|
10
10
|
def json_attribute(name)
|
11
11
|
validate { |record| record.send(:json_attribute_must_be_valid, name) }
|
12
|
-
before_validation
|
12
|
+
before_validation do |record|
|
13
|
+
record.send(:add_json_uncastable_values_error, name)
|
14
|
+
record.send(:add_json_parsing_error, name)
|
15
|
+
end
|
13
16
|
|
14
17
|
define_method(:"#{name}=") do |json|
|
15
18
|
super(decode_json(name, json))
|
@@ -22,7 +25,7 @@ module Locomotive
|
|
22
25
|
|
23
26
|
def decode_json(name, json)
|
24
27
|
begin
|
25
|
-
value = json.is_a?(String) ? ActiveSupport::JSON.decode(
|
28
|
+
value = json.is_a?(String) ? ActiveSupport::JSON.decode(CGI.unescape(json)) : json
|
26
29
|
instance_variable_set(:"@#{name}_json_parsing_error", nil)
|
27
30
|
value
|
28
31
|
rescue ActiveSupport::JSON.parse_error
|
@@ -44,6 +47,22 @@ module Locomotive
|
|
44
47
|
end
|
45
48
|
end
|
46
49
|
|
50
|
+
# https://www.mongodb.com/docs/mongoid/current/reference/fields/#uncastable-values
|
51
|
+
def add_json_uncastable_values_error(name)
|
52
|
+
value_before = attributes_before_type_cast[name.to_s]
|
53
|
+
value_now = self.send(name)
|
54
|
+
|
55
|
+
return if value_now
|
56
|
+
|
57
|
+
# if the field is localized, take the translated value (current locale)
|
58
|
+
if value_before && fields[name.to_s].try(:localized?) && value_before.respond_to?(:key?)
|
59
|
+
value_before = value_before[::Mongoid::Fields::I18n.locale]
|
60
|
+
end
|
61
|
+
|
62
|
+
# Uncastable value detected!
|
63
|
+
self.errors.add(name, 'has a wrong object type') if !value_before.nil?
|
64
|
+
end
|
65
|
+
|
47
66
|
def add_json_parsing_error(name)
|
48
67
|
error = instance_variable_get(:"@#{name}_json_parsing_error")
|
49
68
|
|
@@ -38,8 +38,8 @@ module Locomotive
|
|
38
38
|
scope :latest_updated, -> { order_by(updated_at: :desc).limit(Locomotive.config.ui[:latest_entries_nb]) }
|
39
39
|
scope :next_or_previous,
|
40
40
|
->(condition, order_by) { where({ _visible: true }.merge(condition)).limit(1).order_by(order_by) }
|
41
|
-
scope :by_id_or_slug, ->(id_or_slug) {
|
42
|
-
scope :by_ids_or_slugs, ->(ids_or_slugs) {
|
41
|
+
scope :by_id_or_slug, ->(id_or_slug) { where('$or' => [{ _id: id_or_slug }, { _slug: id_or_slug }]) }
|
42
|
+
scope :by_ids_or_slugs, ->(ids_or_slugs) { where('$or' => [{ :_slug.in => [*ids_or_slugs] }, { :_id.in => [*ids_or_slugs] }]) }
|
43
43
|
|
44
44
|
## indexes ##
|
45
45
|
index _type: 1
|
@@ -64,7 +64,7 @@ module Locomotive
|
|
64
64
|
scope :handle, ->(handle) { where(handle: handle) }
|
65
65
|
scope :minimal_attributes, -> { without(:raw_template, :template) }
|
66
66
|
scope :dependent_from, ->(id) { where(:template_dependencies.in => [id]) }
|
67
|
-
scope :by_id_or_fullpath, ->(id_or_fullpath) {
|
67
|
+
scope :by_id_or_fullpath, ->(id_or_fullpath) { any_of({ _id: id_or_fullpath }, { fullpath: id_or_fullpath }) }
|
68
68
|
|
69
69
|
delegate :fullpath, to: :parent, prefix: true
|
70
70
|
|
@@ -111,7 +111,7 @@ module Locomotive
|
|
111
111
|
end
|
112
112
|
|
113
113
|
def touch_site_attribute
|
114
|
-
self.
|
114
|
+
self.raw_template_previously_changed? ? :template_version : :content_version
|
115
115
|
end
|
116
116
|
|
117
117
|
protected
|
@@ -145,7 +145,7 @@ module Locomotive
|
|
145
145
|
end
|
146
146
|
|
147
147
|
def update_children
|
148
|
-
self.children.map(&:save) if self.
|
148
|
+
self.children.map(&:save) if self.slug_previously_changed? or self.fullpath_previously_changed?
|
149
149
|
end
|
150
150
|
|
151
151
|
def record_current_locale
|
@@ -17,7 +17,7 @@ module Locomotive
|
|
17
17
|
validates_uniqueness_of :slug, scope: :site_id
|
18
18
|
|
19
19
|
## named scopes ##
|
20
|
-
scope :by_id_or_slug, ->(id_or_slug) {
|
20
|
+
scope :by_id_or_slug, ->(id_or_slug) { where('$or' => [{ _id: id_or_slug }, { slug: id_or_slug }]) }
|
21
21
|
|
22
22
|
## behaviours ##
|
23
23
|
slugify_from :name
|
@@ -15,7 +15,7 @@ module Locomotive
|
|
15
15
|
validates_uniqueness_of :slug, scope: :site_id
|
16
16
|
|
17
17
|
## named scopes ##
|
18
|
-
scope :by_id_or_slug, ->(id_or_slug) {
|
18
|
+
scope :by_id_or_slug, ->(id_or_slug) { where('$or' => [{ _id: id_or_slug }, { slug: id_or_slug }]) }
|
19
19
|
|
20
20
|
## behaviours ##
|
21
21
|
slugify_from :name
|
@@ -16,7 +16,7 @@ module Locomotive
|
|
16
16
|
|
17
17
|
## named scopes ##
|
18
18
|
scope :ordered, -> { order_by(key: :asc) }
|
19
|
-
scope :by_id_or_key, ->(id_or_key) {
|
19
|
+
scope :by_id_or_key, ->(id_or_key) { where('$or' => [{ _id: id_or_key }, { key: id_or_key }]) }
|
20
20
|
|
21
21
|
## callbacks ##
|
22
22
|
before_validation :underscore_key
|
@@ -71,7 +71,7 @@ module Locomotive
|
|
71
71
|
csv_options = { headers: true, col_sep: ';', quote_char: "\"" }.merge(csv_options || {})
|
72
72
|
asset = content_assets.where(id: csv_asset_id).first
|
73
73
|
raise 'The CSV file doesn\'t exist anymore' unless asset
|
74
|
-
CSV.parse(asset.source.read, csv_options)
|
74
|
+
CSV.parse(asset.source.read, **csv_options)
|
75
75
|
rescue Exception => e
|
76
76
|
raise WrongImportFileException.new e.message
|
77
77
|
end
|
@@ -169,10 +169,10 @@ module Locomotive
|
|
169
169
|
def send_notifications(entry, emails = nil)
|
170
170
|
return unless self.content_type.public_submission_enabled?
|
171
171
|
|
172
|
-
Locomotive::Account.
|
172
|
+
Locomotive::Account.where('$or' => [
|
173
173
|
{ :_id.in => self.content_type.public_submission_accounts || [] },
|
174
174
|
{ :email.in => emails || [] }
|
175
|
-
).each do |account|
|
175
|
+
]).each do |account|
|
176
176
|
Locomotive::Notifications.new_content_entry(site, account, entry).deliver
|
177
177
|
end
|
178
178
|
end
|
@@ -2,9 +2,19 @@ module Locomotive
|
|
2
2
|
class ContentTypeService < Struct.new(:site)
|
3
3
|
|
4
4
|
def list
|
5
|
-
site
|
6
|
-
|
7
|
-
|
5
|
+
site
|
6
|
+
.content_types
|
7
|
+
.order_by(:'display_settings.position'.asc, :name.asc)
|
8
|
+
.pluck(:_id, :name, :slug, :number_of_entries, :display_settings)
|
9
|
+
.map do |(_id, name, slug, number_of_entries, display_settings)|
|
10
|
+
Locomotive::ContentType.new(
|
11
|
+
_id: _id,
|
12
|
+
name: name,
|
13
|
+
slug: slug,
|
14
|
+
number_of_entries: number_of_entries,
|
15
|
+
display_settings: display_settings
|
16
|
+
)
|
17
|
+
end
|
8
18
|
end
|
9
19
|
|
10
20
|
def find_by_slug(slug)
|
@@ -27,10 +27,10 @@ module Locomotive
|
|
27
27
|
if include_new_options && locale != default_locale
|
28
28
|
::Mongoid::Fields::I18n.with_locale(default_locale) do
|
29
29
|
self.field.reload.select_options.each do |option|
|
30
|
-
next unless option.attributes[
|
30
|
+
next unless option.attributes['name'][default_locale.to_s].blank?
|
31
31
|
|
32
32
|
# force the name in the default locale
|
33
|
-
option.name = option.attributes[
|
33
|
+
option.name = option.attributes['name'].values.first
|
34
34
|
end
|
35
35
|
end
|
36
36
|
|
@@ -38,7 +38,7 @@ module Locomotive
|
|
38
38
|
site.pages
|
39
39
|
.only(:_id, :title, :sections_dropzone_content, :sections_content)
|
40
40
|
.where(is_layout: false, target_klass_name: nil, :slug.ne => '404')
|
41
|
-
.or({ title: /#{query}/i }, { _id: query })
|
41
|
+
.and(Locomotive::Page.or({ title: /#{query}/i }, { _id: query }))
|
42
42
|
.limit(max_results)
|
43
43
|
.sort(title: 1).map do |page|
|
44
44
|
{
|
@@ -2,15 +2,5 @@
|
|
2
2
|
|
3
3
|
module Locomotive
|
4
4
|
class BaseUploader < ::CarrierWave::Uploader::Base
|
5
|
-
include ::CarrierWave::ImageOptim
|
6
|
-
|
7
|
-
if Locomotive.config.optimize_uploaded_files
|
8
|
-
process optimize: [{
|
9
|
-
gifsicle: true,
|
10
|
-
jpegoptim: { allow_lossy: true, max_quality: 75 },
|
11
|
-
optipng: { level: 4 }
|
12
|
-
}]
|
13
|
-
end
|
14
|
-
|
15
5
|
end
|
16
6
|
end
|