Merge remote-tracking branch 'origin/jsf' into jsf

# Conflicts:
#	src/main/resources/META-INF/resources/admin/user.xhtml
This commit is contained in:
Anton Romanov 2020-04-24 22:51:45 +04:00
commit 6adb3fec71
4 changed files with 111 additions and 60 deletions

View File

@ -13,6 +13,7 @@ import javax.inject.Inject;
import javax.inject.Named;
import java.io.Serializable;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
@Named
@ -26,6 +27,10 @@ public class PaperView implements Serializable {
private Paper paper;
private Date newDeadlineDate;
private String newDeadlineDescription;
@PostConstruct
public void init() {
paper = paperService.findPaperById(Integer.valueOf(FacesUtil.getRequestParams().get("id")));
@ -57,4 +62,20 @@ public class PaperView implements Serializable {
FacesUtil.showInfoMessage("Статья сохранена", "");
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

@ -41,15 +41,6 @@
<p:message for="firstName"/>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="Фамилия"/>
</p:column>
<p:column>
<p:inputText id="lastName" required="true" value="#{userView.user.lastName}"/>
<p:message for="lastName"/>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="Отчество"/>
@ -59,6 +50,15 @@
<p:message for="patr"/>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="Фамилия"/>
</p:column>
<p:column>
<p:inputText id="lastName" required="true" value="#{userView.user.lastName}"/>
<p:message for="lastName"/>
</p:column>
</p:row>
<p:row>
<p:column>
<h:outputLabel value="Email"/>

View File

@ -2,7 +2,8 @@
<html xmlns="http://www.w3.org/1999/xhtml"
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:define name="header">
Редактирование статьи
@ -32,23 +33,31 @@
</style>
<p:panel id="panel" header="Статья" style="margin-bottom:10px;">
<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="Название:"/>
</p:column>
<p:column>
</div>
<div class="ui-md-7 ui-g-12">
<p:inputText id="name" required="true" value="#{paperView.paper.title}"/>
<p:message for="name"/>
</p:column>
<p:column>
<p:link href="/conference/conferenceList.xhtml" value="Статья участвует в конференции"/>
</p:column>
</p:row>
<p:row>
<p:column>
</div>
<div class="ui-md-2 ui-g-12">
<p:link href="/conference/conferenceList.xhtml?id=paperView.paper.conferences[0].id"
value="Статья участвует в конференции"
rendered="#{not empty paperView.paper.conferences}"/>
<p:commandButton value="Привязать к конференции"
rendered="#{empty paperView.paper.conferences}"
disabled="true"/>
</div>
<div class="ui-md-3 ui-g-12">
<p:outputLabel for="paperStatus" value="Статус:"/>
</p:column>
<p:column>
</div>
<div class="ui-md-7 ui-g-12">
<p:panelGrid columns="2" id="paperStatus">
<p:selectOneMenu id="status" required="true" value="#{paperView.paper.status}"
converter="paperStatusConverter">
@ -63,13 +72,11 @@
<ui:param name="shortMode" value="true"/>
</ui:include>
</p:panelGrid>
</p:column>
</p:row>
<p:row>
<p:column>
</div>
<div class="ui-md-3 ui-g-12">
<p:outputLabel for="type" value="Тип:"/>
</p:column>
<p:column>
</div>
<div class="ui-md-7 ui-g-12">
<p:selectOneMenu id="type" value="#{paperView.paper.type}"
converter="paperTypeConverter">
<f:selectItems value="#{paperView.paperTypes}"
@ -77,23 +84,11 @@
itemLabel="#{type.typeName}"
itemValue="#{type}"/>
</p:selectOneMenu>
</p:column>
</p:row>
<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>
</div>
<div class="ui-md-3 ui-g-12">
<p:outputLabel for="authors" value="Авторы:"/>
</p:column>
<p:column>
</div>
<div class="ui-md-7 ui-g-12">
<p:selectCheckboxMenu id="authors" value="#{paperView.paper.authors}" multiple="true"
converter="#{userConverter}">
<f:attribute name="collectionType" value="java.util.HashSet"/>
@ -102,16 +97,46 @@
itemLabel="#{author.userAbbreviate}"
itemValue="#{author}"/>
</p:selectCheckboxMenu>
</p:column>
</p:row>
</div>
<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>
<p:column>
<div class="ui-md-3 ui-g-12">
<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"
update="messages @form"/>
</p:column>
</p:row>
</p:panelGrid>
</div>
</div>
</div>
</p:panel>
</ui:define>
</ui:composition>

View File

@ -13,7 +13,10 @@
<div class="ui-fluid">
<div class="ui-g">
<div class="ui-md-5 ui-g-12">
<p:inputText placeholder="Создать новую статью" value="#{papersView.newPaperTitle}"/>
<p:inputText placeholder="Создать новую статью" id="newPaperName"
value="#{papersView.newPaperTitle}" required="true"
requiredMessage="Введите название новой статьи"/>
<p:message for="newPaperName"/>
</div>
<div class="ui-md-2 ui-g-12">
<p:commandButton action="#{papersView.create}" value="Создать" ajax="true" process="@form"
@ -23,8 +26,9 @@
<div class="ui-md-3 ui-g-12">
<p:commandButton value="Удалить выделенные" id="papersRemoveButton"
disabled="#{papersView.selectedPapers.isEmpty()}"
action="#{papersView.deleteSelected}" ajax="true" process="@form"
update="messages @form">
action="#{papersView.deleteSelected}" ajax="true"
process="mainForm:papersRemoveButton"
update="messages mainForm:papersTable">
<p:confirm header="Подтверждение" message="Удалить выделенные статьи?"
icon="pi pi-exclamation-triangle"/>
</p:commandButton>
@ -32,7 +36,7 @@
<p:confirmDialog global="true" showEffect="fade" hideEffect="fade">
<p:commandButton value="Да" type="button" styleClass="ui-confirmdialog-yes" icon="pi pi-check"/>
<p:commandButton value="Нет" type="button" styleClass="ui-confirmdialog-no" icon="pi pi-times"/>
</p:confirmDialog>te
</p:confirmDialog>
</div>
<p:dataTable value="#{papersView.papers}" var="paper" paginator="true" paginatorPosition="bottom"
@ -46,10 +50,11 @@
placeholder="Строка поиска..."/>
</p:outputPanel>
</f:facet>
<p:ajax event="rowSelect" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowSelectCheckbox" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowUnselectCheckbox" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowUnselect" update="mainForm:papersRemoveButton" process="@form"/>
<p:ajax event="rowSelect" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:ajax event="rowSelectCheckbox" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:ajax event="rowUnselectCheckbox" update="mainForm:papersRemoveButton"
process="mainForm:papersTable"/>
<p:ajax event="rowUnselect" update="mainForm:papersRemoveButton" process="mainForm:papersTable"/>
<p:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="Название" filterBy="#{paper.title}" filterMatchMode="contains">
<h:outputLink value="/paper/paper.xhtml">