footer.go 9.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. package containers
  2. import (
  3. "fmt"
  4. "github.com/iancoleman/strcase"
  5. "github.com/jinzhu/inflection"
  6. "github.com/qor5/admin/pagebuilder"
  7. "github.com/qor5/web"
  8. . "github.com/theplant/htmlgo"
  9. )
  10. type WebFooter struct {
  11. ID uint
  12. EnglishUrl string
  13. JapaneseUrl string
  14. }
  15. func (*WebFooter) TableName() string {
  16. return "container_footers"
  17. }
  18. func RegisterFooter(pb *pagebuilder.Builder) {
  19. footer := pb.RegisterContainer("Footer").
  20. RenderFunc(func(obj interface{}, input *pagebuilder.RenderInput, ctx *web.EventContext) HTMLComponent {
  21. footer := obj.(*WebFooter)
  22. return FooterTemplate(footer, input)
  23. })
  24. footer.Model(&WebFooter{}).URIName(inflection.Plural(strcase.ToKebab("Footer"))).Editing("EnglishUrl", "JapaneseUrl")
  25. }
  26. func FooterTemplate(data *WebFooter, input *pagebuilder.RenderInput) (body HTMLComponent) {
  27. body = ContainerWrapper(
  28. fmt.Sprintf(inflection.Plural(strcase.ToKebab("Footer"))+"_%v", data.ID), "", "container-footer", "", "", "",
  29. "", false, false, input.IsEditor, input.IsReadonly, "",
  30. Div(RawHTML(fmt.Sprintf(`
  31. <div class='container-footer-main'>
  32. <div class='container-footer-primary'>
  33. <div class='container-footer-links'>
  34. <div class='container-footer-links-group'>
  35. <div class='container-footer-links-title'>
  36. <a href='/what-we-do/'>What we do</a>
  37. </div>
  38. <ul data-list-unset='true' class='container-footer-links-list'>
  39. <li class='container-footer-links-item'>
  40. <a href='/commerce/'>Commerce</a>
  41. </li>
  42. <li class='container-footer-links-item'>
  43. <a href='/content/'>Content</a>
  44. </li>
  45. <li class='container-footer-links-item'>
  46. <a href='/consulting/'>Consulting</a>
  47. </li>
  48. <li class='container-footer-links-item'>
  49. <a href='/personalization/'>Personalization</a>
  50. </li>
  51. </ul>
  52. </div>
  53. <div class='container-footer-links-group'>
  54. <div class='container-footer-links-title'>
  55. <a href='/projects/'>Projects</a>
  56. </div>
  57. <ul data-list-unset='true' class='container-footer-links-list'>
  58. <li class='container-footer-links-item'>
  59. <a href='/projects/?filter=Commerce'>Commerce</a>
  60. </li>
  61. <li class='container-footer-links-item'>
  62. <a href='/projects/?filter=Content'>Content</a>
  63. </li>
  64. <li class='container-footer-links-item'>
  65. <a href='/projects/?filter=Consulting'>Consulting</a>
  66. </li>
  67. <li class='container-footer-links-item'>
  68. <a href='/projects/?filter=Mobile%%20Apps'>Mobile Apps</a>
  69. </li>
  70. <li class='container-footer-links-item'>
  71. <a href='/projects/?filter=Personalization'>Personalization</a>
  72. </li>
  73. </ul>
  74. </div>
  75. <div class='container-footer-links-group'>
  76. <div class='container-footer-links-title'>
  77. <a href='/why-clients-choose-us/'>Why clients choose us</a>
  78. </div>
  79. <ul data-list-unset='true' class='container-footer-links-list'>
  80. <li class='container-footer-links-item'>
  81. <a href='
  82. /why-clients-choose-us/#speed'>Speed</a>
  83. </li>
  84. <li class='container-footer-links-item'>
  85. <a href='/why-clients-choose-us/#reliability'>Reliability</a>
  86. </li>
  87. <li class='container-footer-links-item'>
  88. <a href='/why-clients-choose-us/#expertise'>Expertise</a>
  89. </li>
  90. <li class='container-footer-links-item'>
  91. <a href='/why-clients-choose-us/#pricing'>Pricing</a>
  92. </li>
  93. <li class='container-footer-links-item'>
  94. <a href='/why-clients-choose-us/#workflow'>Workflow</a>
  95. </li>
  96. </ul>
  97. </div>
  98. <div class='container-footer-links-group'>
  99. <div class='container-footer-links-title'>
  100. <a href='/our-company/'>Our company</a>
  101. </div>
  102. <ul data-list-unset='true' class='container-footer-links-list'>
  103. <li class='container-footer-links-item'>
  104. <a href='/our-company/culture/'>Our culture</a>
  105. </li>
  106. <li class='container-footer-links-item'>
  107. <a href='/join-our-team/'>Join our team</a>
  108. </li>
  109. <li class='container-footer-links-item'>
  110. <a href='/news-and-events/'>News &amp; Events</a>
  111. </li>
  112. <li class='container-footer-links-item'>
  113. <a href='/articles/'>Articles</a>
  114. </li>
  115. <li class='container-footer-links-item'>
  116. <a href='/privacy-policy/'>Privacy policy</a>
  117. </li>
  118. <li class='container-footer-links-item'>
  119. <a href='/contact/'>Contact us</a>
  120. </li>
  121. </ul>
  122. </div>
  123. </div>
  124. <div class='container-footer-follow'>
  125. <div class='container-footer-links-title'>Follow us</div>
  126. <div class='container-footer-follow-link'>
  127. <a href='https://www.facebook.com/theplant/' target='_blank' class='link-facebook'><svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M8.29522 5.99976C7.44176 5.99976 6.75 6.6915 6.75 7.54511V32.4544C6.75 33.3077 7.44176 33.9998 8.29522 33.9998H21.7056V23.1567H18.0565V18.931H21.7056V15.8147C21.7056 12.1979 23.9145 10.2288 27.1406 10.2288C28.6861 10.2288 30.0142 10.3437 30.4012 10.3954V14.1748L28.1637 14.1759C26.409 14.1759 26.0695 15.0094 26.0695 16.233V18.931H30.2538L29.7092 23.1567H26.0695V33.9998H33.2045C34.058 33.9998 34.75 33.3077 34.75 32.4544V7.54511C34.75 6.6915 34.058 5.99976 33.2045 5.99976H8.29522Z" fill="currentColor"/></svg></a>
  128. <a href='https://twitter.com/_theplant' target='_blank' class='link-twitter'><svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M14.8126 34C26.8873 34 33.4916 23.9962 33.4916 15.321C33.4916 15.0369 33.4916 14.754 33.4724 14.4725C34.7572 13.5431 35.8663 12.3924 36.7477 11.0743C35.5495 11.6052 34.2785 11.9534 32.9771 12.1072C34.3475 11.2867 35.3732 9.99632 35.8633 8.47609C34.5746 9.24077 33.1648 9.77969 31.6946 10.0696C29.6597 7.90575 26.4262 7.37615 23.8072 8.77773C21.1883 10.1793 19.8353 13.1635 20.5069 16.057C15.2285 15.7924 10.3105 13.2992 6.97704 9.19795C5.2346 12.1976 6.12461 16.035 9.00953 17.9615C7.9648 17.9305 6.94284 17.6487 6.02991 17.1398V17.223C6.03076 20.348 8.23359 23.0396 11.2967 23.6583C10.3302 23.9219 9.31617 23.9605 8.33246 23.771C9.19249 26.4452 11.6571 28.2773 14.4658 28.33C12.1411 30.157 9.26943 31.1488 6.31277 31.1458C5.79044 31.1448 5.26862 31.1132 4.75 31.0511C7.7522 32.9777 11.2454 33.9996 14.8126 33.9949" fill="currentColor"/></svg></a>
  129. <a href='https://linkedin.com/company/the-plant' target='_blank' class='link-linkedin'><svg width="40" height="40" viewBox="0 0 40 40" xmlns="http://www.w3.org/2000/svg"><path d="M34.8015 34H28.9896V24.9041C28.9896 22.7356 28.9523 19.9458 25.9697 19.9458C22.9443 19.9458 22.4829 22.3093 22.4829 24.7496V34H16.6776V15.2964H22.2495V17.854H22.3306C23.1053 16.3834 25.0021 14.8329 27.8292 14.8329C33.7156 14.8329 34.8026 18.7054 34.8026 23.7426V34H34.8015ZM10.1228 12.7422C8.25558 12.7422 6.75 11.2323 6.75 9.37056C6.75 7.50886 8.25558 6 10.1228 6C11.9823 6 13.4911 7.50996 13.4911 9.37056C13.4911 11.2312 11.9823 12.7422 10.1228 12.7422ZM7.21132 34H13.0298V15.2964H7.21132V34Z" fill="currentColor"/></svg></a>
  130. </div>
  131. </div>
  132. </div>
  133. <div class='container-footer-secondary'>
  134. <ul data-list-unset='true' class='container-footer-language'>
  135. <li>
  136. <a href='%s'>English</a>
  137. </li>
  138. <li>
  139. <a href='%s'>日本語</a>
  140. </li>
  141. </ul>
  142. <svg class="container-footer-logo" viewBox="0 0 151 29" fill="none" xmlns="http://www.w3.org/2000/svg"><path fill-rule="evenodd" clip-rule="evenodd" d="M137.448 9.664V0l-13.557 9.664v18.911H151V0l-13.552 9.664z" fill="#fff"/><path d="M5.654 13.053H0V9.63h15.254v3.423H9.599v15.522H5.654V13.053zM17.413 9.63h3.682v6.846c.544-.743 1.175-1.292 1.894-1.645a5.059 5.059 0 012.262-.531c1.56 0 2.717.416 3.471 1.247.754.814 1.131 2.105 1.131 3.874v9.154h-3.682v-8.65c0-.973-.184-1.636-.552-1.99-.368-.354-.86-.53-1.473-.53-.473 0-.885.07-1.236.212a3.457 3.457 0 00-.947.61 3.436 3.436 0 00-.631.902 2.59 2.59 0 00-.237 1.115v8.331h-3.682V9.63zM45.549 24.25c-.246 1.557-.868 2.742-1.868 3.556-.981.796-2.42 1.194-4.313 1.194-2.28 0-3.997-.637-5.154-1.91-1.14-1.274-1.71-3.078-1.71-5.413 0-1.168.167-2.203.5-3.105.333-.92.797-1.698 1.394-2.335a5.882 5.882 0 012.182-1.433c.842-.336 1.771-.504 2.788-.504 2.104 0 3.682.61 4.734 1.83 1.07 1.221 1.604 2.867 1.604 4.936v1.486h-9.52c.035 1.115.316 1.99.842 2.627.526.62 1.315.929 2.367.929 1.455 0 2.314-.62 2.577-1.858h3.577zm-3.393-4.139c0-.955-.237-1.698-.71-2.229-.456-.53-1.175-.796-2.157-.796-.49 0-.92.08-1.288.239-.369.16-.684.38-.947.663a2.896 2.896 0 00-.579.956c-.14.353-.219.742-.236 1.167h5.917zM54.61 9.63h6.706c1.438 0 2.621.168 3.55.504.947.319 1.692.752 2.236 1.3.56.53.947 1.159 1.157 1.884.228.708.342 1.45.342 2.23 0 .83-.114 1.626-.342 2.387a4.668 4.668 0 01-1.157 2.017c-.544.566-1.28 1.017-2.21 1.353-.911.336-2.068.504-3.471.504h-2.946v6.766H54.61V9.63zm6.68 8.889c.683 0 1.244-.07 1.683-.212.456-.142.815-.336 1.078-.584.263-.248.438-.549.526-.902.105-.372.158-.77.158-1.194 0-.443-.053-.832-.158-1.168a1.834 1.834 0 00-.552-.849c-.263-.23-.623-.407-1.079-.53-.438-.124-.999-.186-1.683-.186h-2.788v5.625h2.814zM71.169 9.63h3.682v18.945h-3.682V9.63zM86.281 26.824a7.142 7.142 0 01-1.84 1.513c-.667.389-1.535.583-2.604.583-.614 0-1.201-.08-1.762-.238a4.17 4.17 0 01-1.447-.743 3.722 3.722 0 01-.973-1.274c-.245-.53-.368-1.159-.368-1.884 0-.955.21-1.733.631-2.335.42-.601.973-1.07 1.657-1.406a8.266 8.266 0 012.288-.717c.86-.141 1.727-.23 2.604-.265l1.762-.08v-.69c0-.849-.237-1.432-.71-1.75-.456-.32-1-.479-1.631-.479-1.455 0-2.288.558-2.498 1.672l-3.367-.318c.246-1.45.877-2.494 1.894-3.131 1.017-.655 2.384-.982 4.102-.982 1.052 0 1.947.133 2.683.398.737.248 1.324.61 1.762 1.088.456.478.78 1.061.973 1.751.21.672.316 1.433.316 2.282v8.756H86.28v-1.75zm-.079-4.431l-1.63.08c-.772.035-1.394.114-1.868.238-.473.124-.841.283-1.104.478a1.33 1.33 0 00-.5.637 2.45 2.45 0 00-.131.822c0 .46.158.823.473 1.088.316.266.754.398 1.315.398.947 0 1.718-.22 2.314-.663.334-.248.605-.557.816-.929.21-.389.315-.867.315-1.433v-.716zM92.87 14.725h3.577v1.91c.544-.814 1.184-1.406 1.92-1.778a5.235 5.235 0 012.341-.557c1.56 0 2.717.416 3.471 1.247.754.814 1.131 2.105 1.131 3.874v9.154h-3.682v-8.65c0-.973-.184-1.636-.552-1.99-.368-.354-.859-.53-1.473-.53-.473 0-.885.07-1.236.212a3.455 3.455 0 00-.947.61 3.431 3.431 0 00-.63.902 2.59 2.59 0 00-.238 1.115v8.331h-3.681v-13.85zM109.276 17.617h-2.156v-2.893h2.156v-3.688h3.682v3.689h3.156v2.892h-3.156v6.395c0 .725.149 1.22.447 1.485.298.248.684.372 1.157.372.246 0 .491-.009.737-.027.263-.035.517-.088.762-.159l.526 2.733a7.825 7.825 0 01-1.499.319c-.473.07-.929.106-1.367.106-1.508 0-2.63-.363-3.367-1.088-.718-.725-1.078-1.946-1.078-3.662v-6.474z" fill="#fff"/></svg>
  143. </div>
  144. </div>
  145. `, data.EnglishUrl, data.JapaneseUrl))).Class("container-wrapper"))
  146. return
  147. }