express_admin 1.3.2 → 1.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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
@@ -1,20 +1,23 @@
1
1
  module ExpressAdmin
2
2
  # renders a sidebar partial if one is available
3
3
  # otherwise uses menu.yml
4
- class AddonSidebarComponent < ExpressTemplates::Components::Base
4
+ class ModuleSidebar < ExpressTemplates::Components::Base
5
+ tag :section
5
6
 
6
- emits -> {
7
+ contains -> {
8
+ ul(class: 'menu-items') {
9
+ li(class: 'title') { current_menu_name }
10
+ menu_list(helpers.current_menu.items)
11
+ }
12
+ }
13
+
14
+ def build(*args, &block)
7
15
  begin
8
16
  render("shared/#{helpers.current_module_path_name}/sidebar")
9
17
  rescue Exception => e
10
- section(class: 'module-sidebar') {
11
- ul(class: 'menu-items') {
12
- li(class: 'title') { current_menu_name }
13
- menu_list(helpers.current_menu.items)
14
- }
15
- }
18
+ super(*args, &block)
16
19
  end
17
- }
20
+ end
18
21
 
19
22
  def menu_list(list)
20
23
  list.each do |item|
@@ -27,6 +30,5 @@ module ExpressAdmin
27
30
  link_to item.title.html_safe, helpers.instance_eval(item.path)
28
31
  }
29
32
  end
30
-
31
33
  end
32
34
  end
@@ -0,0 +1,14 @@
1
+ module ExpressAdmin
2
+ class PageHeader < ExpressTemplates::Components::Base
3
+ ETC = ExpressTemplates::Components
4
+
5
+ contains -> {
6
+ h1 {
7
+ content_for(:page_header) if content_for?(:page_header)
8
+ }
9
+ para(class: 'lead') {
10
+ content_for(:page_header_lead) if content_for?(:page_header_lead)
11
+ }
12
+ }
13
+ end
14
+ end
@@ -1,18 +1,29 @@
1
1
  require 'rails/generators/generated_attribute'
2
2
 
3
3
  module ExpressAdmin
4
- class SmartForm < ExpressTemplates::Components::Configurable
5
- include ExpressTemplates::Components::Capabilities::Resourceful
6
-
7
- emits -> {
8
- express_form(form_args) {
9
- hidden(:id)
10
- filter_by_name(editable_attributes).each do |attrib|
11
- form_field_for(attrib)
12
- end
13
- filter_by_name(has_many_through_associations).each do |assoc|
14
- select_collection(assoc.name, nil, nil, class: 'select2')
15
- end
4
+ class SmartForm < ExpressTemplates::Components::Forms::ExpressForm
5
+ TIMESTAMPS = %w(updated_at created_at)
6
+
7
+ has_option :virtual_attributes, 'Override the list of virtual attributes of the resource to be displayed'
8
+ has_option :exclude, 'Attributes not to be included in the form'
9
+ has_option :only, 'Respects the order the attributes are listed in'
10
+ has_option :show_timestamps, 'Set to true to show timestamps as labels'
11
+
12
+ contains {
13
+ # TODO: taken from express_form. should be inherited?
14
+ div(style: 'display:none') {
15
+ add_child helpers.utf8_enforcer_tag
16
+ add_child helpers.send(:method_tag, resource.persisted? ? :put : :post)
17
+ helpers.send(:token_tag)
18
+ }
19
+
20
+ filter_by_name(editable_attributes).each do |attrib|
21
+ form_field_for(attrib)
22
+ end
23
+ filter_by_name(has_many_through_associations).each do |assoc|
24
+ select_collection(assoc.name, nil, nil, class: 'select2')
25
+ end
26
+ if show_timestamps?
16
27
  filter_by_name(timestamp_attributes).each do |timestamp|
17
28
  div {
18
29
  label {
@@ -20,11 +31,10 @@ module ExpressAdmin
20
31
  }
21
32
  }
22
33
  end
23
- submit(class: 'button')
24
- }
34
+ end
35
+ submit(class: 'button')
25
36
  }
26
37
 
27
- TIMESTAMPS = ['updated_at', 'created_at']
28
38
 
29
39
  def form_field_for(attrib)
30
40
  field_type_substitutions = {'text_area' => 'textarea',
@@ -33,7 +43,7 @@ module ExpressAdmin
33
43
  field_type = attrib.field_type.to_s.sub(/_field$/,'')
34
44
  if relation = attrib.name.match(/(\w+)_id$/).try(:[], 1)
35
45
  # TODO: should allow select2 override
36
- select(attrib.name, options: config["#{relation}_collection".to_sym], select2: true)
46
+ select(attrib.name.to_sym, options: config["#{relation}_collection".to_sym], select2: true)
37
47
  else
38
48
  if field_type == 'text_area'
39
49
  textarea attrib.name.to_sym, rows: 10
@@ -45,19 +55,6 @@ module ExpressAdmin
45
55
 
46
56
  protected
47
57
 
48
- def form_args
49
- { id: resource_name,
50
- action: form_action,
51
- resource_name: resource_name,
52
- resource_class: config[:resource_class],
53
- namespace: namespace}
54
- end
55
-
56
- # from express_form - perhaps move back to shared module
57
- def form_action
58
- config[:action] || (helpers.resource.try(:persisted?) ? resource_path(ivar: true) : collection_path)
59
- end
60
-
61
58
  def resource_attributes
62
59
  super.map do |attrib|
63
60
  field_definition = [attrib.name, attrib.type] # index not important here for now
@@ -85,6 +82,10 @@ module ExpressAdmin
85
82
  resource_attributes.select {|attrib| TIMESTAMPS.include?(attrib.name) }
86
83
  end
87
84
 
85
+ def show_timestamps?
86
+ !!config[:show_timestamps]
87
+ end
88
+
88
89
  def non_timestamp_attributes
89
90
  resource_attributes.reject {|attrib| TIMESTAMPS.include?(attrib.name) }
90
91
  end
@@ -2,44 +2,61 @@ module ExpressAdmin
2
2
  class SmartTable < ExpressTemplates::Components::Configurable
3
3
  include ExpressTemplates::Components::Capabilities::Resourceful
4
4
 
5
+ tag :table
6
+
5
7
  MAX_COLS_TO_SHOW_IDX = 5
6
8
 
7
9
  attr :columns
8
10
 
9
- emits -> {
10
- table(id: config[:id], class: 'table striped') {
11
- thead {
12
- tr {
11
+ has_option :scrollable, 'Set to true if the table should be scrollable'
12
+ has_option :show_actions, 'Set to true if table has actions for each row'
13
+ has_option :row_class, 'Add a class to each table row'
14
+
15
+
16
+ column_defs = {}
17
+ column_defs[:array] = {description: "List of fields to include in the table as columns",
18
+ options: -> {resource.columns.map(&:name)} }
19
+ column_defs[:hash] = {description: "Hash of column names (titles) and how to calculate the cell values."}
20
+
21
+ has_option :columns, 'Specify the columns. May provide as a hash with values used to provide cell values as a proc.',
22
+ type: [:array, :hash]
23
+
24
+ contains -> {
25
+ thead {
26
+ tr {
27
+ display_columns.each do |column|
28
+ th(class: column.name) {
29
+ column.title
30
+ }
31
+ end
32
+ actions_header if should_show_actions?
33
+ hidden_columns_header_indicator if columns_hidden?
34
+ }
35
+ }
36
+ tbody {
37
+ collection.each do |item|
38
+ tr(id: row_id(item), class: row_class(item)) {
13
39
  display_columns.each do |column|
14
- th(class: column.name) {
15
- column.title
40
+ td(class: column.name) {
41
+ cell_value(item, column.accessor)
16
42
  }
17
43
  end
18
- actions_header if should_show_actions?
19
- hidden_columns_header_indicator if columns_hidden?
44
+ actions_column(item) if should_show_actions?
45
+ hidden_column_cell if columns_hidden?
20
46
  }
21
- }
22
- tbody {
23
- collection.each do |item|
24
- tr(id: row_id(item), class: row_class(item)) {
25
- display_columns.each do |column|
26
- td(class: column.name) {
27
- cell_value(item, column.accessor)
28
- }
29
- end
30
- actions_column(item) if should_show_actions?
31
- hidden_column_cell if columns_hidden?
32
- }
33
- end ; nil
34
- }
47
+ end ; nil
35
48
  }
36
49
 
37
- scroll_table if !!config[:scroll_table]
50
+ scroll_table if !!config[:scrollable]
51
+ }
52
+
53
+ before_build -> {
54
+ add_class 'table striped'
38
55
  }
39
56
 
40
57
  def scroll_table
41
58
  script {
42
- %Q($('\##{my[:id]}').scrollTableBody())
59
+ %Q($('\##{config[:id]}').scrollTableBody())
43
60
  }
44
61
  end
45
62
 
@@ -48,7 +65,7 @@ module ExpressAdmin
48
65
  end
49
66
 
50
67
  def should_show_actions?
51
- config[:actions].nil? || !!config[:actions]
68
+ !!config[:show_actions]
52
69
  end
53
70
 
54
71
  def resource_path(item)
@@ -81,10 +98,6 @@ module ExpressAdmin
81
98
  end
82
99
  end
83
100
 
84
- def is_permanent?
85
- config[:permanent].nil? || (config[:permanent].present? && config[:permanent])
86
- end
87
-
88
101
  def row_id(item)
89
102
  "#{collection_member_name}:#{item.to_param}"
90
103
  end
@@ -92,7 +105,7 @@ module ExpressAdmin
92
105
  def cell_value(item, accessor)
93
106
  if accessor.respond_to?(:call)
94
107
  value = begin
95
- eval "(#{accessor.source}).call(item).to_s"
108
+ accessor.call(item).html_safe
96
109
  rescue
97
110
  'Error: '+$!.to_s
98
111
  end
@@ -1,14 +1,19 @@
1
1
  module ExpressAdmin
2
2
  class WidgetBox < ExpressTemplates::Components::Configurable
3
- emits -> (block) {
4
- div(class: 'widget-box', id: "#{config[:id].to_s.dasherize}-box") {
5
- header(class: 'title') { box_title }
6
- div(class: 'widget-body') {
7
- block.call(self) if block
8
- }
3
+
4
+ has_option :title, 'The title to be displayed.'
5
+
6
+ contains -> (&block) {
7
+ header(class: 'title') { box_title }
8
+ div(class: 'widget-body') {
9
+ block.call(self) if block
9
10
  }
10
11
  }
11
12
 
13
+ before_build -> {
14
+ set_attribute(:id, "#{config[:id].to_s.dasherize}-box")
15
+ }
16
+
12
17
  protected
13
18
 
14
19
  def resource_name
@@ -13,10 +13,10 @@ html {
13
13
  render('shared/express_admin/navigation_bar')
14
14
  div(class: 'main-page') {
15
15
  div(class: 'page-sidebar') {
16
- addon_sidebar_component
16
+ module_sidebar
17
17
  }
18
18
  div(class: 'page-body') {
19
- page_header_component
19
+ page_header
20
20
  current_arbre_element.add_child yield
21
21
  }
22
22
  }
@@ -6,12 +6,12 @@ nav(class: 'top-bar') {
6
6
  image_tag 'express_admin/appexpress_logo_dark.png', class: 'nav-logo'
7
7
  }
8
8
  }
9
- mega_menu_component
9
+ mega_menu
10
10
  li {
11
- icon_link(icon_name: 'android-open', text: 'View Site', href: '/', target: '_blank')
11
+ icon_link("android-open", text: 'View Site', href: '/', target: '_blank')
12
12
  }
13
13
  render(partial: 'shared/nav_bar_actions')
14
- li { flash_message_component } unless helpers.flash.empty?
14
+ li { flash_messages } unless helpers.flash.empty?
15
15
  }
16
16
  }
17
17
  div(class: 'secondary-menu') {
@@ -1,3 +1,3 @@
1
1
  module ExpressAdmin
2
- VERSION = "1.3.2"
2
+ VERSION = "1.4.0"
3
3
  end
Binary file
@@ -7,6 +7,7 @@ module ExpressAdmin
7
7
  def resource_assigns
8
8
  {resource: Widget.new, collection: Widget.all}
9
9
  end
10
+
10
11
  def helpers
11
12
  view = mock_action_view(resource_assigns)
12
13
  class << view
@@ -25,15 +26,14 @@ module ExpressAdmin
25
26
  view
26
27
  end
27
28
 
28
-
29
29
  def widget_form(*args)
30
30
  arbre {
31
- smart_form(:widgets, *args)
31
+ smart_form(:widget, *args)
32
32
  }
33
33
  end
34
34
 
35
35
  test "renders a form correct id" do
36
- assert_match '<form id="widget"', widget_form
36
+ assert_match /form.*id="widget"/, widget_form
37
37
  end
38
38
 
39
39
  test "uses inherited_resources path helpers to set correct action" do
@@ -71,8 +71,9 @@ module ExpressAdmin
71
71
  end
72
72
 
73
73
  test "timestamps are not editable" do
74
- assert_match /Created At:.*\n/, widget_form
75
- assert_match /Updated At:.*\n/, widget_form
74
+ form_with_timestamps = widget_form(show_timestamps: true)
75
+ assert_match /Created At:.*\n/, form_with_timestamps
76
+ assert_match /Updated At:.*\n/, form_with_timestamps
76
77
  end
77
78
 
78
79
  test "fields have labels" do
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- express_templates (0.7.0)
4
+ express_templates (0.7.1)
5
5
  activesupport (~> 4.2)
6
6
  arbre
7
7
  parslet (~> 1.6)
@@ -15,7 +15,7 @@ Gem::Specification.new do |s|
15
15
  s.license = "MIT"
16
16
 
17
17
  s.files = Dir["{app,config,db,lib}/**/*", "LICENSE", "Rakefile", "README.md"]
18
- s.test_files = Dir["test/**/*"]
18
+ s.test_files = Dir["test/**/*"] - Dir["test/log/*", "test/tmp/*", "test/dummy/tmp/**/*", "test/dummy/log/*"]
19
19
 
20
20
  s.add_dependency "activesupport", "~> 4.2" # strictly speaking we only depend on active support
21
21
  s.add_dependency "parslet", "~> 1.6"
@@ -1,16 +1,7 @@
1
- require 'ostruct'
2
1
  module ExpressTemplates
3
2
  module Compiler
4
3
  def compile(template_or_src=nil, &block)
5
4
 
6
- if block
7
- begin
8
- block.source
9
- rescue
10
- raise "block must have source - did you do compile(&:label) ?"
11
- end
12
- end
13
-
14
5
  template, src = _normalize(template_or_src)
15
6
 
16
7
  %Q[Arbre::Context.new(assigns.merge(template_virtual_path: @virtual_path), self) { #{src || block.source_body} }.to_s]
@@ -5,6 +5,5 @@ end
5
5
 
6
6
  require 'express_templates/components/base'
7
7
  require 'express_templates/components/configurable'
8
- require 'express_templates/components/form_rails_support'
9
8
  require 'express_templates/components/tree_for'
10
9
  require 'express_templates/components/forms'
@@ -21,12 +21,46 @@ module ExpressTemplates
21
21
  # puts "added #{method_name} -> #{klass.name}"
22
22
  end
23
23
 
24
- def self.emits(proc = nil, &block)
25
- define_method(:build, &(proc || block))
24
+ def initialize(*)
25
+ super
26
+ _default_attributes.each do |name, value|
27
+ set_attribute(name, value)
28
+ end
29
+ add_class _default_classes
26
30
  end
27
31
 
28
- def build(*args, block)
29
- raise "#build method must be overridden"
32
+ def self.contains(proc = nil, &block)
33
+ define_method(:_build_body, &(proc || block))
34
+ end
35
+
36
+ # Override the tag_name method for other than <div>
37
+ def self.tag(tag)
38
+ define_method(:tag_name) { tag }
39
+ end
40
+
41
+ # Provide default attributes for the enclosing tag
42
+ # of the component
43
+ def self.has_attributes(attribs)
44
+ self._default_classes = attribs.delete(:class)
45
+ _default_attributes.merge!(attribs)
46
+ end
47
+
48
+ def self.before_build(proc_or_symbol = nil, &block)
49
+ if proc_or_symbol.kind_of?(Symbol)
50
+ define_method(:_before_build) do
51
+ self.send(proc_or_symbol)
52
+ end
53
+ else
54
+ define_method(:_before_build, &(proc_or_symbol || block))
55
+ end
56
+ end
57
+
58
+ def build(*args, &block)
59
+ _extract_class!(args)
60
+ _before_build if respond_to?(:_before_build)
61
+ super(*args) {
62
+ _build_body(&block) if respond_to?(:_build_body)
63
+ }
30
64
  end
31
65
 
32
66
  def resource
@@ -37,13 +71,31 @@ module ExpressTemplates
37
71
  builder_method_and_class subclass.to_s.demodulize.underscore, subclass
38
72
  end
39
73
 
40
- def indent_level
41
- parent_indent_level = parent.try(:indent_level) || 0
42
- end
74
+ protected
75
+ def default_class_name
76
+ self.class.name.demodulize.underscore.dasherize
77
+ end
43
78
 
44
- def to_s
45
- children.to_s
46
- end
79
+
80
+ private
81
+ def _extract_class!(args)
82
+ add_class args.last.delete(:class) if args.last.try(:kind_of?, Hash)
83
+ end
84
+ def _default_attributes
85
+ self.class._default_attributes
86
+ end
87
+ def self._default_attributes
88
+ @default_attributes ||= {}
89
+ end
90
+ def _default_classes
91
+ self.class._default_classes
92
+ end
93
+ def self._default_classes
94
+ @default_classes ||= ''
95
+ end
96
+ def self._default_classes=(classes)
97
+ @default_classes = classes
98
+ end
47
99
 
48
100
  end
49
101
  end