From 48955b9cfdb6885ef6de6bad3253d3ae1629c1a0 Mon Sep 17 00:00:00 2001 From: Anton Romanov Date: Thu, 21 Nov 2019 11:30:09 +0400 Subject: [PATCH] show paper statuses --- src/main/java/ru/ulstu/paper/model/Paper.java | 24 +++++++++----- .../META-INF/resources/css/style.css | 33 +++++++++++++++++++ .../resources/paper/paperStatusFragment.xhtml | 11 ++++--- 3 files changed, 55 insertions(+), 13 deletions(-) diff --git a/src/main/java/ru/ulstu/paper/model/Paper.java b/src/main/java/ru/ulstu/paper/model/Paper.java index f7b851c..457cf82 100644 --- a/src/main/java/ru/ulstu/paper/model/Paper.java +++ b/src/main/java/ru/ulstu/paper/model/Paper.java @@ -39,24 +39,30 @@ import java.util.Set; @DiscriminatorValue("PAPER") public class Paper extends BaseEntity implements UserActivity, EventSource { public enum PaperStatus { - ATTENTION("Обратить внимание"), - ON_PREPARATION("На подготовке"), - ON_REVIEW("Отправлена на проверку"), - ACCEPTED("Принята"), - NOT_ACCEPTED("Не принята"), - COMPLETED("Завершена (опубликована)"), - DRAFT("Черновик"), - FAILED("Провалены сроки"); + ATTENTION("Обратить внимание", "text-warning"), + ON_PREPARATION("На подготовке", "text-primary"), + ON_REVIEW("Отправлена на проверку", "text-review"), + ACCEPTED("Принята", "text-accepted"), + NOT_ACCEPTED("Не принята", "text-not-accepted"), + COMPLETED("Завершена (опубликована)", "text-success"), + DRAFT("Черновик", "text-draft"), + FAILED("Провалены сроки", "text-failed"); private final String statusName; + private final String elementClass; - PaperStatus(String name) { + PaperStatus(String name, String elementClass) { this.statusName = name; + this.elementClass = elementClass; } public String getStatusName() { return statusName; } + + public String getElementClass() { + return elementClass; + } } public enum PaperType { diff --git a/src/main/resources/META-INF/resources/css/style.css b/src/main/resources/META-INF/resources/css/style.css index 8020cf6..cb7b6b4 100644 --- a/src/main/resources/META-INF/resources/css/style.css +++ b/src/main/resources/META-INF/resources/css/style.css @@ -5,3 +5,36 @@ .ui-picklist-list { width: 100% !important; } + + +.text-draft { + color: rgba(0, 0, 0, 0.48) !important; +} + +.text-primary { + color: #228bba !important; +} + +.text-warning { + color: #940000 !important; +} + +.text-review { + color: #94028d !important; +} + +.text-success { + color: #007741 !important; +} + +.text-accepted { + color: #fec503 !important; +} + +.text-not-accepted { + color: #A38831 !important; +} + +.text-failed { + color: #A38831 !important; +} diff --git a/src/main/resources/META-INF/resources/paper/paperStatusFragment.xhtml b/src/main/resources/META-INF/resources/paper/paperStatusFragment.xhtml index ba2d31a..42c7979 100644 --- a/src/main/resources/META-INF/resources/paper/paperStatusFragment.xhtml +++ b/src/main/resources/META-INF/resources/paper/paperStatusFragment.xhtml @@ -1,5 +1,8 @@ - - - + + + + + +