outpost-cms 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/README.md +19 -1
- data/Rakefile +0 -12
- data/app/assets/javascripts/outpost.js +1 -1
- data/app/assets/javascripts/outpost/auto_slug_field.js.coffee +6 -6
- data/app/assets/javascripts/outpost/date_time_input.js.coffee +13 -13
- data/app/assets/javascripts/outpost/field_counter.js.coffee +15 -15
- data/app/assets/javascripts/outpost/field_manager.js.coffee +3 -3
- data/app/assets/javascripts/outpost/global_plugins.js.coffee +16 -19
- data/app/assets/javascripts/outpost/index_manager.js.coffee +12 -12
- data/app/assets/javascripts/outpost/notification.js.coffee +33 -11
- data/app/assets/javascripts/outpost/preview.js.coffee +4 -4
- data/app/assets/javascripts/outpost/utilities.js.coffee +13 -0
- data/app/assets/stylesheets/outpost/_base.css.scss +9 -9
- data/app/assets/stylesheets/outpost/_forms.css.scss +28 -15
- data/app/assets/stylesheets/outpost/_index.css.scss +2 -2
- data/app/assets/stylesheets/outpost/_utility.css.scss +1 -1
- data/app/controllers/outpost/application_controller.rb +5 -3
- data/app/controllers/outpost/errors_controller.rb +2 -1
- data/app/controllers/outpost/resource_controller.rb +1 -1
- data/app/controllers/outpost/sessions_controller.rb +10 -5
- data/app/helpers/authorization_helper.rb +3 -3
- data/app/helpers/list_helper.rb +72 -49
- data/app/helpers/outpost_helper.rb +4 -4
- data/app/helpers/render_helper.rb +5 -5
- data/app/helpers/utility_helper.rb +5 -5
- data/app/models/permission.rb +8 -5
- data/app/views/layouts/outpost/application.html.erb +7 -7
- data/app/views/layouts/outpost/minimal.html.erb +1 -1
- data/app/views/outpost/errors/error_500.html.erb +1 -1
- data/app/views/outpost/resource/_errors.html.erb +2 -11
- data/app/views/outpost/resource/edit.html.erb +8 -4
- data/app/views/outpost/resource/new.html.erb +5 -1
- data/app/views/outpost/sessions/new.html.erb +1 -1
- data/app/views/outpost/shared/_filters.html.erb +2 -2
- data/app/views/outpost/shared/_form_block.html.erb +2 -2
- data/app/views/outpost/shared/_form_nav.html.erb +1 -1
- data/app/views/outpost/shared/_full_errors.html.erb +9 -0
- data/app/views/outpost/shared/_headers.html.erb +4 -4
- data/app/views/outpost/shared/_navigation.html.erb +4 -4
- data/app/views/outpost/shared/_submit_row.html.erb +5 -5
- data/lib/action_view/helpers/form_builder.rb +28 -16
- data/lib/outpost.rb +8 -5
- data/lib/outpost/breadcrumbs.rb +13 -11
- data/lib/outpost/config.rb +6 -6
- data/lib/outpost/controller.rb +8 -2
- data/lib/outpost/controller/actions.rb +3 -3
- data/lib/outpost/controller/authentication.rb +2 -1
- data/lib/outpost/controller/authorization.rb +3 -2
- data/lib/outpost/controller/callbacks.rb +2 -1
- data/lib/outpost/controller/custom_errors.rb +44 -13
- data/lib/outpost/controller/helpers.rb +1 -29
- data/lib/outpost/controller/ordering.rb +59 -16
- data/lib/outpost/controller/preferences.rb +3 -3
- data/lib/outpost/helpers/naming.rb +2 -2
- data/lib/outpost/hook.rb +5 -5
- data/lib/outpost/list.rb +3 -3
- data/lib/outpost/list/base.rb +23 -13
- data/lib/outpost/list/column.rb +13 -4
- data/lib/outpost/list/filter.rb +4 -4
- data/lib/outpost/model.rb +2 -2
- data/lib/outpost/model/authentication.rb +6 -2
- data/lib/outpost/model/authorization.rb +1 -2
- data/lib/outpost/model/identifier.rb +15 -10
- data/lib/outpost/model/methods.rb +2 -2
- data/lib/outpost/model/naming.rb +10 -7
- data/lib/outpost/model/routing.rb +6 -6
- data/lib/outpost/model/serializer.rb +3 -3
- data/lib/outpost/version.rb +1 -1
- data/spec/controllers/authentication_spec.rb +10 -10
- data/spec/controllers/sessions_controller_spec.rb +17 -17
- data/spec/factories.rb +1 -1
- data/spec/features/authentication_spec.rb +43 -0
- data/spec/features/authorization_spec.rb +28 -0
- data/spec/features/creating_spec.rb +44 -0
- data/spec/features/destroying_spec.rb +18 -0
- data/spec/features/editing_spec.rb +43 -0
- data/spec/features/save_options_spec.rb +35 -0
- data/spec/helpers/authorization_helper_spec.rb +8 -8
- data/spec/helpers/list_helper_spec.rb +34 -0
- data/spec/helpers/render_helper_spec.rb +1 -1
- data/spec/helpers/utility_helper_spec.rb +10 -10
- data/spec/internal/app/controllers/outpost/people_controller.rb +3 -3
- data/spec/internal/app/models/person.rb +3 -0
- data/spec/internal/config/routes.rb +1 -1
- data/spec/internal/db/combustion_test.sqlite +0 -0
- data/spec/internal/log/test.log +35260 -53251
- data/spec/internal/tmp/cache/assets/test/sass/20f5650af539e2cc0c7216330842920da53e851d/bootstrap.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/20f5650af539e2cc0c7216330842920da53e851d/datepicker.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_labels-badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_layouts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_reset.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_sprites.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/4867dc0a3f589a0a2c9635bfeae1ddc8691d74a0/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/56c521c2866fc194cbbf1ead1ad9e7d727f5e7b3/select2.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/87aa0c8b43c5e29ce88dd86b1a2c657232e4bb6f/outpost.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cde194af3b19eae3aef82845ab8bc0df6c0d84d4/select2.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_labels-badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_layouts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_reset.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_sprites.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/cee3b45c60038923cb15e74edf0b508296df0b89/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_alerts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_breadcrumbs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_button-groups.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_buttons.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_close.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_code.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_component-animations.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_dropdowns.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_forms.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_grid.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_labels-badges.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_layouts.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_mixins.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_modals.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_navbar.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_navs.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_pager.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_pagination.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_reset.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_scaffolding.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_sprites.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_tables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_type.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_utilities.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_variables.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/db455d3ae1e484fbc281e7097adf4ecb850d7d10/_wells.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/e1eb86f6478445881765984079761fb4af85ab4e/select2.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_base.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_edit.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_forms.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_index.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/_utility.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/application.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/outpost.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sass/ea24470654f74c1fe92aa45b2fae66b2a464a390/select2.css.scssc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/00154e1fc60e5765eb3704d402af06d1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0122e4f8c5576de5137307df7d6163a0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/016db564806ffd72c90385066f2d1526 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0185dbaba82d3fbc0fd9d2383dc7338d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/01a8e4b866eb7fc8ea5ed3941f1b1877 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/02713d4140ec033db3e897e7597c2096 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0377ae38f0ab4fa7131b364012d9a4fa +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/04effed13eef407140fbe39b6efae4b2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/086d226e30e05ea260b6d01a4fbd8a29 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0a032a3ea9ed2f90e27e350839fcc8dc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0bc810339d0afdbe60e338e0041023cc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0e167df01ba09061de9f5c49cfdccc99 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/0e69140d2c49ad3bd2a53e1a61ca911f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/15a87828df71925cca15a55b77afcf64 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/19b0f301c27628308ff1f81a322fcaa9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1b718773e74da99a05a30cc200c74d2b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1d2a3ed3a5ee7d864dccd4feb0298858 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1dfbb70993a8817b5e5aee44b888309d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1e397e58ea65aa807232e81ba0646007 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1e85a069dc1fa2fd3a325dd73115819a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/1fa01b5b6a31a3380b9f7926508624cb +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/21f2bd9f5281712ad2d8c772fd407505 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/235664cdcf9cd81bf6a89a09e1e5711a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/23643a6f2a1f5c182681eca82a12b3b5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/25f2c3cb96afc04742cb792a8adf703a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/26ad3186c36f3514d1028fb00180ed9c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/271f465e2ee560eee64005efa04346de +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/29a5c683744eb88ed1292f59cd6063c9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2bb02e7009e6fec07e0ed0d01a1cf997 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2cb954dcae3aa6f587625543070feb84 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/2f2c37a813522cd1889d2ebdfb2d2a66 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/316c469209d39a7bdac5c11828cf8d74 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/31be2b6ebd86190dc1ec80ce5f0833c5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/36372f01bbdb43b410ec5192f7b6902f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3717c6d6d1b1afd049b633417ed63cdd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/37abf1a201cc821dfc13cc427659a47b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/38341483f58eeea1d871954dbe986267 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/38aa3f8364fc8f118029ff4651c72221 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3e5a01607dc58566739854e9f3ce5024 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3f1c054c86b6510099f8e6c5dfe7ff3a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3f744831928042565f7903a46a39791c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/3fadb5164d4b3caf81ef217fcde0d142 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/44020d882ece5491178ab3560f0d47a6 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/450ba61c4dc9c4cfa9f7efa5c9bba83d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4543f412f8a876cd357e5888a4453e5d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4a0eb5dbdb969be5257139300ae901a9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4ad30c03a35f4b46291c9c6331c43567 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4c55f0b46f9bfc697010c07487d932e1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4d5649fe189b1fdead6428fdd2b9fafd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4d779cbf3db6f14b3e022a5e5758d72d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4ed642ba978ceb9502349fa8e6676440 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/4f6d52d657e0c1e635762f3edc6e8e20 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/50ae0bcf805250caf4ae4c4e01deebc9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/53fc0263b1ce55a46ed55c461a2a8696 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/53fee1ff706022963c15ff24d5c53b54 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/54746a8bf1cdccbce2a3cfb4af05aef8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/595ad1f5b58343141474f9211039df61 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5c8c03be6364f23b4008487f351afa73 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5d1e25ab219593639db982c901882c0f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5d676e2352411dd3f05c6cee14727d1c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5e2716f68ca78a5c0c83b157db90fc0d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/5e3f572f31041a301e0891c10f04604c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/620148b9ab753da9e8644581b619731b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6471408d963e9165f8831b4bab80edd9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/64a8cb638857a130dbabae4d1633618e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6503f1ef9797aafce9339deb9200cfca +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6519463c3d8d8a34d743ef38eff5df45 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/656b07036edb74305c343f41eba55695 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6571b577767caea14c3b89201d0643a2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6748f4abf46d0d2f516279ec032fd817 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/67a11a42996d51802481c92dc09c83fa +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6873baccb9ed57b839e83cfb93738955 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6b9d79602e3b6ff9dd067605adeb0888 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6c3df81c5fb88b555bafde4f54db7db2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6c62bea96eebf0f05624a859e8666f9a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/6cecd8ec655b80ac006bbec236b4263b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/700c635c138594de7ac50ad4b0420a0f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/70de8c6638b3ad61a4125dfb42e41f5b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/72a7339f697b2dcde9bd4835eaa42642 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/756eb63f1239c0a7a3d85253ddb5ca0d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/76e213ff5da12faa448078def3d32db5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/76e3360cc08985753a1273cd40c3084a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/78f9aaf7b4a1253db9bdb2f2301a9b7d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7ba5aaf62125e0b56d9e46603f5f8601 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7e0d7eb383740100156a527b9e26d659 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/7e297a13578eea5ae51d5abb3be9df18 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/81670753eb8197bb1b9ca4d5a66a6fc5 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/896416332cf9f3e34262e6241b8237ef +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8b99288467087dc247c025d41444f377 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8c123b8d3cc73220c5b69f99d2168389 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8c5dcc180f78ee4957d754df726e2248 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/8e6315300501d34a896b82c0c0ceb70c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/90d6924223f69e10833fa8ef351e35ab +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9117ec941398c9b1340aa0b170ab2dc7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/91d56ecde1551ea73ef462a44b77f650 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9676f39584b5a04f92b29c0729175a8c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9788c645f0c65ea7466be1dc13f64eea +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9add31bfd5f6aaa920af7f38211f9aa2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9b08bbf9ae722116682b8e22cb38c2ec +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9bc5469fea2a4926d4744c370bae613a +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9c1b3e8d4f1bab87ed819b82da42f535 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9c736faedfe2dfe359042f9d2ce85367 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9cf76f5ce68332b0f67c2f3b896a3475 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9d484a2e742210fa6bc8be543c6331b9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/9dd86c42f919be9f13a14317e7607f31 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a0743c695fe7f2f40fc5f188fd054c2b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a0b5c6371ce0b3308fc3be90c4f9ef5b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a1e23f12c8163631dc3a2a98efd393a1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a2668b2b36e10c17a0a37e15af1adf92 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a2d1f22b3a5164f8bdf8a2e08456d9c3 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a458e44cf710f6e94208e22d3eafae3f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/a79a727e3b12ecb263735a8edecc86c2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/aaa6c30950f43b707d50ee44229c1d0f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ac25c69ce48ecf3a3a3808ba26537243 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/acb56c1b241b90a3a8694a04d7724e7d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ad5315bf4cd3b8c4d38f662ef41c44d0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b0e1d9e51dba635c57573102d479dea9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b1a78635932522eb99a619b6e190b898 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b236b354a0e5045c17b85a70f66e612d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b2a3274db2081478a289f8eeee8370c7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b49f83c898ca822909d8d2c32470cfec +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b4c4d53c35d932c2b28bcefa990ec7fc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b6f987547de2c90ebc0413d3263b87e8 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b832658770b677e87a9d095ed3a87c47 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/b9d76e389aeda53d2f9cc256f75e303b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bad56ba50db6ed97894b003103289ffe +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bb4e55b9b1a8a3bb8a8f0a10d4c6b074 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bc8ba0b8c4f10524a604a7163f16e3dd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bdfb9045b2f813ac4397c5cf0487f840 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bf20d01df22f01e0fd66116d0ce58969 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/bf6fcb4c8c96d5406899b48c688e17a2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c0291860b6abb7bdc04ccc1e990e38f0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c1195a7d9d0e930545cda22ad40b0a9c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c13a23e52c9d1956c61fb8540bfff8ef +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c1aa6b16696817c61530071b80c0cd43 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c3954ed4f5e4dced91ee1240e4f90a05 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c56fce185c88af8d191796b0172f498b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c698133fe56541139a2f0d883ca07936 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c7fcb613d0a346398fdf7a3a6ee722a1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c811799e9db5c939aab1e8e394df3b64 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c9a027b847d199e99825ea85000303cf +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c9f12fd289b0f7e670ede1eeb8d3c24c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/c9f83bead35bd9bb5c671e327174c526 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cb6a30f2c5219f77229df845e426ea71 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cbbd567516b06004eb748f5a59bc14cc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cbf827028b6168652324eb60180e21bd +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cc6766435593a06fcc9193244ea952a0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ccf22a7e27ed81a71d47f42a7cdb8e0e +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cd7d618755faec87f9c5cf47c6ae3365 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/cded6947b5642cfe05ffecc7a33ba54f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d3638dad50702ecfe0e1b3bc8e07afc4 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d5693a0bc9ebc317ed346946e8fe94ba +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d5c56cd3863549bedac1c7b3f28ae1d7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/d6ba30bdd7d4b6d5205c150734acf5fa +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dd47254dcdc30cdbffbe6c32c57032fe +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/dde6829bdb6fb77823831ab67644b76f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ded9d8a2db25b4ab7f6d4f297208ded2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/df8f0d31d3b82184ed7ded27b99b8ad4 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e29bc5278f7e0bed414f714583faceee +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e461582472217950b63ee3247041e99c +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e521c94e59f66d600e517a555502fa11 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e5be380a9dba4e6deae7a8511e4d7c13 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e744b5ae603dc485f33ed176c899adfc +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e80c7be4df818b60928137fb7c450a43 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/e8edf2c8d66f7e31710f9aa5068d1155 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ea8cf9239f191c63624cef6a3b6d2fbe +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ebb6acb80a5274f63d3ac5fd8df530b1 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ebf2e1ad04f201369fb43454efc7bbd7 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ec197b57d7a6b4163dac32744e3fa5b0 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/edb76e2e1ee82dc916a1086ca2d71de9 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/edc87d0b81267faccd7c5ada85675f9b +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ef4e09f768bb9330652eaa198bbd2c61 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ef64bea489660cf5e30a6feb53bf3a5d +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f1b8af27ca9833a0ac2a5e10763efaa2 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f5827ca48c75eb2925e0ae71f4545190 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f60d687ea69fe491a8686efe8d6b3022 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f66a526c31371958b5cd65928dd07d7f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f6d577e76daa020d3df860c5dc7f8f61 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f71d6134d0f24cb1de62de79100e19ee +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f7ace754f231b5ad97520f631ea60e01 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/f8f8cc64c68687e8c827d78d42ed93a4 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/fa2eaf4b4fc72c8cb321c6f9c022a55f +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/fa32e1bd0e55873cd424ac5e7ce5c5ac +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/fa9f906d3d676d23eac6d15f90f77876 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/fd8537c2a374241cc1d2d029ca4a3623 +0 -0
- data/spec/internal/tmp/cache/assets/test/sprockets/ff2e40602b14836c882af817459fa90e +0 -0
- data/spec/internal/tmp/capybara/capybara-201308160115352034044402.html +51 -0
- data/spec/internal/tmp/capybara/capybara-201308160118107572662369.html +140 -0
- data/spec/internal/tmp/capybara/capybara-201308160124322422773822.html +140 -0
- data/spec/internal/tmp/capybara/capybara-201308160216057700618069.html +71 -0
- data/spec/internal/tmp/capybara/capybara-201308160227299029704750.html +51 -0
- data/spec/internal/tmp/capybara/capybara-201308160227517375148134.html +51 -0
- data/spec/lib/breadcrumbs_spec.rb +5 -5
- data/spec/lib/config_spec.rb +11 -11
- data/spec/lib/controller/callbacks_spec.rb +1 -9
- data/spec/lib/controller/helpers_spec.rb +4 -4
- data/spec/lib/hook_spec.rb +1 -1
- data/spec/lib/list/base_spec.rb +18 -18
- data/spec/lib/list/column_spec.rb +4 -4
- data/spec/lib/list/filter_spec.rb +2 -2
- data/spec/lib/model/authentication_spec.rb +4 -4
- data/spec/lib/model/authorization_spec.rb +4 -4
- data/spec/lib/model/identifier_spec.rb +19 -18
- data/spec/lib/model/methods_spec.rb +1 -1
- data/spec/lib/model/naming_spec.rb +10 -10
- data/spec/lib/model/routing_spec.rb +14 -14
- data/spec/lib/model/serializer_spec.rb +1 -1
- data/spec/lib/outpost_spec.rb +5 -5
- data/spec/spec_helper.rb +7 -0
- data/spec/support/authentication_helper.rb +20 -0
- data/spec/support/authorization_helper.rb +13 -0
- metadata +632 -124
data/lib/outpost.rb
CHANGED
@@ -9,8 +9,11 @@ require 'outpost/config'
|
|
9
9
|
|
10
10
|
module Outpost
|
11
11
|
extend ActiveSupport::Autoload
|
12
|
-
|
13
|
-
OBJ_KEY_REGEX = %r{([
|
12
|
+
|
13
|
+
OBJ_KEY_REGEX = %r{([^-]+)-(\d+)}
|
14
|
+
|
15
|
+
DESCENDING = "DESC"
|
16
|
+
ASCENDING = "ASC"
|
14
17
|
|
15
18
|
autoload :Controller
|
16
19
|
autoload :Model
|
@@ -55,16 +58,16 @@ module Outpost
|
|
55
58
|
end
|
56
59
|
|
57
60
|
#--------------------
|
58
|
-
|
61
|
+
|
59
62
|
def model_classes
|
60
63
|
@model_classes ||= begin
|
61
64
|
klasses = {}
|
62
|
-
|
65
|
+
|
63
66
|
Outpost.config.registered_models.each do |name|
|
64
67
|
klass = name.constantize
|
65
68
|
klasses.merge!(klass.content_key => klass)
|
66
69
|
end
|
67
|
-
|
70
|
+
|
68
71
|
klasses
|
69
72
|
end
|
70
73
|
end
|
data/lib/outpost/breadcrumbs.rb
CHANGED
@@ -3,7 +3,7 @@
|
|
3
3
|
#
|
4
4
|
# Super-simple breadcrumbs for you and me.
|
5
5
|
# Include it into a controller
|
6
|
-
#
|
6
|
+
#
|
7
7
|
# Arguments:
|
8
8
|
# Pairs of strings. Title of breadcrumb, Path
|
9
9
|
#
|
@@ -28,9 +28,11 @@
|
|
28
28
|
# You can also define multiple breadcrumbs at once.
|
29
29
|
# Every 2 arguments is a new breadcrumb:
|
30
30
|
#
|
31
|
-
# breadcrumb "Edit",
|
31
|
+
# breadcrumb "Edit",
|
32
|
+
# outpost_edit_post_path(@post.id),
|
33
|
+
# @post.title, outpost_post_path(@post)
|
32
34
|
#
|
33
|
-
# Don't want the crumb to be linked? Just leave the
|
35
|
+
# Don't want the crumb to be linked? Just leave the
|
34
36
|
# second argument off, or +nil+ if you're defining
|
35
37
|
# multiple breadcrumbs:
|
36
38
|
#
|
@@ -40,32 +42,32 @@ module Outpost
|
|
40
42
|
class Breadcrumb
|
41
43
|
attr_accessor :title, :link
|
42
44
|
end
|
43
|
-
|
45
|
+
|
44
46
|
#---------------
|
45
|
-
|
47
|
+
|
46
48
|
module Breadcrumbs
|
47
49
|
extend ActiveSupport::Concern
|
48
|
-
|
50
|
+
|
49
51
|
included do
|
50
52
|
attr_reader :breadcrumbs
|
51
|
-
|
53
|
+
|
52
54
|
if self < ActionController::Base
|
53
55
|
helper_method :breadcrumbs
|
54
56
|
end
|
55
57
|
end
|
56
|
-
|
58
|
+
|
57
59
|
#--------------
|
58
60
|
# Use this method to add breadcrumbs.
|
59
|
-
# See Outpost::Breadcrumbs
|
61
|
+
# See Outpost::Breadcrumbs
|
60
62
|
# for usage.
|
61
63
|
def breadcrumb(*args)
|
62
64
|
@breadcrumbs ||= []
|
63
|
-
|
65
|
+
|
64
66
|
args.each_slice(2).map do |pair|
|
65
67
|
crumb = Outpost::Breadcrumb.new
|
66
68
|
crumb.title = pair[0]
|
67
69
|
crumb.link = pair[1]
|
68
|
-
|
70
|
+
|
69
71
|
@breadcrumbs.push crumb
|
70
72
|
end
|
71
73
|
end
|
data/lib/outpost/config.rb
CHANGED
@@ -10,22 +10,22 @@ module Outpost
|
|
10
10
|
:excluded_list_columns => [],
|
11
11
|
:user_class => "User",
|
12
12
|
:authentication_attribute => :email,
|
13
|
-
:preferences => [:
|
13
|
+
:preferences => [:order_attribute, :order_direction]
|
14
14
|
}
|
15
|
-
|
15
|
+
|
16
16
|
# Pass a block to this method to define the configuration
|
17
17
|
# If no block is passed, config will be defaults
|
18
18
|
def self.configure
|
19
19
|
yield Outpost.config if block_given?
|
20
20
|
Outpost.config
|
21
21
|
end
|
22
|
-
|
22
|
+
|
23
23
|
# An array of models that should show up
|
24
24
|
attr_writer :registered_models
|
25
25
|
def registered_models
|
26
26
|
@registered_models || []
|
27
27
|
end
|
28
|
-
|
28
|
+
|
29
29
|
attr_writer :preferences
|
30
30
|
def preferences
|
31
31
|
@preferences || DEFAULTS[:preferences]
|
@@ -47,13 +47,13 @@ module Outpost
|
|
47
47
|
def title_attributes
|
48
48
|
(@title_attributes ||= DEFAULTS[:title_attributes]) | [:simple_title]
|
49
49
|
end
|
50
|
-
|
50
|
+
|
51
51
|
# Ignore these attributes when building a basic form
|
52
52
|
attr_writer :excluded_form_fields
|
53
53
|
def excluded_form_fields
|
54
54
|
(@excluded_form_fields ||= []) | DEFAULTS[:excluded_form_fields]
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
# Ignore these attributes when building a basic list
|
58
58
|
attr_writer :excluded_list_columns
|
59
59
|
def excluded_list_columns
|
data/lib/outpost/controller.rb
CHANGED
@@ -14,7 +14,7 @@ module Outpost
|
|
14
14
|
autoload :Authentication
|
15
15
|
autoload :Authorization
|
16
16
|
autoload :CustomErrors
|
17
|
-
|
17
|
+
|
18
18
|
included do
|
19
19
|
helper_method :list, :model, :fields
|
20
20
|
end
|
@@ -116,7 +116,13 @@ module Outpost
|
|
116
116
|
end
|
117
117
|
|
118
118
|
def find_model
|
119
|
-
self.name
|
119
|
+
self.name
|
120
|
+
.demodulize
|
121
|
+
.underscore
|
122
|
+
.split("_")[0...-1]
|
123
|
+
.join("_")
|
124
|
+
.classify
|
125
|
+
.constantize
|
120
126
|
end
|
121
127
|
end # ClassMethods
|
122
128
|
end # Controller
|
@@ -28,7 +28,7 @@ module Outpost
|
|
28
28
|
|
29
29
|
def create
|
30
30
|
@record = model.new(form_params)
|
31
|
-
|
31
|
+
|
32
32
|
if @record.save
|
33
33
|
notice "Saved #{@record.simple_title}"
|
34
34
|
respond_with :outpost, @record, location: requested_location
|
@@ -53,9 +53,9 @@ module Outpost
|
|
53
53
|
notice "Deleted #{@record.simple_title}"
|
54
54
|
respond_with :outpost, @record
|
55
55
|
end
|
56
|
-
|
56
|
+
|
57
57
|
private
|
58
|
-
|
58
|
+
|
59
59
|
def form_params
|
60
60
|
params[model.singular_route_key]
|
61
61
|
end
|
@@ -13,7 +13,8 @@ module Outpost
|
|
13
13
|
# Returns Outpost.user_class instance.
|
14
14
|
def current_user
|
15
15
|
begin
|
16
|
-
@current_user ||= Outpost.user_class
|
16
|
+
@current_user ||= Outpost.user_class
|
17
|
+
.where(can_login: true).find(session[:user_id])
|
17
18
|
rescue ActiveRecord::RecordNotFound
|
18
19
|
session[:user_id] = nil
|
19
20
|
@current_user = nil
|
@@ -19,8 +19,9 @@ module Outpost
|
|
19
19
|
|
20
20
|
# What to do when a user doesn't have proper permissions
|
21
21
|
def handle_unauthorized(resource)
|
22
|
-
redirect_to outpost_root_path,
|
23
|
-
alert: "You don't have permission to manage
|
22
|
+
redirect_to outpost_root_path,
|
23
|
+
alert: "You don't have permission to manage " \
|
24
|
+
"#{resource.to_title.pluralize}"
|
24
25
|
return false
|
25
26
|
end
|
26
27
|
end # Authorization
|
@@ -6,7 +6,8 @@ module Outpost
|
|
6
6
|
end
|
7
7
|
|
8
8
|
def get_records
|
9
|
-
@records = model.order(
|
9
|
+
@records = model.order(
|
10
|
+
"#{model.table_name}.#{order_attribute} #{order_direction}")
|
10
11
|
.page(params[:page]).per(self.list.per_page)
|
11
12
|
end
|
12
13
|
end # Callbacks
|
@@ -2,11 +2,11 @@ module Outpost
|
|
2
2
|
module Controller
|
3
3
|
module CustomErrors
|
4
4
|
extend ActiveSupport::Concern
|
5
|
-
|
5
|
+
|
6
6
|
NOT_FOUND_ERROR_CLASSES = [
|
7
|
-
ActionController::RoutingError,
|
7
|
+
ActionController::RoutingError,
|
8
8
|
ActionController::UnknownController,
|
9
|
-
AbstractController::ActionNotFound,
|
9
|
+
AbstractController::ActionNotFound,
|
10
10
|
ActiveRecord::RecordNotFound
|
11
11
|
]
|
12
12
|
|
@@ -15,12 +15,15 @@ module Outpost
|
|
15
15
|
end
|
16
16
|
|
17
17
|
included do
|
18
|
-
rescue_from StandardError,
|
19
|
-
|
18
|
+
rescue_from StandardError,
|
19
|
+
with: ->(e) { render_error(500, e) and return false }
|
20
|
+
|
21
|
+
rescue_from *NOT_FOUND_ERROR_CLASSES,
|
22
|
+
with: ->(e) { render_error(404, e) and return false }
|
20
23
|
end
|
21
|
-
|
24
|
+
|
22
25
|
#----------------------
|
23
|
-
|
26
|
+
|
24
27
|
def render_error(status, e=StandardError)
|
25
28
|
response.status = status
|
26
29
|
|
@@ -28,14 +31,42 @@ module Outpost
|
|
28
31
|
raise e
|
29
32
|
else
|
30
33
|
respond_to do |format|
|
31
|
-
format.html
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
34
|
+
format.html do
|
35
|
+
render(
|
36
|
+
:template => "/errors/error_#{status}",
|
37
|
+
:layout => "application",
|
38
|
+
:status => status,
|
39
|
+
:locals => { error: e }
|
40
|
+
)
|
41
|
+
end
|
42
|
+
|
43
|
+
format.xml do
|
44
|
+
render xml: {
|
45
|
+
:error => response.message,
|
46
|
+
:code => status
|
47
|
+
}, status: status
|
48
|
+
end
|
49
|
+
|
50
|
+
format.json do
|
51
|
+
render json: {
|
52
|
+
:error => response.message,
|
53
|
+
:code => status
|
54
|
+
}, status: status
|
55
|
+
end
|
56
|
+
|
57
|
+
format.text do
|
58
|
+
render(
|
59
|
+
:text => "#{status} - #{response.message}",
|
60
|
+
:status => status
|
61
|
+
)
|
62
|
+
end
|
63
|
+
|
64
|
+
format.any do
|
65
|
+
head status
|
66
|
+
end
|
36
67
|
end
|
37
68
|
end
|
38
69
|
end
|
39
|
-
end
|
70
|
+
end
|
40
71
|
end
|
41
72
|
end
|
@@ -1,37 +1,9 @@
|
|
1
|
-
##
|
1
|
+
##
|
2
2
|
# Outpost::Controller::Helpers
|
3
3
|
module Outpost
|
4
4
|
module Controller
|
5
5
|
module Helpers
|
6
6
|
extend ActiveSupport::Concern
|
7
|
-
include Outpost::Controller::Ordering
|
8
|
-
|
9
|
-
included do
|
10
|
-
helper_method :sort_mode, :order
|
11
|
-
end
|
12
|
-
|
13
|
-
# Public: The order that the records are currently sorted by.
|
14
|
-
# This gets passed directly to ActiveRecord, so it should be
|
15
|
-
# a valid database order.
|
16
|
-
#
|
17
|
-
# Returns String of the order.
|
18
|
-
def order
|
19
|
-
@order ||= set_order
|
20
|
-
end
|
21
|
-
|
22
|
-
# Public: The sort mode that the records are currently sorted by.
|
23
|
-
# This gets passed directory to ActiveRecord, so it should be
|
24
|
-
# a valid database sort mode.
|
25
|
-
#
|
26
|
-
# Examples
|
27
|
-
#
|
28
|
-
# sort_mode
|
29
|
-
# # => "asc"
|
30
|
-
#
|
31
|
-
# Returns String of the sort mode.
|
32
|
-
def sort_mode
|
33
|
-
@sort_mode ||= set_sort_mode
|
34
|
-
end
|
35
7
|
|
36
8
|
# Public: Set the flash[:notice] message, only for HTML requests.
|
37
9
|
#
|
@@ -1,8 +1,50 @@
|
|
1
1
|
module Outpost
|
2
2
|
module Controller
|
3
3
|
module Ordering
|
4
|
+
extend ActiveSupport::Concern
|
5
|
+
|
6
|
+
included do
|
7
|
+
helper_method :order_direction, :order_attribute, :order
|
8
|
+
end
|
9
|
+
|
10
|
+
# Public: The order that the records are currently sorted by.
|
11
|
+
# This gets passed directly to ActiveRecord, so it should be
|
12
|
+
# a valid database order.
|
13
|
+
#
|
14
|
+
# Returns String of the order.
|
15
|
+
def order_attribute
|
16
|
+
@order_attribute ||= set_order_attribute
|
17
|
+
end
|
18
|
+
|
19
|
+
# Public: The sort mode that the records are currently sorted by.
|
20
|
+
# This gets passed directory to ActiveRecord, so it should be
|
21
|
+
# a valid database sort mode.
|
22
|
+
#
|
23
|
+
# Examples
|
24
|
+
#
|
25
|
+
# order_direction
|
26
|
+
# # => "ASC"
|
27
|
+
#
|
28
|
+
# Returns String of the sort mode.
|
29
|
+
def order_direction
|
30
|
+
@order_direction ||= set_order_direction
|
31
|
+
end
|
32
|
+
|
33
|
+
# Public: The order string to be passed into ActiveRecord
|
34
|
+
#
|
35
|
+
# Examples
|
36
|
+
#
|
37
|
+
# order
|
38
|
+
# # => "updated_at DESC"
|
39
|
+
#
|
40
|
+
# Returns String of the order.
|
41
|
+
def order
|
42
|
+
@order ||= "#{order_attribute} #{order_direction}"
|
43
|
+
end
|
44
|
+
|
45
|
+
|
4
46
|
private
|
5
|
-
|
47
|
+
|
6
48
|
# Set which attribute is doing the sorting
|
7
49
|
#
|
8
50
|
# If params[:order] is present, then set the
|
@@ -12,33 +54,34 @@ module Outpost
|
|
12
54
|
# then use the preferred order.
|
13
55
|
#
|
14
56
|
# Otherwise use the list order.
|
15
|
-
def
|
16
|
-
key = "#{model.content_key}
|
57
|
+
def set_order_attribute
|
58
|
+
key = "#{model.content_key}_order_attribute"
|
17
59
|
preferred_order = preference(key)
|
18
60
|
|
19
|
-
@
|
61
|
+
@order_attribute = if params[:order].present?
|
20
62
|
set_preference(key, params[:order])
|
21
63
|
elsif preferred_order.present?
|
22
64
|
preferred_order
|
23
65
|
else
|
24
|
-
list.
|
66
|
+
list.default_order_attribute
|
25
67
|
end
|
26
68
|
end
|
27
69
|
|
28
|
-
# Set the
|
70
|
+
# Set the order direction
|
29
71
|
#
|
30
|
-
# It will either be the requested
|
31
|
-
# then the table's default
|
32
|
-
def
|
33
|
-
key = "#{model.content_key}
|
34
|
-
|
72
|
+
# It will either be the requested direction, or if not available,
|
73
|
+
# then the table's default direction.
|
74
|
+
def set_order_direction
|
75
|
+
key = "#{model.content_key}_order_direction"
|
76
|
+
preferred_direction = preference(key)
|
35
77
|
|
36
|
-
@
|
37
|
-
|
38
|
-
|
39
|
-
|
78
|
+
@order_direction = if [Outpost::ASCENDING, Outpost::DESCENDING]
|
79
|
+
.include?(params[:direction])
|
80
|
+
set_preference(key, params[:direction])
|
81
|
+
elsif preferred_direction.present?
|
82
|
+
preferred_direction
|
40
83
|
else
|
41
|
-
list.
|
84
|
+
list.default_order_direction
|
42
85
|
end
|
43
86
|
end
|
44
87
|
end
|