express_admin 1.3.2 → 1.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (182) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/stylesheets/express_admin/components/_definition.sass +1 -1
  3. data/app/assets/stylesheets/express_admin/components/_h_box.sass +1 -1
  4. data/app/assets/stylesheets/express_admin/components/_live_edit.sass +3 -0
  5. data/app/assets/stylesheets/express_admin/components/_v_box.sass +1 -1
  6. data/app/assets/stylesheets/express_admin/screen.sass +1 -0
  7. data/app/components/express_admin/definition_list.rb +29 -12
  8. data/app/components/express_admin/definition_table.rb +11 -43
  9. data/app/components/express_admin/{flash_message_component.rb → flash_messages.rb} +3 -2
  10. data/app/components/express_admin/icon.rb +9 -2
  11. data/app/components/express_admin/icon_link.rb +32 -25
  12. data/app/components/express_admin/layout_component.rb +2 -32
  13. data/app/components/express_admin/layout_components/h_box.rb +3 -6
  14. data/app/components/express_admin/layout_components/pane.rb +8 -16
  15. data/app/components/express_admin/layout_components/sidebar_region.rb +2 -6
  16. data/app/components/express_admin/layout_components/v_box.rb +3 -6
  17. data/app/components/express_admin/main_region.rb +2 -4
  18. data/app/components/express_admin/{mega_menu_component.rb → mega_menu.rb} +6 -19
  19. data/app/components/express_admin/{addon_sidebar_component.rb → module_sidebar.rb} +12 -10
  20. data/app/components/express_admin/page_header.rb +14 -0
  21. data/app/components/express_admin/smart_form.rb +30 -29
  22. data/app/components/express_admin/smart_table.rb +43 -30
  23. data/app/components/express_admin/widget_box.rb +11 -6
  24. data/app/views/layouts/express_admin/admin.html.et +2 -2
  25. data/app/views/shared/express_admin/_navigation_bar.html.et +3 -3
  26. data/lib/express_admin/version.rb +1 -1
  27. data/test/dummy/db/test.sqlite3 +0 -0
  28. data/test/dummy/test/components/smart_form_test.rb +6 -5
  29. data/vendor/gems/express_templates/Gemfile.lock +1 -1
  30. data/vendor/gems/express_templates/express_templates-0.8.0.gem +0 -0
  31. data/vendor/gems/express_templates/express_templates.gemspec +1 -1
  32. data/vendor/gems/express_templates/lib/express_templates/compiler.rb +0 -9
  33. data/vendor/gems/express_templates/lib/express_templates/components.rb +0 -1
  34. data/vendor/gems/express_templates/lib/express_templates/components/base.rb +62 -10
  35. data/vendor/gems/express_templates/lib/express_templates/components/capabilities/resourceful.rb +12 -0
  36. data/vendor/gems/express_templates/lib/express_templates/components/configurable.rb +143 -16
  37. data/vendor/gems/express_templates/lib/express_templates/components/forms/basic_fields.rb +11 -16
  38. data/vendor/gems/express_templates/lib/express_templates/components/forms/checkbox.rb +6 -6
  39. data/vendor/gems/express_templates/lib/express_templates/components/forms/express_form.rb +18 -26
  40. data/vendor/gems/express_templates/lib/express_templates/components/forms/form_component.rb +17 -16
  41. data/vendor/gems/express_templates/lib/express_templates/components/forms/radio.rb +14 -32
  42. data/vendor/gems/express_templates/lib/express_templates/components/forms/select.rb +18 -35
  43. data/vendor/gems/express_templates/lib/express_templates/components/forms/select_collection.rb +11 -17
  44. data/vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb +18 -14
  45. data/vendor/gems/express_templates/lib/express_templates/components/tree_for.rb +11 -4
  46. data/vendor/gems/express_templates/lib/express_templates/renderer.rb +1 -3
  47. data/vendor/gems/express_templates/lib/express_templates/version.rb +1 -1
  48. data/vendor/gems/express_templates/test/components/base_test.rb +45 -24
  49. data/vendor/gems/express_templates/test/components/capabilities/resourceful_test.rb +1 -1
  50. data/vendor/gems/express_templates/test/components/configurable_test.rb +108 -30
  51. data/vendor/gems/express_templates/test/components/forms/basic_fields_test.rb +3 -3
  52. data/vendor/gems/express_templates/test/components/forms/express_form_test.rb +4 -1
  53. data/vendor/gems/express_templates/test/components/forms/radio_test.rb +3 -3
  54. data/vendor/gems/express_templates/test/components/forms/submit_test.rb +3 -3
  55. data/vendor/gems/express_templates/test/components/tree_for_test.rb +1 -1
  56. data/vendor/gems/express_templates/test/core_extensions/proc_test.rb +10 -0
  57. data/vendor/gems/express_templates/test/dummy/log/test.log +1240 -20959
  58. data/vendor/gems/express_templates/test/test_helper.rb +3 -0
  59. metadata +22 -248
  60. data/app/components/express_admin/page_header_component.rb +0 -29
  61. data/app/components/express_admin/setting_form.rb +0 -48
  62. data/test/dummy/log/development.log +0 -35
  63. data/test/dummy/log/test.log +0 -51433
  64. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0fNukwCUjSC_GRsVIMtSMVdZkd5bq5eShMcGCrCVolc.cache +0 -0
  65. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0zehLcbCZ34CdyBVctEOnsyyyFlqjtTI-VkIje9xdCQ.cache +0 -1
  66. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1EoyfDwFVtgMAOjo7HPkor8TQbVaioOFx9hildx_DTQ.cache +0 -0
  67. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1c4REJHKdQH9bwZhZ7Ixshmy_1jAzXc3-9OiDCDyRlk.cache +0 -0
  68. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1rKHSaJsgLcnfIJRWYdYy7IimMCKcdI-I_ABekUargk.cache +0 -0
  69. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2kMk5s4FKAOWE1z_MvFIKHmdvNDzyoknoi39xL7KwJw.cache +0 -0
  70. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2oGeKB_QtwWpX3sJNHocsJiBZT60x_cwV_nSGh_HS-A.cache +0 -0
  71. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2rQDWRzFxOlBnczJ1BLfE2yCPVvrhgLGfAI7VSM54wk.cache +0 -0
  72. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/3S9nnUmEIG4-hDY6cVc82GFUUWicNxtpFfWwJAmJSkI.cache +0 -2
  73. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4OPIkynisipUm8vKo57HUhBMWFSHBno_IH6OdpK29IA.cache +0 -1
  74. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4WErFdugnc8uWYwUE9vVfw4xxCgknECdpWhn8teZbLk.cache +0 -1
  75. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4a7epNa5R1jeKCtFsJKTdVqMEQm5p0clABRPIiKegMo.cache +0 -0
  76. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4hK1AdPGHbXGkebvk-nSvhxtCdOSlMYNWvA43CvQKhI.cache +0 -0
  77. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/57pjjkzReNE1L9yodewGebfd0AwnfQb33rtJjSTNpLc.cache +0 -0
  78. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/6c0H20s6oHf45XogeDELaojxa0PX1NmirTTWV1ClcRw.cache +0 -0
  79. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7vpDV8GyXVfyuFIkRrrkOwUXyIaCmf22tBPDpvhCUUc.cache +0 -0
  80. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/89d4LukQv0MLDc35wfIlQZps-IyoMSdlaSZjBF4U5Qs.cache +0 -1
  81. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/9QvwPXfTSVmgQX6tdK9GuCn0--MZ8Z8eJJbHpUEq1p8.cache +0 -1
  82. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/BoKdGhgi5NHfGTc42p9nltpEIYj_BBUxVdv7YhpBmmA.cache +0 -0
  83. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Cpj6WyqdggDUkeQl_Ut3P9sUtPHPXXwkmZ92TfIJGJ8.cache +0 -0
  84. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DwepgSdLiEklsJWIJItEY_ZW-nOjjeHqcdQwBtu0mus.cache +0 -0
  85. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FOJpwMQCx9V9wfhJQKFa2f7BjfP7vyS7M3o6VX0nAI0.cache +0 -1
  86. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GJGMlSyTg1AvPCV_6PaLOTVEKbHeVKY1jhCoaKuRlxM.cache +0 -1
  87. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GStmpiXE4g01i-UTlSKq8B9yS69WpAp0YH7vWyESBwI.cache +0 -0
  88. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H0aD5KRj-4fhORkqWcWZfKPOQfu_ggvt4OmYOl4S5mw.cache +0 -0
  89. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H53ZZ50FwJjYUOMH60F7cpINgkh9tOF4R3L6ANoH6tU.cache +0 -1
  90. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/HY86Fwn8VPlIysY56uV-wu90bISxrXeiCtwDXg94Glg.cache +0 -0
  91. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IBLgVNsKBbJxN8NQnh6zTc3bC_OG-8BhtA3xCNDV6ks.cache +0 -1
  92. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IcNDN_pmsAcLAMv6CST75OwOucmYm3q2099jn4tB0H8.cache +0 -2
  93. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JpdfSFVzivQn6TFSivlys3nV3VzD8cT0ET8uqbptxV4.cache +0 -1
  94. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KLD96-U_D5wyyJMO4CJwhXydNwVp3GnQ_Pcu9fqMWwk.cache +0 -1
  95. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KRkc9MoVFNfI2aJI6sncnC92a1RmZyYM_CbJoa01saw.cache +0 -0
  96. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KYe0_GIi-cNX0eRteBB0aixVATrVRo7Z3BaWFCgc7yg.cache +0 -1
  97. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LsiO4sLQfM0GvyEYhaC2E54rCurTkewg7YJX-sWBctI.cache +0 -0
  98. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/MczkmkaXLyXg8mAnmpTt-Rhvlf_OGFUEr-Ut9BuWo6g.cache +0 -0
  99. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NDViKg4-yspkY1tX9IQWnh1-LkiKqIohBqtRlYZZQcs.cache +0 -2
  100. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OXsmreTQ3MNzGsrV1eEoW72VZQ52hQ0HiuTr0ImnqHA.cache +0 -0
  101. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Po8q4NrWy9Kymnz_HbOk-WbdGY_KuuXc6urGogTHe7U.cache +0 -0
  102. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/PuMvTyv89E8wfRqbWNMhTH3PAE61uCCHgpEsgdOzMXQ.cache +0 -0
  103. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Pvp8CVIKYjspNrgzEvgleujifrrdfATzWbwALDzQNE4.cache +0 -2
  104. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/PzcOUndLc-O-VBR2SDM2rFkiqh-iqknTEgEAXDLKfdc.cache +0 -0
  105. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QbX1HRM7KX85_PeVHcd6VJM6sqzUCWXEEYZX7CAG0eA.cache +0 -1
  106. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UDHqQKrYSSvXfCbiJjXzmJh2Q6T5hLO80aaPvs9n-74.cache +0 -0
  107. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UFtISk01WwcjjWcPLyjeHX3bgBqZHGQcb0Z4KFNmduA.cache +0 -0
  108. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UWvG-0WgVYHVxrtLU32uumROQuSjJv_M_svW1B8YxhY.cache +0 -1
  109. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UruI7_ZpuzDnmNir9hzUa_r8oiuuIfVTco19ACdxwRw.cache +0 -2
  110. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/V1aP9G-CVtOLR5PTnHleid8WC9TSfFAT1DzAygp_5CQ.cache +0 -1
  111. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VQ2-2HlkGd1XVIHlwRGcgDsjto3oE-50-4E3HGdt8uU.cache +0 -1
  112. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VezioHwyk87G6TWkkYX88tBHC6QToVGOU5geZ54Ts5A.cache +0 -1
  113. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WG06sI8kg0TrFKDQh2slScD0xqYK5UF0gPF1Ri6APG0.cache +0 -0
  114. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WfQ-xKbnwqaKy-UQa8spczc9qocIL_jZE4cyRZftjfA.cache +0 -2
  115. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WhePtBvZPmF1Jhdcc4glsjhxBJQo9Qw0CDgy_F8lClY.cache +0 -0
  116. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/X2i4W-0ADnY8zQKnn3oh3P61cDw_n1B26D2JPcgWBTY.cache +0 -2
  117. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XPpCqlT8yHTnQNHKRxjnilUBvAs6klpgWXneFU15U78.cache +0 -0
  118. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XXTM8o6vkSxhxxm8P_orbeCZvxb8nMk7cjdwvUNL1io.cache +0 -0
  119. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XyRQXY_oj8GLw9z8lj2dknGu45jbX5lK8ko7TePosPE.cache +0 -2
  120. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Y7zGDJM6L5VhKbRWRU6vonJVe-DGxBuOhE_qGM8zJ0o.cache +0 -1
  121. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YDMOayx363vI7odbkHMVI-_RxkOoVP2Hb7FX0mFVFE0.cache +0 -1
  122. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Z88gJS67lNABJgUB18JzXrnGkVbYfXQvjqm7mSJIv3o.cache +0 -1
  123. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ZAIAu3UIaGRI3RknA2lbuZ8Y6AZ12VB84mQRg-q0vFs.cache +0 -1
  124. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_2bn753sv7A0CDBODs7rO8SWdQ1OMi2vbzSas5co4TE.cache +0 -0
  125. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_FyeE-ad3bA2IH6ZwZOn6J4qaW857Rjv4FBs_HIPiqM.cache +0 -0
  126. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_k4X14Cc-2Y4gc47s7PaWtAaG_zcq1ICJInTYNp6bI4.cache +0 -2
  127. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_kr_dP4VVnM8s8ZMdiNBSpuPqkQVx46FUdCTDH4XR70.cache +0 -0
  128. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_y-BPEZTh3iXcaPJkcP9-krjw-V8LMhop4VGxUEUDsY.cache +0 -1
  129. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/afi__XQzjsqMT3svcCGlVD_YrHEWQZAEbJt4CgYaCkw.cache +0 -1
  130. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bdqS7lHa0nBN-mqdSomfMK-S6ct2TAn0z9kVzFBwQPM.cache +0 -0
  131. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/c4lC2GnsHBJ0BpWF3Nlgfk2FLPkhA7GCIiMMjnMTWE8.cache +0 -0
  132. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/csH89NDps1_QU4E0p0HHZti2XLd_etKYDqM9cPsNpps.cache +0 -0
  133. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/dVokuKbK8HbOtvPIksKGBAYE8x44l372dQ0gEISqbdo.cache +0 -0
  134. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ePtEu-AuU0iZ2J02ZafF9yOJVd8VVdV2KSheiJYlXzA.cache +0 -1
  135. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eTRff0YXBw-Tx9VEMxb-Es8NwqjHCXiaosBLxijl3I8.cache +0 -1
  136. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fRkrxaDYzRDIvxEUGZBFbW5ocAlmDQNg8_LRcOJJOzI.cache +0 -1
  137. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/goVFgqSk0CBOXpbwLNd-enc31BvXm1S8cMSJ3zbxRYI.cache +0 -1
  138. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hPH6lLkPX0EzSG_eBprMMUnmFs9y89AOarfyhGoAFGc.cache +0 -0
  139. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hgfrt0FmGrYD5SJVJhlsUPtL9usJvw3vZrW4dqQq16Y.cache +0 -1
  140. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hiZg7FLw7SFa7S-BQ8CKWdAqFVUZy2HVb2chmQijM-g.cache +0 -0
  141. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iKb8yzw0EdFpNkayUbc16U7olK7iwE2xIs_6b_xIEtI.cache +0 -1
  142. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iY03Ztj2YhBWadK8LHOKR3Hj1W7PLss0v85Q6Nj7E3Q.cache +0 -0
  143. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ipLhCJrCCVwH7l_p1quUi2xS6POFlVHfZCqIymk8CoI.cache +0 -0
  144. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ipTot5AshDPhFtCBNfXROxutQlCrYkvsXsy3fcVT0Nw.cache +0 -0
  145. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/j5CxYBAeuD-bGDZUBh-pA0mEPCSVFDZsJm3x7QED4g0.cache +0 -1
  146. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jr4uhEONyFYm0QhfEOMqv05S-BeUP7gw1gQl3GIFyAI.cache +0 -0
  147. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kDj0mxTRTc51sKL3YhP09H-N_wvNoeTMq4ZZXxWk00U.cache +0 -0
  148. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kGO7_IQtBwpe93nSTKj6cCWGm0fZ_NoXltdw8E_74CQ.cache +0 -2
  149. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/le9WohG3eSGbBMySdKkdvkHXW8yipO8w4iQZCCCQb3M.cache +0 -1
  150. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mtmR_XlvnlYbOPmP1EkOj96q2Z5OQNv4HkeFj9DwEXQ.cache +0 -2
  151. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nU1obIDVHUhN-3yRA6B9U5aO8wsd6zh1tyVtSROJewk.cache +0 -2
  152. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nk1B0AsQ24ck-r1vlAmaG2ZkDkzOfoIi6b5u-5BNFTQ.cache +0 -1
  153. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oN1zSGeSEz4KhkAuUF_yFDsCVPkulfFjomEAjFzGdPc.cache +0 -0
  154. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oZ6SMNNft5SCbvNtWXkGQwKQPVwXoJRMV7VUJfWHc2k.cache +0 -2
  155. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/orzlNSAVLprBGJNkJc1USpGtVMhktfj0hR1igXbs5fA.cache +0 -1
  156. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oygs10cGTBBo7Mj97CjFRTrSrFR7Qi3MnHNR_WQvIps.cache +0 -0
  157. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p0Gnpai0VYzEsAXH_5t9huZ3dO0v6JKRH0PIH--q-XA.cache +0 -2
  158. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p0VpILMLAmqpH1IIuA6MfyLrqT7ltiDJqYqZSLr_k3I.cache +0 -0
  159. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pWOcH5cfG1n9XqxJljnSwciDeLoaTkoUxp1zlOo0WTk.cache +0 -1
  160. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pu9xM8T2O07hU3PafxbOLjg2vJxbbHE3qnIK9JHqVhA.cache +0 -1
  161. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qEHftZrJ-Da_nsvX4UOaALyIt0mwnOuE2TdtBPGAWEw.cache +0 -0
  162. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qIeSoker4TjM7JYRQTOjgRd4nN0WeHnNY1GMK7Zpe8M.cache +0 -0
  163. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rtdpq5fxIYMKM43QyOIluEECg2NP5OA-7Zi8yuowZSI.cache +0 -1
  164. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tTFLM1bjKSeg4nyH7GWbTY6JVvuYhNKFFvsOMS9h8O0.cache +0 -0
  165. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/tzX-HHF4F70o-aSB9Z_duoPxFGDv3auYnrpko9SYafU.cache +0 -1
  166. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ujFa5Hu76zd1O6nO2G7WcgnOWZyTOMKLajazyMXAL_I.cache +0 -0
  167. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uovLHiJZBoVnD7CXYj2WZYmAbBcqGLQOzu4Voz5Fx8c.cache +0 -0
  168. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uyHm0KHsHpJhn-wv69exuuyU4kyJtW3DDQLP7tCD7e4.cache +0 -0
  169. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/v50nc5cuqpLxjepk7XsBmomcmFARYlHQRtq8yOv8AY0.cache +0 -0
  170. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vAh5eTPxI929yxRCyXgbKTWat5cZiVSOyX0UeTveXGE.cache +0 -1
  171. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vKiuNu1fQitE151bh0Tr2Ufkc80jWzchPjxaHkpjQL8.cache +0 -1
  172. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vMbWbI1SO5bEaiu2pRvV8NDmms_j5flYoRvCSJavhdU.cache +0 -0
  173. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vZBxpTbv5C70_MrcmWyk0z6yDwcZ-yjr7fo16bQaLhY.cache +0 -0
  174. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x-3lyh5i4qS-Q9E3X2uj2LthTOxsndFTrFXBsPPo6hI.cache +0 -2
  175. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x3xQgAyjbrGTXy2FX2UzGG77agJgt_xsyNBuofrvY_E.cache +0 -0
  176. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xQqBwKYWFPxZm5tidxsRKk23Z3q-OLRmKQUlMjRev_c.cache +0 -0
  177. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yZNo-6dzWGUNCJDnmqm7X5YB5FOxjYp_l8aKS6KaZOg.cache +0 -0
  178. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yfh4w2OYe-sHC9BwdeUb4FtXVEH59KeRr6P7V_lJ7Uc.cache +0 -1
  179. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ypZCDLo54Pz2ZoUxrxSEUjT5FYMAq8Ozp8OTOYDRdAE.cache +0 -0
  180. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zV58Nou0R2EJG875wLND6wF9ES4diVi1fP7B_B6eCzw.cache +0 -1
  181. data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zxPFYKpkfNJtui1ekitdNMaGAo39fefm-oJCnILEEQ8.cache +0 -1
  182. data/vendor/gems/express_templates/lib/express_templates/components/form_rails_support.rb +0 -21
@@ -2,13 +2,11 @@ module ExpressTemplates
2
2
  module Components
3
3
  module Forms
4
4
  # Provides a form Select component based on the Rails *select_tag* helper.
5
- # Parameters:
6
- # field_name, select_options, helper_options
7
5
  #
8
- # Select options may be specified as an Array or Hash which will be
6
+ # The :options may be specified as an Array or Hash which will be
9
7
  # supplied to the *options_for_select* helper.
10
8
  #
11
- # If the select_options are omitted, the component attempts to check
9
+ # If the :options are omitted, the component attempts to check
12
10
  # whether the field is an association. If an association exists,
13
11
  # the options will be generated using *options_from_collection_for_select*
14
12
  # with the assumption that :id and :name are the value and name fields
@@ -18,24 +16,26 @@ module ExpressTemplates
18
16
  class Select < FormComponent
19
17
  include OptionSupport
20
18
 
21
- emits -> {
22
- div(class: field_wrapper_class) {
23
- label_tag(label_name, label_text)
24
- select_tag(*select_tag_args)
25
- }
19
+ has_option :options, 'Select options. Can be Array, Hash, or Proc.'
20
+ has_option :selected, 'The currently selected value; Used when options are supplied. Otherwise the value is taken from the resource.'
21
+ has_option :include_blank, 'Whether or not to include a blank option.', default: true
22
+ has_option :select2, 'Use select2 enhanced select box.', default: true
23
+
24
+ contains -> {
25
+ label_tag(label_name, label_text)
26
+ select_tag(*select_tag_args)
26
27
  }
27
28
 
28
29
  def select_tag_args
29
- args = [field_name_attribute, select_options, select_helper_options]
30
- args
30
+ [field_name_attribute, select_options, select_helper_options]
31
31
  end
32
32
 
33
33
  def select_options_supplied?
34
- [Array, Hash, Proc].include?(supplied_component_options[:options].class)
34
+ [Array, Hash, Proc].include?(config[:options].class)
35
35
  end
36
36
 
37
37
  def use_supplied_options
38
- opts = supplied_component_options[:options]
38
+ opts = config[:options]
39
39
  if opts.respond_to?(:call) # can be a proc
40
40
  opts.call(resource)
41
41
  else
@@ -55,7 +55,7 @@ module ExpressTemplates
55
55
  end
56
56
 
57
57
  def selected_value
58
- field_options[:selected]||resource.send(field_name)
58
+ config[:selected]||resource.send(field_name)
59
59
  end
60
60
 
61
61
  def options_from_supplied_or_field_values
@@ -104,33 +104,16 @@ module ExpressTemplates
104
104
  end
105
105
  end
106
106
 
107
- def field_options
108
- # If field_otions is omitted the Expander will be
109
- # in last or 3rd position and we don't want that
110
- defaults = {include_blank: true}
111
- defaults.merge(supplied_component_options)
112
- end
113
-
114
107
  def select_helper_options
115
- component_option_names = [:select2, :options, :selected]
116
- add_select2_class( field_options.reject {|k,v| component_option_names.include?(k)})
108
+ add_select2_class( input_attributes.merge(include_blank: !!config[:include_blank]) )
117
109
  end
118
110
 
119
111
  protected
120
112
 
121
113
  def add_select2_class(helper_options)
122
- add_class(helper_options[:class]) if helper_options[:class]
123
- add_class('select2') if supplied_component_options[:select2] === true
124
- helper_options[:class] = (class_list - ["select"]).to_s
125
- helper_options
126
- end
127
-
128
- def supplied_component_options
129
- if @args.last && @args.last.is_a?(Hash)
130
- @args.last
131
- else
132
- {}
133
- end
114
+ classes = (helper_options[:class]||'').split(' ')
115
+ classes << 'select2' if config[:select2] === true
116
+ helper_options.merge(:class => classes.join(' '))
134
117
  end
135
118
 
136
119
  end
@@ -1,24 +1,18 @@
1
1
  module ExpressTemplates
2
2
  module Components
3
3
  module Forms
4
- # Provides a form Select component based on the Rails *select_tag* helper.
5
- # Parameters:
6
- # field_name, select_options, helper_options
7
- #
8
- # Select options may be specified as an Array or Hash which will be
9
- # supplied to the *options_for_select* helper.
10
- #
4
+ # Provides a form Select component based on the Rails *collection_select* helper.
11
5
  class SelectCollection < Select
12
6
 
13
- emits -> {
14
- div(class: field_wrapper_class) {
15
- label_tag(label_name, label_text)
7
+ has_option :multiple, "Allow multiple selections.", default: true
16
8
 
17
- # need this because the collection_select helper does not provide
18
- # the hidden_field_tag trick (see rails api docs for select)
19
- hidden_field_tag(multi_field_name, '')
20
- collection_select(*collection_select_tag_args)
21
- }
9
+ contains -> {
10
+ label_tag(label_name, label_text)
11
+
12
+ # need this because the collection_select helper does not provide
13
+ # the hidden_field_tag trick (see rails api docs for select)
14
+ hidden_field_tag(multi_field_name, '')
15
+ collection_select(*collection_select_tag_args)
22
16
  }
23
17
 
24
18
  def collection_select_tag_args
@@ -30,11 +24,11 @@ module ExpressTemplates
30
24
  end
31
25
 
32
26
  def field_options
33
- super.merge(include_blank: false)
27
+ {include_blank: !!input_attributes.delete(:include_blank)}
34
28
  end
35
29
 
36
30
  def html_options
37
- (super||{}).merge(multiple: true)
31
+ input_attributes.reject {|k,v| k.eql?(:include_blank)}.merge(multiple: config[:multiple])
38
32
  end
39
33
 
40
34
  def multi_field_name
@@ -3,22 +3,26 @@ module ExpressTemplates
3
3
  module Forms
4
4
  class Submit < FormComponent
5
5
 
6
- def build(*args)
7
- div(class: field_wrapper_class) {
8
- if args.first.is_a?(String) or args.empty?
9
- submit_tag(args.first || 'Save', (args[1]||{}))
10
- else
11
- submit_tag 'Save', (args.first || {})
12
- end
13
- }
14
- end
6
+ has_option :button_class, 'The css class of the input button.'
7
+ has_option :value, 'The value of the submit tag. Text show in button.',
8
+ default: 'Save'
15
9
 
16
- def value
17
- if @args.first.is_a?(String)
18
- @args.first
19
- else
20
- 'Save'
10
+ contains -> {
11
+ submit_tag(value, input_attributes)
12
+ }
13
+
14
+ before_build -> {
15
+ # if we are not part of a form, we don't get a default id
16
+ begin
17
+ super()
18
+ rescue
19
+ add_class(config[:class])
20
+ remove_class('submit')
21
21
  end
22
+ }
23
+
24
+ def value
25
+ config[:value]
22
26
  end
23
27
 
24
28
  end
@@ -38,11 +38,18 @@ module ExpressTemplates
38
38
  #
39
39
 
40
40
  class TreeFor < Configurable
41
- emits -> (customize_block) {
41
+
42
+ tag :ul
43
+
44
+ has_attributes :class => 'tree'
45
+
46
+ contains -> (&customize_block) {
42
47
  @customize_block = customize_block
43
- ul(id: config[:id], class: "#{config[:id]} tree") {
44
- list_items(eval(config[:id].to_s))
45
- }
48
+ list_items(eval(config[:id].to_s))
49
+ }
50
+
51
+ before_build -> {
52
+ add_class config[:id]
46
53
  }
47
54
 
48
55
  def list_items(nodes)
@@ -1,8 +1,6 @@
1
1
  module ExpressTemplates
2
2
  module Renderer
3
- # render accepts source or block, expands to macros
4
- # compiles the resulting macros
5
- # and then evaluates the resulting string of ruby in the context provided
3
+ # render accepts source or block, evaluates the resulting string of ruby in the context provided
6
4
  def render context=nil, template_or_src=nil, &block
7
5
  compiled_template = compile(template_or_src, &block)
8
6
  context.instance_eval compiled_template
@@ -1,3 +1,3 @@
1
1
  module ExpressTemplates
2
- VERSION = "0.7.1"
2
+ VERSION = "0.8.0"
3
3
  end
@@ -2,45 +2,66 @@ require 'test_helper'
2
2
 
3
3
  class BaseTest < ActiveSupport::TestCase
4
4
 
5
- def assigns
6
- {}
5
+ class Context
6
+ def assigns
7
+ {}
8
+ end
9
+ end
10
+
11
+ def render(&block)
12
+ ExpressTemplates.render(Context.new, &block)
7
13
  end
8
14
 
9
- class NoLogic < ExpressTemplates::Components::Base
10
- emits {
11
- h1 { span "Some stuff" }
15
+ class UnorderedList < ExpressTemplates::Components::Base
16
+ tag :ul
17
+
18
+ has_attributes :class => 'something',
19
+ 'data-foo' => 'something-else'
20
+
21
+ contains {
22
+ li { "Some stuff" }
12
23
  }
13
24
  end
14
25
 
15
- test ".has_markup makes compile return the block passed through express compiled" do
16
- assert_equal "<h1>\n <span>Some stuff</span>\n</h1>\n", ExpressTemplates.render(self) { no_logic }
26
+ test ".tag_name determines the enclosing tag" do
27
+ assert_match /^\<ul/, render { unordered_list }
17
28
  end
18
29
 
19
- test "components register themselves as arbre builder methods" do
20
- assert Arbre::Element::BuilderMethods.instance_methods.include?(:no_logic)
30
+ test ".has_attributes creates default attributes" do
31
+ assert_match /class="[^"]*something[^"]*"/, render { unordered_list }
32
+ assert_match /data-foo="[^"]*something-else[^"]*"/, render { unordered_list }
21
33
  end
22
34
 
23
- class Context
24
- def assigns
25
- {:foo => ['bar', 'baz']}
26
- end
35
+ test ".contains places fragment inside the enclosing tag" do
36
+ markup = render { unordered_list }
37
+ assert_match /\<ul.*\<li.*\/li\>.*\/ul\>/, markup.gsub("\n", '')
27
38
  end
28
39
 
29
- class HelperExample < ECB
30
- def title_helper
31
- foo.first
32
- end
40
+ test "class name is dasherized instead of underscored" do
41
+ assert_match /class="[^"]*unordered-list[^"]*"/, render { unordered_list }
42
+ end
33
43
 
34
- emits {
35
- h1 {
36
- title_helper
37
- }
38
- }
44
+ test "options are passed to html attributes" do
45
+ assert_match /rows="5"/, render { unordered_list(rows: 5) }
46
+ end
39
47
 
48
+ test "class option adds a class, does not override" do
49
+ markup = render { unordered_list(class: 'extra') }
50
+ assert_match /class="[^"]*something[^"]*"/, markup
51
+ assert_match /class="[^"]*unordered-list[^"]*"/, markup
52
+ assert_match /class="[^"]*extra[^"]*"/, markup
53
+ end
54
+
55
+ class BeforeBuildHook < ExpressTemplates::Components::Base
56
+ before_build :add_my_foo
57
+
58
+ def add_my_foo
59
+ set_attribute('data-foo', 'bar')
60
+ end
40
61
  end
41
62
 
42
- test "helpers defined in component are evaluated in context" do
43
- assert_equal "<h1>bar</h1>\n", ExpressTemplates.render(Context.new) { helper_example }
63
+ test "before_build hook runs before build" do
64
+ assert_match /data-foo="bar"/, render { before_build_hook }
44
65
  end
45
66
 
46
67
  end
@@ -3,7 +3,7 @@ require 'test_helper'
3
3
  module AdminModule
4
4
  module Engine
5
5
  end
6
- class SmartThing
6
+ class SmartThing < ExpressTemplates::Components::Configurable
7
7
  include ExpressTemplates::Components::Capabilities::Resourceful
8
8
 
9
9
  attr_accessor :virtual_path, :config
@@ -2,48 +2,126 @@ require 'test_helper'
2
2
 
3
3
  class ConfigurableTest < ActiveSupport::TestCase
4
4
 
5
- ETC = ExpressTemplates::Components
6
-
7
- class ConfigurableComponent < ETC::Configurable
8
- def markup
9
- div(id: my[:id], class: 'bar')
5
+ class Context
6
+ def assigns
7
+ {}
10
8
  end
11
9
  end
12
10
 
13
- test "renders id argument as dom id" do
14
- compiled_src = ExpressTemplates.render(self) { configurable_component(:foo) }
15
- assert_equal "<div id=\"foo\" class=\"bar\"></div>\n", compiled_src
11
+ def render(&block)
12
+ ExpressTemplates.render(Context.new, &block)
13
+ end
14
+
15
+ ETCC = ExpressTemplates::Components::Configurable
16
+
17
+ class ConfigurableComponent < ETCC
18
+ end
19
+
20
+ test "renders first argument as dom id" do
21
+ assert_match /id="foo"/, render { configurable_component(:foo) }
16
22
  end
17
23
 
18
- class ConfigurableContainerComponent < ETC::Configurable
24
+ test "has no id attribute if not specified" do
25
+ assert_no_match /id="foo"/, render { configurable_component }
26
+ end
19
27
 
20
- # make sure a helper can take arguments
21
- # helper(:name) {|name| name.to_s }
22
- def name(name)
23
- name.to_s
28
+ class ConfigWithOption < ETCC
29
+ has_option :thing, 'Something about things'
30
+ end
31
+
32
+ test "supports option declaration" do
33
+ markup = render { config_with_option }
34
+ assert_equal %Q(<div class="config-with-option"></div>\n), markup
35
+ end
36
+
37
+ test "does not pass declared options as html attributes" do
38
+ markup = render { config_with_option(thing: 'whatever') }
39
+ assert_equal %Q(<div class="config-with-option"></div>\n), markup
40
+ end
41
+
42
+ test "unrecognized options raises an exception" do
43
+ assert_raises(ArgumentError) do
44
+ class ConfigWithUnrecognizedOptions < ETCC
45
+ has_option :title, 'asdfasdf', something_unrecognized: 'whatever'
46
+ end
24
47
  end
48
+ end
25
49
 
26
- def markup &block
27
- div(id: my[:id]) {
28
- h1 { name(my[:id]) }
29
- yield(block) if block
30
- }
50
+ class ConfigWithDefaultOption < ETCC
51
+ has_option :rows, 'Number of rows', type: :integer, default: 5, attribute: true
52
+ end
53
+
54
+ test "default values are supported" do
55
+ markup = render { config_with_default_option }
56
+ assert_equal %Q(<div class="config-with-default-option" rows="5"></div>\n), markup
57
+ end
58
+
59
+ test "default values for attributes can be overridden" do
60
+ markup = render { config_with_default_option(rows: 999) }
61
+ assert_equal %Q(<div class="config-with-default-option" rows="999"></div>\n), markup
62
+ end
63
+
64
+ class ConfigWithRequiredOptions < ETCC
65
+ has_option :title, 'adds a title', required: true
66
+ end
67
+
68
+ test "required options are required" do
69
+ assert_raises(RuntimeError) do
70
+ render { config_with_required_options }
31
71
  end
72
+ assert render { config_with_required_options(title: 'foo') }
73
+ end
74
+
75
+ class ConfigSubclass < ConfigWithRequiredOptions
76
+ has_option :status, 'something'
77
+ end
78
+
79
+ test "options are inherited" do
80
+ assert_equal [:title, :status], ConfigSubclass.supported_options.keys
81
+ end
82
+
83
+ class ConfigArgument < ETCC
84
+ has_argument :name, "The name.", type: :string
85
+
86
+ has_option :something, "else"
87
+
88
+ contains {
89
+ text_node config[:name]
90
+ }
32
91
  end
33
92
 
34
- def assigns
35
- {}
93
+ test ".has_argument adds a positional configuration argument" do
94
+ assert_equal :name, ConfigArgument.new.supported_arguments.keys.last
95
+ assert_equal "The name.", ConfigArgument.new.supported_arguments.values.last[:description]
36
96
  end
37
97
 
38
- test "a configurable component may have also be a container" do
39
- html = ExpressTemplates.render(self) { configurable_container_component(:foo) { |c| para 'bar'} }
40
- expected = <<-HTML
41
- <div id=\"foo\">
42
- <h1>foo</h1>
43
- <p>bar</p>
44
- </div>
45
- HTML
46
- assert_equal "<div id=\"foo\">\n <h1>foo</h1>\n <p>bar</p>\n</div>\n", html
98
+ test ".has_argument makes builder arguments accessible by name according to position" do
99
+ html = render &-> {
100
+ config_argument :bar, 'Foo'
101
+ }
102
+ assert_match />Foo</, html
47
103
  end
48
104
 
49
- end
105
+ class ConfigAnotherArgument < ConfigArgument
106
+ has_argument :title, "comes after name", type: :string
107
+ end
108
+
109
+ test ".has_argument appends supported arguments in order of inheritence" do
110
+ assert_equal [:id, :name, :title], ConfigAnotherArgument.new.supported_arguments.keys
111
+ end
112
+
113
+ class ConfigOverwriteId < ConfigArgument
114
+ has_argument :id, 'Should overwrite :id',
115
+ as: :foo, type: :symbol
116
+ contains -> {
117
+ text_node config[:foo]
118
+ }
119
+ end
120
+
121
+ test ".has_argument as: allows overwrite of inherited argument" do
122
+ html = render {
123
+ config_overwrite_id(:whatever, 'Ignore me')
124
+ }
125
+ assert_match /div.*>whatever/, html
126
+ end
127
+ end