express_admin 1.1.0 → 1.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +3 -1
- data/app/assets/images/express_admin/appexpress_logo_dark.png +0 -0
- data/app/assets/javascripts/express_admin.js +1 -4
- data/app/assets/javascripts/express_admin/admin.js +0 -2
- data/app/assets/javascripts/express_admin/scrollTableBody.js +127 -0
- data/app/assets/stylesheets/express_admin.css +1 -1
- data/app/assets/stylesheets/express_admin/components/_main_menu.sass +5 -0
- data/app/assets/stylesheets/express_admin/components/_megadropdown.sass +0 -5
- data/app/assets/stylesheets/express_admin/components/_module_sidebar.sass +9 -0
- data/app/assets/stylesheets/express_admin/components/_pane.sass +9 -0
- data/app/assets/stylesheets/express_admin/components/_widget_box.sass +10 -0
- data/app/assets/stylesheets/express_admin/globals/_foundation_overrides.sass +612 -0
- data/app/assets/stylesheets/express_admin/globals/_mixins.sass +9 -0
- data/app/assets/stylesheets/express_admin/globals/_typography.sass +8 -16
- data/app/assets/stylesheets/express_admin/globals/_variables.sass +18 -12
- data/app/assets/stylesheets/express_admin/screen.sass +16 -9
- data/app/assets/stylesheets/express_admin/sections/_header.sass +8 -94
- data/app/assets/stylesheets/express_admin/sections/_main_content.sass +3 -61
- data/app/assets/stylesheets/express_admin/sections/_main_region.sass +9 -0
- data/app/assets/stylesheets/express_admin/sections/_page_body.sass +6 -0
- data/app/assets/stylesheets/express_admin/sections/_page_sidebar.sass +5 -0
- data/app/assets/stylesheets/express_admin/sections/_sidebar_region.sass +7 -0
- data/app/assets/stylesheets/express_admin/shared/_buttons.sass +2 -31
- data/app/assets/stylesheets/express_admin/shared/_forms.sass +3 -97
- data/app/assets/stylesheets/express_admin/shared/_layout_components.sass +60 -0
- data/app/assets/stylesheets/express_admin/shared/_messages.sass +1 -1
- data/app/assets/stylesheets/express_admin/shared/_tables.sass +12 -67
- data/app/assets/stylesheets/express_admin/shared/_trees.sass +27 -0
- data/app/components/express_admin/addon_sidebar_component.rb +5 -9
- data/app/components/express_admin/h_box.rb +16 -0
- data/app/components/express_admin/layout_component.rb +14 -0
- data/app/components/express_admin/main_region.rb +1 -1
- data/app/components/express_admin/pane.rb +37 -0
- data/app/components/express_admin/sidebar_region.rb +2 -4
- data/app/components/express_admin/smart_form.rb +63 -27
- data/app/components/express_admin/smart_table.rb +131 -41
- data/app/components/express_admin/v_box.rb +16 -0
- data/app/components/express_admin/widget_box.rb +2 -2
- data/app/helpers/express_admin/admin_helper.rb +14 -9
- data/app/views/layouts/express_admin/admin.html.et +7 -11
- data/app/views/shared/express_admin/_navigation_bar.html.et +17 -13
- data/app/views/shared/express_admin/_navigation_bar_profile.html.et +0 -2
- data/app/views/shared/express_admin/_title.html.et +6 -8
- data/lib/express_admin/engine.rb +1 -1
- data/lib/express_admin/menu.rb +7 -2
- data/lib/express_admin/version.rb +1 -1
- data/lib/generators/express_admin/install/install_generator.rb +4 -4
- data/lib/generators/express_admin/install/templates/controllers/admin_controller.rb.erb +1 -1
- data/lib/generators/express_admin/scaffold/scaffold_generator.rb +10 -2
- data/lib/generators/express_admin/scaffold/templates/index.html.et.erb +1 -1
- data/test/dummy/app/controllers/admin/categories_controller.rb +12 -0
- data/test/dummy/app/controllers/admin/widgets_controller.rb +12 -0
- data/test/dummy/app/models/category.rb +3 -0
- data/test/dummy/app/models/tag.rb +4 -0
- data/test/dummy/app/models/widget.rb +7 -0
- data/test/dummy/app/models/widget_tag.rb +4 -0
- data/test/dummy/app/views/admin/categories/index.html.et +10 -0
- data/test/dummy/app/views/admin/widgets/index.html.et +10 -0
- data/test/dummy/config/routes.rb +5 -0
- data/test/dummy/db/development.sqlite3 +0 -0
- data/test/dummy/db/migrate/20150525221206_create_widgets.rb +15 -0
- data/test/dummy/db/migrate/20150525221228_create_categories.rb +9 -0
- data/test/dummy/db/migrate/20150610081108_create_tags.rb +7 -0
- data/test/dummy/db/migrate/20150610081204_create_widget_tags.rb +8 -0
- data/test/dummy/db/schema.rb +26 -5
- data/test/dummy/db/test.sqlite3 +0 -0
- data/test/dummy/log/development.log +35 -0
- data/test/dummy/log/test.log +33428 -0
- data/test/dummy/test/components/smart_form_test.rb +93 -0
- data/test/dummy/test/components/smart_table_test.rb +137 -0
- data/test/dummy/test/fixtures/categories.yml +8 -0
- data/test/dummy/test/fixtures/tags.yml +14 -0
- data/test/dummy/test/fixtures/widget_tags.yml +10 -0
- data/test/dummy/test/fixtures/widgets.yml +20 -0
- data/test/dummy/test/models/category_test.rb +13 -0
- data/test/dummy/test/models/tag_test.rb +13 -0
- data/test/dummy/test/models/widget_tag_test.rb +13 -0
- data/test/dummy/test/models/widget_test.rb +13 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0fNukwCUjSC_GRsVIMtSMVdZkd5bq5eShMcGCrCVolc.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1c4REJHKdQH9bwZhZ7Ixshmy_1jAzXc3-9OiDCDyRlk.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/1rKHSaJsgLcnfIJRWYdYy7IimMCKcdI-I_ABekUargk.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2kMk5s4FKAOWE1z_MvFIKHmdvNDzyoknoi39xL7KwJw.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2oGeKB_QtwWpX3sJNHocsJiBZT60x_cwV_nSGh_HS-A.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2rQDWRzFxOlBnczJ1BLfE2yCPVvrhgLGfAI7VSM54wk.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/3S9nnUmEIG4-hDY6cVc82GFUUWicNxtpFfWwJAmJSkI.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4WErFdugnc8uWYwUE9vVfw4xxCgknECdpWhn8teZbLk.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/4a7epNa5R1jeKCtFsJKTdVqMEQm5p0clABRPIiKegMo.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/57pjjkzReNE1L9yodewGebfd0AwnfQb33rtJjSTNpLc.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/7vpDV8GyXVfyuFIkRrrkOwUXyIaCmf22tBPDpvhCUUc.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Cpj6WyqdggDUkeQl_Ut3P9sUtPHPXXwkmZ92TfIJGJ8.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/DwepgSdLiEklsJWIJItEY_ZW-nOjjeHqcdQwBtu0mus.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/FOJpwMQCx9V9wfhJQKFa2f7BjfP7vyS7M3o6VX0nAI0.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/GStmpiXE4g01i-UTlSKq8B9yS69WpAp0YH7vWyESBwI.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/H53ZZ50FwJjYUOMH60F7cpINgkh9tOF4R3L6ANoH6tU.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/HY86Fwn8VPlIysY56uV-wu90bISxrXeiCtwDXg94Glg.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/IcNDN_pmsAcLAMv6CST75OwOucmYm3q2099jn4tB0H8.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/JpdfSFVzivQn6TFSivlys3nV3VzD8cT0ET8uqbptxV4.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/KYe0_GIi-cNX0eRteBB0aixVATrVRo7Z3BaWFCgc7yg.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/LsiO4sLQfM0GvyEYhaC2E54rCurTkewg7YJX-sWBctI.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/NDViKg4-yspkY1tX9IQWnh1-LkiKqIohBqtRlYZZQcs.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/OXsmreTQ3MNzGsrV1eEoW72VZQ52hQ0HiuTr0ImnqHA.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/PuMvTyv89E8wfRqbWNMhTH3PAE61uCCHgpEsgdOzMXQ.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Pvp8CVIKYjspNrgzEvgleujifrrdfATzWbwALDzQNE4.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/PzcOUndLc-O-VBR2SDM2rFkiqh-iqknTEgEAXDLKfdc.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QbX1HRM7KX85_PeVHcd6VJM6sqzUCWXEEYZX7CAG0eA.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UDHqQKrYSSvXfCbiJjXzmJh2Q6T5hLO80aaPvs9n-74.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UFtISk01WwcjjWcPLyjeHX3bgBqZHGQcb0Z4KFNmduA.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UWvG-0WgVYHVxrtLU32uumROQuSjJv_M_svW1B8YxhY.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/UruI7_ZpuzDnmNir9hzUa_r8oiuuIfVTco19ACdxwRw.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VQ2-2HlkGd1XVIHlwRGcgDsjto3oE-50-4E3HGdt8uU.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VezioHwyk87G6TWkkYX88tBHC6QToVGOU5geZ54Ts5A.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/WfQ-xKbnwqaKy-UQa8spczc9qocIL_jZE4cyRZftjfA.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XPpCqlT8yHTnQNHKRxjnilUBvAs6klpgWXneFU15U78.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XXTM8o6vkSxhxxm8P_orbeCZvxb8nMk7cjdwvUNL1io.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/XyRQXY_oj8GLw9z8lj2dknGu45jbX5lK8ko7TePosPE.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/YDMOayx363vI7odbkHMVI-_RxkOoVP2Hb7FX0mFVFE0.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Z88gJS67lNABJgUB18JzXrnGkVbYfXQvjqm7mSJIv3o.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_k4X14Cc-2Y4gc47s7PaWtAaG_zcq1ICJInTYNp6bI4.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_kr_dP4VVnM8s8ZMdiNBSpuPqkQVx46FUdCTDH4XR70.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/_y-BPEZTh3iXcaPJkcP9-krjw-V8LMhop4VGxUEUDsY.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/afi__XQzjsqMT3svcCGlVD_YrHEWQZAEbJt4CgYaCkw.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bdqS7lHa0nBN-mqdSomfMK-S6ct2TAn0z9kVzFBwQPM.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/csH89NDps1_QU4E0p0HHZti2XLd_etKYDqM9cPsNpps.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ePtEu-AuU0iZ2J02ZafF9yOJVd8VVdV2KSheiJYlXzA.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/eTRff0YXBw-Tx9VEMxb-Es8NwqjHCXiaosBLxijl3I8.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fRkrxaDYzRDIvxEUGZBFbW5ocAlmDQNg8_LRcOJJOzI.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/goVFgqSk0CBOXpbwLNd-enc31BvXm1S8cMSJ3zbxRYI.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hPH6lLkPX0EzSG_eBprMMUnmFs9y89AOarfyhGoAFGc.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hgfrt0FmGrYD5SJVJhlsUPtL9usJvw3vZrW4dqQq16Y.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hiZg7FLw7SFa7S-BQ8CKWdAqFVUZy2HVb2chmQijM-g.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iKb8yzw0EdFpNkayUbc16U7olK7iwE2xIs_6b_xIEtI.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/iY03Ztj2YhBWadK8LHOKR3Hj1W7PLss0v85Q6Nj7E3Q.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ipLhCJrCCVwH7l_p1quUi2xS6POFlVHfZCqIymk8CoI.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ipTot5AshDPhFtCBNfXROxutQlCrYkvsXsy3fcVT0Nw.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/j5CxYBAeuD-bGDZUBh-pA0mEPCSVFDZsJm3x7QED4g0.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/jr4uhEONyFYm0QhfEOMqv05S-BeUP7gw1gQl3GIFyAI.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kGO7_IQtBwpe93nSTKj6cCWGm0fZ_NoXltdw8E_74CQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/le9WohG3eSGbBMySdKkdvkHXW8yipO8w4iQZCCCQb3M.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/mtmR_XlvnlYbOPmP1EkOj96q2Z5OQNv4HkeFj9DwEXQ.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/nU1obIDVHUhN-3yRA6B9U5aO8wsd6zh1tyVtSROJewk.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oZ6SMNNft5SCbvNtWXkGQwKQPVwXoJRMV7VUJfWHc2k.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/oygs10cGTBBo7Mj97CjFRTrSrFR7Qi3MnHNR_WQvIps.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p0Gnpai0VYzEsAXH_5t9huZ3dO0v6JKRH0PIH--q-XA.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/pu9xM8T2O07hU3PafxbOLjg2vJxbbHE3qnIK9JHqVhA.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qEHftZrJ-Da_nsvX4UOaALyIt0mwnOuE2TdtBPGAWEw.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rtdpq5fxIYMKM43QyOIluEECg2NP5OA-7Zi8yuowZSI.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/ujFa5Hu76zd1O6nO2G7WcgnOWZyTOMKLajazyMXAL_I.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uovLHiJZBoVnD7CXYj2WZYmAbBcqGLQOzu4Voz5Fx8c.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/uyHm0KHsHpJhn-wv69exuuyU4kyJtW3DDQLP7tCD7e4.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/v50nc5cuqpLxjepk7XsBmomcmFARYlHQRtq8yOv8AY0.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vAh5eTPxI929yxRCyXgbKTWat5cZiVSOyX0UeTveXGE.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/vKiuNu1fQitE151bh0Tr2Ufkc80jWzchPjxaHkpjQL8.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x-3lyh5i4qS-Q9E3X2uj2LthTOxsndFTrFXBsPPo6hI.cache +2 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/x3xQgAyjbrGTXy2FX2UzGG77agJgt_xsyNBuofrvY_E.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/xQqBwKYWFPxZm5tidxsRKk23Z3q-OLRmKQUlMjRev_c.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/yZNo-6dzWGUNCJDnmqm7X5YB5FOxjYp_l8aKS6KaZOg.cache +0 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zV58Nou0R2EJG875wLND6wF9ES4diVi1fP7B_B6eCzw.cache +1 -0
- data/test/dummy/tmp/cache/assets/test/sprockets/v3.0/zxPFYKpkfNJtui1ekitdNMaGAo39fefm-oJCnILEEQ8.cache +1 -0
- data/test/fixtures/widgets.yml +20 -0
- data/test/lib/express_admin/menu_test.rb +1 -1
- data/test/{fixtures/express_admin → support}/test_menu.yml +0 -0
- data/test/test_helper.rb +25 -5
- data/vendor/gems/express_templates/Gemfile +16 -0
- data/vendor/gems/express_templates/Gemfile.lock +153 -0
- data/vendor/gems/express_templates/LICENSE +21 -0
- data/vendor/gems/express_templates/README.md +152 -0
- data/vendor/gems/express_templates/Rakefile +32 -0
- data/vendor/gems/express_templates/diagrams/diagram.graffle +2404 -0
- data/vendor/gems/express_templates/diagrams/diagram_express_templates.png +0 -0
- data/vendor/gems/express_templates/diagrams/diagram_haml_erb.png +0 -0
- data/vendor/gems/express_templates/express_templates-0.5.0.gem +0 -0
- data/vendor/gems/express_templates/express_templates.gemspec +29 -0
- data/vendor/gems/express_templates/lib/core_extensions/proc.rb +90 -0
- data/vendor/gems/express_templates/lib/core_extensions/string.rb +25 -0
- data/vendor/gems/express_templates/lib/express_templates.rb +19 -0
- data/vendor/gems/express_templates/lib/express_templates/compiler.rb +36 -0
- data/vendor/gems/express_templates/lib/express_templates/components.rb +18 -0
- data/vendor/gems/express_templates/lib/express_templates/components/base.rb +54 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/adoptable.rb +20 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/building.rb +14 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/conditionality.rb +54 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/configurable.rb +90 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/iterating.rb +75 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/parenting.rb +72 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/rendering.rb +30 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/resourceful.rb +135 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/templating.rb +198 -0
- data/vendor/gems/express_templates/lib/express_templates/components/capabilities/wrapping.rb +84 -0
- data/vendor/gems/express_templates/lib/express_templates/components/column.rb +13 -0
- data/vendor/gems/express_templates/lib/express_templates/components/container.rb +7 -0
- data/vendor/gems/express_templates/lib/express_templates/components/content_for.rb +42 -0
- data/vendor/gems/express_templates/lib/express_templates/components/for_each.rb +30 -0
- data/vendor/gems/express_templates/lib/express_templates/components/form_rails_support.rb +22 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms.rb +17 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/basic_fields.rb +53 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/checkbox.rb +37 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/express_form.rb +57 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/form_component.rb +64 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/form_support.rb +13 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/option_support.rb +65 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/radio.rb +84 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/select.rb +105 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/select_collection.rb +57 -0
- data/vendor/gems/express_templates/lib/express_templates/components/forms/submit.rb +26 -0
- data/vendor/gems/express_templates/lib/express_templates/components/null_wrap.rb +41 -0
- data/vendor/gems/express_templates/lib/express_templates/components/row.rb +28 -0
- data/vendor/gems/express_templates/lib/express_templates/components/table_for.rb +163 -0
- data/vendor/gems/express_templates/lib/express_templates/components/tree_for.rb +86 -0
- data/vendor/gems/express_templates/lib/express_templates/components/unless_block.rb +40 -0
- data/vendor/gems/express_templates/lib/express_templates/expander.rb +140 -0
- data/vendor/gems/express_templates/lib/express_templates/indenter.rb +47 -0
- data/vendor/gems/express_templates/lib/express_templates/interpolator.rb +36 -0
- data/vendor/gems/express_templates/lib/express_templates/macro.rb +45 -0
- data/vendor/gems/express_templates/lib/express_templates/markup.rb +9 -0
- data/vendor/gems/express_templates/lib/express_templates/markup/html_tag.rb +62 -0
- data/vendor/gems/express_templates/lib/express_templates/markup/tag.rb +150 -0
- data/vendor/gems/express_templates/lib/express_templates/markup/wrapper.rb +94 -0
- data/vendor/gems/express_templates/lib/express_templates/markup/yielder.rb +21 -0
- data/vendor/gems/express_templates/lib/express_templates/renderer.rb +11 -0
- data/vendor/gems/express_templates/lib/express_templates/template/handler.rb +15 -0
- data/vendor/gems/express_templates/lib/express_templates/version.rb +3 -0
- data/vendor/gems/express_templates/lib/tasks/express_templates.rake +4 -0
- data/vendor/gems/express_templates/test/compiler_test.rb +9 -0
- data/vendor/gems/express_templates/test/components/base_test.rb +44 -0
- data/vendor/gems/express_templates/test/components/capabilities/resourceful_test.rb +63 -0
- data/vendor/gems/express_templates/test/components/column_test.rb +11 -0
- data/vendor/gems/express_templates/test/components/conditionality_test.rb +37 -0
- data/vendor/gems/express_templates/test/components/configurable_test.rb +43 -0
- data/vendor/gems/express_templates/test/components/container_test.rb +66 -0
- data/vendor/gems/express_templates/test/components/content_for_test.rb +60 -0
- data/vendor/gems/express_templates/test/components/forms/basic_fields_test.rb +52 -0
- data/vendor/gems/express_templates/test/components/forms/checkbox_test.rb +44 -0
- data/vendor/gems/express_templates/test/components/forms/express_form_test.rb +108 -0
- data/vendor/gems/express_templates/test/components/forms/radio_test.rb +96 -0
- data/vendor/gems/express_templates/test/components/forms/select_test.rb +146 -0
- data/vendor/gems/express_templates/test/components/forms/submit_test.rb +12 -0
- data/vendor/gems/express_templates/test/components/iterating_test.rb +127 -0
- data/vendor/gems/express_templates/test/components/null_wrap_test.rb +28 -0
- data/vendor/gems/express_templates/test/components/row_test.rb +16 -0
- data/vendor/gems/express_templates/test/components/table_for_test.rb +211 -0
- data/vendor/gems/express_templates/test/components/tree_for_test.rb +103 -0
- data/vendor/gems/express_templates/test/core_extensions/proc_test.rb +71 -0
- data/vendor/gems/express_templates/test/core_extensions/string_test.rb +20 -0
- data/vendor/gems/express_templates/test/dummy/Rakefile +6 -0
- data/vendor/gems/express_templates/test/dummy/app/assets/javascripts/application.js +13 -0
- data/vendor/gems/express_templates/test/dummy/app/assets/stylesheets/application.css +15 -0
- data/vendor/gems/express_templates/test/dummy/app/controllers/application_controller.rb +5 -0
- data/vendor/gems/express_templates/test/dummy/app/controllers/hello_controller.rb +5 -0
- data/vendor/gems/express_templates/test/dummy/app/helpers/application_helper.rb +2 -0
- data/vendor/gems/express_templates/test/dummy/app/views/hello/show.html.et +5 -0
- data/vendor/gems/express_templates/test/dummy/app/views/layouts/application.html.et +15 -0
- data/vendor/gems/express_templates/test/dummy/bin/bundle +3 -0
- data/vendor/gems/express_templates/test/dummy/bin/rails +4 -0
- data/vendor/gems/express_templates/test/dummy/bin/rake +4 -0
- data/vendor/gems/express_templates/test/dummy/config.ru +4 -0
- data/vendor/gems/express_templates/test/dummy/config/application.rb +26 -0
- data/vendor/gems/express_templates/test/dummy/config/boot.rb +5 -0
- data/vendor/gems/express_templates/test/dummy/config/environment.rb +5 -0
- data/vendor/gems/express_templates/test/dummy/config/environments/development.rb +37 -0
- data/vendor/gems/express_templates/test/dummy/config/environments/production.rb +82 -0
- data/vendor/gems/express_templates/test/dummy/config/environments/test.rb +40 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/assets.rb +8 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/backtrace_silencers.rb +7 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/cookies_serializer.rb +3 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/filter_parameter_logging.rb +4 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/inflections.rb +16 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/mime_types.rb +4 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/session_store.rb +3 -0
- data/vendor/gems/express_templates/test/dummy/config/initializers/wrap_parameters.rb +14 -0
- data/vendor/gems/express_templates/test/dummy/config/locales/en.yml +23 -0
- data/vendor/gems/express_templates/test/dummy/config/routes.rb +4 -0
- data/vendor/gems/express_templates/test/dummy/config/secrets.yml +22 -0
- data/vendor/gems/express_templates/test/dummy/log/test.log +15987 -0
- data/vendor/gems/express_templates/test/dummy/public/404.html +67 -0
- data/vendor/gems/express_templates/test/dummy/public/422.html +67 -0
- data/vendor/gems/express_templates/test/dummy/public/500.html +66 -0
- data/vendor/gems/express_templates/test/dummy/public/favicon.ico +0 -0
- data/vendor/gems/express_templates/test/dummy/test/controllers/hello_controller_test.rb +14 -0
- data/vendor/gems/express_templates/test/dummy/test/helpers/hello_helper_test.rb +4 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-1ax0k6FO5drSUN6jbogg4G0JliUHLffvQUvzSePKxA.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/-cDLO4NJHMndDHchOLz8KLD7QBc68WtaAbYxK2r6GsU.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/0t68EIwZ96sAqQSxFka9MQyIk4viw8ZIoREMCGiJRx0.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/28LzLLDYjhr3jmu0GxjZ-ms5Bol6JilDRXpg8Zgbjqs.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/2zt1IbQCnmzGyeZS_I4sYQzrgneSCKIJBRxcffVHlWY.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/5AeGDyXQbv_BTj3PD4MJpNnGVwUxLsA8H1VcwB69_wE.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/B0RgtiEmqwrCQuw4AnDa3fdENtJeBtO_TqtGJuWOeNs.cache +3 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/D-tMNp19G2zWOPPhnQRUm4K8DPa8SpKPfGALkkofTeE.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/EDVlXrcn_wEfaZ5nc_4QJBT7lPiIBcX96jBo7PBz-vc.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Eso3tkb79hXQ1XdQgjbV03KyQwSeZFAHxVHImsjQ-HQ.cache +2 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/I8LhheC1OlOyvp_qY8kWpqKcZFiqv_BO-l5bExvDEi0.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Kf4VrP5sW-qzziYSN-m7p4nETjLiEwwwRfwUOm7rOr0.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Pd5YOD1DAL7QtTnwETZYBCabg5DkCFgbjt4iuBOcSoY.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/QJ0Z8hROMfWpY6f5Chb7GSuDHE4gpabKVQTr9BCZe9s.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/T1pSAx767vY7X1UDN0vdF7YGEkI5wMSVUKopsdvp7kI.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/VlSPFPDK05c7ImadRiRVKzsaa6e15RwX77QR3NYabME.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/Y7_BbgB9jgJIWYjDCsASySd26DTfPADAu_3DDnLlFog.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/bSfZQxeyghTF4WIVnzGavxlg9afmSNuqcW6bA1Bm1OA.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/fvD_ZNFRzd8Sc4PoTjyHPnkg4f7WMietFunnKqNjlvc.cache +2 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/g2xQygPqA5kMmp5L3wVGWaUIhdVsxFmOel9FF6M0Fuw.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/hKbgrf5CbMO8pe9fCHc-rI5mp1ejAhivBfvfDxBNhQA.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kaif59owjUr3HBharCH5GUxU6KoW_zXD9a9JiTjIYPY.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/kpvKX5UlhhoLJv-faeq7Ibv2KQh4ROjTiarh13gHuWI.cache +2 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lfyrNtbNtwuTXAWlmPCKTS-D3FHoPTY6h53wnUN36-A.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/lyDRhWNhfDw_YCCSbxQw_iOIV3eTfeAoX6mTREuVZSA.cache +3 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p17lC0HAHCtk1ds_NHl9xhEyMtRjfQInw1c6fmFWguc.cache +0 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/p1cwnBd8RQBm9x5HzDmiiU7RhvnxhPX8VTfi0tTElJY.cache +3 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qT6_0ti_v6fAjS3wETXqvTkr6W0LP4PB942uLYQzWK8.cache +3 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/qzU7DVwQZ7z6i6pYUpssYsAj0y33GN83B4O1bLvkW_4.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/r56eI1z7iFKeySym_9zw5hVOPjb0d6IQPn5pAYTKk04.cache +2 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/rGWvoeLyiyqb813IXgfDpDxks23JQoLLZOa69bzKPE8.cache +1 -0
- data/vendor/gems/express_templates/test/dummy/tmp/cache/assets/test/sprockets/v3.0/y8T65xpx0s3RgT_YiqWEEXIaBsgK4woCNSuZ1zjQZBk.cache +2 -0
- data/vendor/gems/express_templates/test/expander_stack_test.rb +41 -0
- data/vendor/gems/express_templates/test/expander_test.rb +99 -0
- data/vendor/gems/express_templates/test/express_templates_test.rb +19 -0
- data/vendor/gems/express_templates/test/handler_test.rb +122 -0
- data/vendor/gems/express_templates/test/indenter_test.rb +27 -0
- data/vendor/gems/express_templates/test/interpolator_test.rb +80 -0
- data/vendor/gems/express_templates/test/markup/tag_test.rb +149 -0
- data/vendor/gems/express_templates/test/markup/wrapper_test.rb +42 -0
- data/vendor/gems/express_templates/test/markup/yielder_test.rb +9 -0
- data/vendor/gems/express_templates/test/performance_test.rb +93 -0
- data/vendor/gems/express_templates/test/test_helper.rb +28 -0
- data/vendor/gems/foundation_apps_styles/Gemfile +4 -0
- data/vendor/gems/foundation_apps_styles/LICENSE.txt +21 -0
- data/vendor/gems/foundation_apps_styles/README.md +41 -0
- data/vendor/gems/foundation_apps_styles/Rakefile +13 -0
- data/vendor/gems/foundation_apps_styles/bin/console +14 -0
- data/vendor/gems/foundation_apps_styles/bin/setup +7 -0
- data/vendor/gems/foundation_apps_styles/foundation_apps_styles.gemspec +24 -0
- data/vendor/gems/foundation_apps_styles/lib/foundation_apps_styles.rb +6 -0
- data/vendor/gems/foundation_apps_styles/lib/foundation_apps_styles/version.rb +3 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/account.svg +44 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/action.svg +38 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/ban.svg +17 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/bell.svg +22 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/bookmark.svg +14 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/cart.svg +35 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/chevron.svg +28 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/circle-check.svg +25 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/circle-x.svg +25 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/cog.svg +17 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/comment-square.svg +14 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/dashboard.svg +38 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/document.svg +28 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/envelope.svg +44 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/flag.svg +24 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/home.svg +28 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/lock.svg +55 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/magnifying-glass.svg +26 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/person.svg +62 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/reload.svg +19 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/share-boxed.svg +17 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/star.svg +14 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/thumb.svg +38 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/iconic/zoom.svg +56 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_global.scss +131 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_includes.scss +33 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/_settings.scss +614 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_accordion.scss +72 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_action-sheet.scss +265 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_block-list.scss +360 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_button-group.scss +197 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_button.scss +205 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_card.scss +93 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_extras.scss +54 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_forms.scss +460 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_grid.scss +422 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_iconic.scss +95 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_label.scss +134 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_list.scss +19 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_menu-bar.scss +382 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_modal.scss +129 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_motion.scss +525 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_notification.scss +207 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_off-canvas.scss +169 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_panel.scss +134 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_popup.scss +68 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_switch.scss +134 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_tabs.scss +100 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_title-bar.scss +135 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_typography.scss +345 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/components/_utilities.scss +160 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/foundation-apps.css +6146 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/foundation.scss +50 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_breakpoints.scss +154 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_functions.scss +343 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_images.scss +19 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/helpers/_mixins.scss +123 -0
- data/vendor/gems/foundation_apps_styles/vendor/assets/stylesheets/vendor/_normalize.scss +424 -0
- metadata +512 -36
- data/app/assets/stylesheets/express_admin/foundation_and_overrides.scss +0 -1443
- data/app/assets/stylesheets/express_admin/sections/_devise.sass +0 -42
- data/app/assets/stylesheets/express_admin/sections/_sidebar.sass +0 -42
- data/app/assets/stylesheets/express_admin/shared/_labels.sass +0 -16
- data/app/assets/stylesheets/express_admin/shared/_navigation.sass +0 -20
- data/lib/generators/express_admin/scaffold/templates/show.html.et.erb +0 -10
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class ExpressTemplatesTest < ActiveSupport::TestCase
|
4
|
+
test "we have a module" do
|
5
|
+
assert_kind_of Module, ExpressTemplates
|
6
|
+
end
|
7
|
+
|
8
|
+
test "ExpressTemplates.render renders a template" do
|
9
|
+
result = ExpressTemplates.render(self) do
|
10
|
+
ul {
|
11
|
+
li 'one'
|
12
|
+
li 'two'
|
13
|
+
li 'three'
|
14
|
+
}
|
15
|
+
end
|
16
|
+
assert_equal "<ul><li>one</li><li>two</li><li>three</li></ul>", result
|
17
|
+
end
|
18
|
+
|
19
|
+
end
|
@@ -0,0 +1,122 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class HandlerTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
GARAHandler = ExpressTemplates::Template::Handler.new
|
6
|
+
|
7
|
+
DEFAULT_DOCTYPE = "<!DOCTYPE html PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\" \"http://www.w3.org/TR/REC-html40/loose.dtd\">"
|
8
|
+
A_LINK = %Q(<a href="#">link</a>)
|
9
|
+
|
10
|
+
class LookupContext
|
11
|
+
def disable_cache
|
12
|
+
yield
|
13
|
+
end
|
14
|
+
|
15
|
+
def find_template(*args)
|
16
|
+
end
|
17
|
+
|
18
|
+
attr_accessor :formats
|
19
|
+
end
|
20
|
+
|
21
|
+
class Context
|
22
|
+
include ActionView::Context
|
23
|
+
include ActionView::Helpers::TagHelper
|
24
|
+
def initialize(*args)
|
25
|
+
@output_buffer = "original"
|
26
|
+
@virtual_path = nil
|
27
|
+
end
|
28
|
+
|
29
|
+
def lookup_context
|
30
|
+
@lookup_context ||= LookupContext.new
|
31
|
+
end
|
32
|
+
|
33
|
+
def concat(string)
|
34
|
+
@output_buffer << string
|
35
|
+
end
|
36
|
+
|
37
|
+
def capture(&block)
|
38
|
+
block.call
|
39
|
+
end
|
40
|
+
|
41
|
+
def link_helper
|
42
|
+
A_LINK
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
def new_template(body = " h1 'Hello' ", details = { format: :html })
|
47
|
+
ActionView::Template.new(body, "hello template", details.fetch(:handler) { GARAHandler }, {:virtual_path => "hello"}.merge!(details))
|
48
|
+
end
|
49
|
+
|
50
|
+
def render(locals = {})
|
51
|
+
output = @template.render(@context, locals)
|
52
|
+
output
|
53
|
+
end
|
54
|
+
|
55
|
+
def with_doctype(body, alt_doctype = nil)
|
56
|
+
"#{alt_doctype||DEFAULT_DOCTYPE}\n#{body}"
|
57
|
+
end
|
58
|
+
|
59
|
+
def setup
|
60
|
+
controller = Object.new
|
61
|
+
class << controller
|
62
|
+
def view_context_class ; Context ; end
|
63
|
+
end
|
64
|
+
@context = Context.new(nil, {}, controller)
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
test "our handler is registered" do
|
69
|
+
handler = ActionView::Template.registered_template_handler("et")
|
70
|
+
assert_equal ExpressTemplates::Template::Handler, handler
|
71
|
+
end
|
72
|
+
|
73
|
+
test "html generates <h1>Hello</h1> by default" do
|
74
|
+
@template = new_template
|
75
|
+
result = render
|
76
|
+
assert_equal "<h1>Hello</h1>", result
|
77
|
+
end
|
78
|
+
|
79
|
+
test "nesting elements with ruby block structure" do
|
80
|
+
@template = new_template("ul { li 'one' ; li 'two' ; li 'three' }")
|
81
|
+
assert_equal "<ul><li>one</li><li>two</li><li>three</li></ul>", render
|
82
|
+
end
|
83
|
+
|
84
|
+
test "class names" do
|
85
|
+
@template = new_template("p.whatever.another 'Lorum Ipsum' ")
|
86
|
+
assert_equal "<p class=\"whatever another\">Lorum Ipsum</p>", render
|
87
|
+
end
|
88
|
+
|
89
|
+
test "string in block works" do
|
90
|
+
@template = new_template "h1 { 'foo' } "
|
91
|
+
assert_equal "<h1>foo</h1>", render
|
92
|
+
end
|
93
|
+
|
94
|
+
# test "real document has doctype and newline" do
|
95
|
+
# @template = new_template("html { body { h1 \"hello\" } }")
|
96
|
+
# assert_equal with_doctype("<html xmlns=\"http://www.w3.org/1999/xhtml\">\n <body>\n <h1>hello</h1>\n </body>\n</html>\n"), render
|
97
|
+
# end
|
98
|
+
|
99
|
+
|
100
|
+
test "other attributes" do
|
101
|
+
@template = new_template("p('Lorum Ipsum', style: 'align: right;')")
|
102
|
+
assert_equal "<p style=\"align: right;\">Lorum Ipsum</p>", render
|
103
|
+
end
|
104
|
+
|
105
|
+
test "locals work" do
|
106
|
+
@template = new_template "h1 { my_title }"
|
107
|
+
@template.locals = [:my_title]
|
108
|
+
assert_equal "<h1>Foo</h1>", render(my_title: 'Foo')
|
109
|
+
end
|
110
|
+
|
111
|
+
test "helpers returning html when alone in a block" do
|
112
|
+
@template = new_template("li { link_helper } ")
|
113
|
+
assert_equal "<li>#{A_LINK}</li>", render
|
114
|
+
end
|
115
|
+
|
116
|
+
test "helpers returning html work in sequence within a block" do
|
117
|
+
@template = new_template("li { link_helper ; link_helper } ")
|
118
|
+
assert_equal "<li>#{A_LINK}#{A_LINK}</li>", render
|
119
|
+
end
|
120
|
+
|
121
|
+
|
122
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class IndenterTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
Indenter = ExpressTemplates::Indenter
|
6
|
+
|
7
|
+
test ".for(:name) takes a block receiving whitespace" do
|
8
|
+
Indenter.for(:foo) do
|
9
|
+
assert_equal "\n ", Indenter.for(:foo) { |indent, indent_with_newline| indent_with_newline }
|
10
|
+
assert_equal " ", Indenter.for(:foo) { |indent, indent_with_newline| indent }
|
11
|
+
end
|
12
|
+
end
|
13
|
+
|
14
|
+
test "nesting blocks increases whitespace accordingly" do
|
15
|
+
nested_whitespace = Indenter.for(:foo) do |ws1|
|
16
|
+
Indenter.for(:foo) do |ws2|
|
17
|
+
ws2
|
18
|
+
end
|
19
|
+
end
|
20
|
+
assert_equal " ", nested_whitespace
|
21
|
+
end
|
22
|
+
|
23
|
+
test ".for(:name) returns current indent without newline when block is not given" do
|
24
|
+
assert_equal "", Indenter.for(:foo) { |_| Indenter.for(:foo) }
|
25
|
+
end
|
26
|
+
|
27
|
+
end
|
@@ -0,0 +1,80 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
require 'express_templates/interpolator'
|
3
|
+
require 'parslet/convenience'
|
4
|
+
|
5
|
+
class InterpolatorTest < ActiveSupport::TestCase
|
6
|
+
|
7
|
+
def parse(s)
|
8
|
+
parser = ExpressTemplates::Interpolator.new
|
9
|
+
parsed = parser.parse_with_debug(s)
|
10
|
+
pp parsed if ENV['DEBUG'].eql?('true')
|
11
|
+
parsed
|
12
|
+
end
|
13
|
+
|
14
|
+
def transform(s)
|
15
|
+
trans = ExpressTemplates::Transformer.new
|
16
|
+
trans.apply(parse(s)).flatten.join
|
17
|
+
end
|
18
|
+
|
19
|
+
test "simplest expression parses" do
|
20
|
+
tree = parse("{{something}}")
|
21
|
+
expected = [{:interpolation=>{:expression=>[{:text=>"something"}]}}]
|
22
|
+
assert_equal expected, tree
|
23
|
+
end
|
24
|
+
|
25
|
+
test "simple expression with surrounding text parses" do
|
26
|
+
tree = parse('whatever {{something}} something else')
|
27
|
+
expected = [{:text=>"whatever "},
|
28
|
+
{:interpolation=>{:expression=>[{:text=>"something"}]}},
|
29
|
+
{:text=>" something else"}]
|
30
|
+
assert_equal expected, tree
|
31
|
+
end
|
32
|
+
|
33
|
+
test "nested without outer text parses" do
|
34
|
+
tree = parse('{{some {{thing}} foo}}')
|
35
|
+
expected = [{:interpolation=>
|
36
|
+
{:expression=>
|
37
|
+
[{:text=>"some "},
|
38
|
+
{:interpolation=>{:expression=>[{:text=>"thing"}]}},
|
39
|
+
{:text=>" foo"}]}}]
|
40
|
+
assert_equal expected, tree
|
41
|
+
end
|
42
|
+
|
43
|
+
test "nested with outer text parses" do
|
44
|
+
tree = parse('a lot of {{something {{good}}}}')
|
45
|
+
expected = [{:text=>"a lot of "},
|
46
|
+
{:interpolation=>
|
47
|
+
{:expression=>
|
48
|
+
[{:text=>"something "},
|
49
|
+
{:interpolation=>{:expression=>[{:text=>"good"}]}}]}}]
|
50
|
+
assert_equal expected, tree
|
51
|
+
end
|
52
|
+
|
53
|
+
test 'nested with multiple nested expressions parses' do
|
54
|
+
tree = parse(%q(%Q({{foo("{{xyz}}", "{{zyx}}", bar: "baz")}})))
|
55
|
+
expected = [{:text=>"%Q("},
|
56
|
+
{:interpolation=>
|
57
|
+
{:expression=>
|
58
|
+
[{:text=>"foo(\""},
|
59
|
+
{:interpolation=>{:expression=>[{:text=>"xyz"}]}},
|
60
|
+
{:text=>"\", \""},
|
61
|
+
{:interpolation=>{:expression=>[{:text=>"zyx"}]}},
|
62
|
+
{:text=>"\", bar: \"baz\")"}]}},
|
63
|
+
{:text=>")"}]
|
64
|
+
assert_equal expected, tree
|
65
|
+
end
|
66
|
+
|
67
|
+
|
68
|
+
test '"{{something}}" transforms to "#{something}"' do
|
69
|
+
assert_equal '#{something}', transform("{{something}}")
|
70
|
+
end
|
71
|
+
|
72
|
+
test '"{{some {{thing}} foo}}" transforms to "#{some #{thing} foo}"' do
|
73
|
+
assert_equal '#{some #{thing} foo}', transform("{{some {{thing}} foo}}")
|
74
|
+
end
|
75
|
+
|
76
|
+
test %('a lot of {{something "{{good}}"}}' transforms) do
|
77
|
+
assert_equal 'a lot of #{something "#{good}"}', transform('a lot of {{something "{{good}}"}}')
|
78
|
+
end
|
79
|
+
|
80
|
+
end
|
@@ -0,0 +1,149 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class TagTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
class Bare < ExpressTemplates::Markup::Tag ; end
|
6
|
+
class Sub < ExpressTemplates::Markup::Tag ; end
|
7
|
+
|
8
|
+
def bare_tag(*args)
|
9
|
+
Bare.new(*args)
|
10
|
+
end
|
11
|
+
|
12
|
+
def sub_tag(*args)
|
13
|
+
Sub.new(*args)
|
14
|
+
end
|
15
|
+
|
16
|
+
|
17
|
+
# NOTE: Due to formatting html leading newlines may be
|
18
|
+
# required for test values. These are stripped for the
|
19
|
+
# first tag during ExpressTemplates.compile
|
20
|
+
|
21
|
+
test "#macro_name returns the name of the class" do
|
22
|
+
assert_equal 'bare', bare_tag.macro_name
|
23
|
+
end
|
24
|
+
|
25
|
+
test "#compile returns a string" do
|
26
|
+
assert_kind_of String, bare_tag.compile
|
27
|
+
end
|
28
|
+
|
29
|
+
test "has no children" do
|
30
|
+
assert_empty bare_tag.children
|
31
|
+
end
|
32
|
+
|
33
|
+
def bare_with_2_children
|
34
|
+
tag = bare_tag "child1", "child2"
|
35
|
+
end
|
36
|
+
|
37
|
+
test "can be created with children" do
|
38
|
+
assert_equal 2, bare_with_2_children.children.size
|
39
|
+
assert_equal "child2", bare_with_2_children.children.last
|
40
|
+
end
|
41
|
+
|
42
|
+
test "#compile on bare_with_2_children yields '\"<bare>\"+\"child1\"+\"child2\"+\"</bare>\"'" do
|
43
|
+
assert_equal '"<bare>"+"child1"+"child2"+"</bare>"', bare_with_2_children.compile
|
44
|
+
end
|
45
|
+
|
46
|
+
test "#start_tag is my macro_name as an xml start tag" do
|
47
|
+
assert_equal "<#{bare_tag.macro_name}>", bare_tag.start_tag
|
48
|
+
end
|
49
|
+
|
50
|
+
test "#close_tag is my macro_name as an xml close tag" do
|
51
|
+
assert_equal "</#{bare_tag.macro_name}>", bare_tag.close_tag
|
52
|
+
end
|
53
|
+
|
54
|
+
def tag_with_subtag
|
55
|
+
bare_tag sub_tag
|
56
|
+
end
|
57
|
+
|
58
|
+
test "#compile on tag_with_subtag returns a string which when eval'd looks like '<bare><sub /></bare>'" do
|
59
|
+
assert_equal '<bare><sub /></bare>', eval(tag_with_subtag.compile)
|
60
|
+
end
|
61
|
+
|
62
|
+
test "#to_template on bare_tag returns 'bare'" do
|
63
|
+
assert_equal 'bare', bare_tag.to_template
|
64
|
+
end
|
65
|
+
|
66
|
+
test "#to_template on tag_with_subtag returns 'bare {\n sub\n}\n'" do
|
67
|
+
assert_equal "bare {\n sub\n}\n", tag_with_subtag.to_template
|
68
|
+
end
|
69
|
+
|
70
|
+
test "#to_template on nested tags indents properly'" do
|
71
|
+
expected = %Q(bare {
|
72
|
+
sub {
|
73
|
+
sub
|
74
|
+
}
|
75
|
+
}
|
76
|
+
)
|
77
|
+
assert_equal expected, Bare.new(Sub.new(Sub.new)).to_template
|
78
|
+
end
|
79
|
+
|
80
|
+
test "double bracketed option values are substituted for evaluation in context" do
|
81
|
+
assert_equal '"<bare should_eval_in_context=\"#{foo}\" />"',
|
82
|
+
Interpolator.transform(bare_tag(should_eval_in_context: "{{foo}}").compile)
|
83
|
+
end
|
84
|
+
|
85
|
+
test "double bracketed child values are substituted for evaluation in context" do
|
86
|
+
assert_equal '"<bare>"+"#{foo}"+"</bare>"',
|
87
|
+
Interpolator.transform(bare_tag("{{foo}}").compile)
|
88
|
+
end
|
89
|
+
|
90
|
+
test "data option value hashes are converted to data attributes similar to haml" do
|
91
|
+
assert_equal %("<bare data-one=\\"two\\" data-three=\\"four\\" />"),
|
92
|
+
bare_tag(data: {one: 'two', three: 'four'}).compile
|
93
|
+
end
|
94
|
+
|
95
|
+
test "data option value hashes can take immediate values" do
|
96
|
+
assert_equal %("<bare data-foo=\\"true\\" data-bar=\\"42\\" data-baz=\\"blah\\" />"),
|
97
|
+
bare_tag(data: {foo: true, bar: 42, baz: 'blah'}).compile
|
98
|
+
end
|
99
|
+
|
100
|
+
|
101
|
+
# todo?
|
102
|
+
# test "proc option values are evaluated in context"
|
103
|
+
|
104
|
+
test "empty tags use abbreviated empty tag form" do
|
105
|
+
assert_equal '"<bare />"', bare_tag.compile
|
106
|
+
end
|
107
|
+
|
108
|
+
test "empty i tag does does not use abbreviated form since it is used for icons" do
|
109
|
+
assert_equal '"<i>"+"</i>"', ExpressTemplates::Markup::I.new.compile
|
110
|
+
end
|
111
|
+
|
112
|
+
test "method missing returns self" do
|
113
|
+
tag = bare_tag
|
114
|
+
assert_equal tag, tag.foo
|
115
|
+
end
|
116
|
+
|
117
|
+
# the block form of this is tested in expander
|
118
|
+
test "children still evaluated after css class provided via method syntax" do
|
119
|
+
assert_equal '"<bare class=\"foo\">"+"<sub />"+"</bare>"', (bare_tag.foo(sub_tag)).compile
|
120
|
+
end
|
121
|
+
|
122
|
+
test "CSS classes specified with underscored method get translated to dashed" do
|
123
|
+
assert_equal '"<bare class=\"foo-bar\" />"', bare_tag._foo_bar.compile
|
124
|
+
end
|
125
|
+
|
126
|
+
test "dom ID may be passed as a symbol" do
|
127
|
+
assert_equal '"<bare id=\"foo\" />"', bare_tag(:foo).compile
|
128
|
+
end
|
129
|
+
|
130
|
+
test "proc option values are evaluated in context" do
|
131
|
+
assert_equal '"<bare id=\"#{(-> { awesome }).call}\" />"', bare_tag(id: -> { awesome }).compile
|
132
|
+
end
|
133
|
+
|
134
|
+
test "markup is indented" do
|
135
|
+
ExpressTemplates::Markup::Tag.formatted do
|
136
|
+
code = ExpressTemplates.compile &-> {ul { li { "*"*36 }}}
|
137
|
+
assert_equal "\n<ul>\n <li>#{"*"*36}</li>\n</ul>\n", eval(code)
|
138
|
+
end
|
139
|
+
end
|
140
|
+
|
141
|
+
test "print doctype for HTML5 document version" do
|
142
|
+
assert_equal '"<!DOCTYPE html>"', ExpressTemplates::Markup::Doctype.new.compile
|
143
|
+
end
|
144
|
+
|
145
|
+
test "void tags do not have trailing slash" do
|
146
|
+
assert_equal '"<img>"', ExpressTemplates::Markup::Img.new.compile
|
147
|
+
end
|
148
|
+
|
149
|
+
end
|
@@ -0,0 +1,42 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
class WrapperTest < ActiveSupport::TestCase
|
4
|
+
|
5
|
+
Wrapper = ExpressTemplates::Markup::Wrapper
|
6
|
+
|
7
|
+
test "name compiles to just name" do
|
8
|
+
assert_equal '%Q(#{foo})', Interpolator.transform(Wrapper.new('foo').compile)
|
9
|
+
end
|
10
|
+
|
11
|
+
test "simple args are preserved" do
|
12
|
+
wrapper = Wrapper.new('foo', "xyzzy", 'bar', "baz", 1, false, 3)
|
13
|
+
assert_equal '%Q(#{foo("xyzzy", "bar", "baz", 1, false, 3)})', Interpolator.transform(wrapper.compile)
|
14
|
+
end
|
15
|
+
|
16
|
+
test "args are preserved" do
|
17
|
+
wrapper = Wrapper.new('foo', "xyzzy", bar: "baz")
|
18
|
+
assert_equal '%Q(#{foo("xyzzy", bar: "baz")})', Interpolator.transform(wrapper.compile)
|
19
|
+
end
|
20
|
+
|
21
|
+
test "something returning nil when wrapped and compiled, evals to an empty string" do
|
22
|
+
assert_equal '', eval(Interpolator.transform(Wrapper.new('nil').compile))
|
23
|
+
end
|
24
|
+
|
25
|
+
test "double-braced args are evaluated in context" do
|
26
|
+
wrapper = Wrapper.new('foo', "{{xyz}}", "{{zyx}}", bar: "baz")
|
27
|
+
assert_equal '%Q(#{foo(xyz, zyx, bar: "baz")})', Interpolator.transform(wrapper.compile)
|
28
|
+
end
|
29
|
+
|
30
|
+
test "initializer block is preserved in compile" do
|
31
|
+
wrapper = Wrapper.new('foo') { whatever }
|
32
|
+
assert_equal '%Q(#{foo { whatever }})', Interpolator.transform(wrapper.compile)
|
33
|
+
wrapper = Wrapper.new('foo', 'bar') { whatever }
|
34
|
+
assert_equal '%Q(#{foo("bar") { whatever }})', Interpolator.transform(wrapper.compile)
|
35
|
+
end
|
36
|
+
|
37
|
+
test "lambda option values are evaluated in context" do
|
38
|
+
wrapper = Wrapper.new('foo', bar: -> { something })
|
39
|
+
assert_equal '%Q(#{foo(bar: (-> { something }).call)})', Interpolator.transform(wrapper.compile)
|
40
|
+
end
|
41
|
+
|
42
|
+
end
|