Newer
Older
Sonia Zorba
committed
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
<?xml version="1.0" encoding="UTF-8" ?>
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:composite="http://java.sun.com/jsf/composite"
xmlns:h="http://xmlns.jcp.org/jsf/html"
xmlns:f="http://xmlns.jcp.org/jsf/core"
xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
<composite:interface>
</composite:interface>
<composite:implementation>
<div class="modal fade" tabindex="-1" role="dialog" id="ucd-editor">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title">Custom UCDs</h4>
</div>
<h:panelGroup class="modal-body" layout="block" id="ucd-editor-body" rendered="#{ucdEditor.customUCDs ne null}">
<h:selectOneRadio value="#{ucdEditor.viewExisting}">
<f:selectItem itemValue="#{true}" itemLabel="View existing" />
<f:selectItem itemValue="#{false}" itemLabel="Add new" />
<f:ajax execute="ucd-editor-body" render="ucd-editor-body" />
</h:selectOneRadio>
<br/>
<h:panelGroup rendered="#{ucdEditor.viewExisting}">
<h:panelGroup rendered="#{ucdEditor.customUCDs.size() eq 0}">
<p>No custom UCD inserted yet.</p>
</h:panelGroup>
<h:panelGroup rendered="#{ucdEditor.customUCDs.size() gt 0}">
<ul>
<ui:repeat value="#{ucdEditor.customUCDs}" var="ucd" varStatus="loop">
<li>
<h:commandLink class="text-danger" action="#{ucdEditor.removeUCD(loop.index)}">
×
<ui:remove>
<!-- Note: due to a strange JSF bug following render attribute needs complete component id reference -->
</ui:remove>
<f:ajax execute="ucd-editor-body" render="main:ucd-editor:ucd-editor-body" />
</h:commandLink>
[#{ucd.code}] <span title="#{ucd.description}">#{ucd.word}</span>
</li>
</ui:repeat>
</ul>
</h:panelGroup>
</h:panelGroup>
<h:panelGroup rendered="#{!ucdEditor.viewExisting}" layout="block" class="form-horizontal">
<div class="form-group">
<h:outputLabel for="new-ucd-syntax" class="control-label col-xs-3">Syntax</h:outputLabel>
<div class="col-xs-8">
<h:selectOneMenu value="#{ucdEditor.newUCDConfiguration.syntax}" class="form-control" id="new-ucd-syntax">
<f:selectItem itemValue="BOTH" />
<f:selectItem itemValue="PRIMARY" />
<f:selectItem itemValue="SECONDARY" />
<f:selectItem itemValue="PHOT_QUANTITY" />
<f:selectItem itemValue="COLOUR" />
<f:selectItem itemValue="VECTOR" />
</h:selectOneMenu>
</div>
</div>
<div class="form-group">
<h:outputLabel for="new-ucd-word" class="control-label col-xs-3">Word</h:outputLabel>
<div class="col-xs-8">
<h:inputText id="new-ucd-word" class="form-control" value="#{ucdEditor.newUCDConfiguration.word}" />
<h:panelGroup class="text-danger" rendered="#{ucdEditor.invalidUCDMessage ne null}">#{ucdEditor.invalidUCDMessage}</h:panelGroup>
</div>
</div>
<div class="form-group">
<h:outputLabel for="new-ucd-description" class="control-label col-xs-3">Description</h:outputLabel>
<div class="col-xs-8">
<h:inputText id="new-ucd-description" class="form-control" value="#{ucdEditor.newUCDConfiguration.description}" />
</div>
</div>
<div class="row">
<div class="col-xs-8 col-xs-offset-3 text-center">
<h:commandLink action="#{ucdEditor.addUCD()}" class="btn btn-success">
Add new UCD
<f:ajax execute="@form" render="ucd-editor-body" />
</h:commandLink>
</div>
</div>
</h:panelGroup>
</h:panelGroup>
</div>
</div>
</div>
</composite:implementation>
</html>