Commit 139689a8 authored by Andreas Gärtner's avatar Andreas Gärtner
Browse files

Task #15902/Task #15972: Color and badge caption overhaul.

parent 055e5a79
......@@ -229,7 +229,7 @@
/* user */
QUESTIONS_TO_STUDENTS: "Fragen ans Publikum",
QUESTIONS_FROM_STUDENTS: "Fragen der Studierenden",
UNRED_QUESTIONS_FROM_STUDENTS: "Ungelesene Fragen",
UNREAD_QUESTIONS_FROM_STUDENTS: "Ungelesene Fragen",
PREPARATION_QUESTIONS: "Vorbereitung",
PREPARATION_QUESTIONS_LONG: "Vorbereitungsaufgaben",
PREPARATION_QUESTION_SHORT: "Vorbereitung",
......@@ -790,7 +790,7 @@
/* user */
QUESTIONS_TO_STUDENTS: "Teacher's questions",
QUESTIONS_FROM_STUDENTS: "Student questions",
UNRED_QUESTIONS_FROM_STUDENTS: "Unread student questions",
UNREAD_QUESTIONS_FROM_STUDENTS: "Unread questions",
PREPARATION_QUESTIONS: "Prep tasks",
PREPARATION_QUESTIONS_LONG: "Preparation tasks",
PREPARATION_QUESTION_SHORT: "Prep task",
......
......@@ -111,7 +111,7 @@ Ext.define('ARSnova.view.Caption', {
});
var hasFeedbackQuestions = false;
var hasUnredFeedbackQuestions = false;
var hasUnreadFeedbackQuestions = false;
var hasQuestions = false;
var hasUnansweredQuestions = false;
var hasAnswers = false;
......@@ -120,7 +120,7 @@ Ext.define('ARSnova.view.Caption', {
hasQuestions = hasQuestions || item > 0;
} else {
hasFeedbackQuestions = hasFeedbackQuestions || item.hasFeedbackQuestions || item.numInterposed > 0;
hasUnredFeedbackQuestions = hasUnredFeedbackQuestions || item.hasUnredFeedbackQuestions || item.numUnredInterposed > 0;
hasUnreadFeedbackQuestions = hasUnreadFeedbackQuestions || item.hasUnredFeedbackQuestions || item.numUnredInterposed > 0;
hasQuestions = hasQuestions || item.hasQuestions || item.numQuestions > 0;
hasUnansweredQuestions = hasUnansweredQuestions || item.hasUnansweredQuestions || item.numUnanswered > 0;
hasAnswers = hasAnswers || item.hasAnswers || item.numAnswers > 0;
......@@ -130,7 +130,7 @@ Ext.define('ARSnova.view.Caption', {
badgeText: options.interposed && hasFeedbackQuestions ? Messages.QUESTIONS_FROM_STUDENTS : "",
badgeCls: "feedbackQuestionsBadgeIcon"
}, {
badgeText: (options.unredInterposed && hasUnredFeedbackQuestions) ? Messages.UNRED_QUESTIONS_FROM_STUDENTS : "",
badgeText: (options.unredInterposed && hasUnreadFeedbackQuestions) ? Messages.UNREAD_QUESTIONS_FROM_STUDENTS : "",
badgeCls: "unreadFeedbackQuestionsBadgeIcon"
}, {
badgeText: (options.questions && hasQuestions) || (options.unanswered && hasUnansweredQuestions) ? Messages.QUESTIONS : "",
......
......@@ -218,7 +218,8 @@ Ext.define('ARSnova.view.speaker.InClass', {
this.caption = Ext.create('ARSnova.view.Caption', {
style: "border-radius: 15px",
minScreenWidth: 440
minScreenWidth: 440,
hidden: true
});
this.inClassItems = Ext.create('Ext.form.FormPanel', {
......@@ -363,13 +364,12 @@ Ext.define('ARSnova.view.speaker.InClass', {
updateCaption: function () {
var me = this;
var hasOptions = function (badges) {
return Ext.Object.getValues(badges).reduce(function (a, b) {
return a + b;
}, 0) > 0;
};
var hasOptions = this.badgeOptions.numAnswers ||
this.badgeOptions.numUnredInterposed ||
this.badgeOptions.numInterposed ||
this.badgeOptions.numQuestions;
if (hasOptions(this.badgeOptions)) {
if (hasOptions) {
me.caption.explainBadges([me.badgeOptions]);
me.caption.listButton.setText(' ');
me.caption.show();
......
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