kadmin 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/app/helpers/kadmin/pagination_helper.rb +1 -1
- data/lib/kadmin.rb +3 -0
- data/lib/kadmin/finder.rb +57 -0
- data/lib/kadmin/form.rb +1 -1
- data/lib/kadmin/pager.rb +82 -0
- data/lib/kadmin/version.rb +1 -1
- data/test/dummy/app/controllers/admin/application_controller.rb +11 -0
- data/test/dummy/app/controllers/admin/groups_controller.rb +0 -0
- data/test/dummy/app/controllers/admin/persons_controller.rb +86 -0
- data/test/dummy/app/views/admin/persons/_form.html.erb +0 -0
- data/test/dummy/app/views/admin/persons/edit.html.erb +0 -0
- data/test/dummy/app/views/admin/persons/index.html.erb +0 -0
- data/test/dummy/app/views/admin/persons/new.html.erb +0 -0
- data/test/dummy/config/routes.rb +7 -3
- data/test/dummy/log/development.log +393 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-2/-2HjYbMRby-CwTDE7jk4lgNd3X-l5tHSk4A5UzXzrz0.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-E/-E8hxZ6OimFAVoaq-ht5ACFfHh65ARRQ9Mb-zTeA5H8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-_/-_GyWOMxsUj1Vcwf_522X6jS5CyLaFUziq4bW17lZAw.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-r/-r0OPtWop7e-i6aqm5Z9zWo9gHXFypWEP1MYcBokwMA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/11/11SrJ22TDT3o5ArL97bHJR-ITSG0RNL-Ea36RCQV0XQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/1v/1vA0wPw0oVAyJv-VQobqbmEDrLurYRWV4THCWLfzLoQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/3c/3cghbNCfivQK44JxoMoCPOiw1Vcc07mUX8AsN0nfdGg.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5E/5EK4YMOiNjfof61fycHKHeTg9YQvAvkhSKjWLEjuglk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5L/5Lly_CA8DZvPhQV2jDQx-Y6P_y3Ygra9t5jfSlGhHDA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5X/5X5Ap1XOYPJqjTBnphJksdHxO2xnQXMmoILKMllPuFU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5m/5mtdWqMi8vbaQoUKpJ6h58QXzdOfczoeIbu_2VY6kEk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/6K/6KVInstMdXQzYrg2I6GWoOxR7U_0wWzeBnsWEvg8J3M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/6S/6SHOn6gX8LwD8NmftjKNw-BtmJBgL4Xx0hmW1RgBxdk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7v/7vp0pszBWSYyAY0Tz4ZHI9eX6GU4etWfK0D6GF7gLTY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/8F/8FV04EdmYtfXyf3Ktwdfqj5SJ-kEEQQOmvrzE-hrqig.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/8F/8FXsR_p1ch9E_ae2wsJWUnHL6MxAbITe2I14tExB3Ec.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/8P/8PiD2jpkOTKwCqmTucDpZfcaYIoDaLpRmCTDikmBAMk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/AD/ADjuF7qlW-VJcrkl1TCQhPDGvPeugjWk0reLQCK2gDI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/AK/AKh8PXD1zgb2pdxirj252TVteTypvd4JLXRf_dQfmKk.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/B4/B4E3KRrOxNPSEX-9Ugyv9uaAY3gIW2c2730GkDSdEtE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/EM/EMa_S-cjtjY8YOtd4L6izIK8FNfQPBISCjmwrYeilXk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Eo/Eo00KDTHIwB2VlsZf4O0IHAC0zp8jSuVqe-scWtAjn0.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Fj/Fj9wk3WG0X_LuTI9jEPYY2HU5btm59aOpbx1afwZy4M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/GF/GF3FBYfVQk64OkuJbBl2h63bZN9hYzPIBtVhNwVs4MY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/GI/GILdEr9hblYezO2NmQP4NzxoA1pW2P-_HWZcr0IwNe8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/JR/JRLYN2dARxj66xZ7WU5-LfR8WCTxOw21DHHpwVNlu8k.cache +5 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jc/JcSljJd7QjwNSL4TRtvRNz65r3PiRZ8VJ_itLYWgiw0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Je/Je2odU6RuxXpO5e6xD_7Vm3_QKBj21A4Eb5Xe_3tcmE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jf/Jf8eGGgzDrZIH9psuQTMsOXOfSnfXnkuFyWLTd2TbEk.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/KM/KM9biR7CwnS-iyvtFSieT4mpV0Yq3PAzDPh4BkBuitk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LJ/LJN964xN-evJQCr_R906196saBvCUBqdNEo1HbeKoqo.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LU/lUq0r6fdSX67R3L3fN37itzZ8ThNiKY2pSz4mt0hhHQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Le/LeUQdG0D7O4lxvySURbAaoGowjdY-WmNqf3Mfqrfxyg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Mr/MrTfw8APk-gyKkw845UfDSHEmjSmlyecpb4qghVCsJc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/OI/OI6uxGcnsKavdWTtwDAasU3wPx8QXhzBgV0X2n1KjMQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/QR/QRwUeu2lR_fh0S1COd57cS_0HzJLvVvAfX2b7wdgq9E.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/QW/QWTzvJsN-St1M5X7c0iPtNpfrg3jbt6DKvSIfrvg1Xo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Re/ReGBPYTMVGc5UsM5L7KB0_3B13aNUqF-fsr2inoeNsE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rp/Rpze3DS02RzORY0sa58XN-eCPxEpCNWzdMzJHX3PPCc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/SM/SMgGnRKtH1iPOR1Rr4jeYv8FXJD6NfEInNJkgh44-h0.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TS/TSxUS1m35WV62C8Ns3ZFB34VDTAJZFE9j8sIvFjJ34g.cache +5 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Tr/TrpGZkuLXDxCiZNsH9rPQUuPXTiKIHKtPFEkVvqUSdU.cache +4 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/UB/UBqrW0q1xgxd0LgpdhEN2rIkgx311VLn1E4J8xTehS8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/UY/UYkqW8Qk-RYuenP9AA1t0qrUGElEFrX70S5Z98vIf-o.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/U_/U_4FnN2FfvOfugPWddXzWbw4DHmvFBUs5OsmFiPkiOE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vw/Vw4dSgF0h0cmaCSTiVWdLSTRFpOKkeU3pHBBdvxMFtQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/WN/WN9LSGmlySXuqyBDltZaSgTQId_fBr7tszD5QBdx6as.cache +4 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/X9/X9q2gGamGd5n5DLvpqdgA0yXRVz9_DWFChihiNYYFMo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/XF/XFAZTK0FYqKi-VAo7wBhb0qmjdyryXXZ-7ngyMKtpfk.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/XG/XG2LAoElu3yFQXjnrTK-AHdNi5aX19chAKrEfMKFtTU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y9/Y9nCQQIgQsTdjgKu5AciGNFhclfbFHR7_sZ3-1meqxY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ZL/ZL89Pj7x95nCdeZtpp_31rhNpmaOS1YY6vaNZP2WtIY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/aa/aaI8WDVOjLkqpVJtZyxmaV0Ru-gx2JOYGNJN3DruFlY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/bH/bHLekJe4OFtBYonKEfS65V6aWHD2knMb-ClTgZOip-g.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/bS/bSgsBjtu-Y7WrxesKqith5xy2XjVTuWXEGghmr4rivk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/br/br7hrpCNcrm7KR7vVkj13rI-f1RiauXbXgD9VbBI6RE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/br/brn0WV626bUtP2mU86iYCgWpaHzMFJQ13RgmXaDjeq4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/c9/C9xBy-OdhnODNhOzAOFhLTbcYOoB4EioR5LptxwvkUQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/eQ/eQWn4vC7aRx4Y2aDQRmUvCE5wEWZz6exOeDUs3bTYN4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ed/edWZZcjeQS8RikaC_mEOMPS3UouUuaWUTLs_xITZyIs.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/f6/f6M3kAL7aMbibGjJss7EfrMqNY_B2aLlGidMK-F9QFY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/g5/g561cCJ02dyuteLibfkiC5SNvKXoYe-pYktOT6C__70.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hZ/hZi1k6tpxxCGYxRe7zY74ItcOI8gZrREOpGuA8JSpGg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ha/haYOUyt5JRK5bGjubStgXfKTHFnf8_2iv0iN-Y30aHc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hv/hv0lgWWTtx1-VMIag9WFrPh-lQol_RVLcJA6EznjGRk.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/iA/iAUmEEgZxyXBF7Q3JUzYO6VF_hUcAy9WBGWrO8FBs94.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/LYL55Pi6vnSDQ3iOktqbsTgZEaKIno8IBN3be_nwM5c.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/lY/LYb7LJEULabV45Z9punrLTmjttI1vKPMoIeWQndAmaU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/m2/m2ooo6C8yP1WOv12MfbvdH6OYOArlpVmrWYcWXXW4aQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mq/mqXDp-fAKgt19ulbEzOXo6DdsDq2Sq8mUjERjj_ubeY.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/o0/o0fvPxdmhDOI8sS59RdhHJauHXfn15Fkyj3IamJoCSc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pE/pEhaat2KBd5SrT7szC_8R1_6hK17FTpvoRFkmCRSD3M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pL/pLFfHJgRLnMnJCB5QltUHOjJbtA2wjXXyDGPZedbyRA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pa/paqNgBYCkw0rEQFxOkV0hAQm4EE8TMsjcOsITksk_2M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pd/PDCyll73DKdKcTnGTebiyoY4BhSMElDW378tTa8eHSc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pd/pdUxdFTgb3YAZKNEVaEeQnZb97lA1Ew2o5PybzVUm4A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/pw/pw-vQJukxf5ufqJunKWowupXuYv2XV1kAOxKltIkSuM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ri/riMaEi70pbOAROVA_sDeCIgDUQHNLgZ0CcFtaoPQUN8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/rs/rs29jYXdRVDaE8LFpPP5sue1m6VBOjzSSSmbj3w0R7g.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/sK/sKfUi0-HbSWcqtguY1lJhNdX-evf5_LMTcOOdFhOIco.cache +4 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/sz/szmBNR1H1DygmcGPID8zNIcbmrO1vGqzHYRGuc5u7-c.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/tU/tU-Tu9-noE-IHLvRNqvK_woXM1aNYteaOPgUhxs6YLU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/tq/tqXoYuJiHJnkCpau1HYEYtY2-wDz7t8r5iGWAbGMlu0.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wD/wDcCsc6hXZcj30Tt2oEu81vheWFzK0QaFnvQMZMGR4A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wQ/wQZeIXz8XzLJqkIuny4tEGMxrqJttMCiiPe5sg2kV4U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wo/woi16qt5oc0y3TT4Wynsah4txzpgkIum8AqwR8-eSW0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xJ/xJB6l0maG-NSSTY2ojO_ISRuAnQQ3XH9HoBS1BTecMc.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/y7/y7rODAuztmvstdGLcihv_rSwUM0unmpxshTZ2NYl9EQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zQ/zQfrKzck6RKqYFUfKWT4m168XkPB0bFfxD-vJFHwzBs.cache +0 -0
- metadata +163 -2
- 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
|