ratchet_design 0.1.19 → 0.1.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (102) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/ratchet/_esvg.js +72 -0
  3. data/app/assets/javascripts/ratchet/_icons.js +19 -0
  4. data/app/assets/javascripts/ratchet/_topology.js +19 -0
  5. data/app/assets/javascripts/ratchet/base/form.js +4 -4
  6. data/app/assets/javascripts/ratchet/core.js +15 -8
  7. data/app/assets/javascripts/ratchet/enhancement/{_collapse.js → collapse.js} +3 -3
  8. data/app/assets/javascripts/ratchet/enhancement/lightbox.js +52 -118
  9. data/app/assets/javascripts/ratchet/enhancement/modal.js +185 -0
  10. data/app/assets/javascripts/ratchet/enhancement/smooth-scroll.js +21 -0
  11. data/app/assets/javascripts/ratchet/utility/once.js +42 -0
  12. data/app/assets/stylesheets/ratchet/_colors.yml +54 -0
  13. data/app/assets/stylesheets/ratchet/_core.scss +8 -1
  14. data/app/assets/stylesheets/ratchet/base/_button.scss +22 -31
  15. data/app/assets/stylesheets/ratchet/base/_document.scss +66 -53
  16. data/app/assets/stylesheets/ratchet/base/_form.scss +0 -1
  17. data/app/assets/stylesheets/ratchet/base/_list.scss +6 -15
  18. data/app/assets/stylesheets/ratchet/base/_media.scss +22 -6
  19. data/app/assets/stylesheets/ratchet/base/_section.scss +8 -257
  20. data/app/assets/stylesheets/ratchet/base/_slider.scss +388 -0
  21. data/app/assets/stylesheets/ratchet/base/_table.scss +1 -2
  22. data/app/assets/stylesheets/ratchet/base/_text.scss +13 -29
  23. data/app/assets/stylesheets/ratchet/enhancement/_deployments.scss +26 -0
  24. data/app/assets/stylesheets/ratchet/enhancement/_hero.scss +1 -1
  25. data/app/assets/stylesheets/ratchet/enhancement/_lightbox.scss +35 -76
  26. data/app/assets/stylesheets/ratchet/enhancement/_modal.scss +125 -0
  27. data/app/assets/stylesheets/ratchet/utility/_animations.scss +8 -0
  28. data/app/assets/stylesheets/ratchet/utility/_color.scss +25 -105
  29. data/app/assets/stylesheets/ratchet/utility/_global.scss +30 -24
  30. data/app/assets/stylesheets/ratchet/utility/_grid.scss +152 -15
  31. data/app/assets/svgs/ratchet/_icons/backup.svg +9 -0
  32. data/app/assets/svgs/ratchet/_icons/block.svg +7 -0
  33. data/app/assets/svgs/ratchet/_icons/compose-logomark.svg +8 -0
  34. data/app/assets/svgs/ratchet/_icons/connecting-in.svg +46 -0
  35. data/app/assets/svgs/ratchet/_icons/connecting-out.svg +33 -0
  36. data/app/assets/svgs/ratchet/_icons/customer-buffer.svg +28 -0
  37. data/app/assets/svgs/ratchet/_icons/customer-citrix.svg +12 -0
  38. data/app/assets/svgs/ratchet/_icons/customer-guardian.svg +31 -0
  39. data/app/assets/svgs/ratchet/_icons/customer-roximity.svg +16 -0
  40. data/app/assets/svgs/ratchet/_icons/customer-upworthy.svg +13 -0
  41. data/app/assets/svgs/ratchet/_icons/db-money.svg +31 -0
  42. data/app/assets/svgs/ratchet/_icons/deployment.svg +1 -0
  43. data/app/assets/svgs/ratchet/{facebook.svg → _icons/facebook.svg} +0 -0
  44. data/app/assets/svgs/ratchet/_icons/gear.svg +12 -0
  45. data/app/assets/svgs/ratchet/{github.svg → _icons/github.svg} +0 -0
  46. data/app/assets/svgs/ratchet/{google-plus.svg → _icons/google-plus.svg} +0 -0
  47. data/app/assets/svgs/ratchet/{ibm.svg → _icons/ibm.svg} +0 -0
  48. data/app/assets/svgs/ratchet/{inbox.svg → _icons/inbox.svg} +0 -0
  49. data/app/assets/svgs/ratchet/_icons/index.svg +3 -0
  50. data/app/assets/svgs/ratchet/_icons/keylock.svg +8 -0
  51. data/app/assets/svgs/ratchet/_icons/life-preserver.svg +17 -0
  52. data/app/assets/svgs/ratchet/{linkedin.svg → _icons/linkedin.svg} +0 -0
  53. data/app/assets/svgs/ratchet/_icons/metrics.svg +7 -0
  54. data/app/assets/svgs/ratchet/_icons/money-stack.svg +60 -0
  55. data/app/assets/svgs/ratchet/_icons/notepad.svg +12 -0
  56. data/app/assets/svgs/ratchet/_icons/notepad2.svg +14 -0
  57. data/app/assets/svgs/ratchet/_icons/one-click.svg +6 -0
  58. data/app/assets/svgs/ratchet/{ratchet.svg → _icons/ratchet.svg} +0 -0
  59. data/app/assets/svgs/ratchet/_icons/reliability.svg +12 -0
  60. data/app/assets/svgs/ratchet/_icons/safe.svg +26 -0
  61. data/app/assets/svgs/ratchet/_icons/scaling.svg +16 -0
  62. data/app/assets/svgs/ratchet/{search.svg → _icons/search.svg} +0 -0
  63. data/app/assets/svgs/ratchet/{subscribe.svg → _icons/subscribe.svg} +0 -0
  64. data/app/assets/svgs/ratchet/{twitter.svg → _icons/twitter.svg} +0 -0
  65. data/app/assets/svgs/ratchet/{y-combinator.svg → _icons/y-combinator.svg} +0 -0
  66. data/app/assets/svgs/ratchet/_icons/youtube.svg +3 -0
  67. data/app/assets/svgs/ratchet/_topology/arbiter.svg +1 -0
  68. data/app/assets/svgs/ratchet/_topology/backup.svg +1 -0
  69. data/app/assets/svgs/ratchet/_topology/config.svg +1 -0
  70. data/app/assets/svgs/ratchet/_topology/haproxy-2.svg +1 -0
  71. data/app/assets/svgs/ratchet/_topology/haproxy-storage.svg +1 -0
  72. data/app/assets/svgs/ratchet/_topology/haproxy.svg +1 -0
  73. data/app/assets/svgs/ratchet/_topology/memory.svg +1 -0
  74. data/app/assets/svgs/ratchet/_topology/portal-2.svg +1 -0
  75. data/app/assets/svgs/ratchet/_topology/portal.svg +1 -0
  76. data/app/assets/svgs/ratchet/_topology/sentinel-memory.svg +1 -0
  77. data/app/assets/svgs/ratchet/_topology/sentinel.svg +1 -0
  78. data/app/assets/svgs/ratchet/_topology/storage.svg +1 -0
  79. data/app/helpers/ratchet/application_helper.rb +10 -2
  80. data/app/helpers/ratchet/form_helper.rb +84 -1
  81. data/app/helpers/ratchet/icon_helper.rb +113 -0
  82. data/app/helpers/ratchet/pricing_helper.rb +133 -0
  83. data/app/helpers/ratchet/toggle_nav_helper.rb +101 -0
  84. data/app/views/layouts/ratchet/default.html.slim +3 -3
  85. data/app/views/shared/ratchet/_defs.html.slim +30 -88
  86. data/app/views/shared/ratchet/_fonts.html.slim +88 -0
  87. data/app/views/shared/ratchet/_footer.html.slim +1 -1
  88. data/app/views/shared/ratchet/_header.html.slim +5 -5
  89. data/app/views/shared/ratchet/_icons.html.slim +190 -5
  90. data/lib/ratchet_design/config_data.rb +29 -0
  91. data/lib/ratchet_design/version.rb +1 -1
  92. data/lib/ratchet_design.rb +27 -10
  93. data/public/core-0.1.20.js +22627 -0
  94. data/public/{fonts-woff-0.1.19.css → fonts-woff-0.1.20.css} +0 -0
  95. data/public/{fonts-woff2-0.1.19.css → fonts-woff2-0.1.20.css} +0 -0
  96. metadata +84 -22
  97. data/app/assets/javascripts/ratchet/_svg.js +0 -55
  98. data/public/core-0.1.19.js +0 -138
  99. data/public/core-0.1.19.js.gz +0 -0
  100. data/public/core-0.1.19.map.json +0 -1
  101. data/public/fonts-woff-0.1.19.css.gz +0 -0
  102. data/public/fonts-woff2-0.1.19.css.gz +0 -0
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 265 169" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="proxy.-2"><g><path d="M132.501,0.245l-59.756,34.5l66.251,38.25l59.756,-34.5l-66.251,-38.25Z" style="fill:url(#_Linear1);"/><path d="M198.752,38.495l-59.756,34.5l-66.251,-38.25l59.756,-34.5l66.251,38.25Zm-125.007,-3.75l65.251,37.672l58.756,-33.922l-65.251,-37.673l-58.756,33.923Z" style="fill:#4d7594;"/><path d="M198.752,53.495l-59.756,34.5l-66.251,-38.25l0,-15l66.251,38.25l59.756,-34.5l0,15Z" style="fill:url(#_Linear2);"/><g><g><path d="M133.996,77.031l-40.622,-23.454l0,1.155l40.622,23.453l0,-1.154Z" style="fill:#3d6484;"/><path d="M79.301,44.009c0.836,0.483 1.516,1.78 1.516,2.896c0,1.115 -0.68,1.628 -1.516,1.145c-0.836,-0.483 -1.516,-1.78 -1.516,-2.895c0,-1.116 0.68,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M84.497,47.009c0.837,0.483 1.516,1.78 1.516,2.896c0,1.115 -0.679,1.628 -1.516,1.145c-0.836,-0.483 -1.515,-1.78 -1.515,-2.895c0,-1.116 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/><path d="M89.693,50.009c0.837,0.483 1.516,1.78 1.516,2.896c0,1.115 -0.679,1.628 -1.516,1.145c-0.836,-0.483 -1.515,-1.78 -1.515,-2.895c0,-1.116 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/></g></g></g><g><path d="M198.753,38.495l-59.756,34.5l66.251,38.25l59.756,-34.5l-66.251,-38.25Z" style="fill:url(#_Linear3);"/><path d="M265.004,76.745l-59.756,34.5l-66.251,-38.25l59.756,-34.5l66.251,38.25Zm-125.007,-3.75l65.251,37.672l58.756,-33.922l-65.251,-37.673l-58.756,33.923Z" style="fill:#2cc7ff;"/><path d="M265.004,91.745l-59.756,34.5l-66.251,-38.25l0,-15l66.251,38.25l59.756,-34.5l0,15Z" style="fill:url(#_Linear4);"/><g><g><path d="M195.093,112.304l-45.844,-26.467l0,1.154l45.844,26.468l0,-1.155Z" style="fill:#0b82a0;"/><path d="M145.553,82.259c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M198.789,112.995c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.628 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/></g></g></g><g><path d="M59.756,42.244l-59.756,34.5l66.251,38.25l59.756,-34.5l-66.251,-38.25Z" style="fill:url(#_Linear5);"/><path d="M126.007,80.494l-59.756,34.5l-66.251,-38.25l59.756,-34.5l66.251,38.25Zm-125.007,-3.75l65.251,37.673l58.756,-33.923l-65.251,-37.672l-58.756,33.922Z" style="fill:#4d7594;"/><path d="M126.007,95.494l-59.756,34.5l-66.251,-38.25l0,-15l66.251,38.25l59.756,-34.5l0,15Z" style="fill:url(#_Linear6);"/><g><g><path d="M61.251,119.03l-40.623,-23.453l0,1.154l40.623,23.454l0,-1.155Z" style="fill:#3d6484;"/><path d="M6.556,86.008c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M11.752,89.008c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M16.948,92.008c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/></g></g></g><g><path d="M126.007,80.494l-59.755,34.5l66.251,38.25l59.755,-34.5l-66.251,-38.25Z" style="fill:url(#_Linear7);"/><path d="M192.258,118.744l-59.755,34.5l-66.251,-38.25l59.755,-34.5l66.251,38.25Zm-125.006,-3.75l65.251,37.673l58.755,-33.923l-65.251,-37.672l-58.755,33.922Z" style="fill:#2cc7ff;"/><path d="M192.258,133.745l-59.755,34.5l-66.251,-38.25l0,-15l66.251,38.25l59.755,-34.5l0,15Z" style="fill:url(#_Linear8);"/><g><g><path d="M122.347,154.304l-45.844,-26.468l0,1.155l45.844,26.468l0,-1.155Z" style="fill:#0b82a0;"/><path d="M72.807,124.259c0.837,0.483 1.516,1.78 1.516,2.896c0,1.115 -0.679,1.628 -1.516,1.145c-0.836,-0.483 -1.515,-1.78 -1.515,-2.895c0,-1.116 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/><path d="M126.043,154.995c0.837,0.483 1.516,1.78 1.516,2.895c0,1.116 -0.679,1.629 -1.516,1.146c-0.836,-0.483 -1.515,-1.78 -1.515,-2.896c0,-1.115 0.679,-1.628 1.515,-1.145Z" style="fill:#00fc72;"/></g></g></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(59.7558,-34.5,41.9992,64.0854,138.996,72.9947)"><stop offset="0" style="stop-color:#335774;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#243e57;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.501,-75.5768,75.5768,132.501,205.248,126.245)"><stop offset="0" style="stop-color:#253d54;stop-opacity:0.980392"/><stop offset="1" style="stop-color:#35516a;stop-opacity:0.980392"/></linearGradient><linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(59.7559,-34.4997,118.499,108.253,205.248,111.245)"><stop offset="0" style="stop-color:#00ceee;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#0a789a;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.496,-76.7757,76.0798,133.707,205.254,126.245)"><stop offset="0" style="stop-color:#00a3c8;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#00b6c3;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear5" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(59.7558,-34.5,41.9992,64.0854,66.2509,114.994)"><stop offset="0" style="stop-color:#335774;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#243e57;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear6" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.501,-75.5768,75.5768,132.501,132.503,168.245)"><stop offset="0" style="stop-color:#253d54;stop-opacity:0.980392"/><stop offset="1" style="stop-color:#35516a;stop-opacity:0.980392"/></linearGradient><linearGradient id="_Linear7" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(59.7559,-34.4997,118.499,108.253,132.503,153.244)"><stop offset="0" style="stop-color:#00ceee;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#0a789a;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear8" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.496,-76.7757,76.0798,133.707,132.508,168.245)"><stop offset="0" style="stop-color:#00a3c8;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#00b6c3;stop-opacity:0.94902"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 265 168" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="portal"><g><path d="M132.501,0l-132.501,76.5l66.251,38.25l132.501,-76.5l-66.251,-38.25Z" style="fill:url(#_Linear1);"/><path d="M198.752,38.25l-132.501,76.5l-66.251,-38.25l132.501,-76.5l66.251,38.25Zm-197.752,38.25l65.251,37.672l131.501,-75.922l-65.251,-37.673l-131.501,75.923Z" style="fill:#4d7594;"/><path d="M198.752,53.25l-132.501,76.5l-66.251,-38.25l0,-15l66.251,38.25l132.501,-76.5l0,15Z" style="fill:url(#_Linear2);"/><g><g><path d="M61.251,118.785l-40.623,-23.453l0,1.155l40.623,23.453l0,-1.155Z" style="fill:#3d6484;"/><path d="M6.556,85.764c0.836,0.483 1.515,1.78 1.515,2.895c0,1.116 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.78 -1.516,-2.896c0,-1.115 0.679,-1.628 1.516,-1.145Z" style="fill:#00fc72;"/><path d="M11.752,88.764c0.836,0.483 1.515,1.78 1.515,2.895c0,1.116 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.78 -1.516,-2.896c0,-1.115 0.679,-1.628 1.516,-1.145Z" style="fill:#00fc72;"/><path d="M16.948,91.764c0.836,0.483 1.515,1.78 1.515,2.895c0,1.116 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.78 -1.516,-2.896c0,-1.115 0.679,-1.628 1.516,-1.145Z" style="fill:#00fc72;"/></g></g></g><g><path d="M198.753,38.25l-132.501,76.5l66.251,38.25l132.501,-76.5l-66.251,-38.25Z" style="fill:url(#_Linear3);"/><path d="M265.004,76.5l-132.501,76.5l-66.251,-38.25l132.501,-76.5l66.251,38.25Zm-197.752,38.25l65.251,37.672l131.501,-75.922l-65.251,-37.673l-131.501,75.923Z" style="fill:#2cc7ff;"/><path d="M265.004,91.5l-132.501,76.5l-66.251,-38.25l0,-15l66.251,38.25l132.501,-76.5l0,15Z" style="fill:url(#_Linear4);"/><g><g><path d="M122.347,154.059l-45.844,-26.468l0,1.155l45.844,26.468l0,-1.155Z" style="fill:#0b82a0;"/><path d="M72.807,124.014c0.837,0.483 1.516,1.781 1.516,2.896c0,1.115 -0.679,1.628 -1.516,1.146c-0.836,-0.483 -1.515,-1.781 -1.515,-2.896c0,-1.115 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/><path d="M126.043,154.75c0.837,0.483 1.516,1.78 1.516,2.896c0,1.115 -0.679,1.628 -1.516,1.145c-0.836,-0.483 -1.515,-1.78 -1.515,-2.895c0,-1.116 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/></g></g></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.501,-76.4996,-0.000400432,88.3339,66.2509,114.75)"><stop offset="0" style="stop-color:#335774;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#243e57;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.501,-75.5768,75.5768,132.501,132.503,168)"><stop offset="0" style="stop-color:#253d54;stop-opacity:0.980392"/><stop offset="1" style="stop-color:#35516a;stop-opacity:0.980392"/></linearGradient><linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.501,-76.4992,76.4992,132.501,132.503,153)"><stop offset="0" style="stop-color:#00ceee;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#0a789a;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.496,-76.7757,76.0798,133.707,132.508,168)"><stop offset="0" style="stop-color:#00a3c8;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#00b6c3;stop-opacity:0.94902"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 265 183" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="sentinel.-memory"><g><path d="M132.501,0l-132.501,76.5l44.167,25.5l132.501,-76.5l-44.167,-25.5Z" style="fill:url(#_Linear1);"/><path d="M176.668,25.5l-132.501,76.5l-44.167,-25.5l132.501,-76.5l44.167,25.5Zm-175.668,51l43.167,24.922l131.501,-75.922l-43.167,-24.923l-131.501,75.923Z" style="fill:#b067ff;"/><path d="M176.668,55.5l-132.501,76.5l-44.167,-25.5l0,-30l44.167,25.5l132.501,-76.5l0,30Z" style="fill:url(#_Linear2);"/><g><path d="M20.95,95.753c0.275,0.166 0.548,0.351 0.82,0.563c0.549,0.43 1.086,0.957 1.59,1.561c1.137,1.365 2.09,3.112 2.689,4.928c0.275,0.834 0.475,1.679 0.591,2.5c0.13,0.921 0.154,1.811 0.072,2.621c-0.076,0.757 -0.246,1.442 -0.503,2.026c-0.3,0.683 -0.717,1.224 -1.224,1.592c-0.525,0.38 -1.145,0.574 -1.821,0.565c-0.699,-0.009 -1.455,-0.236 -2.214,-0.662c-0.762,-0.427 -1.524,-1.051 -2.233,-1.833c-0.684,-0.754 -1.314,-1.65 -1.852,-2.628c-0.518,-0.943 -0.949,-1.96 -1.265,-2.988c-0.269,-0.876 -0.453,-1.758 -0.544,-2.606c-0.094,-0.877 -0.091,-1.718 0.012,-2.48c0.09,-0.678 0.26,-1.292 0.501,-1.82c0.566,-1.238 1.523,-1.977 2.69,-2.077c0.496,-0.042 1.028,0.03 1.574,0.215c0.269,0.091 0.54,0.211 0.813,0.353c0.102,0.054 0.203,0.111 0.304,0.17Zm-0.124,2.931c-0.514,-0.284 -1.019,-0.428 -1.486,-0.407c-0.411,0.019 -0.784,0.163 -1.097,0.42c-0.293,0.24 -0.531,0.58 -0.701,0.999c-0.144,0.354 -0.238,0.766 -0.278,1.217c-0.048,0.524 -0.025,1.099 0.069,1.694c0.066,0.422 0.168,0.853 0.303,1.281c0.388,1.234 1.042,2.424 1.826,3.319c0.431,0.492 0.897,0.889 1.364,1.167c0.471,0.279 0.941,0.438 1.379,0.461c0.408,0.021 0.786,-0.076 1.111,-0.282c0.324,-0.207 0.595,-0.521 0.796,-0.926c0.162,-0.328 0.277,-0.715 0.339,-1.145c0.073,-0.505 0.076,-1.069 0.008,-1.657c-0.061,-0.522 -0.178,-1.064 -0.347,-1.601c-0.348,-1.104 -0.909,-2.176 -1.587,-3.031c-0.455,-0.574 -0.953,-1.034 -1.463,-1.367c-0.079,-0.05 -0.157,-0.097 -0.236,-0.142Z" style="fill:#b149f7;"/><path d="M20.874,101.535c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.628 1.516,-1.146Z" style="fill:#fbff16;"/><path d="M35.03,110.23l-9.136,-5.276l0,3l9.136,5.276l0,-3Z" style="fill:#b149f7;"/><path d="M16.8,96.24l-16.8,-9.699l0,3l16.8,9.699l0,-3Z" style="fill:#b149f7;"/><path d="M16.8,103.168l-16.8,-9.699l0,3l16.8,9.699l0,-3Z" style="fill:#b149f7;"/></g></g><g id="memory"><path d="M176.669,25.5l-132.501,76.5l88.335,51l132.501,-76.5l-88.335,-51Z" style="fill:url(#_Linear3);"/><path d="M265.004,76.5l-132.501,76.5l-88.335,-51l132.501,-76.5l88.335,51Zm-219.836,25.5l87.335,50.423l131.501,-75.923l-87.335,-50.422l-131.501,75.922Z" style="fill:#71ff6d;"/><path d="M265.004,106.5l-132.501,76.5l-88.335,-51l0,-30l88.335,51l132.501,-76.5l0,30Z" style="fill:url(#_Linear4);"/><path d="M123.515,161.311l-23.593,-13.622l0,3l23.593,13.622l0,-3Z" style="fill:#087b3c;"/><path d="M76.704,134.285l-23.593,-13.622l0,3l23.593,13.622l0,-3Z" style="fill:#087b3c;"/><g><path d="M83.117,137.466c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M88.313,140.466c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.629 1.516,-1.146Z" style="fill:#00fc72;"/><path d="M93.509,143.466c0.837,0.483 1.516,1.781 1.516,2.896c0,1.115 -0.679,1.629 -1.516,1.146c-0.836,-0.483 -1.515,-1.781 -1.515,-2.896c0,-1.115 0.679,-1.629 1.515,-1.146Z" style="fill:#00fc72;"/></g></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(130.806,-74.5415,-27.4588,74.1774,45.8632,100.041)"><stop offset="0" style="stop-color:#ab44ff;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#7c00b6;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-75.0777,75.0777,132.502,132.502,183)"><stop offset="0" style="stop-color:#8300db;stop-opacity:0.952941"/><stop offset="1" style="stop-color:#a32bff;stop-opacity:0.952941"/></linearGradient><linearGradient id="_Linear3" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(133.74,-80.0731,29.0726,102.644,132.083,154.209)"><stop offset="0" style="stop-color:#00ea52;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#14bb62;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear4" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-79.5019,76.9201,136.949,176.67,208.5)"><stop offset="0" style="stop-color:#00b454;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#00d84b;stop-opacity:0.94902"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 265 183" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="sentinel"><path d="M132.501,0l-132.501,76.5l132.503,76.5l132.501,-76.5l-132.503,-76.5Z" style="fill:url(#_Linear1);"/><path d="M265.004,76.5l-132.501,76.5l-132.503,-76.5l132.501,-76.5l132.503,76.5Zm-264.004,0l131.503,75.923l131.501,-75.923l-131.503,-75.923l-131.501,75.923Z" style="fill:#b067ff;"/><path d="M265.004,106.5l-132.501,76.5l-132.503,-76.5l0,-30l132.503,76.5l132.501,-76.5l0,30Z" style="fill:url(#_Linear2);"/><g><path d="M20.95,95.753c0.275,0.166 0.548,0.351 0.82,0.563c0.549,0.43 1.086,0.957 1.59,1.561c1.137,1.365 2.09,3.112 2.689,4.928c0.275,0.834 0.475,1.679 0.591,2.5c0.13,0.921 0.154,1.811 0.072,2.621c-0.076,0.757 -0.246,1.442 -0.503,2.026c-0.3,0.683 -0.717,1.224 -1.224,1.592c-0.525,0.38 -1.145,0.574 -1.821,0.565c-0.699,-0.009 -1.455,-0.236 -2.214,-0.662c-0.762,-0.427 -1.524,-1.051 -2.233,-1.833c-0.684,-0.754 -1.314,-1.65 -1.852,-2.628c-0.518,-0.943 -0.949,-1.96 -1.265,-2.988c-0.269,-0.876 -0.453,-1.758 -0.544,-2.606c-0.094,-0.877 -0.091,-1.718 0.012,-2.48c0.09,-0.678 0.26,-1.292 0.501,-1.82c0.566,-1.238 1.523,-1.977 2.69,-2.077c0.496,-0.042 1.028,0.03 1.574,0.215c0.269,0.091 0.54,0.211 0.813,0.353c0.102,0.054 0.203,0.111 0.304,0.17Zm-0.124,2.931c-0.514,-0.284 -1.019,-0.428 -1.486,-0.407c-0.411,0.019 -0.784,0.163 -1.097,0.42c-0.293,0.24 -0.531,0.58 -0.701,0.999c-0.144,0.354 -0.238,0.766 -0.278,1.217c-0.048,0.524 -0.025,1.099 0.069,1.694c0.066,0.422 0.168,0.853 0.303,1.281c0.388,1.234 1.042,2.424 1.826,3.319c0.431,0.492 0.897,0.889 1.364,1.167c0.471,0.279 0.941,0.438 1.379,0.461c0.408,0.021 0.786,-0.076 1.111,-0.282c0.324,-0.207 0.595,-0.521 0.796,-0.926c0.162,-0.328 0.277,-0.715 0.339,-1.145c0.073,-0.505 0.076,-1.069 0.008,-1.657c-0.061,-0.522 -0.178,-1.064 -0.347,-1.601c-0.348,-1.104 -0.909,-2.176 -1.587,-3.031c-0.455,-0.574 -0.953,-1.034 -1.463,-1.367c-0.079,-0.05 -0.157,-0.097 -0.236,-0.142Z" style="fill:#b149f7;"/><path d="M20.874,101.535c0.836,0.483 1.515,1.781 1.515,2.896c0,1.115 -0.679,1.629 -1.515,1.146c-0.837,-0.483 -1.516,-1.781 -1.516,-2.896c0,-1.115 0.679,-1.628 1.516,-1.146Z" style="fill:#fbff16;"/><path d="M123.678,161.41l-97.784,-56.456l0,3l97.784,56.456l0,-3Z" style="fill:#b149f7;"/><path d="M16.8,96.24l-16.8,-9.699l0,3l16.8,9.699l0,-3Z" style="fill:#b149f7;"/><path d="M16.8,103.168l-16.8,-9.699l0,3l16.8,9.699l0,-3Z" style="fill:#b149f7;"/></g></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-73.5623,73.5623,132.502,132.502,150.062)"><stop offset="0" style="stop-color:#ab44ff;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#7c00b6;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-75.0777,75.0777,132.502,132.502,183)"><stop offset="0" style="stop-color:#8300db;stop-opacity:0.952941"/><stop offset="1" style="stop-color:#a32bff;stop-opacity:0.952941"/></linearGradient></defs></svg>
@@ -0,0 +1 @@
1
+ <?xml version="1.0" encoding="UTF-8" standalone="no"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg width="100%" height="100%" viewBox="0 0 265 183" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" xml:space="preserve" style="fill-rule:evenodd;clip-rule:evenodd;stroke-linejoin:round;stroke-miterlimit:1.41421;"><g id="storage"><path d="M132.501,0l-132.501,76.5l132.503,76.5l132.501,-76.5l-132.503,-76.5Z" style="fill:url(#_Linear1);"/><path d="M265.004,76.5l-132.501,76.5l-132.503,-76.5l132.501,-76.5l132.503,76.5Zm-264.004,0l131.503,75.923l131.501,-75.923l-131.503,-75.923l-131.501,75.923Z" style="fill:#17b7f1;"/><path d="M265.004,106.5l-132.501,76.5l-132.503,-76.5l0,-30l132.503,76.5l132.501,-76.5l0,30Z" style="fill:url(#_Linear2);"/><path d="M123.541,155.576l-115.181,-66.5l0,3l115.181,66.5l0,-3Z" style="fill:#0057bb;fill-opacity:0.952941;"/><path d="M123.541,161.326l-115.181,-66.5l0,3l115.181,66.5l0,-3Z" style="fill:#0057bb;fill-opacity:0.952941;"/><path d="M123.541,167.076l-115.181,-66.5l0,3l115.181,66.5l0,-3Z" style="fill:#0057bb;fill-opacity:0.952941;"/></g><defs><linearGradient id="_Linear1" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-75.8165,75.8165,132.502,132.502,152.316)"><stop offset="0" style="stop-color:#0091ff;stop-opacity:0.94902"/><stop offset="1" style="stop-color:#006eec;stop-opacity:0.94902"/></linearGradient><linearGradient id="_Linear2" x1="0" y1="0" x2="1" y2="0" gradientUnits="userSpaceOnUse" gradientTransform="matrix(132.502,-78.4128,75.8672,136.948,132.502,168.631)"><stop offset="0" style="stop-color:#006eec;stop-opacity:0.952941"/><stop offset="1" style="stop-color:#0a81ff;stop-opacity:0.952941"/></linearGradient></defs></svg>
@@ -57,8 +57,11 @@ module Ratchet
57
57
  # Consolidated page class output
58
58
  def page_classes
59
59
  page_class = @classes.map(&:to_s).join(" ") rescue nil
60
- parts = request.path.split("/").reject(&:blank?).reject{|s| s.match(/\A[0-9]+(\.[0-9]+)?\z/)}
61
- [ parts.last, page_class ].reject(&:blank?).join(" ")
60
+ [page_class ].reject(&:blank?).join(" ")
61
+ end
62
+
63
+ def deployment_name(name)
64
+ Site.deployment_data['deployments'][name][:name]
62
65
  end
63
66
 
64
67
  # Main section class output
@@ -71,5 +74,10 @@ module Ratchet
71
74
  @main_classes || ''
72
75
  end
73
76
  end
77
+
78
+ def number_to_currency(value)
79
+ ActionController::Base.helpers.number_to_currency(value, unit: '$')
80
+ end
81
+
74
82
  end
75
83
  end
@@ -197,7 +197,7 @@ module Ratchet
197
197
 
198
198
  options['value'] ||= options['min'] || 0
199
199
 
200
- html_options = {"class" => classnames, "type" => "range", "min" => options['min'], "max" => options['max'], "value" => options['value'] }.update('data' => data)
200
+ html_options = {"id"=> options['id'], "class" => classnames, "type" => "range", "min" => options['min'], "max" => options['max'], "value" => options['value'] }.update('data' => data)
201
201
 
202
202
  content_tag(:label, class: 'range-label') {
203
203
  concat label if label
@@ -420,5 +420,88 @@ module Ratchet
420
420
  }
421
421
  end
422
422
 
423
+ def slider_input_tag(name, options={})
424
+ options = options.stringify_keys
425
+ classnames = options.delete('class') || ''
426
+
427
+ data = options['data'] || {}
428
+ data['input'] ||= name
429
+
430
+ if options['position_label']
431
+ data['position_label'] = options['position_label']
432
+ end
433
+
434
+ # Set values (and max based on values size)
435
+ if values = options['values']
436
+ data['values'] = values.join(',')
437
+ options['max'] ||= values.size - 1
438
+ end
439
+
440
+ # Support legacy option
441
+ options['labels'] ||= options['label']
442
+
443
+ if labels = options['labels']
444
+ if labels.is_a?(Array)
445
+ data['label'] = labels.join(';')
446
+ options['max'] ||= labels.size - 1
447
+ elsif labels.is_a?(Hash)
448
+ labels.each do |label, value|
449
+ data['label-'+dasherize(label.to_s.downcase)] = value.join(';')
450
+ options['max'] ||= value.size - 1
451
+ end
452
+ end
453
+ end
454
+
455
+ if labels == false
456
+ data['label'] = 'false'
457
+ end
458
+
459
+ if labels = options['external_labels']
460
+ if labels.is_a?(Hash)
461
+ labels.each do |label, value|
462
+ l = label.to_s.downcase.dasherize
463
+ data['external-label-'+l] = value.join(';')
464
+ end
465
+ end
466
+ end
467
+
468
+ if before = options['before']
469
+ if before.is_a?(String)
470
+ data['before-label'] = before
471
+ else
472
+ before.each do |key, value|
473
+ data["before-label-#{key}"] = value
474
+ end
475
+ end
476
+ end
477
+
478
+ if mark = options['mark']
479
+ data['mark'] = mark.join(',')
480
+ end
481
+
482
+ if after = options['after']
483
+ if after.is_a?(String)
484
+ data['after-label'] = after
485
+ else
486
+ after.each do |key, value|
487
+ data["after-label-#{key}"] = value
488
+ end
489
+ end
490
+ end
491
+
492
+ if line_labels = options['line_labels']
493
+ data['line_labels'] = []
494
+ line_labels.each do |k, v|
495
+ data['line_labels'] << "#{k}:#{v}"
496
+ end
497
+ data['line_labels'] = data['line_labels'].join(';')
498
+ end
499
+
500
+ options['value'] ||= options['min'] || 0
501
+
502
+ html_options = {"class" => classnames, "type" => "range", "min" => options['min'], "max" => options['max'], "value" => options['value'] }.update('data' => data)
503
+ tag :input, html_options
504
+ end
505
+ alias :range_input_tag :slider_input_tag
423
506
  end
424
507
  end
@@ -0,0 +1,113 @@
1
+ module Ratchet
2
+ module IconHelper
3
+
4
+ def deployment_info(name)
5
+ deployment = deployments[name.downcase]
6
+
7
+ if deployment.nil? && !Rails.env.production?
8
+ raise %Q{No deployment type "#{name}" exists.}
9
+ end
10
+
11
+ deployment
12
+ end
13
+
14
+ def deployments
15
+ Site.deployment_data['deployments']
16
+ end
17
+
18
+ def deployment_graphic
19
+ Site.deployment_icon
20
+ end
21
+
22
+ def grid_bg(options={})
23
+ options = {
24
+ scale: true,
25
+ class: "svg-bg bottom centered",
26
+ "aria-hidden" => true
27
+ }.merge(options)
28
+
29
+ use_svg "graphics/grid", options
30
+ end
31
+
32
+ def topology_desc(part, deployment_name)
33
+ parts = Site.deployment_data['parts']
34
+ if parts[deployment_name] && parts[deployment_name][part]
35
+ parts[deployment_name][part]
36
+ else
37
+ parts[part]
38
+ end
39
+ end
40
+
41
+ def deployment_text(text, options={})
42
+ options = {
43
+ x: deployment_graphic.width.to_f / 2,
44
+ y: deployment_graphic.height.to_f / 2,
45
+ fill: "currentColor",
46
+ "font-weight" => 700,
47
+ "font-size" => "57px",
48
+ "text-anchor" => "middle",
49
+ "dominant-baseline" =>"central",
50
+ "alignment-baseline" => "central"
51
+ }.merge(options)
52
+
53
+ content_tag(:text, text, options).html_safe
54
+ end
55
+
56
+ def deployment_topology(name, options={})
57
+ data = deployment_info(name)
58
+
59
+ components = data[:topology].map do |item|
60
+ Esvg.find_symbol("topology/#{item}")
61
+ end
62
+
63
+ base = 153 # height of top plane
64
+ options[:spacing] ||= 10 # space between
65
+
66
+ # Find height of each section
67
+ heights = components.map(&:height).map { |h| h - base + options[:spacing] }
68
+
69
+ # Start coordinates at 0
70
+ y = [0].concat heights
71
+
72
+ # Add previous height total to create next coordinate
73
+ y = y.map.with_index { |h, i| y[0..i].reduce(:+) }
74
+
75
+ # Full height = last calculated coordinate + base (minus the additional space)
76
+ height = base + y.pop - options[:spacing]
77
+
78
+ use = components.map.with_index do |c, i|
79
+ part_name = c.name.sub('topology-','')
80
+ c.use_tag(y: y[i], width: c.width, height: c.height, class:'capsule', "aria-label" => topology_desc(part_name, name.downcase))
81
+ end.reverse.join
82
+
83
+ attr = {
84
+ version: "1.1",
85
+ preserveAspectRatio: "xMidYMid meet",
86
+ viewBox: "0 0 #{components.last.width} #{height}",
87
+ 'aria-label' => "Topology of a #{data[:name]} deployment"
88
+ }.merge(options)
89
+
90
+ content_tag(:svg, attr) { use.html_safe }
91
+ end
92
+
93
+ def deployment_svg(name, options={})
94
+ data = deployment_info(name)
95
+ (options[:use] ||= {})
96
+ options[:use][:stroke] ||= options.delete(:stroke) || "currentColor"
97
+ options[:use][:stroke_width] ||= options.delete(:stroke_width) || 4
98
+ options[:use][:class] ||= "deployment-icon-hex #{options[:use][:class]}".strip
99
+
100
+ options[:fill] ||= "url(##{data[:gradient]})"
101
+ options[:color] ||= "#fff"
102
+ options[:content] ||= deployment_text(data[:short_name], options.delete(:text) || {})
103
+
104
+ deployment_graphic.use(options).html_safe
105
+ end
106
+
107
+ def deployment_icon(name, options={})
108
+ options[:stroke_width] ||= 8
109
+ options[:text] ||= { "font-weight" => 600, "font-size" => "76px" }
110
+ deployment_svg name, options
111
+ end
112
+ end
113
+ end
@@ -0,0 +1,133 @@
1
+ module Ratchet
2
+ module PricingHelper
3
+
4
+ TYPE_SIZE = {
5
+ 'data' => { ram: 0.1, storage: 1 },
6
+ 'memory' => { ram: 0.25, storage: 0.25 },
7
+ 'memdata' => { ram: 0.25, storage: 0.25 }
8
+ }
9
+
10
+ steps = [1, 2, 5, 10, 25, 100]
11
+ ranges = [[1,10],[12,22],[25,50],[60,120],[125,350],[400,1000]]
12
+ units = []
13
+
14
+ ranges.each_with_index do |range, index|
15
+ (range.first .. range.last).step(steps[index]) do |step|
16
+ units.push step
17
+ end
18
+ end
19
+
20
+ UNITS = units
21
+
22
+ def pricing_data
23
+ @deployment_pricing ||= begin
24
+ deployment_data = Site.config_data['deployments']
25
+
26
+ # Only select pricing for deployments we have planned UI for
27
+ pricing = Site.config_data['pricing'].select { |d| deployment_data['slugs'][ d['slug'] ] }
28
+
29
+ deployment_pricing = {}
30
+ pricing.each do |deployment|
31
+
32
+ slug = deployment_data['slugs'][ deployment['slug'] ]
33
+ overhead = deployment['base_overhead'] || 0
34
+ type = TYPE_SIZE[deployment['scalables'].first['type']] # Storage/Memory configuration for this deployment type
35
+ tiers = deployment['scalables'].first['price_tiers']
36
+ base_price = tiers.first['unit_cost'] # Get per unit price with no discount
37
+ max_units = deployment_data['deployments'][slug][:max_units] || UNITS.last
38
+
39
+ new_data = {
40
+ units: [],
41
+ price: [],
42
+ price_ph: [],
43
+ discount: [],
44
+ savings: [],
45
+ storage: [],
46
+ memory: []
47
+ }
48
+
49
+ units = UNITS.select {|u| tiers.first['range'][0] <= u && u <= max_units }
50
+ units.push(max_units) if units.last < max_units
51
+
52
+ tiers.each do |tier|
53
+
54
+ range = units.select{ |u| tier['range'].first <= u && u <= tier['range'].last }
55
+ cost = tier['unit_cost']
56
+ discount = tier['discount_pct']
57
+
58
+ new_data[:units].concat range
59
+ new_data[:price].concat range.map{|r| number_to_currency((cost * r) + overhead) }
60
+ new_data[:price_ph].concat range.map{|r| (((cost * r) + overhead).to_f / 720).round(4) }
61
+ new_data[:discount].concat range.map{|r| discount }
62
+ new_data[:savings].concat range.map{|r| number_to_currency(((cost * r) + overhead) * discount/100 )}
63
+ new_data[:storage].concat range.map{|r| r * type[:storage] }
64
+ new_data[:memory].concat range.map{|r| r * type[:ram] }
65
+
66
+ end
67
+
68
+ deployment_pricing[slug] = new_data
69
+
70
+ end
71
+
72
+ deployment_pricing
73
+ end
74
+ end
75
+
76
+ def number_to_currency(value)
77
+ ActionController::Base.helpers.number_to_currency(value, unit: '')
78
+ end
79
+
80
+ def pricing_slider(name, options={})
81
+ data = pricing_data[name].merge(options)
82
+
83
+
84
+ data[:mark] = []
85
+ data[:storage].map!{ |s| nearest_size(s) }
86
+ data[:memory].map!{ |s| nearest_size(s) }
87
+
88
+ data[:line_labels] = {
89
+ "1" => data[:storage].first,
90
+ "#{data[:units].size}" => data[:storage].last
91
+ }
92
+
93
+ current_discount = 0
94
+
95
+ data[:discount].each_with_index do |d, index|
96
+ if d != current_discount
97
+ current_discount = d
98
+ data[:mark].push index + 1
99
+ #data[:line_labels][(index+1).to_s] = data[:storage][index]
100
+ end
101
+ end
102
+
103
+
104
+ data[:line_labels] = {
105
+ "1" => data[:storage].first,
106
+ "#{data[:storage].size}" => data[:storage].last
107
+ }
108
+
109
+ data[:values] = data.delete(:units)
110
+
111
+ data[:external_labels] = {
112
+ discount: data.delete(:discount).map{|d| d == 0 ? '' : d },
113
+ savings: data.delete(:savings).map{|d| d == '0.00' ? '' : d },
114
+ storage: data.delete(:storage),
115
+ memory: data.delete(:memory),
116
+ price_m: data.delete(:price),
117
+ price_h: data.delete(:price_ph)
118
+ }
119
+
120
+ data
121
+
122
+ end
123
+
124
+ def nearest_size(size)
125
+ if size > 1024
126
+ "#{(size / 1024).round(2)} TB"
127
+ else
128
+ size = (size * 1024 * 1048576).round(2) # GiB -> MiB -> Bytes
129
+ ActionController::Base.helpers.number_to_human_size(size, precision: 3).sub(/\.0 /,' ')
130
+ end
131
+ end
132
+ end
133
+ end
@@ -0,0 +1,101 @@
1
+ module Ratchet
2
+ module ToggleNavHelper
3
+ class ToggleNav < RatchetDesign::Helper
4
+
5
+ def initialize(tag = :div, options = {})
6
+
7
+ if tag.is_a? Hash
8
+ options = tag
9
+ tag = :div
10
+ end
11
+
12
+ options[:tag] = tag
13
+
14
+ @options = options
15
+ @options[:name] ||= "radio-group-#{rand(10000)}-#{rand(10000)}"
16
+ @count = 0
17
+ end
18
+
19
+ def display(body)
20
+ options = @options
21
+ options.delete(:name)
22
+
23
+ display_tag options.delete(:tag), options, body
24
+ end
25
+
26
+ def display_tag(tag, options, body )
27
+ options[:class] = "toggle-nav #{@options[:class]}"
28
+ content_tag(tag, options) { body }
29
+ end
30
+
31
+ def extract_block(&block)
32
+ capture(&block).html_safe
33
+ end
34
+
35
+ def option(label = nil, options = {}, &block)
36
+
37
+ if label.is_a? Hash
38
+ options = label
39
+ label = options.delete(:label)
40
+ end
41
+
42
+ checked = options.delete(:checked) || false
43
+ name = options.delete(:name) || @options[:name]
44
+ label_text = content_tag(:span, class: 'label-text') { label } if label
45
+
46
+ label_class = "#{options.delete(:class)} toggle-label"
47
+ label_id = "#{name}_#{@count += 1}"
48
+
49
+ # The label should have an active class
50
+ # when the radio is active
51
+ options[:add_class] = "active; ##{label_id}& #{options[:add_clss]}"
52
+
53
+ options = set_toggle_options(options)
54
+
55
+ content_tag(:label, class: label_class, id: label_id ) {
56
+ concat radio_button_tag(name, true, checked, options)
57
+ concat extract_block(&block) if block_given?
58
+ concat label_text
59
+ }
60
+ end
61
+
62
+ def set_toggle_options( options )
63
+ options[:data] ||= {}
64
+ options[:data] = options[:data].merge({
65
+ show: options.delete(:show),
66
+ hide: options.delete(:hide),
67
+ add_class: options.delete(:add_class),
68
+ remove_class: options.delete(:remove_class)
69
+ })
70
+
71
+ options
72
+ end
73
+ end
74
+
75
+ class ToggleRow < ToggleNav
76
+ def display_tag(tag, options, body )
77
+
78
+ options[:class] = "toggle-row #{@options[:class]}".strip
79
+ label = content_tag(:span, class: 'toggle-row-label-text') { options.delete(:label) } if options[:label]
80
+
81
+ content_tag(tag, options) {
82
+ concat label
83
+ concat content_tag('div', class: 'toggle-row-panel') { body }
84
+ }
85
+ end
86
+ end
87
+
88
+ class TogglePanel < ToggleNav
89
+ def display_tag(tag, options, body)
90
+
91
+ options[:class] = "toggle-panels #{@options[:class]}".strip
92
+ label = content_tag(:span, class: 'toggle-panel-label-text') { options.delete(:label) } if options[:label]
93
+
94
+ content_tag(tag, options) {
95
+ concat label
96
+ concat ( body )
97
+ }
98
+ end
99
+ end
100
+ end
101
+ end
@@ -23,6 +23,9 @@ html
23
23
  - if content_for?(:favicon)
24
24
  = yield :favicon
25
25
 
26
+ / Site CSS
27
+ = yield :stylesheets
28
+
26
29
  / Ratchet core JS
27
30
  = javascript_tag "core"
28
31
 
@@ -35,9 +38,6 @@ html
35
38
  ratchet.loadFont( 'proxima-nova-', '#{stylesheet_url("fonts-woff.css").first}', '#{stylesheet_url("fonts-woff2.css").first}' )
36
39
  })
37
40
 
38
- / Site CSS
39
- = yield :stylesheets
40
-
41
41
  / Head
42
42
  = yield :head
43
43