From fccfb2ca845666a223ba33f40ed7ece7b4fdfcaf Mon Sep 17 00:00:00 2001 From: anhefti Date: Wed, 27 Nov 2019 10:11:13 +0100 Subject: [PATCH] some tweaks on exam form --- .../seb/sebserver/gui/content/ExamForm.java | 33 ++++++++++++------- src/main/resources/static/css/sebserver.css | 6 ++-- 2 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java index e469670b..7ac7f32b 100644 --- a/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java +++ b/src/main/java/ch/ethz/seb/sebserver/gui/content/ExamForm.java @@ -308,7 +308,8 @@ public class ExamForm implements TemplateComposer { QuizData.QUIZ_ATTR_START_URL, FORM_QUIZ_URL_TEXT_KEY, exam.startURL) - .readonly(true)) + .readonly(true) + .withInputSpan(7)) .addField(FormBuilder.text( QuizData.QUIZ_ATTR_DESCRIPTION, @@ -316,7 +317,8 @@ public class ExamForm implements TemplateComposer { exam.description) .asArea() .readonly(true) - .withInputSpan(6)) + .withInputSpan(6) + .withEmptyCellSeparation(false)) .addField(FormBuilder.text( Domain.EXAM.ATTR_STATUS + "_display", @@ -401,15 +403,18 @@ public class ExamForm implements TemplateComposer { .withColumn(new ColumnDefinition<>( Domain.CONFIGURATION_NODE.ATTR_NAME, CONFIG_NAME_COLUMN_KEY, - ExamConfigurationMap::getConfigName)) + ExamConfigurationMap::getConfigName) + .widthProportion(2)) .withColumn(new ColumnDefinition<>( Domain.CONFIGURATION_NODE.ATTR_DESCRIPTION, CONFIG_DESCRIPTION_COLUMN_KEY, - ExamConfigurationMap::getConfigDescription)) - .withColumn(new ColumnDefinition<>( + ExamConfigurationMap::getConfigDescription) + .widthProportion(4)) + .withColumn(new ColumnDefinition( Domain.CONFIGURATION_NODE.ATTR_STATUS, CONFIG_STATUS_COLUMN_KEY, - this.resourceService::localizedExamConfigStatusName)) + this.resourceService::localizedExamConfigStatusName) + .widthProportion(1)) .withDefaultActionIf( () -> editable, this::viewExamConfigPageAction) @@ -483,15 +488,18 @@ public class ExamForm implements TemplateComposer { .withColumn(new ColumnDefinition<>( Domain.INDICATOR.ATTR_NAME, INDICATOR_NAME_COLUMN_KEY, - Indicator::getName)) + Indicator::getName) + .widthProportion(2)) .withColumn(new ColumnDefinition<>( Domain.INDICATOR.ATTR_TYPE, INDICATOR_TYPE_COLUMN_KEY, - this::indicatorTypeName)) + this::indicatorTypeName) + .widthProportion(1)) .withColumn(new ColumnDefinition<>( Domain.THRESHOLD.REFERENCE_NAME, INDICATOR_THRESHOLD_COLUMN_KEY, - ExamForm::thresholdsValue)) + ExamForm::thresholdsValue) + .widthProportion(4)) .withDefaultActionIf( () -> editable, () -> actionBuilder @@ -720,7 +728,7 @@ public class ExamForm implements TemplateComposer { return Constants.EMPTY_NOTE; } - return indicator.thresholds + final StringBuilder builder = indicator.thresholds .stream() .reduce( new StringBuilder(), @@ -735,8 +743,9 @@ public class ExamForm implements TemplateComposer { .append(threshold.value).append(" (").append(threshold.color).append(")") .append("") .append(" | "), - (sb1, sb2) -> sb1.append(sb2)) - .toString(); + (sb1, sb2) -> sb1.append(sb2)); + builder.delete(builder.length() - 3, builder.length() - 1); + return builder.toString(); } private Function cancelModifyFunction() { diff --git a/src/main/resources/static/css/sebserver.css b/src/main/resources/static/css/sebserver.css index 930d6f19..48dac24c 100644 --- a/src/main/resources/static/css/sebserver.css +++ b/src/main/resources/static/css/sebserver.css @@ -109,14 +109,12 @@ Label-SeparatorLine { } Label.colordark { - font: 12px Arial, Helvetica, monospace; - letter-spacing: 3.25px; + font: 12px "Courier New", Courier, monospace; color: #4a4a4a; } Label.colorlight { - font: 12px Arial, Helvetica, monospace; - letter-spacing: 3.25px; + font: 12px "Courier New", Courier, monospace; color: #FFFFFF; }