wobauth 3.4.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 +165 -0
- data/Rakefile +30 -0
- data/app/assets/javascripts/wobauth/admin.js +13 -0
- data/app/assets/javascripts/wobauth/authorities.js.coffee +31 -0
- data/app/assets/javascripts/wobauth/groups.js +2 -0
- data/app/assets/javascripts/wobauth/memberships.js +2 -0
- data/app/assets/javascripts/wobauth/roles.js +2 -0
- data/app/assets/stylesheets/wobauth/application.css +15 -0
- data/app/assets/stylesheets/wobauth/authorities.css +4 -0
- data/app/assets/stylesheets/wobauth/groups.css +4 -0
- data/app/assets/stylesheets/wobauth/memberships.css +4 -0
- data/app/assets/stylesheets/wobauth/roles.css +4 -0
- data/app/controllers/wobauth/ad_users_controller.rb +24 -0
- data/app/controllers/wobauth/application_controller.rb +25 -0
- data/app/controllers/wobauth/authorities_controller.rb +88 -0
- data/app/controllers/wobauth/groups/authorities_controller.rb +11 -0
- data/app/controllers/wobauth/groups/memberships_controller.rb +11 -0
- data/app/controllers/wobauth/groups_controller.rb +60 -0
- data/app/controllers/wobauth/login_controller.rb +10 -0
- data/app/controllers/wobauth/memberships_controller.rb +79 -0
- data/app/controllers/wobauth/registrations_controller.rb +26 -0
- data/app/controllers/wobauth/roles_controller.rb +30 -0
- data/app/controllers/wobauth/users/authorities_controller.rb +11 -0
- data/app/controllers/wobauth/users/memberships_controller.rb +11 -0
- data/app/controllers/wobauth/users_controller.rb +76 -0
- data/app/helpers/wobauth/ad_users_helper.rb +60 -0
- data/app/helpers/wobauth/application_helper.rb +53 -0
- data/app/helpers/wobauth/authorities_helper.rb +9 -0
- data/app/models/wobauth/ad_user.rb +4 -0
- data/app/models/wobauth/admin_ability.rb +67 -0
- data/app/models/wobauth/authority.rb +17 -0
- data/app/models/wobauth/group.rb +18 -0
- data/app/models/wobauth/membership.rb +11 -0
- data/app/models/wobauth/role.rb +19 -0
- data/app/models/wobauth/user.rb +11 -0
- data/app/services/wobauth/search_ad_user_service.rb +53 -0
- data/app/views/devise/registrations/edit.html.erb +25 -0
- data/app/views/devise/sessions/new.html.erb +17 -0
- data/app/views/devise/shared/_links.html.erb +0 -0
- data/app/views/wobauth/ad_users/index.html.erb +69 -0
- data/app/views/wobauth/authorities/_form.html.erb +32 -0
- data/app/views/wobauth/authorities/edit.html.erb +1 -0
- data/app/views/wobauth/authorities/index.html.erb +41 -0
- data/app/views/wobauth/authorities/new.html.erb +1 -0
- data/app/views/wobauth/authorities/show.html.erb +45 -0
- data/app/views/wobauth/groups/_form.html.erb +20 -0
- data/app/views/wobauth/groups/_group_memberships.html.erb +21 -0
- data/app/views/wobauth/groups/_group_roles.html.erb +23 -0
- data/app/views/wobauth/groups/edit.html.erb +1 -0
- data/app/views/wobauth/groups/index.html.erb +31 -0
- data/app/views/wobauth/groups/new.html.erb +1 -0
- data/app/views/wobauth/groups/show.html.erb +45 -0
- data/app/views/wobauth/memberships/_form.html.erb +20 -0
- data/app/views/wobauth/memberships/edit.html.erb +1 -0
- data/app/views/wobauth/memberships/index.html.erb +33 -0
- data/app/views/wobauth/memberships/new.html.erb +1 -0
- data/app/views/wobauth/memberships/show.html.erb +28 -0
- data/app/views/wobauth/roles/_role_authorities.html.erb +21 -0
- data/app/views/wobauth/roles/index.html.erb +26 -0
- data/app/views/wobauth/roles/show.html.erb +18 -0
- data/app/views/wobauth/shared/_accounting.html.erb +25 -0
- data/app/views/wobauth/shared/_admin.html.erb +13 -0
- data/app/views/wobauth/users/_form.html.erb +28 -0
- data/app/views/wobauth/users/_user_groups.html.erb +22 -0
- data/app/views/wobauth/users/_user_roles.html.erb +23 -0
- data/app/views/wobauth/users/edit.html.erb +1 -0
- data/app/views/wobauth/users/index.html.erb +52 -0
- data/app/views/wobauth/users/new.html.erb +1 -0
- data/app/views/wobauth/users/show.html.erb +130 -0
- data/config/initializers/assets.rb +1 -0
- data/config/initializers/devise.rb +260 -0
- data/config/initializers/devise_failure_app.rb +21 -0
- data/config/initializers/simple_form.rb +169 -0
- data/config/initializers/simple_form_bootstrap.rb +154 -0
- data/config/initializers/wobapphelpers.rb +18 -0
- data/config/locales/de.yml +80 -0
- data/config/locales/devise.de.yml +60 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/en.yml +27 -0
- data/config/locales/simple_form.en.yml +31 -0
- data/config/locales/wobapphelpers.de.yml +10 -0
- data/config/locales/wobapphelpers.en.yml +8 -0
- data/config/routes.rb +24 -0
- data/db/migrate/20140501113226_create_wobauth_roles.rb +9 -0
- data/db/migrate/20140501150743_create_wobauth_groups.rb +10 -0
- data/db/migrate/20140504124045_create_wobauth_memberships.rb +11 -0
- data/db/migrate/20140504143328_create_wobauth_authorities.rb +15 -0
- data/db/migrate/20140508120810_devise_create_wobauth_users.rb +55 -0
- data/db/migrate/20171231084355_additional_fields_to_wobauth_user.rb +8 -0
- data/lib/concerns/models/user.rb +44 -0
- data/lib/generators/templates/initializers/wobauth.rb +20 -0
- data/lib/generators/wobauth/install_generator.rb +20 -0
- data/lib/tasks/wobauth_tasks.rake +4 -0
- data/lib/templates/erb/scaffold/_form.html.erb +26 -0
- data/lib/templates/erb/scaffold/edit.html.erb +1 -0
- data/lib/templates/erb/scaffold/index.html.erb +32 -0
- data/lib/templates/erb/scaffold/new.html.erb +1 -0
- data/lib/templates/erb/scaffold/show.html.erb +15 -0
- data/lib/templates/rails/scaffold_controller/controller.rb +66 -0
- data/lib/wobauth/engine.rb +33 -0
- data/lib/wobauth/version.rb +4 -0
- data/lib/wobauth.rb +57 -0
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/db/test1.sqlite3 +0 -0
- data/test/dummy/log/test.log +1954 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-6/-6x3utBDawbjV5d477TJ9PeEoQTk9Yh292Yg_8Ox16U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-A/-A9u9WxFQ9YT2TSLvmYJYJf2Kg9JfDoIt6YZQRcwUHE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-C/-CJCPQLf_lB4gJr983MP5sZdH3uZuYPIe-xSw4QBln4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-K/-K6Cz6iJ4bgvnwN-rMFxBtyYEU6EGdLH9b4N38_GwIs.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/-x/-xwsVQHMHEQFqvVNjKKkEiujw9_CUgnJ2Hmzampfy60.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/2J/2JNdqFTZ9i8DAT1rZCc-Xj70u9zcQtlJoqEK68sRPVM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/4N/4NSPDtUmuTVU5uLI-eBtnORjzrwVgeLgrgIJh4tjWeQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/4u/4uuqiFX5bLo0J5QqMPSZc642NRkdX4l-Vguvyq6Oe3U.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/5O/5Oqd8RObzOeHuHy3NTiGE5p_ZkpftjQQgJgS_3KKdH0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/6U/6UZEqCkIx3XO_NjOjjWyLET2-dS4Gs_RPAB9NtA99-A.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/76/767sF803BgrHtDgUPUUn-HN41e6fklZIQkVKyKD59P4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/77/77ZyE9pECDHt-19ik7nBaJXJQT-7V2UDr49kFOIO1DM.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/7n/7nJvPEaj-WV6RCKHc3hpHsAbWek8cidSKvDKLedQpH4.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/85/856_llbCcD4ntIG6h4uR2WQY9SrutzA-9K6xT53ZPTY.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/9A/9A6WX6bvqMDoyDrYrGQy2l6nf_JtHoQZsa-pEJ0FgDU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/BA/BABtX6k2NZISYrxZSviAXC8UIxZfRhEDDbx7dMf_ShQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/D4/D4_Vl_wB6Vq8O0LvQ9iHt-YqG_c0fUR4af06OZlk10k.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/DX/DXGc2xprS_TuG5PzNCaBHKBMWTlyrZZYA9jlvlcBn3M.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ex/ExDgDLUsesHZC1FAxhQLmTyBpg6IW4gVCUB8U8Ov-X4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/F8/F8M6mPdg93dPiXZzHGo3Y0I42et4yc5Hr-eCfuOUeac.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Hk/Hkx4xbJvgHfFgfNDKyHxertTGvARWOgVuNuGU-OWPEU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Jo/Jom6Wnb-Sd-d3W24hNHS58BHtuw5Dsm7vvWVPtLB0PA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/K5/K5UnItDV1g9ixIoFloUxCNirxL5UFrOT0jz1vKy5shc.cache +31 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/K6/K6geC8zADOljHu2R2-DHUgVrgGyij9e4dnxgIdEypMU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/KW/KWpcGMHEfc0mpysCx46leXLgyrzubUIXWouB91Ia5Ik.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LD/LD1fywEt5YfgacZhvpug0VXFakWRb1jidort_y8Fl00.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LT/LTqeGcgCnDytohL1bGvcUZdnrp6gImr9Gzgfj6sYtW4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/LX/LXirLCvjN2zWwKoda0ZdfOoFufIGRC9bZFKo95Kxs2w.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/MH/MH3Sbn3D_A-k2L9Qd_MSjC2d6zv52DnzX3REO1P8n-E.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Nm/NmUDbY8fbYAMYUH3HOmHzTLkeJaf-49yXUpF5TXGnYM.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/O1/O1xVVUGePb-AZZi4nfbefQqZJEuQKvVAnHbbksdys0g.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Og/Og28UaPh4fHs8CazZFMRRClJKMdtcZ6TLkcrwXO9888.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Py/Py0iDud1Fnb6eLZHFV1BlJ1PKkeJS5bSVb8DL5Lyoyo.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Qs/QscUYhnZ_Tw9H1UICqO4jqvLwSznyhEMlkTJRFR63Qk.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Rx/RxBkonRxRoJzfP-2eiuZPIg4Wy1eaNd6MQ6N0QTzLbw.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/S_/S_VAM9XIEPYa1eIrH2MGCvwgC6UuKNU3IsOsXYCbRfE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TK/TK13HHucosr5_ne6uScM6nK6naCAYu11S4GxXyvGEA4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TP/TPYDffricRYUN-8EoF99EbRAm5m9QVJ4NsV4JQHUaTU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/TQ/TQZclZQajgRAt0UPyDLa5SDHOXXd7nrs_Aw1guZ1EDE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/U-/U-j-KeDrdeyrmflpuJSSH3aH_tGth_0zwnjl9eaecCU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Ui/Ui_ImrdWE848w92udaqCheUJypT-7QIicGTDDcF94ZY.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Vy/VyeoEaFiHk-BFfUz0QQyO1ywWUjhhvXaWjOhrueWuz4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/WC/WCZBAZL9AYx33c-WzmPLL8ZaSkyPBwQEpJSzDMruSTA.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/XG/XG-1Cxql9XcU0QzVsKfaImD2F-_fbQakmCOO1PZeiO8.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Y-/Y-mfMOkq6o7o6NIVKY5m1HzoQPj6deRrSVoSnePwWDg.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/Z5/Z56duv_o-wQlnyich8DqrY8VfI5mRampXLuyzcCQSes.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_X/_XFCt_G6l_CeYOky6Ky04YbAJMGmZ1S55wnsXuzjbFQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/_c/_cAbQgu5_t6QaopeTV6bHpVH6nABdZSHUD3dtw3TFvI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/aU/aUB5QePK5Y_57d0ISu6VcHykCHzl47ej-nXJSzHo7mM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ao/ao7sMvRzih2MlCNwwQnYbm-FUNM2rl1wlruiVgH8VbE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/b8/b8sc4SHWqZyiR9LoszM7AwU7Z9RStRdUzs5Cm4b1xi4.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/dG/dGu-1JGz62Geuns1TpCaYbAwvwLKjSjDp_VhKV3nWOw.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/dH/dHU4yPNGwU72V1rymqid8RLS4ole8B-9UGSJG-QyDsQ.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ei/eiJS8jxPa_CT4ECt01iVkhPzc9QQShE__hFgFUVMqhc.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hq/hqAVf5Mc94swL5QKxbwrtNQ1F6-4shrOpiZMk60yjMM.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/hz/hzzNh1KGk98zydo_p20ZW15iDYFoCsUZuYdK99A54Mo.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/ip/ip5FbXNQpdaOzVbU6_r90bYcY8R47qbE2_C79IUdlvQ.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/je/je9xQVOnasRNd1k49Q5KJdmxQscPKO-8qeVDMmmsVrI.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/jt/jtOzRwEskymBEhztMwmAwvXzROImYepCy7Zb25fxexQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/m3/m3BDc8KCgIUXE0VeZ142byDvlbYuOEBpNW_2ucKyb3M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mf/mfkdFcsUrRviUKGZkElnxw6dCyhyArAFbAVNuqQKcsE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/mx/mxQkXyjT__7etUOHa4WpbGL4YguqInaF8rQXNK4c6JU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/o4/o4yHfopv-ZxcXaMdi1_2O0CkBEWWQEd0wR0tEwKJ8s8.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/oF/oFjp7US8e9Cu4GOLqlO_vPIaX9jYwqrYbCFq6mgaYWE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/op/opKuUcXieH4Q4hch708zXOG2Rud2bhIilb38wKiOdjA.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/p4/p4U2tbFHGXaOchAVtbEfIHRvWKO2i-0nsq_4vtGNABU.cache +2 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/s4/s4jckxw_fz9fwDYqkrZPCsD7cCATrXbD5R7ducBhtoU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/uP/uPXk7u0shmDjGGOhtU06VSo7E81DYc2t9OGhQUvxEA0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/vS/vSQW3iohJ14LLnwWgoHFeHB-I3yIzLi9tLoZkUaE81M.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/vu/vuRt78a_J3dg7DUMHX1Nx9DYLME15Z1NjQ-4V8BoNCU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/w6/w6Gz48zxIouRBGOu5VmTHWsL9r0M4LKp124UOJ3mZN0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wj/wjsRbpDa20LzSzj66UKcgy3Wif53rLBEoeuyKIKz4pk.cache +3 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/wo/wo1g4ZKtmQmol-3MoVPFApwd5fnGEA23tCRCLuEw3D0.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xG/xGQ1RojQn3N9C51pkj4Flt274TjVuszRi1Puir0p6dE.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/xN/xNqJDUb7i6VSD0HU-EV3dcNYRoz2d48cGwn1CBqLvVU.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/y1/y1pwuOg2qdJFc_DgDEw6OIyr6GbmGpwV-p7X2sS64sU.cache +0 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zO/zOWzdA_n0s0vjbJ6IGB8gj1-mbqzbCywIQCMLr71qDE.cache +1 -0
- data/test/dummy/tmp/cache/assets/sprockets/v3.0/zV/zVdKofyDUgEZzwP0GQ8q4RxOoxo-qoGazLMre0zxw9c.cache +0 -0
- data/test/tmp/config/initializers/wobauth.rb +15 -0
- data/test/tmp/config/locales/wobauth.de.yml +42 -0
- data/test/tmp/config/locales/wobauth.en.yml +27 -0
- metadata +636 -0
@@ -0,0 +1,260 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
7
|
+
# config.secret_key = '07f86feaa5f6d66db4bf41f4a713e0cb65c349c2c95581ae8baf5e423711ab8552ddfbbbd9197ec4e85b5ad96c68393cd8060585361acf8a6cd8881c65bf60a0'
|
8
|
+
|
9
|
+
# ==> Mailer Configuration
|
10
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
11
|
+
# note that it will be overwritten if you use your own mailer class
|
12
|
+
# with default "from" parameter.
|
13
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
14
|
+
|
15
|
+
# Configure the class responsible to send e-mails.
|
16
|
+
# config.mailer = 'Devise::Mailer'
|
17
|
+
|
18
|
+
# ==> ORM configuration
|
19
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
20
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
21
|
+
# available as additional gems.
|
22
|
+
require 'devise/orm/active_record'
|
23
|
+
|
24
|
+
# ==> Configuration for any authentication mechanism
|
25
|
+
# Configure which keys are used when authenticating a user. The default is
|
26
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
27
|
+
# authenticating a user, both parameters are required. Remember that those
|
28
|
+
# parameters are used only when authenticating and not when retrieving from
|
29
|
+
# session. If you need permissions, you should implement that in a before filter.
|
30
|
+
# You can also supply a hash where the value is a boolean determining whether
|
31
|
+
# or not authentication should be aborted when the value is not present.
|
32
|
+
config.authentication_keys = [ :username ]
|
33
|
+
|
34
|
+
# Configure parameters from the request object used for authentication. Each entry
|
35
|
+
# given should be a request method and it will automatically be passed to the
|
36
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
37
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
38
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
39
|
+
# config.request_keys = []
|
40
|
+
|
41
|
+
# Configure which authentication keys should be case-insensitive.
|
42
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
43
|
+
# to authenticate or find a user. Default is :email.
|
44
|
+
config.case_insensitive_keys = [ :username, :email ]
|
45
|
+
|
46
|
+
# Configure which authentication keys should have whitespace stripped.
|
47
|
+
# These keys will have whitespace before and after removed upon creating or
|
48
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
49
|
+
config.strip_whitespace_keys = [ :username, :email ]
|
50
|
+
|
51
|
+
# Tell if authentication through request.params is enabled. True by default.
|
52
|
+
# It can be set to an array that will enable params authentication only for the
|
53
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
54
|
+
# enable it only for database (email + password) authentication.
|
55
|
+
# config.params_authenticatable = true
|
56
|
+
|
57
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
58
|
+
# It can be set to an array that will enable http authentication only for the
|
59
|
+
# given strategies, for example, `config.http_authenticatable = [:database]` will
|
60
|
+
# enable it only for database authentication. The supported strategies are:
|
61
|
+
# :database = Support basic authentication with authentication key + password
|
62
|
+
# config.http_authenticatable = false
|
63
|
+
|
64
|
+
# If http headers should be returned for AJAX requests. True by default.
|
65
|
+
# config.http_authenticatable_on_xhr = true
|
66
|
+
|
67
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
68
|
+
# config.http_authentication_realm = 'Application'
|
69
|
+
|
70
|
+
# It will change confirmation, password recovery and other workflows
|
71
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
72
|
+
# Does not affect registerable.
|
73
|
+
# config.paranoid = true
|
74
|
+
|
75
|
+
# By default Devise will store the user in session. You can skip storage for
|
76
|
+
# particular strategies by setting this option.
|
77
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
78
|
+
# may want to disable generating routes to Devise's sessions controller by
|
79
|
+
# passing skip: :sessions to `devise_for` in your config/routes.rb
|
80
|
+
config.skip_session_storage = [:http_auth]
|
81
|
+
|
82
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
83
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
84
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
85
|
+
# from the server. You can disable this option at your own risk.
|
86
|
+
# config.clean_up_csrf_token_on_authentication = true
|
87
|
+
|
88
|
+
# ==> Configuration for :database_authenticatable
|
89
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
90
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
91
|
+
#
|
92
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
93
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
94
|
+
# a value less than 10 in other environments. Note that, for bcrypt (the default
|
95
|
+
# encryptor), the cost increases exponentially with the number of stretches (e.g.
|
96
|
+
# a value of 20 is already extremely slow: approx. 60 seconds for 1 calculation).
|
97
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
98
|
+
|
99
|
+
# Setup a pepper to generate the encrypted password.
|
100
|
+
# config.pepper = 'ae866908c788f5623196f80e0aa11a5ef2c22b6d9dcaf93bb5b73d6ea221aab5d7119fb377593910627d7a1a0805d8fbb142849f4c29d73b756db89f9907257d'
|
101
|
+
|
102
|
+
# ==> Configuration for :confirmable
|
103
|
+
# A period that the user is allowed to access the website even without
|
104
|
+
# confirming their account. For instance, if set to 2.days, the user will be
|
105
|
+
# able to access the website for two days without confirming their account,
|
106
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
107
|
+
# the user cannot access the website without confirming their account.
|
108
|
+
# config.allow_unconfirmed_access_for = 2.days
|
109
|
+
|
110
|
+
# A period that the user is allowed to confirm their account before their
|
111
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
112
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
113
|
+
# their account can't be confirmed with the token any more.
|
114
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
115
|
+
# before confirming their account.
|
116
|
+
# config.confirm_within = 3.days
|
117
|
+
|
118
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
119
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
120
|
+
# db field (see migrations). Until confirmed, new email is stored in
|
121
|
+
# unconfirmed_email column, and copied to email column on successful confirmation.
|
122
|
+
config.reconfirmable = true
|
123
|
+
|
124
|
+
# Defines which key will be used when confirming an account
|
125
|
+
# config.confirmation_keys = [ :email ]
|
126
|
+
|
127
|
+
# ==> Configuration for :rememberable
|
128
|
+
# The time the user will be remembered without asking for credentials again.
|
129
|
+
# config.remember_for = 2.weeks
|
130
|
+
|
131
|
+
# If true, extends the user's remember period when remembered via cookie.
|
132
|
+
# config.extend_remember_period = false
|
133
|
+
|
134
|
+
# Options to be passed to the created cookie. For instance, you can set
|
135
|
+
# secure: true in order to force SSL only cookies.
|
136
|
+
# config.rememberable_options = {}
|
137
|
+
|
138
|
+
# ==> Configuration for :validatable
|
139
|
+
# Range for password length.
|
140
|
+
config.password_length = 8..128
|
141
|
+
|
142
|
+
# Email regex used to validate email formats. It simply asserts that
|
143
|
+
# one (and only one) @ exists in the given string. This is mainly
|
144
|
+
# to give user feedback and not to assert the e-mail validity.
|
145
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
146
|
+
|
147
|
+
# ==> Configuration for :timeoutable
|
148
|
+
# The time you want to timeout the user session without activity. After this
|
149
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
150
|
+
# config.timeout_in = 30.minutes
|
151
|
+
|
152
|
+
# If true, expires auth token on session timeout.
|
153
|
+
# config.expire_auth_token_on_timeout = false
|
154
|
+
|
155
|
+
# ==> Configuration for :lockable
|
156
|
+
# Defines which strategy will be used to lock an account.
|
157
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
158
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
159
|
+
# config.lock_strategy = :failed_attempts
|
160
|
+
|
161
|
+
# Defines which key will be used when locking and unlocking an account
|
162
|
+
config.unlock_keys = [ :username ]
|
163
|
+
|
164
|
+
# Defines which strategy will be used to unlock an account.
|
165
|
+
# :email = Sends an unlock link to the user email
|
166
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
167
|
+
# :both = Enables both strategies
|
168
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
169
|
+
# config.unlock_strategy = :both
|
170
|
+
|
171
|
+
# Number of authentication tries before locking an account if lock_strategy
|
172
|
+
# is failed attempts.
|
173
|
+
# config.maximum_attempts = 20
|
174
|
+
|
175
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
176
|
+
# config.unlock_in = 1.hour
|
177
|
+
|
178
|
+
# Warn on the last attempt before the account is locked.
|
179
|
+
# config.last_attempt_warning = false
|
180
|
+
|
181
|
+
# ==> Configuration for :recoverable
|
182
|
+
#
|
183
|
+
# Defines which key will be used when recovering the password for an account
|
184
|
+
config.reset_password_keys = [ :username ]
|
185
|
+
|
186
|
+
# Time interval you can reset your password with a reset password key.
|
187
|
+
# Don't put a too small interval or your users won't have the time to
|
188
|
+
# change their passwords.
|
189
|
+
config.reset_password_within = 6.hours
|
190
|
+
|
191
|
+
# ==> Configuration for :encryptable
|
192
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
193
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
194
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
195
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
196
|
+
# REST_AUTH_SITE_KEY to pepper).
|
197
|
+
#
|
198
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
199
|
+
# config.encryptor = :sha512
|
200
|
+
|
201
|
+
# ==> Scopes configuration
|
202
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
203
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
204
|
+
# are using only default views.
|
205
|
+
# config.scoped_views = false
|
206
|
+
|
207
|
+
# Configure the default scope given to Warden. By default it's the first
|
208
|
+
# devise role declared in your routes (usually :user).
|
209
|
+
# config.default_scope = :user
|
210
|
+
|
211
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
212
|
+
# only the current scope. By default, Devise signs out all scopes.
|
213
|
+
# config.sign_out_all_scopes = true
|
214
|
+
|
215
|
+
# ==> Navigation configuration
|
216
|
+
# Lists the formats that should be treated as navigational. Formats like
|
217
|
+
# :html, should redirect to the sign in page when the user does not have
|
218
|
+
# access, but formats like :xml or :json, should return 401.
|
219
|
+
#
|
220
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
221
|
+
# should add them to the navigational formats lists.
|
222
|
+
#
|
223
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
224
|
+
# config.navigational_formats = ['*/*', :html]
|
225
|
+
|
226
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
227
|
+
config.sign_out_via = :delete
|
228
|
+
|
229
|
+
# ==> OmniAuth
|
230
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
231
|
+
# up on your models and hooks.
|
232
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', scope: 'user,public_repo'
|
233
|
+
|
234
|
+
# ==> Warden configuration
|
235
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
236
|
+
# change the failure app, you can configure them inside the config.warden block.
|
237
|
+
#
|
238
|
+
# config.warden do |manager|
|
239
|
+
# manager.intercept_401 = false
|
240
|
+
# manager.default_strategies(scope: :user).unshift :some_external_strategy
|
241
|
+
# end
|
242
|
+
|
243
|
+
config.warden do |manager|
|
244
|
+
manager.failure_app = Wobauth::FailureApp
|
245
|
+
end
|
246
|
+
|
247
|
+
# ==> Mountable engine configurations
|
248
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
249
|
+
# is mountable, there are some extra configurations to be taken into account.
|
250
|
+
# The following options are available, assuming the engine is mounted as:
|
251
|
+
#
|
252
|
+
# mount MyEngine, at: '/my_engine'
|
253
|
+
#
|
254
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
255
|
+
config.router_name = :wobauth
|
256
|
+
#
|
257
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
258
|
+
# so you need to do it manually. For the users scope, it would be:
|
259
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
260
|
+
end
|
@@ -0,0 +1,21 @@
|
|
1
|
+
module Wobauth
|
2
|
+
|
3
|
+
class FailureApp < Devise::FailureApp
|
4
|
+
|
5
|
+
def redirect_url
|
6
|
+
wobauth.new_user_session_url
|
7
|
+
end
|
8
|
+
#
|
9
|
+
# # You need to override respond to eliminate recall
|
10
|
+
def respond
|
11
|
+
if http_auth?
|
12
|
+
http_auth
|
13
|
+
else
|
14
|
+
redirect
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
end
|
19
|
+
|
20
|
+
end
|
21
|
+
|
@@ -0,0 +1,169 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
# Wrappers are used by the form builder to generate a
|
4
|
+
# complete input. You can remove any component from the
|
5
|
+
# wrapper, change the order or even add your own to the
|
6
|
+
# stack. The options given below are used to wrap the
|
7
|
+
# whole input.
|
8
|
+
config.wrappers :default, class: :input,
|
9
|
+
hint_class: :field_with_hint, error_class: :field_with_errors do |b|
|
10
|
+
## Extensions enabled by default
|
11
|
+
# Any of these extensions can be disabled for a
|
12
|
+
# given input by passing: `f.input EXTENSION_NAME => false`.
|
13
|
+
# You can make any of these extensions optional by
|
14
|
+
# renaming `b.use` to `b.optional`.
|
15
|
+
|
16
|
+
# Determines whether to use HTML5 (:email, :url, ...)
|
17
|
+
# and required attributes
|
18
|
+
b.use :html5
|
19
|
+
|
20
|
+
# Calculates placeholders automatically from I18n
|
21
|
+
# You can also pass a string as f.input placeholder: "Placeholder"
|
22
|
+
b.use :placeholder
|
23
|
+
|
24
|
+
## Optional extensions
|
25
|
+
# They are disabled unless you pass `f.input EXTENSION_NAME => true`
|
26
|
+
# to the input. If so, they will retrieve the values from the model
|
27
|
+
# if any exists. If you want to enable any of those
|
28
|
+
# extensions by default, you can change `b.optional` to `b.use`.
|
29
|
+
|
30
|
+
# Calculates maxlength from length validations for string inputs
|
31
|
+
# and/or database column lengths
|
32
|
+
b.optional :maxlength
|
33
|
+
|
34
|
+
# Calculate minlength from length validations for string inputs
|
35
|
+
b.optional :minlength
|
36
|
+
|
37
|
+
# Calculates pattern from format validations for string inputs
|
38
|
+
b.optional :pattern
|
39
|
+
|
40
|
+
# Calculates min and max from length validations for numeric inputs
|
41
|
+
b.optional :min_max
|
42
|
+
|
43
|
+
# Calculates readonly automatically from readonly attributes
|
44
|
+
b.optional :readonly
|
45
|
+
|
46
|
+
## Inputs
|
47
|
+
b.use :label_input
|
48
|
+
b.use :hint, wrap_with: { tag: :span, class: :hint }
|
49
|
+
b.use :error, wrap_with: { tag: :span, class: :error }
|
50
|
+
|
51
|
+
## full_messages_for
|
52
|
+
# If you want to display the full error message for the attribute, you can
|
53
|
+
# use the component :full_error, like:
|
54
|
+
#
|
55
|
+
# b.use :full_error, wrap_with: { tag: :span, class: :error }
|
56
|
+
end
|
57
|
+
|
58
|
+
# The default wrapper to be used by the FormBuilder.
|
59
|
+
config.default_wrapper = :default
|
60
|
+
|
61
|
+
# Define the way to render check boxes / radio buttons with labels.
|
62
|
+
# Defaults to :nested for bootstrap config.
|
63
|
+
# inline: input + label
|
64
|
+
# nested: label > input
|
65
|
+
config.boolean_style = :nested
|
66
|
+
|
67
|
+
# Default class for buttons
|
68
|
+
config.button_class = 'btn'
|
69
|
+
|
70
|
+
# Method used to tidy up errors. Specify any Rails Array method.
|
71
|
+
# :first lists the first message for each field.
|
72
|
+
# Use :to_sentence to list all errors for each field.
|
73
|
+
# config.error_method = :first
|
74
|
+
|
75
|
+
# Default tag used for error notification helper.
|
76
|
+
config.error_notification_tag = :div
|
77
|
+
|
78
|
+
# CSS class to add for error notification helper.
|
79
|
+
config.error_notification_class = 'error_notification'
|
80
|
+
|
81
|
+
# ID to add for error notification helper.
|
82
|
+
# config.error_notification_id = nil
|
83
|
+
|
84
|
+
# Series of attempts to detect a default label method for collection.
|
85
|
+
# config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
|
86
|
+
|
87
|
+
# Series of attempts to detect a default value method for collection.
|
88
|
+
# config.collection_value_methods = [ :id, :to_s ]
|
89
|
+
|
90
|
+
# You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
|
91
|
+
# config.collection_wrapper_tag = nil
|
92
|
+
|
93
|
+
# You can define the class to use on all collection wrappers. Defaulting to none.
|
94
|
+
# config.collection_wrapper_class = nil
|
95
|
+
|
96
|
+
# You can wrap each item in a collection of radio/check boxes with a tag,
|
97
|
+
# defaulting to :span.
|
98
|
+
# config.item_wrapper_tag = :span
|
99
|
+
|
100
|
+
# You can define a class to use in all item wrappers. Defaulting to none.
|
101
|
+
# config.item_wrapper_class = nil
|
102
|
+
|
103
|
+
# How the label text should be generated altogether with the required text.
|
104
|
+
# config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
|
105
|
+
|
106
|
+
# You can define the class to use on all labels. Default is nil.
|
107
|
+
# config.label_class = nil
|
108
|
+
|
109
|
+
# You can define the default class to be used on forms. Can be overriden
|
110
|
+
# with `html: { :class }`. Defaulting to none.
|
111
|
+
# config.default_form_class = nil
|
112
|
+
|
113
|
+
# You can define which elements should obtain additional classes
|
114
|
+
# config.generate_additional_classes_for = [:wrapper, :label, :input]
|
115
|
+
|
116
|
+
# Whether attributes are required by default (or not). Default is true.
|
117
|
+
# config.required_by_default = true
|
118
|
+
|
119
|
+
# Tell browsers whether to use the native HTML5 validations (novalidate form option).
|
120
|
+
# These validations are enabled in SimpleForm's internal config but disabled by default
|
121
|
+
# in this configuration, which is recommended due to some quirks from different browsers.
|
122
|
+
# To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
|
123
|
+
# change this configuration to true.
|
124
|
+
config.browser_validations = false
|
125
|
+
|
126
|
+
# Collection of methods to detect if a file type was given.
|
127
|
+
# config.file_methods = [ :mounted_as, :file?, :public_filename ]
|
128
|
+
|
129
|
+
# Custom mappings for input types. This should be a hash containing a regexp
|
130
|
+
# to match as key, and the input type that will be used when the field name
|
131
|
+
# matches the regexp as value.
|
132
|
+
# config.input_mappings = { /count/ => :integer }
|
133
|
+
|
134
|
+
# Custom wrappers for input types. This should be a hash containing an input
|
135
|
+
# type as key and the wrapper that will be used for all inputs with specified type.
|
136
|
+
# config.wrapper_mappings = { string: :prepend }
|
137
|
+
|
138
|
+
# Namespaces where SimpleForm should look for custom input classes that
|
139
|
+
# override default inputs.
|
140
|
+
# config.custom_inputs_namespaces << "CustomInputs"
|
141
|
+
|
142
|
+
# Default priority for time_zone inputs.
|
143
|
+
# config.time_zone_priority = nil
|
144
|
+
|
145
|
+
# Default priority for country inputs.
|
146
|
+
# config.country_priority = nil
|
147
|
+
|
148
|
+
# When false, do not use translations for labels.
|
149
|
+
# config.translate_labels = true
|
150
|
+
|
151
|
+
# Automatically discover new inputs in Rails' autoload path.
|
152
|
+
# config.inputs_discovery = true
|
153
|
+
|
154
|
+
# Cache SimpleForm inputs discovery
|
155
|
+
# config.cache_discovery = !Rails.env.development?
|
156
|
+
|
157
|
+
# Default class for inputs
|
158
|
+
# config.input_class = nil
|
159
|
+
|
160
|
+
# Define the default class of the input wrapper of the boolean input.
|
161
|
+
config.boolean_label_class = 'checkbox'
|
162
|
+
|
163
|
+
# Defines if the default input wrapper class should be included in radio
|
164
|
+
# collection wrappers.
|
165
|
+
# config.include_default_input_wrapper_class = true
|
166
|
+
|
167
|
+
# Defines which i18n scope will be used in Simple Form.
|
168
|
+
# config.i18n_scope = 'simple_form'
|
169
|
+
end
|
@@ -0,0 +1,154 @@
|
|
1
|
+
# Use this setup block to configure all options available in SimpleForm.
|
2
|
+
SimpleForm.setup do |config|
|
3
|
+
config.error_notification_class = 'alert alert-danger'
|
4
|
+
# config.button_class = 'btn btn-primary'
|
5
|
+
config.boolean_label_class = 'form-check-label'
|
6
|
+
|
7
|
+
# Helpers
|
8
|
+
wrapper_options = {class: 'form-group'}
|
9
|
+
input_options = {error_class: 'is-invalid'}
|
10
|
+
label_class = 'col-form-label'
|
11
|
+
|
12
|
+
error_and_hint = ->(b) do
|
13
|
+
b.use :error, wrap_with: {tag: 'span', class: 'invalid-feedback'}
|
14
|
+
b.use :hint, wrap_with: {tag: 'small', class: 'form-text text-muted'}
|
15
|
+
end
|
16
|
+
|
17
|
+
config.wrappers :vertical_form, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
18
|
+
b.use :html5
|
19
|
+
b.use :placeholder
|
20
|
+
b.optional :maxlength
|
21
|
+
b.optional :minlength
|
22
|
+
b.optional :pattern
|
23
|
+
b.optional :min_max
|
24
|
+
b.optional :readonly
|
25
|
+
b.use :label, class: 'control-label'
|
26
|
+
|
27
|
+
b.use :input, class: 'form-control'
|
28
|
+
error_and_hint.call(b)
|
29
|
+
end
|
30
|
+
|
31
|
+
config.wrappers :vertical_file_input, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
32
|
+
b.use :html5
|
33
|
+
b.use :placeholder
|
34
|
+
b.optional :maxlength
|
35
|
+
b.optional :minlength
|
36
|
+
b.optional :readonly
|
37
|
+
b.use :label, class: 'control-label'
|
38
|
+
|
39
|
+
b.use :input
|
40
|
+
error_and_hint.call(b)
|
41
|
+
end
|
42
|
+
|
43
|
+
config.wrappers :vertical_boolean, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
44
|
+
b.use :html5
|
45
|
+
b.optional :readonly
|
46
|
+
|
47
|
+
b.wrapper tag: 'div', class: 'checkbox' do |ba|
|
48
|
+
ba.use :label_input
|
49
|
+
end
|
50
|
+
|
51
|
+
error_and_hint.call(b)
|
52
|
+
end
|
53
|
+
|
54
|
+
config.wrappers :vertical_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
55
|
+
b.use :html5
|
56
|
+
b.optional :readonly
|
57
|
+
b.use :label, class: 'control-label'
|
58
|
+
b.use :input
|
59
|
+
error_and_hint.call(b)
|
60
|
+
end
|
61
|
+
|
62
|
+
config.wrappers :horizontal_form, tag: 'div', class: 'form-group row', error_class: 'has-invalid' do |b|
|
63
|
+
b.use :html5
|
64
|
+
b.use :placeholder
|
65
|
+
b.optional :maxlength
|
66
|
+
b.optional :minlength
|
67
|
+
b.optional :pattern
|
68
|
+
b.optional :min_max
|
69
|
+
b.optional :readonly
|
70
|
+
b.use :label, class: 'col-sm-3 col-md-2 col-form-label'
|
71
|
+
|
72
|
+
b.wrapper tag: 'div', class: 'col-sm-9 col-md-10' do |ba|
|
73
|
+
ba.use :input, class: 'form-control'
|
74
|
+
error_and_hint.call(ba)
|
75
|
+
end
|
76
|
+
end
|
77
|
+
|
78
|
+
config.wrappers :horizontal_file_input, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
79
|
+
b.use :html5
|
80
|
+
b.use :placeholder
|
81
|
+
b.optional :maxlength
|
82
|
+
b.optional :minlength
|
83
|
+
b.optional :readonly
|
84
|
+
b.use :label, class: 'col-sm-3 col-md-2 col-form-label'
|
85
|
+
|
86
|
+
b.wrapper tag: 'div', class: 'col-sm-9 col-md-10' do |ba|
|
87
|
+
ba.use :input
|
88
|
+
error_and_hint.call(ba)
|
89
|
+
end
|
90
|
+
end
|
91
|
+
|
92
|
+
config.wrappers :horizontal_boolean, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
93
|
+
b.use :html5
|
94
|
+
b.optional :readonly
|
95
|
+
b.use :label, class: 'col-sm-3 col-md-2 col-form-label'
|
96
|
+
|
97
|
+
b.wrapper tag: 'div', class: 'offset-sm-3 col-sm-9 offset-md-2 col-md-10' do |wr|
|
98
|
+
wr.wrapper tag: 'div', class: 'checkbox' do |ba|
|
99
|
+
ba.use :label_input
|
100
|
+
end
|
101
|
+
error_and_hint.call(wr)
|
102
|
+
end
|
103
|
+
end
|
104
|
+
|
105
|
+
config.wrappers :horizontal_radio_and_checkboxes, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
106
|
+
b.use :html5
|
107
|
+
b.optional :readonly
|
108
|
+
|
109
|
+
b.use :label, class: 'col-sm-3 col-md-2 col-form-label'
|
110
|
+
|
111
|
+
b.wrapper tag: 'div', class: 'col-sm-9 col-md-10' do |ba|
|
112
|
+
ba.use :input
|
113
|
+
error_and_hint.call(b)
|
114
|
+
end
|
115
|
+
end
|
116
|
+
|
117
|
+
config.wrappers :inline_form, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
118
|
+
b.use :html5
|
119
|
+
b.use :placeholder
|
120
|
+
b.optional :maxlength
|
121
|
+
b.optional :minlength
|
122
|
+
b.optional :pattern
|
123
|
+
b.optional :min_max
|
124
|
+
b.optional :readonly
|
125
|
+
b.use :label, class: 'sr-only'
|
126
|
+
|
127
|
+
b.use :input, class: 'form-control'
|
128
|
+
error_and_hint.call(b)
|
129
|
+
end
|
130
|
+
|
131
|
+
config.wrappers :multi_select, tag: 'div', class: 'form-group', error_class: 'has-invalid' do |b|
|
132
|
+
b.use :html5
|
133
|
+
b.optional :readonly
|
134
|
+
b.use :label, class: 'control-label'
|
135
|
+
b.wrapper tag: 'div', class: 'form-inline' do |ba|
|
136
|
+
ba.use :input, class: 'form-control'
|
137
|
+
error_and_hint.call(ba)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
# Wrappers for forms and inputs using the Bootstrap toolkit.
|
141
|
+
# Check the Bootstrap docs (http://getbootstrap.com)
|
142
|
+
# to learn about the different styles for forms and inputs,
|
143
|
+
# buttons and other elements.
|
144
|
+
config.default_wrapper = :horizontal_form
|
145
|
+
config.wrapper_mappings = {
|
146
|
+
check_boxes: :horizontal_radio_and_checkboxes,
|
147
|
+
radio_buttons: :horizontal_radio_and_checkboxes,
|
148
|
+
file: :horizontal_file_input,
|
149
|
+
boolean: :horizontal_boolean,
|
150
|
+
datetime: :multi_select,
|
151
|
+
date: :multi_select,
|
152
|
+
time: :multi_select
|
153
|
+
}
|
154
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Wobapphelpers.setup do |config|
|
2
|
+
#
|
3
|
+
# exclude some controllers from breadcrumbs
|
4
|
+
# the given string must match controller.controller_name
|
5
|
+
#
|
6
|
+
# example:
|
7
|
+
# config.breadcrumb_controller_blacklist = ["user_sessions"]
|
8
|
+
# default:
|
9
|
+
# config.breadcrumb_controller_blacklist = []
|
10
|
+
#
|
11
|
+
# show action links only if has ability to execute the action
|
12
|
+
# * :none : always present action links
|
13
|
+
# * :cancan1 : for cancancan '~>1.7.0' or cancan '~>1.6.0'
|
14
|
+
# * :cancan2 : for cancan '~>2.0.0', untested
|
15
|
+
#
|
16
|
+
# default:
|
17
|
+
# config.cancan = :none
|
18
|
+
end
|