family_gallery 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (227) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/family_gallery/groups_controller.rb +45 -2
  3. data/app/controllers/family_gallery/user_roles_controller.rb +37 -0
  4. data/app/controllers/family_gallery/user_taggings_controller.rb +10 -9
  5. data/app/controllers/family_gallery/users_controller.rb +45 -3
  6. data/app/controllers/family_gallery/welcome_controller.rb +4 -1
  7. data/app/models/family_gallery/ability.rb +13 -2
  8. data/app/models/family_gallery/group.rb +2 -0
  9. data/app/models/family_gallery/picture.rb +2 -0
  10. data/app/models/family_gallery/user.rb +1 -0
  11. data/app/models/family_gallery/user_role.rb +6 -0
  12. data/app/views/family_gallery/user_roles/_form.html.haml +3 -0
  13. data/app/views/family_gallery/user_roles/new.html.haml +3 -0
  14. data/app/views/family_gallery/users/show.html.haml +21 -0
  15. data/config/initializers/awesome_translations.rb +1 -0
  16. data/config/initializers/simple_form.rb +166 -0
  17. data/config/locales/awesome_translations/app/helpers/family_gallery/da.yml +6 -0
  18. data/config/locales/awesome_translations/app/helpers/family_gallery/en.yml +6 -0
  19. data/config/locales/awesome_translations/app/models/family_gallery/da.yml +6 -0
  20. data/config/locales/awesome_translations/app/models/family_gallery/en.yml +6 -0
  21. data/config/locales/awesome_translations/app/views/family_gallery/user_roles/da.yml +6 -0
  22. data/config/locales/awesome_translations/app/views/family_gallery/user_roles/en.yml +6 -0
  23. data/config/locales/awesome_translations/models/family_gallery__user/da.yml +7 -0
  24. data/config/locales/awesome_translations/models/family_gallery__user/en.yml +7 -0
  25. data/config/locales/simple_form.en.yml +31 -0
  26. data/config/routes.rb +4 -2
  27. data/db/plugin_migrate/20150508081950_add_user_owner_to_groups.rb +6 -0
  28. data/lib/family_gallery/version.rb +1 -1
  29. data/lib/templates/erb/scaffold/_form.html.erb +13 -0
  30. data/spec/controllers/family_gallery/groups_controller_spec.rb +66 -0
  31. data/spec/controllers/family_gallery/locales_controller_spec.rb +15 -0
  32. data/spec/controllers/family_gallery/pictures_controller_spec.rb +4 -2
  33. data/spec/controllers/family_gallery/user_roles_controller_spec.rb +37 -0
  34. data/spec/controllers/family_gallery/user_taggings_controller_spec.rb +44 -0
  35. data/spec/controllers/family_gallery/users_controller_spec.rb +67 -0
  36. data/spec/dummy/config/environments/production.rb +1 -1
  37. data/spec/dummy/config/environments/test.rb +1 -1
  38. data/spec/dummy/db/schema.rb +54 -51
  39. data/spec/dummy/log/development.log +4782 -0
  40. data/spec/dummy/log/test.log +5331 -0
  41. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/-hQRdqWQu73Yx5QiUxfYRURbqzfHDb1PE6qGmeEO9kY.cache +0 -0
  42. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/2zwTWOD1Dd_S-opzh-CmX1_fydfXvWEza9KYHrWKYkY.cache +1 -0
  43. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/3W4YnmQhJyZGtT03ZCAp5cvpoDIVzhYE-OOySbjsapM.cache +37 -0
  44. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/4H6NKxG2YddskIdf_03222wZ8kphBNjvYK6iXCB11eI.cache +1 -0
  45. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/54QJf7-lnbywCPYciET5Fdy74m4XmFU7NNcaYKrgi8Y.cache +2 -0
  46. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7Eve6bsJd_sw7qXnaCbTujcr-UwqfYSnlDcoTl9mGu0.cache +1 -0
  47. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/7JObOpcGWt5r5Ea568fgV01Ed3fjuBlBITVPvrc8oIs.cache +0 -0
  48. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/8yJQ_Ka1A9O1RTb9-nVPpwwHeMGjnwG0pgczu_lMbk0.cache +1 -0
  49. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9FNXvWqcBTSfSon_2U8pCSk_JDdYk6l6uAiLQXVvrCM.cache +0 -0
  50. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/9PbYLPdCxP_oX_b-QxCkVET4lbO7nF2KPia6rAfr3Ts.cache +1 -0
  51. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/AcloL6yHnBX7CKq3FN9W6CAIc9bHnT5cYYbT9pmLsxw.cache +2 -0
  52. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ase2RYqrsQ0kXoNr1E1j2MEwz-TskbvO9IOLrEgZSL0.cache +0 -0
  53. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BBI1gtQkrJmBf3CJ-374M44oGqVpJHgf22Rbwa_u2zg.cache +0 -0
  54. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/B_SJ67b35_bVz7ZAZfC8f7lafyhPAd-_5mqoriIyYYk.cache +2 -0
  55. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/BtXkANDk3VSuFwpmHdQbfnKVEqGoVGHkHV_4rFXYp6Q.cache +1 -0
  56. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/CBLZYr6WegdsXk9rst09TEqFulLRRVv34rZyBxwK8aI.cache +0 -0
  57. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Dq1_xO_MW2UacskEcnWB7fRcbOy68mH1nPQwIi8wYBo.cache +0 -0
  58. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EQEMGT66vIudsh79XT-x8PVBoh4owB2NYGtn4OJRzww.cache +1 -0
  59. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/EwXlChRQzpcU12HptCvsJR_EfQioGzc6m7AnDAVMwPI.cache +0 -0
  60. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/GLtDgVmTUMo6-chqHh1ySimmdEtd9dsA0nhuoY7bzxY.cache +2 -0
  61. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/G_pGbb7858rh3p9R7pozCPHO0hKAqZASWy8H8bLJ6_4.cache +0 -0
  62. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/J8AwnZgVdY_2YOa6ENN4l8hZtj6LK_NDVaeWe9DhPgM.cache +0 -0
  63. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Kf-DnPjkjmvu-fT_zByJLtBpzTslzCno2S31xS8xV0g.cache +1 -0
  64. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Ko8Vzjv9GJnw996cHHcXEr71e9YvRqt6SwjCRRt3tgg.cache +0 -0
  65. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/KvmmgF4_oMLrlbbYNHZEQ58AT-cMOMxXUkQYXomKtHY.cache +0 -0
  66. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MFut7RR3tu2hiErVmmSYINrcGr40XnFrPQ5TxyAEeM0.cache +0 -0
  67. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/MsSVIHis1abvfaf6VRc8sVwl9OIOuOnSPTLApLb1szQ.cache +26 -0
  68. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/My-O9yZmyHinYEYM0x0LZggXiR3okwyuADQDtiuyp9A.cache +1 -0
  69. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/NMmnYWHpTEJfb2Co4fFWb-ckZ8Q13pXTVZq-h1ai3ks.cache +0 -0
  70. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OG-AzAgty2btZCvNBFwbES6B4QL6nWh3Jj_jIKb8P7c.cache +1 -0
  71. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ORv1F5nTty3sUqjSYnf4rZpPb_R86-ee0sjOFDp0rVE.cache +0 -0
  72. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/OjsENZSpPllinbzGj3Ep0ciCD7jYal5drMCf1BeHkaQ.cache +2 -0
  73. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/QQlNrhy9Js3uB_rSo_PlVeBQbGfXUfAJepRTHUgJdEI.cache +0 -0
  74. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/SOx2q96as0kzSLQxGFUw5apPSemYDlx6kZ6Bs_xBIQw.cache +2 -0
  75. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TNRu3lXH9ajazn-ls77N6agT2-YAPrBRiUeM2eByrU0.cache +2 -0
  76. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TOOITiJ4HpxXtGMd7d399TlIsjwVtcI7RcJa3uY4VHY.cache +0 -0
  77. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/TU2SJ0iFXlj_Xc78W3sY-yoMxI0LI2FkYy8-xGHirw4.cache +1 -0
  78. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/UF-PSA6IsTb86RU5b7B2UeqC63P_RirW16IGiJJfE1w.cache +1 -0
  79. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/VX22nz7EPkkv-lqD4LJ7UCrdCiVmdmIcMQ1UEvrApLc.cache +2 -0
  80. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/Vure74VwhZbVg6HZlMPfBhCn9jtjfbuvxBi1ErljXVA.cache +2 -0
  81. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/W3xFppatT78R8Zaa-xYuePzMl1UEU3yzQrLrtTH3OYI.cache +0 -0
  82. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/W6GEe6xsjragJiA0CEQ8UvPvUf2ASDSDKIC340AldG0.cache +0 -0
  83. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/YpzbVFSK9wVVcwaTtVrZmBykb1LcCINHumet4i4u8_Y.cache +1 -0
  84. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZCJHSey2jfX1Bg7QPxIrER6wYPCOd6XmH2q4-z5wL04.cache +0 -0
  85. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZbZyURMpvUSF3E_nWseuxqin9q83ShHXU-kLUiybEmE.cache +0 -0
  86. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ZljYtWTUhhzX0dWYStfd5ZGu0TuyUQ3UrEcnPc7kenA.cache +0 -0
  87. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/_C8HSdR8bq6ow17yYRN0JX92DxWP-gU_RL0sZ_rSzlM.cache +0 -0
  88. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/_NTZYWaLn69VxNc3bKjyFMslFp96byaJnki87xlv_fc.cache +0 -0
  89. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/bBq28xeM5j70IrH9IunvD6S7CbTX_OSTXO_Z-wEw2zs.cache +0 -0
  90. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/baMRNj958ooabY74Hut8zDMSZ9Etyt7HJAgZQgPGMok.cache +1 -0
  91. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cS9J4Z827SAl4OWYrgmzMgbCoUX64UkTICkg87HG1wA.cache +0 -0
  92. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/cTW4ExxiKScaif6-lb5OdnXFLxfpdV50HU5f0uvA7no.cache +0 -0
  93. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dD-Q0iRHARSIzldbElnIgjIEn9xppxvLEctUCH0tg8w.cache +0 -0
  94. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dh9_a9U18qiWcpV9Yx5NCcKmQr9ETgMYFOgLpO5aYkA.cache +1 -0
  95. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/dicwROVZEbu8y5AblmyAg91xUuMd8uGqrGtHoMJeKF8.cache +1 -0
  96. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/drwR3Ciba2VyB0azQjYLHqtmeSF11AIXVdVU13iZyLg.cache +1 -0
  97. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/eL2knZFREuZ8m_nhxo0k3BWljEPTM43lNR5VaRtolsM.cache +1 -0
  98. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/eoHlDmKTK2irlNAuaoEg11qxGfuidvkji-TMujr9DsY.cache +2 -0
  99. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/fH8aZNt8wQxn-ML4khOtvGN0jdBY0Zwq6NHO2T7Jhj0.cache +1 -0
  100. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/fXiMZGL7KjUDKrGoIw2ah2fK0cKXnzIZE17bqHO-uac.cache +1 -0
  101. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/fc0Fzd6YwzG62dl0uZLr_o7yWjW8lz-Aa_m1AlMIxLQ.cache +45 -0
  102. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/g0qJ9gwsvbCGjQHUq3AgBJ2zicAc7YFi4aPC8jiFpYI.cache +2 -0
  103. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/g8QlMs9PpeN8NF_NkRcyG1K4qFOxte6oaKZaaGliGxw.cache +2 -0
  104. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/jVsCHPCK3sdvZh1IA8ZNhj0XJPOBXIAUKs-ZEBZt2jk.cache +0 -0
  105. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/lAlebtP1k8gDXgNbPi7_3ZmqA-aBulsdkOEryRLGRcY.cache +1 -0
  106. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/m8-_FKUhLMujJ8SusNRRRiVhzFlY02drWKvwyRf9Zd4.cache +1 -0
  107. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/n8l3H2IJdBWMcK_tP7hCsHJTQ5zeaDM9aLHnX2CY37Y.cache +3 -0
  108. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/npFyVNaDh-swtdSqW3TF9WxhreMiWzyqO-pr35xPlmQ.cache +1 -0
  109. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/oPkhqvTlfd3dKFMLM1JSr6dn3KnDz9oMXeqHbmARFYo.cache +1 -0
  110. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/pfvA3haPAtjQJR6gnDGyG8zqThtKf3yjVh1GCCKwcpI.cache +0 -0
  111. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/qr9tsE4lpH7uQc6gCmw8CvFxL5QDGoRtvkv0NumsIoo.cache +5 -0
  112. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/rXlNxo1eiSuqmgQUpJIAZAaOS-3gJyofOT7NGJbqZrQ.cache +0 -0
  113. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/v9OMdsq-LrIbQoFnehOd7lTlPJRxc8P7PZ5sB1tKZ2o.cache +1 -0
  114. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/vM_7L82P-HS_agBk__BgmO0syvueAfJl0UldzluSSjQ.cache +1 -0
  115. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/w4tfk-hbGJoNzF8IVntgCOnn0yb6jaiWxG-qXa4bwcs.cache +2 -0
  116. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/x9dMYbokRbywIRg4eEe7FMEHoXPjRw6sUMfWMe_7CzQ.cache +0 -0
  117. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/zqU8o81RQqTBxt1IOXvBVyjQkBmsQwzd0s8NnIlJAVs.cache +0 -0
  118. data/spec/dummy/tmp/cache/assets/development/sprockets/v3.0/ztAFgiR1-7wXLVWKs4XywPFWo2N4-l7_nuzdlkIj9RE.cache +2 -0
  119. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/-o-IBBprz9s9-rltAzVB8x4_8eEJigbRLsCNmSV_ICc.cache +0 -0
  120. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/0V0ghK3-AtDSzJgSQq-Cg4-weW2qpmwvQcMSmwh37BI.cache +1 -0
  121. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/0gNNYwnIBPipphH48SD4erjXNmtSmQrNLJLzNuz_c-8.cache +1 -0
  122. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2H8RKUJBcpFiSBqqIOefhvJUZoDvuzxSuFaQK0eqDuo.cache +0 -0
  123. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/2zwTWOD1Dd_S-opzh-CmX1_fydfXvWEza9KYHrWKYkY.cache +1 -0
  124. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/3V-sWIRvP4Jhx_mZgxLdbm7IrLyYMgYGQFZvGPbLpb0.cache +0 -0
  125. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/3W4YnmQhJyZGtT03ZCAp5cvpoDIVzhYE-OOySbjsapM.cache +37 -0
  126. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/4SDTbACzKhs32SEozlKqqDPDCYFHjrXH7XidUEhpADU.cache +1 -0
  127. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/54QJf7-lnbywCPYciET5Fdy74m4XmFU7NNcaYKrgi8Y.cache +2 -0
  128. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/5TXJKaIpZrRB9xZpCd9rw9CtGNsQERwqU5Cjqitlv4M.cache +1 -0
  129. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6B0nQ_UnJFE8dQWvYa5J8A7cFhs0El892lwXpyu5JtA.cache +1 -0
  130. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/6a3IhoRAUZxuBEGS8p-LpE_Tgy9EZFuO-A3HzXn52W4.cache +0 -0
  131. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/BBI1gtQkrJmBf3CJ-374M44oGqVpJHgf22Rbwa_u2zg.cache +0 -0
  132. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/B_SJ67b35_bVz7ZAZfC8f7lafyhPAd-_5mqoriIyYYk.cache +2 -0
  133. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Bryuiq6fZ0wSJCC57NMEljLXg8w0lnLjNEB9DHzCpkw.cache +1 -0
  134. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/C-Eod-J3fOVMmGIX3SV9_n7vC8BLXTEOvjC2NwBt-2Y.cache +0 -0
  135. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ICwMeYygy6CCub8BAXuJLfFwJg61Bmbr_PhNt4Vhq4c.cache +1 -0
  136. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/IQmjCFKTbPheFk6_xCBLo7sHocNTZ6VpeBYaLgdM71I.cache +1 -0
  137. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Kf-DnPjkjmvu-fT_zByJLtBpzTslzCno2S31xS8xV0g.cache +1 -0
  138. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/KvmmgF4_oMLrlbbYNHZEQ58AT-cMOMxXUkQYXomKtHY.cache +0 -0
  139. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/MFut7RR3tu2hiErVmmSYINrcGr40XnFrPQ5TxyAEeM0.cache +0 -0
  140. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/MsSVIHis1abvfaf6VRc8sVwl9OIOuOnSPTLApLb1szQ.cache +26 -0
  141. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/N-zHZ8WVdRA65wR3RT57sS2pd-3HNf59WzBMKlbDNug.cache +0 -0
  142. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/OjsENZSpPllinbzGj3Ep0ciCD7jYal5drMCf1BeHkaQ.cache +2 -0
  143. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Q2nSqmt6DcH0h0tAffSjuA1wlKvccSAaEdT_rIJHlsc.cache +1 -0
  144. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/QvrStR3i1j8aHfZ3cSjbDz2PE8OhmBEqktkMxwbQuPg.cache +1 -0
  145. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/S796FHnthmUABzGZql4bA881lNmrpmiC8puwvsbq2nY.cache +0 -0
  146. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/SOx2q96as0kzSLQxGFUw5apPSemYDlx6kZ6Bs_xBIQw.cache +2 -0
  147. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/TNRu3lXH9ajazn-ls77N6agT2-YAPrBRiUeM2eByrU0.cache +2 -0
  148. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/TrGv38AbovT3ejol2umzRXa7pBCb3L3MN5LzvFhLQbA.cache +0 -0
  149. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/UKqisVY2cbaNVWO4s-3u4yzbL-lpph6xDQShrHSFXXw.cache +1 -0
  150. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/UmMN-oZ3n5-tmrbvpDo4OPssqaav4JxuDHI9Ma3dXGg.cache +1 -0
  151. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/Vure74VwhZbVg6HZlMPfBhCn9jtjfbuvxBi1ErljXVA.cache +2 -0
  152. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/W3xFppatT78R8Zaa-xYuePzMl1UEU3yzQrLrtTH3OYI.cache +0 -0
  153. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/XE01v4f5NaneQq7m1FmPZ4-f-2fcVC1YObXCUZI0CTw.cache +1 -0
  154. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/XVZlTX7hPc5gOvs9gdeowS_dzpOesUJtObI0WFHUOb0.cache +1 -0
  155. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ZXUtiQ0v8meOIeOKfyljADVLHRZSKKVlIy17kRlz-nA.cache +0 -0
  156. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/_C8HSdR8bq6ow17yYRN0JX92DxWP-gU_RL0sZ_rSzlM.cache +0 -0
  157. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/_GMY0JbsxLMYoWZ5mM8-mQ0ONkhDlunESsaE1tjrSYE.cache +1 -0
  158. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/a0uziDegoB2On6BnaTdY4zR9zeaEhLgl6BHYbauraUw.cache +1 -0
  159. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ae-GcGxfVPz3K8pp-PjOcjhfC0vj3h7dTFTbHKTPCAY.cache +1 -0
  160. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/bBq28xeM5j70IrH9IunvD6S7CbTX_OSTXO_Z-wEw2zs.cache +0 -0
  161. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/csuqsRmDEoL5pkcikg3MXOdNP2jIgU92QsZOoh8-c0A.cache +0 -0
  162. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/eLcf86K3dtFSrWmxBIGS1XWQlu2aNqPazPge666S-Zo.cache +0 -0
  163. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/eoHlDmKTK2irlNAuaoEg11qxGfuidvkji-TMujr9DsY.cache +2 -0
  164. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fDTCOONxq_Wdd1UC96tYHpj7FVlkKuExKJ8tEeU8O1c.cache +1 -0
  165. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fH8aZNt8wQxn-ML4khOtvGN0jdBY0Zwq6NHO2T7Jhj0.cache +1 -0
  166. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/fc0Fzd6YwzG62dl0uZLr_o7yWjW8lz-Aa_m1AlMIxLQ.cache +45 -0
  167. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/g8QlMs9PpeN8NF_NkRcyG1K4qFOxte6oaKZaaGliGxw.cache +2 -0
  168. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/hM2mSsXSJDikxih_B1ryBFqOipzMhIbzzqRSgoajQv8.cache +0 -0
  169. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/iIpEhB7lFqYkQqVzA9J2-70FD-nDFz4TJvixuhe8YVs.cache +0 -0
  170. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/jVsCHPCK3sdvZh1IA8ZNhj0XJPOBXIAUKs-ZEBZt2jk.cache +0 -0
  171. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/mJPnjmwHqHROmjB73eWZty-B_WGDwqdTDE1s_9dft1w.cache +0 -0
  172. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/pfvA3haPAtjQJR6gnDGyG8zqThtKf3yjVh1GCCKwcpI.cache +0 -0
  173. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/qr9tsE4lpH7uQc6gCmw8CvFxL5QDGoRtvkv0NumsIoo.cache +5 -0
  174. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/r0vYJM-ejKpqxQteBU68lNDsqCUY8Y74hKFoGkm4WDU.cache +0 -0
  175. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/rHavE4tc78fwZ4E6YUrSU57H9t5igG1-wnAMdC5PWME.cache +1 -0
  176. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/sL-_5CFM1pqMT0tt4y1SyOmqeV2z8DJpx3CQjy70qeA.cache +0 -0
  177. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/u62VxZ2Y0rf8c9BBVkhsGtW2Cpp1jK1pS_qY3QU1g2Y.cache +1 -0
  178. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/vZaXpBsrCMK78DgtKca-V52yNTnWkBCe1U1hr5LwAZU.cache +0 -0
  179. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/vpMpCPPCHQI_3WErM74srB3yXTzmB6mnASbcEQQ8jjg.cache +1 -0
  180. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/vuTB6kAIoYc9IY1cCEWib408r-K1vB6jZdGMZRtxt_4.cache +1 -0
  181. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/x9dMYbokRbywIRg4eEe7FMEHoXPjRw6sUMfWMe_7CzQ.cache +0 -0
  182. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/yXkkzllTvHiAlfGsCGQ8eM0m8QtaMZRrXxkJkPy2ix8.cache +2 -0
  183. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/z4aTRFQJAcuQT4eIC5Z_O7nMznrMajgLSaE-KuGe3uU.cache +1 -0
  184. data/spec/dummy/tmp/cache/assets/test/sprockets/v3.0/ztAFgiR1-7wXLVWKs4XywPFWo2N4-l7_nuzdlkIj9RE.cache +2 -0
  185. data/spec/dummy/tmp/pids/server.pid +1 -0
  186. data/spec/factories/family_gallery/user_role.rb +7 -0
  187. data/spec/factories/family_gallery/user_tagging.rb +10 -0
  188. data/spec/models/family_gallery/picture_spec.rb +2 -2
  189. data/spec/test_files/0/family_gallery/pictures/000/000/001/original.jpg +0 -0
  190. data/spec/test_files/0/family_gallery/pictures/000/000/002/original.jpg +0 -0
  191. data/spec/test_files/0/family_gallery/pictures/000/000/003/original.jpg +0 -0
  192. data/spec/test_files/0/family_gallery/pictures/000/000/004/original.jpg +0 -0
  193. data/spec/test_files/0/family_gallery/pictures/000/000/005/original.jpg +0 -0
  194. data/spec/test_files/0/family_gallery/pictures/000/000/006/original.jpg +0 -0
  195. data/spec/test_files/0/family_gallery/pictures/000/000/007/original.jpg +0 -0
  196. data/spec/test_files/0/family_gallery/pictures/000/000/008/original.jpg +0 -0
  197. data/spec/test_files/0/family_gallery/pictures/000/000/009/original.jpg +0 -0
  198. data/spec/test_files/0/family_gallery/pictures/000/000/010/original.jpg +0 -0
  199. data/spec/test_files/0/family_gallery/pictures/000/000/011/original.jpg +0 -0
  200. data/spec/test_files/0/family_gallery/pictures/000/000/012/original.jpg +0 -0
  201. data/spec/test_files/0/family_gallery/pictures/000/000/013/original.jpg +0 -0
  202. data/spec/test_files/0/family_gallery/pictures/000/000/014/original.jpg +0 -0
  203. data/spec/test_files/0/family_gallery/pictures/000/000/015/original.jpg +0 -0
  204. data/spec/test_files/0/family_gallery/pictures/000/000/016/original.jpg +0 -0
  205. data/spec/test_files/0/family_gallery/pictures/000/000/017/original.jpg +0 -0
  206. data/spec/test_files/0/family_gallery/pictures/000/000/018/original.jpg +0 -0
  207. data/spec/test_files/0/family_gallery/pictures/000/000/019/original.jpg +0 -0
  208. data/spec/test_files/0/family_gallery/pictures/000/000/020/original.jpg +0 -0
  209. data/spec/test_files/0/family_gallery/pictures/000/000/021/original.jpg +0 -0
  210. data/spec/test_files/0/family_gallery/pictures/000/000/022/original.jpg +0 -0
  211. data/spec/test_files/0/family_gallery/pictures/000/000/023/original.jpg +0 -0
  212. data/spec/test_files/0/family_gallery/pictures/000/000/024/original.jpg +0 -0
  213. data/spec/test_files/0/family_gallery/pictures/000/000/025/original.jpg +0 -0
  214. data/spec/test_files/0/family_gallery/pictures/000/000/026/original.jpg +0 -0
  215. data/spec/test_files/0/family_gallery/pictures/000/000/027/original.jpg +0 -0
  216. data/spec/test_files/0/family_gallery/pictures/000/000/028/original.jpg +0 -0
  217. data/spec/test_files/0/family_gallery/pictures/000/000/029/original.jpg +0 -0
  218. data/spec/test_files/0/family_gallery/pictures/000/000/030/original.jpg +0 -0
  219. data/spec/test_files/0/family_gallery/pictures/000/000/031/original.jpg +0 -0
  220. data/spec/test_files/0/family_gallery/pictures/000/000/032/original.jpg +0 -0
  221. data/spec/test_files/0/family_gallery/pictures/000/000/033/original.jpg +0 -0
  222. data/spec/test_files/0/family_gallery/pictures/000/000/034/original.jpg +0 -0
  223. data/spec/test_files/0/family_gallery/pictures/000/000/035/original.jpg +0 -0
  224. data/spec/test_files/0/family_gallery/pictures/000/000/036/original.jpg +0 -0
  225. data/spec/test_files/0/family_gallery/pictures/000/000/037/original.jpg +0 -0
  226. data/spec/test_files/0/family_gallery/pictures/000/000/038/original.jpg +0 -0
  227. metadata +412 -12
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 601cdfd46f3c826e859d3e4c90b20c2627876409
4
- data.tar.gz: 5e371952631a3cb511b4b3c404e3ee7b620835e0
3
+ metadata.gz: 8724caad748ce58f6c7dde4e0e79bc8c39d25303
4
+ data.tar.gz: 2c2270ccb9d673b54191697519dca7e0447e1960
5
5
  SHA512:
6
- metadata.gz: 8d245e72706ba199f5bdd8815906e7d5498e6288f3f72fac7ed3d58e3a79c218317598287e9e378551edf86397aca8a1aead73b683bf2b09a92c3673ab3196cf
7
- data.tar.gz: 0c5fab8e0f6b39af552fa3836be2339d8c07ca18a045b29d5d3bffd45bce5223ee6567e50f991684835d7190645368f683efba6da7bfd8a140edf5060152142c
6
+ metadata.gz: ed25ed2d0f42742babbb0b183880e7dac7f24817ce4b089847bd2ce4a6fe13413f84de403c4d7c82fcf6c482e02903acec737e16347567dc5b67e24e5e33e54f
7
+ data.tar.gz: 6285dc6ede7d7d140f67669869e3effaab1c16346eb4ee23a8a767b5787f6cbfa0f24466d6b030edee39563fca0a4515ba86796a78d4376b0de849781dc4cc59
@@ -1,10 +1,53 @@
1
- class FamilyGallery::GroupsController < FamilyGallery::ResourcesController
1
+ class FamilyGallery::GroupsController < FamilyGallery::BaseController
2
+ load_and_authorize_resource
3
+
4
+ def index
5
+ @ransack_values = params[:q] || {}
6
+ @ransack = FamilyGallery::Group.ransack(@ransack_values)
7
+
8
+ @groups = @ransack.result.accessible_by(current_ability)
9
+ @groups = @groups.order(:id) unless @ransack_values[:s]
10
+ @groups = @groups.page(params[:page])
11
+ @groups = @groups.select { |group| can?(:show, group) }
12
+ end
13
+
2
14
  def show
3
15
  end
4
16
 
17
+ def new
18
+ end
19
+
20
+ def create
21
+ if @group.save
22
+ redirect_to @group
23
+ else
24
+ render :new
25
+ end
26
+ end
27
+
28
+ def edit
29
+ end
30
+
31
+ def update
32
+ if @group.update_attributes(group_params)
33
+ redirect_to @group
34
+ else
35
+ render :edit
36
+ end
37
+ end
38
+
39
+ def destroy
40
+ if @group.destroy
41
+ redirect_to groups_url
42
+ else
43
+ flash[:error] = @group.errors.full_messages.join(". ")
44
+ redirect_to @group
45
+ end
46
+ end
47
+
5
48
  private
6
49
 
7
- def resource_params
50
+ def group_params
8
51
  params.require(:group).permit(:name, :description)
9
52
  end
10
53
 
@@ -0,0 +1,37 @@
1
+ class FamilyGallery::UserRolesController < FamilyGallery::ResourcesController
2
+ load_and_authorize_resource
3
+
4
+ before_filter :set_user
5
+
6
+ def new
7
+ end
8
+
9
+ def create
10
+ @user_role.user = @user
11
+
12
+ if @user_role.save
13
+ redirect_to @user_role.user
14
+ else
15
+ flash[:error] = @user_role.errors.full_messages.join('. ')
16
+ render :new
17
+ end
18
+ end
19
+
20
+ def destroy
21
+ unless @user_role.destroy
22
+ flash[:errror] = @user_role.errors.full_messages.join('. ')
23
+ end
24
+
25
+ redirect_to @user_role.user
26
+ end
27
+
28
+ private
29
+
30
+ def user_role_params
31
+ params.require(:user_role).permit(:role)
32
+ end
33
+
34
+ def set_user
35
+ @user = FamilyGallery::User.find(params[:user_id])
36
+ end
37
+ end
@@ -1,13 +1,10 @@
1
- class FamilyGallery::UserTaggingsController < FamilyGallery::ResourcesController
2
- load_and_authorize_resource
3
-
1
+ class FamilyGallery::UserTaggingsController < FamilyGallery::BaseController
4
2
  before_filter :set_picture
5
3
 
6
- def create
7
- @user_tagging.picture = @picture
8
- @user_tagging.tagged_by = current_user
9
- @user_tagging.assign_attributes(resource_params)
4
+ load_and_authorize_resource
5
+ skip_authorize_resource only: :new
10
6
 
7
+ def create
11
8
  if @user_tagging.save
12
9
  flash[:notice] = t(".tagging_was_saved")
13
10
  redirect_to @picture
@@ -32,10 +29,14 @@ private
32
29
  @width = 1000
33
30
  @height = @picture.height_for_width(1000)
34
31
 
35
- authorize! :edit, @picture
32
+ if action_name == "create"
33
+ @user_tagging = @picture.user_taggings.new
34
+ @user_tagging.tagged_by = current_user
35
+ @user_tagging.assign_attributes(user_tagging_params)
36
+ end
36
37
  end
37
38
 
38
- def resource_params
39
+ def user_tagging_params
39
40
  params.require(:user_tagging).permit(:user_id, :position_top, :position_left)
40
41
  end
41
42
  end
@@ -1,10 +1,52 @@
1
- class FamilyGallery::UsersController < FamilyGallery::ResourcesController
1
+ class FamilyGallery::UsersController < FamilyGallery::BaseController
2
+ load_and_authorize_resource
3
+
4
+ def index
5
+ @ransack_values = params[:q] || {}
6
+ @ransack = FamilyGallery::User.ransack(@ransack_values)
7
+
8
+ @users = @ransack.result
9
+ @users = @users.order(:id).reverse_order unless @ransack_values[:s]
10
+ @users = @users.page(params[:page])
11
+ end
12
+
2
13
  def show
3
14
  end
4
15
 
16
+ def new
17
+ end
18
+
19
+ def create
20
+ if @user.save
21
+ redirect_to @user
22
+ else
23
+ render :new
24
+ end
25
+ end
26
+
27
+ def edit
28
+ end
29
+
30
+ def update
31
+ if @user.update_attributes(user_params)
32
+ redirect_to @user
33
+ else
34
+ render :edit
35
+ end
36
+ end
37
+
38
+ def destroy
39
+ if @user.destroy
40
+ redirect_to users_url
41
+ else
42
+ flash[:error] = @user.errors.full_messages.join(". ")
43
+ redirect_to user_url(@user)
44
+ end
45
+ end
46
+
5
47
  private
6
48
 
7
- def resource_params
8
- params.require(:user).permit(:first_name, :last_name, :email)
49
+ def user_params
50
+ params.require(:user).permit(:first_name, :last_name, :email, :password)
9
51
  end
10
52
  end
@@ -1,5 +1,8 @@
1
1
  class FamilyGallery::WelcomeController < FamilyGallery::BaseController
2
2
  def index
3
- @groups = FamilyGallery::Group.ordered_by_latest_update.limit(7)
3
+ @groups = FamilyGallery::Group
4
+ .accessible_by(current_ability)
5
+ .ordered_by_latest_update
6
+ .limit(25)
4
7
  end
5
8
  end
@@ -4,9 +4,9 @@ class FamilyGallery::Ability
4
4
  def initialize(user)
5
5
  @user = user
6
6
 
7
- can :index, FamilyGallery::Group
8
-
9
7
  if @user
8
+ user_access
9
+
10
10
  @user.user_roles.each do |user_role|
11
11
  __send__(user_role.role)
12
12
  end
@@ -15,10 +15,21 @@ class FamilyGallery::Ability
15
15
 
16
16
  private
17
17
 
18
+ def user_access
19
+ can [:index, :new, :create], FamilyGallery::Group
20
+ can [:show, :edit, :update, :destroy], FamilyGallery::Group, user_owner_id: @user.id
21
+
22
+ can [:new, :create], FamilyGallery::Picture
23
+ can [:edit, :update, :destroy], FamilyGallery::Picture, user_owner_id: @user.id
24
+
25
+ can [:new, :create, :edit, :update, :destroy], FamilyGallery::UserTagging, picture: {user_owner_id: @user.id}
26
+ end
27
+
18
28
  def administrator
19
29
  can :manage, FamilyGallery::Group
20
30
  can :manage, FamilyGallery::Picture
21
31
  can :manage, FamilyGallery::User
22
32
  can :manage, FamilyGallery::UserTagging
33
+ can :manage, FamilyGallery::UserRole
23
34
  end
24
35
  end
@@ -1,6 +1,8 @@
1
1
  class FamilyGallery::Group < ActiveRecord::Base
2
2
  translates :name, :description
3
3
 
4
+ belongs_to :user_owner, class_name: "User"
5
+
4
6
  has_many :group_picture_links, dependent: :destroy
5
7
  has_many :pictures, through: :group_picture_links
6
8
 
@@ -12,6 +12,8 @@ class FamilyGallery::Picture < ActiveRecord::Base
12
12
  has_attached_file :image, style: {medium: "900x900", thumb: "120x120"}
13
13
  validates_attachment_content_type :image, content_type: /\Aimage\/.*\Z/
14
14
 
15
+ validates_presence_of :user_owner
16
+
15
17
  after_create :parse_exif
16
18
 
17
19
  def width_for_height(new_height)
@@ -4,6 +4,7 @@ class FamilyGallery::User < ActiveRecord::Base
4
4
  validates_presence_of :email
5
5
  validates_uniqueness_of :email
6
6
 
7
+ has_many :owned_groups, class_name: "Group", foreign_key: "user_owner_id", dependent: :restrict_with_error
7
8
  has_many :owned_pictures, class_name: "Picture", foreign_key: "user_owner_id", dependent: :restrict_with_error
8
9
  has_many :pictures_tagged_on, through: :user_taggings, source: :picture
9
10
  has_many :user_roles, dependent: :destroy
@@ -4,4 +4,10 @@ class FamilyGallery::UserRole < ActiveRecord::Base
4
4
  validates_presence_of :role
5
5
  validates_uniqueness_of :role, scope: :user_id
6
6
  validates_presence_of :user
7
+
8
+ def self.role_options
9
+ {
10
+ t('.administrator') => 'administrator'
11
+ }
12
+ end
7
13
  end
@@ -0,0 +1,3 @@
1
+ = simple_form_for [user, user_role] do |f|
2
+ = f.input :role, collection: FamilyGallery::UserRole.role_options
3
+ = f.submit t('save'), class: 'button'
@@ -0,0 +1,3 @@
1
+ - content_for(:header_title) { t('.new_user_role_for', user_name: @user.name) }
2
+
3
+ = render 'form', user: @user, user_role: @user_role
@@ -13,3 +13,24 @@
13
13
 
14
14
  - unless @user.uploaded_pictures.any?
15
15
  = t(".this_user_havent_uploaded_any_pictures")
16
+
17
+ %h2= FamilyGallery::UserRole.model_name.human(count: 2)
18
+ = link_to t('add_new'), new_user_user_role_path(@user), class: 'button' if can?(:new, FamilyGallery::UserRole)
19
+
20
+ %br
21
+ %br
22
+
23
+ %table
24
+ %thead
25
+ %tr
26
+ %th= FamilyGallery::UserRole.human_attribute_name(:role)
27
+ %th= t('actions')
28
+ %tbody
29
+ - @user.user_roles.each do |user_role|
30
+ %tr
31
+ %td= user_role.role
32
+ %td
33
+ = link_to t('delete'), user_user_role_path(@user, user_role), method: :delete, data: {confirm: t('are_you_sure')} if can?(:destroy, user_role)
34
+ - if @user.user_roles.empty?
35
+ %tr
36
+ %td{colspan: 1}= t('no_results')
@@ -0,0 +1 @@
1
+ ActiveRecord::Base.include AwesomeTranslations::TranslateFunctionality
@@ -0,0 +1,166 @@
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
+ b.optional :maxlength
32
+
33
+ # Calculates pattern from format validations for string inputs
34
+ b.optional :pattern
35
+
36
+ # Calculates min and max from length validations for numeric inputs
37
+ b.optional :min_max
38
+
39
+ # Calculates readonly automatically from readonly attributes
40
+ b.optional :readonly
41
+
42
+ ## Inputs
43
+ b.use :label_input
44
+ b.use :hint, wrap_with: { tag: :span, class: :hint }
45
+ b.use :error, wrap_with: { tag: :span, class: :error }
46
+
47
+ ## full_messages_for
48
+ # If you want to display the full error message for the attribute, you can
49
+ # use the component :full_error, like:
50
+ #
51
+ # b.use :full_error, wrap_with: { tag: :span, class: :error }
52
+ end
53
+
54
+ # The default wrapper to be used by the FormBuilder.
55
+ config.default_wrapper = :default
56
+
57
+ # Define the way to render check boxes / radio buttons with labels.
58
+ # Defaults to :nested for bootstrap config.
59
+ # inline: input + label
60
+ # nested: label > input
61
+ config.boolean_style = :nested
62
+
63
+ # Default class for buttons
64
+ config.button_class = 'btn'
65
+
66
+ # Method used to tidy up errors. Specify any Rails Array method.
67
+ # :first lists the first message for each field.
68
+ # Use :to_sentence to list all errors for each field.
69
+ # config.error_method = :first
70
+
71
+ # Default tag used for error notification helper.
72
+ config.error_notification_tag = :div
73
+
74
+ # CSS class to add for error notification helper.
75
+ config.error_notification_class = 'error_notification'
76
+
77
+ # ID to add for error notification helper.
78
+ # config.error_notification_id = nil
79
+
80
+ # Series of attempts to detect a default label method for collection.
81
+ # config.collection_label_methods = [ :to_label, :name, :title, :to_s ]
82
+
83
+ # Series of attempts to detect a default value method for collection.
84
+ # config.collection_value_methods = [ :id, :to_s ]
85
+
86
+ # You can wrap a collection of radio/check boxes in a pre-defined tag, defaulting to none.
87
+ # config.collection_wrapper_tag = nil
88
+
89
+ # You can define the class to use on all collection wrappers. Defaulting to none.
90
+ # config.collection_wrapper_class = nil
91
+
92
+ # You can wrap each item in a collection of radio/check boxes with a tag,
93
+ # defaulting to :span. Please note that when using :boolean_style = :nested,
94
+ # SimpleForm will force this option to be a label.
95
+ # config.item_wrapper_tag = :span
96
+
97
+ # You can define a class to use in all item wrappers. Defaulting to none.
98
+ # config.item_wrapper_class = nil
99
+
100
+ # How the label text should be generated altogether with the required text.
101
+ # config.label_text = lambda { |label, required, explicit_label| "#{required} #{label}" }
102
+
103
+ # You can define the class to use on all labels. Default is nil.
104
+ # config.label_class = nil
105
+
106
+ # You can define the default class to be used on forms. Can be overriden
107
+ # with `html: { :class }`. Defaulting to none.
108
+ # config.default_form_class = nil
109
+
110
+ # You can define which elements should obtain additional classes
111
+ # config.generate_additional_classes_for = [:wrapper, :label, :input]
112
+
113
+ # Whether attributes are required by default (or not). Default is true.
114
+ # config.required_by_default = true
115
+
116
+ # Tell browsers whether to use the native HTML5 validations (novalidate form option).
117
+ # These validations are enabled in SimpleForm's internal config but disabled by default
118
+ # in this configuration, which is recommended due to some quirks from different browsers.
119
+ # To stop SimpleForm from generating the novalidate option, enabling the HTML5 validations,
120
+ # change this configuration to true.
121
+ config.browser_validations = false
122
+
123
+ # Collection of methods to detect if a file type was given.
124
+ # config.file_methods = [ :mounted_as, :file?, :public_filename ]
125
+
126
+ # Custom mappings for input types. This should be a hash containing a regexp
127
+ # to match as key, and the input type that will be used when the field name
128
+ # matches the regexp as value.
129
+ # config.input_mappings = { /count/ => :integer }
130
+
131
+ # Custom wrappers for input types. This should be a hash containing an input
132
+ # type as key and the wrapper that will be used for all inputs with specified type.
133
+ # config.wrapper_mappings = { string: :prepend }
134
+
135
+ # Namespaces where SimpleForm should look for custom input classes that
136
+ # override default inputs.
137
+ # config.custom_inputs_namespaces << "CustomInputs"
138
+
139
+ # Default priority for time_zone inputs.
140
+ # config.time_zone_priority = nil
141
+
142
+ # Default priority for country inputs.
143
+ # config.country_priority = nil
144
+
145
+ # When false, do not use translations for labels.
146
+ # config.translate_labels = true
147
+
148
+ # Automatically discover new inputs in Rails' autoload path.
149
+ # config.inputs_discovery = true
150
+
151
+ # Cache SimpleForm inputs discovery
152
+ # config.cache_discovery = !Rails.env.development?
153
+
154
+ # Default class for inputs
155
+ # config.input_class = nil
156
+
157
+ # Define the default class of the input wrapper of the boolean input.
158
+ config.boolean_label_class = 'checkbox'
159
+
160
+ # Defines if the default input wrapper class should be included in radio
161
+ # collection wrappers.
162
+ # config.include_default_input_wrapper_class = true
163
+
164
+ # Defines which i18n scope will be used in Simple Form.
165
+ # config.i18n_scope = 'simple_form'
166
+ end