fix layout

This commit is contained in:
Anton Romanov 2020-02-17 12:56:19 +04:00
parent 1460e26127
commit 440def2b71
3 changed files with 57 additions and 47 deletions

View File

@ -20,8 +20,8 @@
</style>
<h:form id="mainForm">
<div class="ui-g">
<div class="ui-g-2"></div>
<div class="ui-g-8">
<div class="ui-g-12 ui-md-2"></div>
<div class="ui-g-12 ui-md-8">
<p:menubar>
<p:menuitem>
<h:link outcome="#{page.INDEX}">

View File

@ -11,8 +11,8 @@
</h:head>
<h:body class="black">
<div class="ui-g">
<div class="ui-g-5"></div>
<div class="ui-g-2">
<div class="ui-md-5 ui-g-12"></div>
<div class="ui-md-2 ui-g-12">
<form method="post" action="/login.xhtml">
<p:panel header="Вход в систему" style="margin-bottom:20px">
<table cellpadding="10" style="width: 100%">

View File

@ -10,51 +10,61 @@
text-align: right !important;
}
</style>
<p:dataTable value="#{papersView.papers}" var="paper" paginator="true" rows="10" id="papersTable"
widgetVar="papersTable" emptyMessage="Не найдено подходящих статей"
selection="#{papersView.selectedPapers}" rowKey="#{paper.id}">
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Поиск:"/>
<p:inputText id="globalFilter" onkeyup="PF('papersTable').filter()" style="width:150px"
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:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="Название" filterBy="#{paper.title}" filterMatchMode="contains">
<h:outputLink value="/paper/paper.xhtml">
#{paper.title}
<f:param name="id" value="#{paper.id}"/>
</h:outputLink>
</p:column>
<p:column headerText="Статус" filterBy="#{paper.status} #{paper.status.statusName}"
filterMatchMode="contains">
<f:facet name="filter">
<p:selectOneMenu onchange="PF('papersTable').filter()" styleClass="custom-filter"
converter="paperStatusConverter">
<f:selectItem itemLabel="Статус" itemValue="#{null}" noSelectionOption="true"/>
<f:selectItems value="#{papersView.paperStatuses}" var="status" itemLabel="#{status.statusName}"
itemValue="#{status}"/>
</p:selectOneMenu>
<div class="ui-fluid">
<div class="ui-g">
<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"/>
</div>
<div class="ui-md-5 ui-g-12">
<p:inputText placeholder="Создать новую статью" value="#{papersView.newPaperTitle}"/>
</div>
<div class="ui-md-2 ui-g-12">
<p:commandButton action="#{papersView.create}" value="Создать" ajax="true" process="@form"
update="messages @form mainForm:papersTable"/>
</div>
</div>
<p:dataTable value="#{papersView.papers}" var="paper" paginator="true" rows="10" id="papersTable"
widgetVar="papersTable" emptyMessage="Не найдено подходящих статей"
selection="#{papersView.selectedPapers}" rowKey="#{paper.id}">
<f:facet name="header">
<p:outputPanel>
<h:outputText value="Поиск:"/>
<p:inputText id="globalFilter" onkeyup="PF('papersTable').filter()" style="width:150px"
placeholder="Строка поиска..."/>
</p:outputPanel>
</f:facet>
<ui:include src="paperStatusFragment.xhtml">
<ui:param name="paper" value="#{paper}"/>
</ui:include>
</p:column>
</p:dataTable>
<div class="ui-g-3">
<p:commandButton value="Удалить выделенные" id="papersRemoveButton"
disabled="#{papersView.selectedPapers.isEmpty()}"
action="#{papersView.deleteSelected}" ajax="true" process="@form"
update="messages @form"/>
<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:column selectionMode="multiple" style="width:16px;text-align:center"/>
<p:column headerText="Название" filterBy="#{paper.title}" filterMatchMode="contains">
<h:outputLink value="/paper/paper.xhtml">
#{paper.title}
<f:param name="id" value="#{paper.id}"/>
</h:outputLink>
</p:column>
<p:column headerText="Статус" filterBy="#{paper.status} #{paper.status.statusName}"
filterMatchMode="contains">
<f:facet name="filter">
<p:selectOneMenu onchange="PF('papersTable').filter()" styleClass="custom-filter"
converter="paperStatusConverter">
<f:selectItem itemLabel="Статус" itemValue="#{null}" noSelectionOption="true"/>
<f:selectItems value="#{papersView.paperStatuses}" var="status" itemLabel="#{status.statusName}"
itemValue="#{status}"/>
</p:selectOneMenu>
</f:facet>
<ui:include src="paperStatusFragment.xhtml">
<ui:param name="paper" value="#{paper}"/>
</ui:include>
</p:column>
</p:dataTable>
</div>
<p:inputText placeholder="Создать новую статью" value="#{papersView.newPaperTitle}"/>
<p:commandButton action="#{papersView.create}" value="Сохранить" ajax="true" process="@form"
update="messages @form mainForm:papersTable" style="visibility: hidden"/>
</ui:define>
</ui:composition>
</html>