diff --git a/controllers/main.py b/controllers/main.py index 87f423e8a6b7c1d49f850d4ca6ca5b4b24fa7f02..dea85563ebac198bb2529552f51394162474b2b3 100644 --- a/controllers/main.py +++ b/controllers/main.py @@ -49,6 +49,11 @@ class WebsiteSurveyExtend(Survey): vals = {'last_displayed_page_id': page_id} if next_page is None and not go_back: vals.update({'state': 'done'}) + if user_input.survey_id.is_mail_auto: + # Send mail auto if survey configurated + user_input.action_send_mail() + # Send notification to followers + survey.message_post(body="Sondage terminé", message_type="notification", subtype="ethikis_survey.survey_state_change") else: vals.update({'state': 'skip'}) user_input.sudo(user=user_id).write(vals) diff --git a/models/survey_survey.py b/models/survey_survey.py index ea888f2d4a2cfeda05b912e8e4d3746fc0dc33d9..c7fb9ade44de724824e292ad30bfc773a7441f0e 100644 --- a/models/survey_survey.py +++ b/models/survey_survey.py @@ -38,7 +38,7 @@ class Survey(models.Model): def _track_subtype(self, init_values): self.ensure_one() - if (('stage_id' in init_values) and (self.stage_id.name == "Fermé")): + if (('stage_id' in init_values) and (self.stage_id.name == "Terminé")): return 'ethikis_survey.survey_state_change' return super(Survey, self)._track_subtype(init_values) @@ -92,13 +92,6 @@ class SurveyUserInput(models.Model): 'url': '/survey/%s/%s/%s' % (url_tag, self.survey_id.id, self.token) } - @api.onchange('state') - def on_change_state(self): - # At the end of the survey, send a mail if survey is configured for that - if self.state == 'done': - if self.survey_id.is_mail_auto: - self.action_send_mail() - @api.multi def action_send_mail(self): self.ensure_one() diff --git a/static/src/css/ethikis_survey.css b/static/src/css/ethikis_survey.css index 8b3c80db779810a5d15b8d1dc09d329120d7500b..676eb1fbcae8c552a106d764d534b190e14e123a 100644 --- a/static/src/css/ethikis_survey.css +++ b/static/src/css/ethikis_survey.css @@ -185,14 +185,57 @@ input[type=range] { input[type=range]:focus { outline: none; } + +input[type=range]::-ms-track { + width: 100%; + height: 4px; + cursor: pointer; + animate: 0.2s; + background: #61C4E1; + background-color: #61C4E1; + border-radius: 25px; +} + +input[type=range]::-moz-range-track { + width: 100%; + height: 4px; + cursor: pointer; + animate: 0.2s; + background: #61C4E1; + background-color: #61C4E1; + border-radius: 25px; +} + input[type=range]::-webkit-slider-runnable-track { width: 100%; height: 4px; cursor: pointer; animate: 0.2s; background: #61C4E1; + background-color: #61C4E1; border-radius: 25px; } + +input[type=range]::-moz-range-thumb{ + height: 20px; + width: 20px; + border-radius: 50%; + background: #fff; + box-shadow: 0 0 4px 0 rgba(0,0,0, 1); + cursor: pointer; + -webkit-appearance: none; + margin-top: -8px; +} +input[type=range]::-ms-thumb{ + height: 20px; + width: 20px; + border-radius: 50%; + background: #fff; + box-shadow: 0 0 4px 0 rgba(0,0,0, 1); + cursor: pointer; + -webkit-appearance: none; + margin-top: -8px; +} input[type=range]::-webkit-slider-thumb { height: 20px; width: 20px; @@ -203,9 +246,20 @@ input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; margin-top: -8px; } + +input[type=range]:focus::-ms-track{ + background: #61C4E1; + background-color: #61C4E1; +} +input[type=range]:focus::-moz-range-track{ + background: #61C4E1; + background-color: #61C4E1; +} input[type=range]:focus::-webkit-slider-runnable-track { background: #61C4E1; + background-color: #61C4E1; } + .range-wrap{ position: relative; } @@ -246,7 +300,7 @@ input[type=range]:focus::-webkit-slider-runnable-track { box-shadow: 0 0 0 0.2rem rgba(0, 160, 157, 0); } -.form-control { - background-color: transparent !important; - border: 0px solid #ced4da !important; +input#range{ + background-color: transparent !important; + border: 0px solid #ced4da !important; }