show paper statuses

This commit is contained in:
Anton Romanov 2019-11-21 11:30:09 +04:00
parent 9665653234
commit 48955b9cfd
3 changed files with 55 additions and 13 deletions

View File

@ -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 {

View File

@ -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;
}

View File

@ -1,5 +1,8 @@
<ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<h:outputText value="#{paper.status}"/>
<ui:composition xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://java.sun.com/jsf/html">
<span class="fa-stack fa-1x big-icon" title="#{paper.status.statusName}">
<i class="fa fa-circle #{paper.status.elementClass} fa-stack-2x"></i>
<i class="fa fa-file-text-o fa-stack-1x fa-inverse"></i>
</span>
<p:outputText value="#{paper.status.statusName}"/>
</ui:composition>