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
<?xml version="1.0" encoding="UTF-8" ?>
<ui:composition template="/WEB-INF/templates/master.xhtml"
xmlns="http://www.w3.org/1999/xhtml"
xmlns:f="http://java.sun.com/jsf/core"
xmlns:h="http://java.sun.com/jsf/html"
xmlns:ui="http://java.sun.com/jsf/facelets"
xmlns:tsm_components="http://xmlns.jcp.org/jsf/composite/tsm_components">
<ui:define name="title">TASMAN - Users Management</ui:define>
<ui:define name="scripts">
<h:outputScript library="js" name="ucd-editor.js"></h:outputScript>
</ui:define>
<ui:define name="content">
<f:event listener="#{loggedInChecker.checkFromNonIndex()}" type="preRenderView" />
<h:form id="main" rendered="#{user.admin}">
<tsm_components:user_navbar />
<div class="container">
<div class="row">
<div class="col-sm-10 col-sm-offset-1">
<h1 class="text-center">Users Management</h1>
<br/>
</div>
</div>
<div class="form-horizontal">
<ui:repeat value="#{usersEditing.users}" var="u" varStatus="loop">
<div class="col-xs-8 col-xs-offset-2">
<div class="panel panel-default">
<div class="panel-body">
<div class="row">
<div class="col-xs-1">
<h:commandLink action="#{usersEditing.removeUser(loop.index)}" class="text-danger btn-lg pull-right">
<span class="glyphicon glyphicon-trash"></span>
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</div>
<div class="col-xs-11">
<div class="form-group">
<h:outputLabel class="control-label col-xs-3" for="username">Username</h:outputLabel>
<div class="col-xs-6">
<h:inputText value="#{u.username}" class="form-control" id="username" />
</div>
</div>
<div class="form-group">
<h:outputLabel class="control-label col-xs-3" for="password">Password</h:outputLabel>
<div class="col-xs-6">
<h:inputText value="#{u.password}" class="form-control" id="password" />
</div>
</div>
<div class="form-group">
<h:outputLabel class="control-label col-xs-3" for="role">Role</h:outputLabel>
<div class="col-xs-6">
<h:inputText value="#{u.role}" class="form-control" id="role" />
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</ui:repeat>
<div class="row">
<div class="col-xs-8 col-xs-offset-3">
<h:commandLink action="#{usersEditing.addUser()}" class="btn btn-success">
<span class="glyphicon glyphicon-plus"></span>
Add user
<f:ajax execute="@form" render="@form" />
</h:commandLink>
</div>
</div>
<div class="row">
<div class="col-xs-6 col-xs-offset-3 text-center">
<br/><br/>
<h:commandLink action="#{usersEditing.save()}" class="btn btn-primary">
<span class="glyphicon glyphicon-floppy-disk"></span>
Save
</h:commandLink>
</div>
</div>
</div>
</div>
<tsm_components:ucd_editor />
</h:form>
</ui:define>
</ui:composition>