fix layout

This commit is contained in:
Anton Romanov 2020-04-24 18:23:34 +04:00
parent e167a68bc6
commit ae0a1f3532
2 changed files with 84 additions and 43 deletions

View File

@ -13,6 +13,7 @@ import javax.inject.Inject;
import javax.inject.Named; import javax.inject.Named;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays; import java.util.Arrays;
import java.util.Date;
import java.util.List; import java.util.List;
@Named @Named
@ -26,6 +27,10 @@ public class PaperView implements Serializable {
private Paper paper; private Paper paper;
private Date newDeadlineDate;
private String newDeadlineDescription;
@PostConstruct @PostConstruct
public void init() { public void init() {
paper = paperService.findPaperById(Integer.valueOf(FacesUtil.getRequestParams().get("id"))); paper = paperService.findPaperById(Integer.valueOf(FacesUtil.getRequestParams().get("id")));
@ -57,4 +62,20 @@ public class PaperView implements Serializable {
FacesUtil.showInfoMessage("Статья сохранена", ""); FacesUtil.showInfoMessage("Статья сохранена", "");
return Page.PAPER_LIST + "?faces-redirect=true"; return Page.PAPER_LIST + "?faces-redirect=true";
} }
public Date getNewDeadlineDate() {
return newDeadlineDate;
}
public void setNewDeadlineDate(Date newDeadlineDate) {
this.newDeadlineDate = newDeadlineDate;
}
public String getNewDeadlineDescription() {
return newDeadlineDescription;
}
public void setNewDeadlineDescription(String newDeadlineDescription) {
this.newDeadlineDescription = newDeadlineDescription;
}
} }

View File

@ -2,7 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml" <html xmlns="http://www.w3.org/1999/xhtml"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui" xmlns:ui="http://xmlns.jcp.org/jsf/facelets" xmlns:p="http://primefaces.org/ui"
xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://java.sun.com/jsf/core"> xmlns:h="http://xmlns.jcp.org/jsf/html" xmlns:f="http://java.sun.com/jsf/core"
>
<ui:composition template="/basicTemplate.xhtml"> <ui:composition template="/basicTemplate.xhtml">
<ui:define name="header"> <ui:define name="header">
Редактирование статьи Редактирование статьи
@ -32,28 +33,31 @@
</style> </style>
<p:panel id="panel" header="Статья" style="margin-bottom:10px;"> <p:panel id="panel" header="Статья" style="margin-bottom:10px;">
<p:panelGrid cellpadding="5" id="paperPanel"> <p:panelGrid cellpadding="5" id="paperPanel">
<p:row>
<p:column>
</p:panelGrid>
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-md-3 ui-g-12">
<h:outputLabel value="Название:"/> <h:outputLabel value="Название:"/>
</p:column> </div>
<p:column> <div class="ui-md-7 ui-g-12">
<p:inputText id="name" required="true" value="#{paperView.paper.title}"/> <p:inputText id="name" required="true" value="#{paperView.paper.title}"/>
<p:message for="name"/> <p:message for="name"/>
</p:column> </div>
<p:column> <div class="ui-md-2 ui-g-12">
<p:link href="/conference/conferenceList.xhtml?id=paperView.paper.conferences[0].id" <p:link href="/conference/conferenceList.xhtml?id=paperView.paper.conferences[0].id"
value="Статья участвует в конференции" value="Статья участвует в конференции"
rendered="#{not empty paperView.paper.conferences}"/> rendered="#{not empty paperView.paper.conferences}"/>
<p:commandButton value="Привязать к конференции" <p:commandButton value="Привязать к конференции"
rendered="#{empty paperView.paper.conferences}"/> rendered="#{empty paperView.paper.conferences}"
</p:column> disabled="true"/>
</p:row> </div>
<p:row> <div class="ui-md-3 ui-g-12">
<p:column>
<p:outputLabel for="paperStatus" value="Статус:"/> <p:outputLabel for="paperStatus" value="Статус:"/>
</p:column> </div>
<p:column> <div class="ui-md-7 ui-g-12">
<p:panelGrid columns="2" id="paperStatus"> <p:panelGrid columns="2" id="paperStatus">
<p:selectOneMenu id="status" required="true" value="#{paperView.paper.status}" <p:selectOneMenu id="status" required="true" value="#{paperView.paper.status}"
converter="paperStatusConverter"> converter="paperStatusConverter">
@ -68,13 +72,11 @@
<ui:param name="shortMode" value="true"/> <ui:param name="shortMode" value="true"/>
</ui:include> </ui:include>
</p:panelGrid> </p:panelGrid>
</p:column> </div>
</p:row> <div class="ui-md-3 ui-g-12">
<p:row>
<p:column>
<p:outputLabel for="type" value="Тип:"/> <p:outputLabel for="type" value="Тип:"/>
</p:column> </div>
<p:column> <div class="ui-md-7 ui-g-12">
<p:selectOneMenu id="type" value="#{paperView.paper.type}" <p:selectOneMenu id="type" value="#{paperView.paper.type}"
converter="paperTypeConverter"> converter="paperTypeConverter">
<f:selectItems value="#{paperView.paperTypes}" <f:selectItems value="#{paperView.paperTypes}"
@ -82,23 +84,11 @@
itemLabel="#{type.typeName}" itemLabel="#{type.typeName}"
itemValue="#{type}"/> itemValue="#{type}"/>
</p:selectOneMenu> </p:selectOneMenu>
</p:column> </div>
</p:row> <div class="ui-md-3 ui-g-12">
<p:row>
<p:column>
<p:outputLabel for="comment" value="Комментарий:"/>
</p:column>
<p:column>
<p:editor id="comment" widgetVar="editor2" value="#{paperView.paper.comment}" height="300"
style="margin-bottom:10px" placeholder="Комментарий"/>
</p:column>
</p:row>
<p:row>
<p:column>
<p:outputLabel for="authors" value="Авторы:"/> <p:outputLabel for="authors" value="Авторы:"/>
</p:column> </div>
<p:column> <div class="ui-md-7 ui-g-12">
<p:selectCheckboxMenu id="authors" value="#{paperView.paper.authors}" multiple="true" <p:selectCheckboxMenu id="authors" value="#{paperView.paper.authors}" multiple="true"
converter="#{userConverter}"> converter="#{userConverter}">
<f:attribute name="collectionType" value="java.util.HashSet"/> <f:attribute name="collectionType" value="java.util.HashSet"/>
@ -107,16 +97,46 @@
itemLabel="#{author.userAbbreviate}" itemLabel="#{author.userAbbreviate}"
itemValue="#{author}"/> itemValue="#{author}"/>
</p:selectCheckboxMenu> </p:selectCheckboxMenu>
</p:column> </div>
</p:row> <div class="ui-md-3 ui-g-12">
<p:outputLabel for="authors" value="Ключевые даты:"/>
</div>
<div class="ui-md-7 ui-g-12">
<div class="ui-fluid">
<div class="ui-g">
<ui:repeat value="#{paperView.paper.deadlines}" var="deadline">
<div class="ui-md-5 ui-g-12">
<p:datePicker value="#{deadline.date}" pattern="dd.MM.yyyy"/>
</div>
<div class="ui-md-5 ui-g-12">
<p:inputText value="#{deadline.description}"/>
</div>
</ui:repeat>
<div class="ui-md-5 ui-g-12">
<p:datePicker value="#{paperView.newDeadlineDate}" placeholder="Введите дату"
pattern="dd.MM.yyyy"/>
</div>
<div class="ui-md-5 ui-g-12">
<p:inputText value="#{paperView.newDeadlineDescription}"
placeholder="Описание ключевой даты"/>
</div>
</div>
</div>
</div>
<p:row> <div class="ui-md-3 ui-g-12">
<p:column> <p:outputLabel for="comment" value="Комментарий:"/>
</div>
<div class="ui-md-7 ui-g-12">
<p:editor id="comment" widgetVar="editor2" value="#{paperView.paper.comment}" height="300"
style="margin-bottom:10px" placeholder="Комментарий"/>
</div>
<div class="ui-md-5 ui-g-12">
<p:commandButton action="#{paperView.save}" value="Сохранить" ajax="true" process="@form" <p:commandButton action="#{paperView.save}" value="Сохранить" ajax="true" process="@form"
update="messages @form"/> update="messages @form"/>
</p:column> </div>
</p:row> </div>
</p:panelGrid> </div>
</p:panel> </p:panel>
</ui:define> </ui:define>
</ui:composition> </ui:composition>