Commit 4d0c28eb authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Task #15866: Adds voting closed list color to question list caption.

parent 380e69c4
......@@ -192,6 +192,7 @@
QUESTION_FREETEXT_SHORT: "Text",
OPEN_QUESTION: "Offene Frage",
CLOSED_QUESTION: "Gesperrte Frage",
CLOSED_VOTING: "Abstimmung gesperrt",
CONFIRM_CLOSE_VOTE: "Abstimmung wirklich sperren?",
CONFIRM_CLOSE_QUESTION: "Frage wirklich sperren?",
CONFIRM_CLOSE_ALL_QUESTIONS: "Fragen wirklich sperren?",
......@@ -753,6 +754,7 @@
QUESTION_FREETEXT_SHORT: "Free text",
OPEN_QUESTION: "Open Question",
CLOSED_QUESTION: "Closed Question",
CLOSED_VOTING: "Vote closed",
CONFIRM_CLOSE_VOTE: "Are you sure to close the vote?",
CONFIRM_CLOSE_QUESTION: "Are you sure to close this question?",
CONFIRM_CLOSE_ALL_QUESTIONS: "Are you sure to close all questions?",
......
......@@ -38,7 +38,7 @@ Ext.define('ARSnova.view.Caption', {
style: this.getStyle()
});
this.add([].concat(window.innerWidth > 320 ? [{
this.add([].concat(window.innerWidth > 410 ? [{
cls: 'gravure',
style: {
fontSize: "0.6em"
......@@ -48,6 +48,8 @@ Ext.define('ARSnova.view.Caption', {
},
explainStatus: function (items) {
var listButtonText = "";
var hasActiveItems = false;
items.forEach(function (item) {
hasActiveItems = hasActiveItems || !!item.active;
......@@ -56,6 +58,10 @@ Ext.define('ARSnova.view.Caption', {
items.forEach(function (item) {
hasInactiveItems = hasInactiveItems || !!!item.active;
});
var hasVotingDisabledItems = false;
items.forEach(function (item) {
hasVotingDisabledItems = hasVotingDisabledItems || !!item.votingDisabled;
});
var activeText = "";
if (hasActiveItems) {
......@@ -65,11 +71,26 @@ Ext.define('ARSnova.view.Caption', {
if (hasInactiveItems) {
inactiveText = "<span class='isInactive'>" + this.getTranslation().inactive + "</span>";
}
if (hasActiveItems && hasInactiveItems) {
this.listButton.setText(inactiveText + " / " + activeText);
} else {
this.listButton.setText(activeText || inactiveText);
var votingDisabledText = "";
if (hasVotingDisabledItems) {
votingDisabledText = "<span class='isVoteInactive'>" + this.getTranslation().disabledVote + "</span>";
}
if (hasActiveItems) {
listButtonText = activeText;
}
if (hasVotingDisabledItems) {
listButtonText = listButtonText.length !== 0 ?
listButtonText + " / " + votingDisabledText :
votingDisabledText;
}
if (hasInactiveItems) {
listButtonText = listButtonText.length !== 0 ?
listButtonText + " / " + inactiveText :
inactiveText;
}
this.listButton.setText(listButtonText);
},
summarize: function (sessions, options) {
......
......@@ -88,8 +88,12 @@ Ext.define('ARSnova.view.speaker.AudienceQuestionPanel', {
},
itemCls: 'forwardListButton',
itemTpl: '<tpl if="active"><div class="buttontext noOverflow">{text:htmlEncode}</div></tpl>' +
'<tpl if="!active"><div class="isInactive buttontext noOverflow">{text:htmlEncode}</div></tpl>' +
itemTpl:
'<tpl if="!active"><div class="isInactive buttontext noOverflow">{text:htmlEncode}</div>' +
'<tpl else>' +
'<tpl if="votingDisabled"><div class="isVoteInactive buttontext noOverflow">{text:htmlEncode}</div>' +
'<tpl else><div class="buttontext noOverflow">{text:htmlEncode}</div></tpl>' +
'</tpl>' +
'<div class="x-button x-hasbadge audiencePanelListBadge">' +
'<tpl if="numAnswers &gt; 0"><span class="answersBadgeIcon badgefixed">{numAnswers}</span></tpl></div>',
grouped: true,
......@@ -181,7 +185,8 @@ Ext.define('ARSnova.view.speaker.AudienceQuestionPanel', {
this.caption = Ext.create('ARSnova.view.Caption', {
translation: {
active: Messages.OPEN_QUESTION,
inactive: Messages.CLOSED_QUESTION
inactive: Messages.CLOSED_QUESTION,
disabledVote: Messages.CLOSED_VOTING
},
cls: "x-form-fieldset",
style: "border-radius: 15px",
......
......@@ -474,7 +474,7 @@ html,body {
}
.matrixButton.smallerActionButton .buttonText {
width: 110px !important;
width: 107px !important;
margin-left: 0px;
margin-right: 0px;
}
......
......@@ -474,6 +474,10 @@ $toolbar-toogleCorrect-button-inactive-color: $thm-lightgrey;
color: $thm-red;
}
.isVoteInactive {
color: $thm-orange;
}
.x-toast {
color: #4a5c66;
box-shadow: 0 0 8px 0;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment