Advertisement
Guest User

Untitled

a guest
Mar 13th, 2018
415
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 9.61 KB | None | 0 0
  1. <!DOCTYPE html>
  2. <html lang="fr">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="csrf-token" content="{{ csrf_token() }}">
  6. <title>{{ config('app.name') }}</title>
  7. <link href="https://unpkg.com/bootstrap@3.3.7/dist/css/bootstrap.min.css" rel="stylesheet">
  8. <link href="https://unpkg.com/bootstrap-material-design@0.5.10/dist/css/bootstrap-material-design.css" rel="stylesheet">
  9. <link href="https://unpkg.com/bootstrap-material-design@0.5.10/dist/css/ripples.css" rel="stylesheet">
  10. <link href="/vendor/font-awesome/css/font-awesome.min.css" rel="stylesheet" type="text/css">
  11. <link href="https://fonts.googleapis.com/css?family=Montserrat:400,700" rel="stylesheet" type="text/css">
  12. <link href='https://fonts.googleapis.com/css?family=Kaushan+Script' rel='stylesheet' type='text/css'>
  13. <link href='https://fonts.googleapis.com/css?family=Droid+Serif:400,700,400italic,700italic' rel='stylesheet' type='text/css'>
  14. <link href='https://fonts.googleapis.com/css?family=Roboto+Slab:400,100,300,700' rel='stylesheet' type='text/css'>
  15.  
  16. <style>
  17. body {
  18. background-color: #fff;
  19.  
  20. .btn-green {
  21. background-color: #1ab394;
  22. color: #fff;
  23. border-radius: 3px;
  24.  
  25. &:hover, &:focus {
  26. background-color: #18a689;
  27. color: #fff;
  28. }
  29. }
  30.  
  31. .my-rating {
  32. font-size: 12px;
  33. }
  34.  
  35. .panel-footer {
  36. background-color: #fff;
  37. text-align: right;
  38. }
  39. }
  40.  
  41. </style>
  42.  
  43. <!-- Custom styles for this template -->
  44. <link href="/css/agency.min.css" rel="stylesheet">
  45. </head>
  46. <body>
  47. <div class="col-lg-9 col-md-9 col-sm-12 col-xs-12">
  48. <div class="jumbotron">
  49. <div id="surveyElement"></div>
  50.  
  51. <div id="result"></div>
  52. </div>
  53. </div>
  54. </body>
  55.  
  56. <script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.4/jquery.min.js"></script>
  57. <script src="https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>
  58. <script src="https://unpkg.com/bootstrap-material-design@0.5.10/dist/js/material.js"></script>
  59. <script src="https://unpkg.com/bootstrap-material-design@0.5.10/dist/js/ripples.js"></script>
  60. <script src="https://cdnjs.cloudflare.com/ajax/libs/knockout/3.3.0/knockout-min.js"></script>
  61. <script src="https://unpkg.com/survey-knockout@0.12.15/survey.ko.min.js"></script>
  62.  
  63.  
  64. <script type="text/javascript">
  65. $.material.init();
  66.  
  67. var json = {
  68. completedHtml: "Découvrez <a href=\"/\">ExoSuite !</a>",
  69. title: "Retour sur ExoSuite",
  70. showProgressBar: "top",
  71. pages: [
  72. {
  73. elements: [
  74. {
  75. type: "rating",
  76. name: "À quelle échelle avez-vous aimé l'événement ?",
  77. isRequired: true,
  78. rateValues: [
  79. {
  80. value: "1",
  81. text: "Bof..."
  82. },
  83. {
  84. value: "2",
  85. text: "Ouais"
  86. },
  87. {
  88. value: "3",
  89. text: "Excellent !"
  90. }
  91. ]
  92. },
  93. {
  94. type: "matrix",
  95. columns: [
  96. {
  97. value: "1",
  98. text: "Pas du tout d'accord"
  99. },
  100. {
  101. value: "2",
  102. text: "Neutre"
  103. },
  104. {
  105. value: "3",
  106. text: "Entièrement d'accord"
  107. }
  108. ],
  109. isAllRowRequired: true,
  110. isRequired: true,
  111. name: "Indiquez si vous êtes d'accord avec les phrases suivantes",
  112. rows: [
  113. "Je me suis amusé lors de l'événement",
  114. "J'ai aimé l'aspect communautaire et compétitif de cette événement",
  115. "J'en parlerai à mes proches",
  116. "J'attends le prochain événement"
  117. ]
  118. }
  119. ],
  120. name: "page1"
  121. },
  122. {
  123. elements: [
  124. {
  125. type: "radiogroup",
  126. name: "Combien d'argent vous dépenseriez par mois pour du sport",
  127. isRequired: true,
  128. choices: [
  129. {
  130. value: "1",
  131. text: "0€ - 20€"
  132. },
  133. {
  134. value: "2",
  135. text: "21€ - 50€"
  136. },
  137. {
  138. value: "3",
  139. text: "51€ - 150€"
  140. },
  141. {
  142. value: "4",
  143. text: "Plus de 151€"
  144. }
  145. ],
  146. choicesOrder: "asc"
  147. },
  148. {
  149. type: "radiogroup",
  150. name: "Utilisez-vous une application pour faire du sport ?",
  151. isRequired: true,
  152. choices: [
  153. {
  154. value: "1",
  155. text: "Oui"
  156. },
  157. {
  158. value: "2",
  159. text: "Non"
  160. }
  161. ]
  162. }
  163. ],
  164. name: "page2"
  165. },
  166. {
  167. elements: [
  168. {
  169. type: "radiogroup",
  170. name: "Accepteriez-vous de courir avec des lunettes connectées ?",
  171. isRequired: true,
  172. choices: [
  173. {
  174. value: "1",
  175. text: "Oui"
  176. },
  177. {
  178. value: "2",
  179. text: "Non"
  180. }
  181. ]
  182. },
  183. {
  184. type: "radiogroup",
  185. name: "Voulez-vous faire du sport en utilisant les nouvelles technologies ?",
  186. isRequired: true,
  187. choices: [
  188. {
  189. value: "1",
  190. text: "Oui"
  191. },
  192. {
  193. value: "2",
  194. text: "Non"
  195. }
  196. ]
  197. },
  198. {
  199. type: "html",
  200. html: "Avec les applications pour lunettes connectées ExoSuite, vous aurez la possibilité de courir contre des entités représentant les performances d'autres utilisateurs, que vous pourrez rencontrer lors d'évènements communautaires. Enfilez vos lunettes connectées et devenez acteur d'une révolution en matière de coaching sportif prônant un aspect communautaire amplifié, et obtenez un suivi personnalisé, quand et où vous voulez, afin d'améliorer vos performances.",
  201. name: "question1"
  202. },
  203. {
  204. type: "text",
  205. inputType: "number",
  206. isRequired: true,
  207. name: "Combien seriez-vous prêt à payer pour cette solution sportive innovante ?"
  208. },
  209. {
  210. type: "text",
  211. inputType: "email",
  212. name: "Intéressé ? Laissez-nous votre mail !"
  213. }
  214. ],
  215. name: "page3"
  216. }
  217. ]
  218. };
  219.  
  220. Survey.defaultBootstrapMaterialCss.navigationButton = "btn btn-green";
  221. Survey.defaultBootstrapMaterialCss.rating.item = "btn btn-default my-rating";
  222. Survey.Survey.cssType = "bootstrapmaterial";
  223.  
  224. var survey = new Survey.Model(json);
  225.  
  226. survey.onComplete.add(function(result) {
  227. var str_json = JSON.stringify(result.data);
  228. $.ajax({
  229. url: '/survey',
  230. method: 'POST',
  231. data: {
  232. json: str_json
  233. },
  234. headers: {
  235. 'X-CSRF-TOKEN': $('meta[name=csrf-token]').attr('content')
  236. },
  237. dataType: 'json',
  238. success: function (data) {
  239. console.info(data);
  240. }
  241. });
  242. //document.querySelector('#result').innerHTML = "result: " + JSON.stringify(result.data);
  243. });
  244.  
  245. survey.render("surveyElement");
  246. </script>
  247. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement