Skip to content

Commit

Permalink
Fixed issue #18620: Column relevance disabling not working as expected (
Browse files Browse the repository at this point in the history
#2905)

Co-authored-by: lapiudevgit <devgit@lapiu.biz>
  • Loading branch information
gabrieljenik and lapiudevgit committed Mar 17, 2023
1 parent 554fdd1 commit d9d5594
Show file tree
Hide file tree
Showing 7 changed files with 287 additions and 272 deletions.
5 changes: 1 addition & 4 deletions application/views/questionAdministration/subquestionRow.twig
Expand Up @@ -129,21 +129,18 @@
</div>
</td>

{% set relevanceTooltip = supportsRelevance ? gT("Click to expand") : gT("Relevance is not currently supported for columns") %}

<!-- Relevance equation -->
{% if first and scale_id == 0 %}
<td class="relevance-equation">
<input
data-toggle="tooltip"
data-title="{{ relevanceTooltip }}"
data-title="{{ gT("Click to expand") }}"
type='text'
class='relevance form-control input'
id='subquestions[{{ subquestion.qid }}][{{ scale_id }}][relevance]'
name='subquestions[{{ subquestion.qid }}][{{ scale_id }}][relevance]'
value="{{ subquestion.relevance|escape('html_attr') }}"
onkeypress=" if(event.keyCode==13) { if (event && event.preventDefault) event.preventDefault(); document.getElementById('save-button').click(); return false;}"
{{ supportsRelevance ? '' : 'readonly="readonly"' }}
/>
</td>
{% else %}
Expand Down
5 changes: 3 additions & 2 deletions application/views/questionAdministration/subquestions.twig
Expand Up @@ -3,6 +3,8 @@

{% set first = true %}
{% set scale_id = 0 %}
{# TODO: Add question type attribute to indicate if the type supports relevance on subquestions #}
{% set supportsRelevance = question.questionType.code != 'H' %}

<!-- Loop all language, and then hide all but the current selected one with JS. -->
{% for lang in allLanguages %}
Expand All @@ -28,7 +30,7 @@
<!-- NB: Both questions and answer options uses class "answertable". -->
<div class="subquestions-table-wrapper" style="max-height: 414px;">
<table
class='answertable subquestions-table table table-responsive'
class='answertable subquestions-table table table-responsive {{ supportsRelevance ? '' : 'hide-relevance' }}'
id='subquestions_{{lang}}_{{scale_id}}'
data-scaleid='{{ scale_id }}'
data-input-data-id='add-subquestion-input-javascript-datas'
Expand Down Expand Up @@ -69,7 +71,6 @@
'subquestionl10n': subquestion.questionl10ns[lang],
'language' : lang,
'oldCode' : true,
'supportsRelevance' : question.questionType.code != 'H',
} %}

{% set position = position + 1 %}
Expand Down
269 changes: 137 additions & 132 deletions assets/packages/adminbasics/build/adminbasics.css
@@ -1,4 +1,8 @@
@charset "UTF-8";
#cpdbatt {
min-height: 100px;
}

/**
* Lime Admin Common CSS File
*
Expand Down Expand Up @@ -4352,120 +4356,8 @@ html[dir=rtl] th {
overflow-x: visible;
}

.jcarousel-wrapper {
margin: 20px auto;
position: relative;
border: 10px solid #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 0 2px #999;
-moz-box-shadow: 0 0 2px #999;
box-shadow: 0 0 2px #999;
}

/** Carousel **/
.jcarousel {
position: relative;
overflow: hidden;
width: 100%;
}

.jcarousel ul {
width: 20000em;
position: relative;
list-style: none;
margin: 0;
padding: 0;
}

.jcarousel li {
width: 200px;
float: left;
border: 1px solid #fff;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

.jcarousel img {
display: block;
max-width: 100%;
height: auto !important;
}

/** Carousel Controls **/
.jcarousel-control-prev,
.jcarousel-control-next {
position: absolute;
top: 50%;
margin-top: -15px;
width: 30px;
height: 30px;
text-align: center;
background: #4E443C;
color: #fff;
text-decoration: none;
text-shadow: 0 0 1px #000;
font: 24px/27px Arial, sans-serif;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 0 0 4px #F0EFE7;
-moz-box-shadow: 0 0 4px #F0EFE7;
box-shadow: 0 0 4px #F0EFE7;
}

.jcarousel-control-prev {
left: 15px;
}

.jcarousel-control-next {
right: 15px;
}

/** Carousel Pagination **/
.jcarousel-pagination {
position: absolute;
bottom: -40px;
left: 50%;
-webkit-transform: translate(-50%, 0);
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
margin: 0;
}

.jcarousel-pagination a {
text-decoration: none;
display: inline-block;
font-size: 11px;
height: 10px;
width: 10px;
line-height: 10px;
background: #fff;
color: #4E443C;
border-radius: 10px;
text-indent: -9999px;
margin-right: 7px;
-webkit-box-shadow: 0 0 2px #4E443C;
-moz-box-shadow: 0 0 2px #4E443C;
box-shadow: 0 0 2px #4E443C;
}

.jcarousel-pagination a.active {
background: #4E443C;
color: #fff;
opacity: 1;
-webkit-box-shadow: 0 0 2px #F0EFE7;
-moz-box-shadow: 0 0 2px #F0EFE7;
box-shadow: 0 0 2px #F0EFE7;
}

.template-miniature {
cursor: pointer;
}

.item.inactive {
/** Hide Relevance Equation column for subquestions when not supported */
.subquestions-table.hide-relevance #rel-eq-th, .subquestions-table.hide-relevance td.relevance-equation {
display: none;
}

Expand Down Expand Up @@ -4576,6 +4468,22 @@ div.mappable-attribute-wrapper.paired.ui-state-disabled {
min-height: 100px;
}

#responses-column-filter-modal .checkbox label {
vertical-align: text-bottom;
white-space: nowrap;
overflow-x: hidden;
}

.responses-multiselect-checkboxes {
overflow-y: scroll;
height: 60vh;
}

.responses-column-filter-modal-checkbox-buttons {
text-align: left;
padding-bottom: 15px;
}

.grid-view .table td.button-column, .grid-view .table th.button-column, .grid-view-ls .table td.button-column, .grid-view-ls .table th.button-column {
white-space: nowrap;
text-align: initial;
Expand Down Expand Up @@ -4770,32 +4678,129 @@ div.mappable-attribute-wrapper.paired.ui-state-disabled {
margin: 8px;
}

#responses-column-filter-modal .checkbox label {
vertical-align: text-bottom;
white-space: nowrap;
overflow-x: hidden;
.translate > table {
table-layout: fixed;
}

.responses-multiselect-checkboxes {
overflow-y: scroll;
height: 60vh;
.translate td._from_ > .question-text-from {
width: 100%;
overflow: auto;
word-wrap: break-word;
}

.responses-column-filter-modal-checkbox-buttons {
text-align: left;
padding-bottom: 15px;
.jcarousel-wrapper {
margin: 20px auto;
position: relative;
border: 10px solid #fff;
-webkit-border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px;
-webkit-box-shadow: 0 0 2px #999;
-moz-box-shadow: 0 0 2px #999;
box-shadow: 0 0 2px #999;
}

#cpdbatt {
min-height: 100px;
/** Carousel **/
.jcarousel {
position: relative;
overflow: hidden;
width: 100%;
}

.translate > table {
table-layout: fixed;
.jcarousel ul {
width: 20000em;
position: relative;
list-style: none;
margin: 0;
padding: 0;
}

.translate td._from_ > .question-text-from {
width: 100%;
overflow: auto;
word-wrap: break-word;
.jcarousel li {
width: 200px;
float: left;
border: 1px solid #fff;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
box-sizing: border-box;
}

.jcarousel img {
display: block;
max-width: 100%;
height: auto !important;
}

/** Carousel Controls **/
.jcarousel-control-prev,
.jcarousel-control-next {
position: absolute;
top: 50%;
margin-top: -15px;
width: 30px;
height: 30px;
text-align: center;
background: #4E443C;
color: #fff;
text-decoration: none;
text-shadow: 0 0 1px #000;
font: 24px/27px Arial, sans-serif;
-webkit-border-radius: 30px;
-moz-border-radius: 30px;
border-radius: 30px;
-webkit-box-shadow: 0 0 4px #F0EFE7;
-moz-box-shadow: 0 0 4px #F0EFE7;
box-shadow: 0 0 4px #F0EFE7;
}

.jcarousel-control-prev {
left: 15px;
}

.jcarousel-control-next {
right: 15px;
}

/** Carousel Pagination **/
.jcarousel-pagination {
position: absolute;
bottom: -40px;
left: 50%;
-webkit-transform: translate(-50%, 0);
-ms-transform: translate(-50%, 0);
transform: translate(-50%, 0);
margin: 0;
}

.jcarousel-pagination a {
text-decoration: none;
display: inline-block;
font-size: 11px;
height: 10px;
width: 10px;
line-height: 10px;
background: #fff;
color: #4E443C;
border-radius: 10px;
text-indent: -9999px;
margin-right: 7px;
-webkit-box-shadow: 0 0 2px #4E443C;
-moz-box-shadow: 0 0 2px #4E443C;
box-shadow: 0 0 2px #4E443C;
}

.jcarousel-pagination a.active {
background: #4E443C;
color: #fff;
opacity: 1;
-webkit-box-shadow: 0 0 2px #F0EFE7;
-moz-box-shadow: 0 0 2px #F0EFE7;
box-shadow: 0 0 2px #F0EFE7;
}

.template-miniature {
cursor: pointer;
}

.item.inactive {
display: none;
}
2 changes: 1 addition & 1 deletion assets/packages/adminbasics/build/adminbasics.min.css

Large diffs are not rendered by default.

0 comments on commit d9d5594

Please sign in to comment.