kadmin 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
Files changed (108) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +1 -1
  3. data/app/helpers/kadmin/pagination_helper.rb +1 -1
  4. data/lib/kadmin.rb +3 -0
  5. data/lib/kadmin/finder.rb +57 -0
  6. data/lib/kadmin/form.rb +1 -1
  7. data/lib/kadmin/pager.rb +82 -0
  8. data/lib/kadmin/version.rb +1 -1
  9. data/test/dummy/app/controllers/admin/application_controller.rb +11 -0
  10. data/test/dummy/app/controllers/admin/groups_controller.rb +0 -0
  11. data/test/dummy/app/controllers/admin/persons_controller.rb +86 -0
  12. data/test/dummy/app/views/admin/persons/_form.html.erb +0 -0
  13. data/test/dummy/app/views/admin/persons/edit.html.erb +0 -0
  14. data/test/dummy/app/views/admin/persons/index.html.erb +0 -0
  15. data/test/dummy/app/views/admin/persons/new.html.erb +0 -0
  16. data/test/dummy/config/routes.rb +7 -3
  17. data/test/dummy/log/development.log +393 -0
  18. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-2/-2HjYbMRby-CwTDE7jk4lgNd3X-l5tHSk4A5UzXzrz0.cache +2 -0
  19. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-E/-E8hxZ6OimFAVoaq-ht5ACFfHh65ARRQ9Mb-zTeA5H8.cache +1 -0
  20. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-_/-_GyWOMxsUj1Vcwf_522X6jS5CyLaFUziq4bW17lZAw.cache +0 -0
  21. data/test/dummy/tmp/cache/assets/sprockets/v3.0/-r/-r0OPtWop7e-i6aqm5Z9zWo9gHXFypWEP1MYcBokwMA.cache +0 -0
  22. data/test/dummy/tmp/cache/assets/sprockets/v3.0/11/11SrJ22TDT3o5ArL97bHJR-ITSG0RNL-Ea36RCQV0XQ.cache +0 -0
  23. data/test/dummy/tmp/cache/assets/sprockets/v3.0/1v/1vA0wPw0oVAyJv-VQobqbmEDrLurYRWV4THCWLfzLoQ.cache +3 -0
  24. data/test/dummy/tmp/cache/assets/sprockets/v3.0/3c/3cghbNCfivQK44JxoMoCPOiw1Vcc07mUX8AsN0nfdGg.cache +1 -0
  25. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5E/5EK4YMOiNjfof61fycHKHeTg9YQvAvkhSKjWLEjuglk.cache +0 -0
  26. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
  27. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5X/5X5Ap1XOYPJqjTBnphJksdHxO2xnQXMmoILKMllPuFU.cache +1 -0
  28. data/test/dummy/tmp/cache/assets/sprockets/v3.0/5m/5mtdWqMi8vbaQoUKpJ6h58QXzdOfczoeIbu_2VY6kEk.cache +0 -0
  29. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6K/6KVInstMdXQzYrg2I6GWoOxR7U_0wWzeBnsWEvg8J3M.cache +0 -0
  30. data/test/dummy/tmp/cache/assets/sprockets/v3.0/6S/6SHOn6gX8LwD8NmftjKNw-BtmJBgL4Xx0hmW1RgBxdk.cache +0 -0
  31. data/test/dummy/tmp/cache/assets/sprockets/v3.0/7v/7vp0pszBWSYyAY0Tz4ZHI9eX6GU4etWfK0D6GF7gLTY.cache +0 -0
  32. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8F/8FV04EdmYtfXyf3Ktwdfqj5SJ-kEEQQOmvrzE-hrqig.cache +0 -0
  33. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8F/8FXsR_p1ch9E_ae2wsJWUnHL6MxAbITe2I14tExB3Ec.cache +1 -0
  34. data/test/dummy/tmp/cache/assets/sprockets/v3.0/8P/8PiD2jpkOTKwCqmTucDpZfcaYIoDaLpRmCTDikmBAMk.cache +0 -0
  35. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AD/ADjuF7qlW-VJcrkl1TCQhPDGvPeugjWk0reLQCK2gDI.cache +1 -0
  36. data/test/dummy/tmp/cache/assets/sprockets/v3.0/AK/AKh8PXD1zgb2pdxirj252TVteTypvd4JLXRf_dQfmKk.cache +2 -0
  37. data/test/dummy/tmp/cache/assets/sprockets/v3.0/B4/B4E3KRrOxNPSEX-9Ugyv9uaAY3gIW2c2730GkDSdEtE.cache +1 -0
  38. data/test/dummy/tmp/cache/assets/sprockets/v3.0/EM/EMa_S-cjtjY8YOtd4L6izIK8FNfQPBISCjmwrYeilXk.cache +0 -0
  39. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Eo/Eo00KDTHIwB2VlsZf4O0IHAC0zp8jSuVqe-scWtAjn0.cache +2 -0
  40. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fj/Fj9wk3WG0X_LuTI9jEPYY2HU5btm59aOpbx1afwZy4M.cache +0 -0
  41. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GF/GF3FBYfVQk64OkuJbBl2h63bZN9hYzPIBtVhNwVs4MY.cache +0 -0
  42. data/test/dummy/tmp/cache/assets/sprockets/v3.0/GI/GILdEr9hblYezO2NmQP4NzxoA1pW2P-_HWZcr0IwNe8.cache +1 -0
  43. data/test/dummy/tmp/cache/assets/sprockets/v3.0/JR/JRLYN2dARxj66xZ7WU5-LfR8WCTxOw21DHHpwVNlu8k.cache +5 -0
  44. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jc/JcSljJd7QjwNSL4TRtvRNz65r3PiRZ8VJ_itLYWgiw0.cache +1 -0
  45. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Je/Je2odU6RuxXpO5e6xD_7Vm3_QKBj21A4Eb5Xe_3tcmE.cache +1 -0
  46. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jf/Jf8eGGgzDrZIH9psuQTMsOXOfSnfXnkuFyWLTd2TbEk.cache +1 -0
  47. data/test/dummy/tmp/cache/assets/sprockets/v3.0/KM/KM9biR7CwnS-iyvtFSieT4mpV0Yq3PAzDPh4BkBuitk.cache +0 -0
  48. data/test/dummy/tmp/cache/assets/sprockets/v3.0/LJ/LJN964xN-evJQCr_R906196saBvCUBqdNEo1HbeKoqo.cache +0 -0
  49. data/test/dummy/tmp/cache/assets/sprockets/v3.0/LU/lUq0r6fdSX67R3L3fN37itzZ8ThNiKY2pSz4mt0hhHQ.cache +1 -0
  50. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Le/LeUQdG0D7O4lxvySURbAaoGowjdY-WmNqf3Mfqrfxyg.cache +0 -0
  51. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mr/MrTfw8APk-gyKkw845UfDSHEmjSmlyecpb4qghVCsJc.cache +0 -0
  52. data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
  53. data/test/dummy/tmp/cache/assets/sprockets/v3.0/QR/QRwUeu2lR_fh0S1COd57cS_0HzJLvVvAfX2b7wdgq9E.cache +0 -0
  54. data/test/dummy/tmp/cache/assets/sprockets/v3.0/QW/QWTzvJsN-St1M5X7c0iPtNpfrg3jbt6DKvSIfrvg1Xo.cache +1 -0
  55. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Re/ReGBPYTMVGc5UsM5L7KB0_3B13aNUqF-fsr2inoeNsE.cache +0 -0
  56. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rp/Rpze3DS02RzORY0sa58XN-eCPxEpCNWzdMzJHX3PPCc.cache +0 -0
  57. data/test/dummy/tmp/cache/assets/sprockets/v3.0/SM/SMgGnRKtH1iPOR1Rr4jeYv8FXJD6NfEInNJkgh44-h0.cache +2 -0
  58. data/test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSxUS1m35WV62C8Ns3ZFB34VDTAJZFE9j8sIvFjJ34g.cache +5 -0
  59. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tr/TrpGZkuLXDxCiZNsH9rPQUuPXTiKIHKtPFEkVvqUSdU.cache +4 -0
  60. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UB/UBqrW0q1xgxd0LgpdhEN2rIkgx311VLn1E4J8xTehS8.cache +1 -0
  61. data/test/dummy/tmp/cache/assets/sprockets/v3.0/UY/UYkqW8Qk-RYuenP9AA1t0qrUGElEFrX70S5Z98vIf-o.cache +3 -0
  62. data/test/dummy/tmp/cache/assets/sprockets/v3.0/U_/U_4FnN2FfvOfugPWddXzWbw4DHmvFBUs5OsmFiPkiOE.cache +0 -0
  63. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vw/Vw4dSgF0h0cmaCSTiVWdLSTRFpOKkeU3pHBBdvxMFtQ.cache +0 -0
  64. data/test/dummy/tmp/cache/assets/sprockets/v3.0/WN/WN9LSGmlySXuqyBDltZaSgTQId_fBr7tszD5QBdx6as.cache +4 -0
  65. data/test/dummy/tmp/cache/assets/sprockets/v3.0/X9/X9q2gGamGd5n5DLvpqdgA0yXRVz9_DWFChihiNYYFMo.cache +1 -0
  66. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XF/XFAZTK0FYqKi-VAo7wBhb0qmjdyryXXZ-7ngyMKtpfk.cache +1 -0
  67. data/test/dummy/tmp/cache/assets/sprockets/v3.0/XG/XG2LAoElu3yFQXjnrTK-AHdNi5aX19chAKrEfMKFtTU.cache +1 -0
  68. data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y9/Y9nCQQIgQsTdjgKu5AciGNFhclfbFHR7_sZ3-1meqxY.cache +0 -0
  69. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZL/ZL89Pj7x95nCdeZtpp_31rhNpmaOS1YY6vaNZP2WtIY.cache +0 -0
  70. data/test/dummy/tmp/cache/assets/sprockets/v3.0/aa/aaI8WDVOjLkqpVJtZyxmaV0Ru-gx2JOYGNJN3DruFlY.cache +1 -0
  71. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bH/bHLekJe4OFtBYonKEfS65V6aWHD2knMb-ClTgZOip-g.cache +2 -0
  72. data/test/dummy/tmp/cache/assets/sprockets/v3.0/bS/bSgsBjtu-Y7WrxesKqith5xy2XjVTuWXEGghmr4rivk.cache +0 -0
  73. data/test/dummy/tmp/cache/assets/sprockets/v3.0/br/br7hrpCNcrm7KR7vVkj13rI-f1RiauXbXgD9VbBI6RE.cache +0 -0
  74. data/test/dummy/tmp/cache/assets/sprockets/v3.0/br/brn0WV626bUtP2mU86iYCgWpaHzMFJQ13RgmXaDjeq4.cache +1 -0
  75. data/test/dummy/tmp/cache/assets/sprockets/v3.0/c9/C9xBy-OdhnODNhOzAOFhLTbcYOoB4EioR5LptxwvkUQ.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/sprockets/v3.0/eQ/eQWn4vC7aRx4Y2aDQRmUvCE5wEWZz6exOeDUs3bTYN4.cache +1 -0
  77. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ed/edWZZcjeQS8RikaC_mEOMPS3UouUuaWUTLs_xITZyIs.cache +1 -0
  78. data/test/dummy/tmp/cache/assets/sprockets/v3.0/f6/f6M3kAL7aMbibGjJss7EfrMqNY_B2aLlGidMK-F9QFY.cache +1 -0
  79. data/test/dummy/tmp/cache/assets/sprockets/v3.0/g5/g561cCJ02dyuteLibfkiC5SNvKXoYe-pYktOT6C__70.cache +1 -0
  80. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +0 -0
  81. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ha/haYOUyt5JRK5bGjubStgXfKTHFnf8_2iv0iN-Y30aHc.cache +1 -0
  82. data/test/dummy/tmp/cache/assets/sprockets/v3.0/hv/hv0lgWWTtx1-VMIag9WFrPh-lQol_RVLcJA6EznjGRk.cache +2 -0
  83. data/test/dummy/tmp/cache/assets/sprockets/v3.0/iA/iAUmEEgZxyXBF7Q3JUzYO6VF_hUcAy9WBGWrO8FBs94.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/LYL55Pi6vnSDQ3iOktqbsTgZEaKIno8IBN3be_nwM5c.cache +0 -0
  85. data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/LYb7LJEULabV45Z9punrLTmjttI1vKPMoIeWQndAmaU.cache +1 -0
  86. data/test/dummy/tmp/cache/assets/sprockets/v3.0/m2/m2ooo6C8yP1WOv12MfbvdH6OYOArlpVmrWYcWXXW4aQ.cache +0 -0
  87. data/test/dummy/tmp/cache/assets/sprockets/v3.0/mq/mqXDp-fAKgt19ulbEzOXo6DdsDq2Sq8mUjERjj_ubeY.cache +1 -0
  88. data/test/dummy/tmp/cache/assets/sprockets/v3.0/o0/o0fvPxdmhDOI8sS59RdhHJauHXfn15Fkyj3IamJoCSc.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pE/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +0 -0
  90. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pL/pLFfHJgRLnMnJCB5QltUHOjJbtA2wjXXyDGPZedbyRA.cache +1 -0
  91. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pa/paqNgBYCkw0rEQFxOkV0hAQm4EE8TMsjcOsITksk_2M.cache +0 -0
  92. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pd/PDCyll73DKdKcTnGTebiyoY4BhSMElDW378tTa8eHSc.cache +1 -0
  93. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pd/pdUxdFTgb3YAZKNEVaEeQnZb97lA1Ew2o5PybzVUm4A.cache +0 -0
  94. data/test/dummy/tmp/cache/assets/sprockets/v3.0/pw/pw-vQJukxf5ufqJunKWowupXuYv2XV1kAOxKltIkSuM.cache +0 -0
  95. data/test/dummy/tmp/cache/assets/sprockets/v3.0/ri/riMaEi70pbOAROVA_sDeCIgDUQHNLgZ0CcFtaoPQUN8.cache +1 -0
  96. data/test/dummy/tmp/cache/assets/sprockets/v3.0/rs/rs29jYXdRVDaE8LFpPP5sue1m6VBOjzSSSmbj3w0R7g.cache +0 -0
  97. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sK/sKfUi0-HbSWcqtguY1lJhNdX-evf5_LMTcOOdFhOIco.cache +4 -0
  98. data/test/dummy/tmp/cache/assets/sprockets/v3.0/sz/szmBNR1H1DygmcGPID8zNIcbmrO1vGqzHYRGuc5u7-c.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tU/tU-Tu9-noE-IHLvRNqvK_woXM1aNYteaOPgUhxs6YLU.cache +0 -0
  100. data/test/dummy/tmp/cache/assets/sprockets/v3.0/tq/tqXoYuJiHJnkCpau1HYEYtY2-wDz7t8r5iGWAbGMlu0.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wD/wDcCsc6hXZcj30Tt2oEu81vheWFzK0QaFnvQMZMGR4A.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wQ/wQZeIXz8XzLJqkIuny4tEGMxrqJttMCiiPe5sg2kV4U.cache +1 -0
  103. data/test/dummy/tmp/cache/assets/sprockets/v3.0/wo/woi16qt5oc0y3TT4Wynsah4txzpgkIum8AqwR8-eSW0.cache +1 -0
  104. data/test/dummy/tmp/cache/assets/sprockets/v3.0/xJ/xJB6l0maG-NSSTY2ojO_ISRuAnQQ3XH9HoBS1BTecMc.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/sprockets/v3.0/y7/y7rODAuztmvstdGLcihv_rSwUM0unmpxshTZ2NYl9EQ.cache +1 -0
  106. data/test/dummy/tmp/cache/assets/sprockets/v3.0/zQ/zQfrKzck6RKqYFUfKWT4m168XkPB0bFfxD-vJFHwzBs.cache +0 -0
  107. metadata +163 -2
  108. data/app/controllers/rails_admin/application_controller.rb +0 -58
@@ -1,58 +0,0 @@
1
- module Kadmin
2
- class ApplicationController < ActionController::Base
3
- layout 'kadmin/application'
4
-
5
- helper Kadmin::ApplicationHelper
6
- helper Kadmin::BootstrapHelper
7
- helper Kadmin::NavigationHelper
8
- helper Kadmin::PaginationHelper
9
-
10
- include Kadmin::Concerns::AuthorizedUser
11
-
12
- before_action :authorize
13
- before_action :set_navbar_links
14
- before_action :set_default_format
15
-
16
- # @!group Error Handling
17
-
18
- unless defined?(BetterErrors)
19
- rescue_from StandardError, with: :handle_error
20
- rescue_from ActiveRecord::RecordNotFound, with: :not_found
21
- rescue_from ActionController::ParameterMissing, with: :params_missing
22
- end
23
-
24
- def params_missing(error)
25
- handle_error(error, title: I18n.t('kadmin.errors.params_missing'), status: :bad_request)
26
- end
27
-
28
- def not_found(error)
29
- handle_error(error, title: I18n.t('kadmin.errors.not_found'), status: :not_found)
30
- end
31
-
32
- def handle_error(error, options = {})
33
- options = {
34
- title: error.try(:title) || error.class.name,
35
- message: error.message,
36
- status: :internal_server_error
37
- }.merge(options)
38
- render 'kadmin/error', status: options[:status], locals: options
39
- end
40
-
41
- # @!endgroup
42
-
43
- # @!group Helpers
44
-
45
- # Overload in the sub-controllers to set up the links in the layout
46
- def set_navbar_links
47
- @layout_navbar_links = []
48
- end
49
- protected :set_navbar_links
50
-
51
- def set_default_format
52
- params[:format] = 'html' if params[:format].blank?
53
- end
54
- protected :set_default_format
55
-
56
- # @!endgroup
57
- end
58
- end