7
|
1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
2 <html xmlns="http://www.w3.org/1999/xhtml"
|
|
3 xmlns:h="http://java.sun.com/jsf/html"
|
|
4 xmlns:f="http://java.sun.com/jsf/core"
|
|
5 xmlns:ui="http://java.sun.com/jsf/facelets"
|
|
6 xmlns:a4j="http://richfaces.org/a4j"
|
|
7 xmlns:rich="http://richfaces.org/rich">
|
|
8
|
|
9 <body>
|
|
10 <ui:composition template="/templates/privateTemplate.xhtml">
|
|
11
|
|
12 <ui:define name="privateContent">
|
|
13
|
|
14 <div id="pageTitle">
|
|
15 <h:outputText value="Admin Panel" />
|
|
16 </div>
|
|
17
|
|
18 <h:panelGrid columns="1" id="adminPanel"
|
|
19 style="margin-left: auto; margin-right: auto; text-align: center; width: 700px">
|
|
20
|
|
21
|
|
22
|
|
23 <h:panelGrid columns="3"
|
|
24 style="margin-left: auto; margin-right: auto; text-align: center; width: 400px">
|
|
25 <h:commandButton value="Create User"
|
|
26 actionListener="#{adminBean.actionCreateUser}" />
|
|
27 <h:commandButton value="Show all users"
|
|
28 actionListener="#{adminBean.actionGetAllUsers}" />
|
|
29 </h:panelGrid>
|
|
30
|
|
31 <h:panelGrid columns="2"
|
|
32 rendered="#{adminBean.user != null}"
|
|
33 styleClass="createPanel"
|
|
34 columnClasses="createPanelFirstColumn,createPanelColumn02"
|
|
35 style="width: 400px;">
|
|
36
|
|
37 <h:outputText value="User name" />
|
|
38 <h:inputText value="#{adminBean.user.userName}" />
|
|
39
|
|
40 <h:outputText value="Email" />
|
|
41 <h:inputText value="#{adminBean.user.email}" />
|
|
42
|
|
43 <h:outputText value="Role" />
|
|
44 <h:selectOneMenu value="#{adminBean.user.role}">
|
|
45 <f:selectItems value="#{adminBean.roleList}" />
|
|
46 </h:selectOneMenu>
|
|
47
|
|
48
|
|
49 <h:outputText value="Password"
|
|
50 rendered="#{adminBean.changePassword}" />
|
|
51 <h:inputSecret value="#{adminBean.password1}"
|
|
52 rendered="#{adminBean.changePassword}" />
|
|
53 <h:outputText value="Repeat password"
|
|
54 rendered="#{adminBean.changePassword}" />
|
|
55 <h:inputSecret value="#{adminBean.password2}"
|
|
56 rendered="#{adminBean.changePassword}" />
|
|
57
|
|
58 <h:commandButton value="Save"
|
|
59 actionListener="#{adminBean.actionSaveUser}" />
|
|
60 <h:commandButton value="Cancel"
|
|
61 actionListener="#{adminBean.actionReset}" />
|
|
62 </h:panelGrid>
|
|
63
|
|
64
|
|
65 <rich:dataTable value="#{adminBean.userList}" var="item"
|
|
66 rendered="#{!empty adminBean.userList}"
|
|
67 styleClass="createPanel"
|
|
68 columnClasses="createPanelFirstColumn,createPanelColumn02,createPanelColumn02"
|
|
69 style="width: 400px;">
|
|
70 <h:column>
|
|
71 <f:facet name="header">
|
|
72 <h:outputText value="User Name" />
|
|
73 </f:facet>
|
|
74 <h:outputText value="#{item.userName}" />
|
|
75 </h:column>
|
|
76 <h:column>
|
|
77 <f:facet name="header">
|
|
78 <h:outputText value="E-mail" />
|
|
79 </f:facet>
|
|
80 <h:outputText value="#{item.email}" />
|
|
81 </h:column>
|
|
82 <h:column>
|
|
83 <f:facet name="header">
|
|
84 <h:outputText value="Role" />
|
|
85 </f:facet>
|
|
86 <h:outputText value="#{item.role}" />
|
|
87 </h:column>
|
|
88 <h:column>
|
|
89 <f:facet name="header">
|
|
90 <h:outputText value="Edit" />
|
|
91 </f:facet>
|
|
92 <h:commandButton value="Edit"
|
|
93 actionListener="#{adminBean.actionEditUser}" />
|
|
94 </h:column>
|
|
95 <h:column>
|
|
96 <f:facet name="header">
|
|
97 <h:outputText value="Remove" />
|
|
98 </f:facet>
|
|
99 <h:commandButton value="Remove"
|
|
100 actionListener="#{adminBean.actionRemoveUser}"
|
|
101 onclick="#{ApplicationBean1.JSConfirmationDelete}" />
|
|
102 </h:column>
|
|
103
|
|
104 </rich:dataTable>
|
|
105
|
|
106 </h:panelGrid>
|
|
107
|
|
108 </ui:define>
|
|
109 </ui:composition>
|
|
110 </body>
|
|
111 </html>
|