Odoo modules related to surveys
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

44 lines
1.4 KiB

  1. <?xml version="1.0" encoding="utf-8"?>
  2. <odoo>
  3. <template id="upload_file" name="Upload a file">
  4. <div class="input-file-container">
  5. <t t-if="user_input_line_upload_file">
  6. <t t-foreach="user_input_line_upload_file" t-as="upload_file" t-if="upload_file.question_id.id == question.id">
  7. <t t-if="upload_file.file_type == 'pdf'">
  8. <a width="100px" height="100px" t-att-href="'data:application/pdf;base64,%s' % to_text(upload_file.file)" target="_blank">Download</a>
  9. </t>
  10. <t t-if="upload_file.file_type == 'image'">
  11. <img width="100px" style="height: 100px;" class="img-thumbnail" t-att-src="'data:image/*;base64,%s' % to_text(upload_file.file)"/>
  12. </t>
  13. </t>
  14. </t>
  15. <t t-else="">
  16. <div class="file-field" >
  17. <input class="input-file" id="my-file" type="file" accept="image/*,application/pdf" t-att-name="prefix"/>
  18. </div>
  19. <br/>
  20. </t>
  21. </div>
  22. <script>
  23. $(document).ready(function(){
  24. $(".img-thumbnail").click(function(){
  25. if ( $(this).height() == 240) {
  26. $(this).animate({
  27. opacity: '0.8',
  28. height: '100px',
  29. width: '100px',
  30. }, "slow");
  31. } else {
  32. $(this).animate({
  33. opacity: '0.8',
  34. height: '250px',
  35. width: '250px',
  36. }, "slow");
  37. }
  38. });
  39. });
  40. </script>
  41. </template>
  42. </odoo>