details.xhtml
4.11 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:h="http://java.sun.com/jsf/html" xmlns:users="http://java.sun.com/jsf/composite/cditools/user"
xmlns:compo="http://java.sun.com/jsf/composite/cditools/compo" xmlns:tools="http://java.sun.com/jsf/composite/cditools" xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui">
<h:body>
<ui:composition template="#{sessionHandler.template}">
<f:metadata>
<f:viewParam name="compoId" value="#{compoMgmtView.compoId}"/>
<!-- <f:viewParam name="compoId" value="#{compoMgmtView.compoId2}" /> -->
<f:event type="preRenderView" listener="#{compoMgmtView.initView}"/>
</f:metadata>
<ui:define name="content">
<!-- <h:outputStylesheet library="style" name="insomnia2/css/actionlog.css" /> -->
<h1>Compo: #{compoMgmtView.compo.name}</h1>
<p>Infoa compon entryistä</p>
<compo:editCompo commitAction="#{compoMgmtView.saveCompo}" commitValue="#{i18n['voting.create.saveCompo']}"/>
<h2>Compo filetypes</h2>
<h:form id="filetypeEditform">
<p:panelGrid columns="2">
<p:outputLabel for="filetypeid" rendered="#{not empty compoMgmtView.filetype.id}" value="#{i18n['compo.filetype.id']}"/>
<h:outputText id="filetypeid" rendered="#{not empty compoMgmtView.filetype.id}" value="#{compoMgmtView.filetype.id}"/>
<p:outputLabel for="filetypename" value="#{i18n['compo.filetype.name']}"/>
<p:inputText id="filetypename" value="#{compoMgmtView.filetype.name}"/>
<p:outputLabel for="filetypesort" value="#{i18n['compo.filetype.sort']}"/>
<p:inputText id="filetypesort" value="#{compoMgmtView.filetype.sort}"/>
<p:outputLabel for="filetypetype" value="#{i18n['compo.filetype.filetype']}"/>
<p:selectOneMenu id="filetypetype" value="#{compoMgmtView.filetype.filetype}">
<f:selectItems value="#{compoMgmtView.filetypeTypes}" val="t"/>
</p:selectOneMenu>
</p:panelGrid>
<p:commandButton update="filetypelist,filetypeEditform" action="#{compoMgmtView.saveFiletype}" value="#{i18n['save']}"/>
</h:form>
<br/>
<p:dataTable id="filetypelist" value="#{compoMgmtView.compo.filetypes}" var="ft">
<p:column> <h:outputText value="#{ft.name}"/> </p:column>
<p:column> <h:outputText value="#{ft.filetype}"/> </p:column>
<p:column>
<p:commandButton value="Edit" update="filetypeEditform" action="#{compoMgmtView.editFiletype(ft.id)}" />
<p:commandButton value="Delete" update="filetypelist" action="#{compoMgmtView.deleteFiletype(ft.id)}" />
</p:column>
</p:dataTable>
<h2>#{i18n['compoMgmtView.compo.entries']}</h2>
<h:form>
<p:dataTable styleClass="bordertable" rowClasses="roweven,rowodd" id="compolisttable" value="#{compoMgmtView.entries}" var="entry">
<p:column headerText="Title">
<h:outputText value="#{entry.title}"/>
</p:column>
<p:column headerText="Author">
<h:outputText value="#{entry.author}"/>
</p:column>
<p:column headerText="Notes">
<h:outputText value="#{entry.notes}"/>
</p:column>
<p:column headerText="Screenmessage">
<h:outputText value="#{entry.screenMessage}"/>
</p:column>
<p:column headerText="creator">
<h:link outcome="/useradmin/edit" value="#{entry.creator.user.nick}">
<f:param name="userid" value="#{entry.creator.user.id}"/>
</h:link>
</p:column>
<p:column headerText="Sort">
<h:inputText value="#{entry.sort}" size="4"/>
</p:column>
<p:column headerText="Vote total">
<h:outputText value="#{entry.votetotal}"/>
</p:column>
<p:column headerText="Vote count">
<h:outputText value="#{entry.votes.size()}"/>
</p:column>
<p:column>
<h:link outcome="/voting/submitEntry" value="#{i18n['entry.edit']}">
<f:param name="entryId" value="#{entry.id}"/>
</h:link>
</p:column>
</p:dataTable>
<p:commandButton ajax="false" action="#{compoMgmtView.saveSort}" value="#{i18n['compo.savesort']}"/>
</h:form>
</ui:define>
</ui:composition>
</h:body>
</html>