PHRAS-3678 lightbox fix short cut when vote/forbidden vote on session close (#4028)

* fix short cut when vote

* forbidden to vote when feedback session is close

* fix on mobile

* fix image and button displayed on mobile
This commit is contained in:
Aina Sitraka
2022-05-25 14:38:17 +03:00
committed by GitHub
parent 2d928bc994
commit 3a20353e40
13 changed files with 60 additions and 36 deletions

View File

@@ -13,5 +13,5 @@ module.exports = {
setupDir: _root + 'tests/setup/node.js', setupDir: _root + 'tests/setup/node.js',
karmaConf: _root + 'config/karma.conf.js', karmaConf: _root + 'config/karma.conf.js',
// change this version when you change JS file for lazy loading // change this version when you change JS file for lazy loading
assetFileVersion: 56 assetFileVersion: 57
}; };

View File

@@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) { /******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ } /******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=56"; /******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=57";
/******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete; /******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() { /******/ function onScriptComplete() {

View File

@@ -96,7 +96,7 @@ return /******/ (function(modules) { // webpackBootstrap
/******/ if (__webpack_require__.nc) { /******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ } /******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=56"; /******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=57";
/******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete; /******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() { /******/ function onScriptComplete() {

View File

@@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) { /******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ } /******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=56"; /******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".js?v=57";
/******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete; /******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() { /******/ function onScriptComplete() {

View File

@@ -91,7 +91,7 @@
/******/ if (__webpack_require__.nc) { /******/ if (__webpack_require__.nc) {
/******/ script.setAttribute("nonce", __webpack_require__.nc); /******/ script.setAttribute("nonce", __webpack_require__.nc);
/******/ } /******/ }
/******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=56"; /******/ script.src = __webpack_require__.p + "lazy-" + ({}[chunkId]||chunkId) + ".min.js?v=57";
/******/ var timeout = setTimeout(onScriptComplete, 120000); /******/ var timeout = setTimeout(onScriptComplete, 120000);
/******/ script.onerror = script.onload = onScriptComplete; /******/ script.onerror = script.onload = onScriptComplete;
/******/ function onScriptComplete() { /******/ function onScriptComplete() {

View File

@@ -428,18 +428,26 @@ var lightbox = function lightbox(services) {
_slideshow(bool); _slideshow(bool);
break; break;
case 38: case 38:
el = (0, _jquery2.default)('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ((0, _jquery2.default)('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = (0, _jquery2.default)('#sc_container .basket_element.selected');
_setAgreement(event, el, id, 1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, 1);
}
} }
break; break;
case 40: case 40:
el = (0, _jquery2.default)('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ((0, _jquery2.default)('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = (0, _jquery2.default)('#sc_container .basket_element.selected');
_setAgreement(event, el, id, -1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, -1);
}
} }
break; break;
default: default:
break; break;

View File

@@ -428,18 +428,26 @@ var lightbox = function lightbox(services) {
_slideshow(bool); _slideshow(bool);
break; break;
case 38: case 38:
el = (0, _jquery2.default)('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ((0, _jquery2.default)('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = (0, _jquery2.default)('#sc_container .basket_element.selected');
_setAgreement(event, el, id, 1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, 1);
}
} }
break; break;
case 40: case 40:
el = (0, _jquery2.default)('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ((0, _jquery2.default)('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = (0, _jquery2.default)('#sc_container .basket_element.selected');
_setAgreement(event, el, id, -1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, -1);
}
} }
break; break;
default: default:
break; break;

View File

@@ -234,18 +234,26 @@ const lightbox = services => {
_slideshow(bool); _slideshow(bool);
break; break;
case 38: case 38:
el = $('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ($('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = $('#sc_container .basket_element.selected');
_setAgreement(event, el, id, 1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, 1);
}
} }
break; break;
case 40: case 40:
el = $('#sc_container .basket_element.selected'); // participants can vote
if (el.length === 1) { if ($('#basket_infos .user_infos .choices').length === 1) {
id = el.attr('id').split('_').pop(); el = $('#sc_container .basket_element.selected');
_setAgreement(event, el, id, -1); if (el.length === 1) {
id = el.attr('id').split('_').pop();
_setAgreement(event, el, id, -1);
}
} }
break; break;
default: default:
break; break;

View File

@@ -59,7 +59,7 @@ class PhraseanetExtension extends \Twig_Extension
{ {
return [ return [
// change this version when you change JS file to force the navigation to reload js file // change this version when you change JS file to force the navigation to reload js file
'assetFileVersion' => 56 'assetFileVersion' => 57
]; ];
} }

View File

@@ -250,7 +250,7 @@ a.active_choice {
} }
.lightbox-img { .lightbox-img {
width: 90px; width: 90px;
height: 90px; height: 70px;
background-color: #ededed; background-color: #ededed;
position: absolute; position: absolute;
left: 0; left: 0;

View File

@@ -67,13 +67,13 @@
</div> </div>
<div class="center-image">{{ thumbnail.format100percent(record.get_preview()) }}</div> <div class="center-image">{{ thumbnail.format100percent(record.get_preview()) }}</div>
{% if basket_element.getBasket().isVoteBasket() %} {% if basket_element.getBasket().isVoteBasket() %}
{% if basket_element.getBasket().getParticipant(app.getAuthenticatedUser()).getCanAgree() %} {% if (basket_element.getBasket().isVoteFinished() != true) and basket_element.getBasket().getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;"> <fieldset data-role="controlgroup" data-type="horizontal" style="text-align:center;">
<input {% if basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" /> <input {% if basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() == true%}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-yes_{{basket_element.getId()}}" value="yes" />
<label class="agreement_radio" style="width:110px;text-align:center;" <label class="agreement_radio" style="width:110px;text-align:center;margin-top: 10px;"
for="radio-view-yes_{{ basket_element.getId() }}">{{ 'validation:: OUI' | trans }}</label> for="radio-view-yes_{{ basket_element.getId() }}">{{ 'validation:: OUI' | trans }}</label>
<input {% if basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() == false and basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" /> <input {% if basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() == false and basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() is not null %}checked="checked"{% endif %} type="radio" name="radio-view" id="radio-view-no_{{basket_element.getId()}}" value="no" />
<label class="agreement_radio" style="width:110px;text-align:center;" <label class="agreement_radio" style="width:110px;text-align:center;margin-top: 10px;"
for="radio-view-no_{{ basket_element.getId() }}">{{ 'validation:: NON' | trans }}</label> for="radio-view-no_{{ basket_element.getId() }}">{{ 'validation:: NON' | trans }}</label>
</fieldset> </fieldset>
{% endif %} {% endif %}

View File

@@ -32,7 +32,7 @@
{% endif %} {% endif %}
</div> </div>
<div class="PNB user_infos"> <div class="PNB user_infos">
{% if basket_element and basket_element.getBasket().isVoteBasket() and basket.getParticipant(app.getAuthenticatedUser()).getCanAgree() %} {% if basket_element and basket_element.getBasket().isVoteBasket() and (basket.isVoteFinished() != true) and basket.getParticipant(app.getAuthenticatedUser()).getCanAgree() %}
<div class="PNB choices"> <div class="PNB choices">
<div style="height:60px;"> <div style="height:60px;">
{% set agreement = basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() %} {% set agreement = basket_element.getUserVote(app.getAuthenticatedUser(), true).getAgreement() %}

View File

@@ -53,7 +53,7 @@
</h2> </h2>
{% if basket.isVoteFinished() %} {% if basket.isVoteFinished() %}
{{ '(validation) session terminee' | trans }} {{ '(validation) session terminee' | trans }}
{% elseif basket.getParticipant(app.getAuthenticatedUser()).getIsConfirmed() %} {% elseif basket.isParticipant(app.getAuthenticatedUser()) and basket.getParticipant(app.getAuthenticatedUser()).getIsConfirmed() %}
{{ '(validation) envoyee' | trans }} {{ '(validation) envoyee' | trans }}
{% else %} {% else %}
{{ '(validation) a envoyer' | trans }} {{ '(validation) a envoyer' | trans }}