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.

84 lines
2.1 KiB

2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
  1. from odoo import models, fields, api, _
  2. class SurveySurvey(models.Model):
  3. _inherit = "survey.survey"
  4. @api.model
  5. def _get_default_style(self):
  6. return _(
  7. """/* Background frame (start and thank you) */
  8. // .jumbotron {
  9. // padding: 2rem 1rem;
  10. // margin-bottom: 2rem;
  11. // background-color: #e9ecef;
  12. // border-radius: 0.3rem;
  13. // }
  14. // @media (min-width: 576px) {
  15. // .jumbotron {
  16. // padding: 4rem 2rem;
  17. // }
  18. // }
  19. /* Titles (survey and pages) */
  20. // h1 {
  21. // font-size: 2.1875rem;
  22. // font-family: inherit;
  23. // font-weight: 500;
  24. // line-height: 1.2;
  25. // color: inherit;
  26. // margin-top: 0;
  27. // margin-bottom: 0.5rem;
  28. // }
  29. /* Descriptions (survey and pages) */
  30. // p {
  31. // margin-top: 0;
  32. // margin-bottom: 1rem;
  33. // }
  34. /* Questions titles */
  35. // h2 {
  36. // font-size: 1.75rem;
  37. // font-family: inherit;
  38. // font-weight: 500;
  39. // line-height: 1.2;
  40. // color: inherit;
  41. // margin-top: 0;
  42. // margin-bottom: 0.5rem;
  43. // }
  44. /* Responses labels (MCQ) */
  45. // label {
  46. // margin-bottom: 0.5rem;
  47. // }
  48. /* Buttons (start, navigate and submit) */
  49. // .btn-primary {
  50. // color: #FFFFFF;
  51. // background-color: #00A09D;
  52. // border-color: #00A09D;
  53. // }
  54. // .btn-primary:hover {
  55. // color: #FFFFFF;
  56. // background-color: #007a77;
  57. // border-color: #006d6b;
  58. // }"""
  59. )
  60. scss_style = fields.Text(string="SCSS style", default=_get_default_style)
  61. start_btn_label = fields.Char(
  62. string="Start button label",
  63. translate=True,
  64. track_visibility="onchange",
  65. help='This label will be used in the survey start button. If empty, the label will be "Start survey".',
  66. )
  67. submit_btn_label = fields.Char(
  68. string="Submit button label",
  69. translate=True,
  70. track_visibility="onchange",
  71. help='This label will be used in the survey submit button. If empty, the label will be "Submit survey".',
  72. )
  73. thank_you_title = fields.Char(
  74. string="Thank you page title",
  75. translate=True,
  76. help='This title will be used in the survey "Thank you" page. If empty, the label will be "Thank you !".',
  77. )