2012-07-02 07:55:12 +01:00
|
|
|
<?xml version="1.0" encoding="UTF-8" ?>
|
|
|
|
<%--
|
2018-03-22 23:26:30 +00:00
|
|
|
Copyright (c) 2012-2018, Andy Janata
|
2012-07-02 07:55:12 +01:00
|
|
|
All rights reserved.
|
|
|
|
|
|
|
|
Redistribution and use in source and binary forms, with or without modification, are permitted
|
|
|
|
provided that the following conditions are met:
|
|
|
|
|
|
|
|
* Redistributions of source code must retain the above copyright notice, this list of conditions
|
|
|
|
and the following disclaimer.
|
|
|
|
* Redistributions in binary form must reproduce the above copyright notice, this list of
|
|
|
|
conditions and the following disclaimer in the documentation and/or other materials provided
|
|
|
|
with the distribution.
|
|
|
|
|
|
|
|
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR
|
|
|
|
IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
|
|
|
|
CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
|
|
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
|
|
|
|
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
|
|
|
|
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY
|
|
|
|
WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
|
|
--%>
|
|
|
|
<%--
|
|
|
|
Administration tools.
|
|
|
|
|
|
|
|
@author Andy Janata (ajanata@socialgamer.net)
|
|
|
|
--%>
|
|
|
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
|
2018-03-22 23:26:30 +00:00
|
|
|
<%@ page import="com.google.inject.Injector" %>
|
|
|
|
<%@ page import="com.google.inject.Key" %>
|
|
|
|
<%@ page import="com.google.inject.TypeLiteral" %>
|
2012-07-02 07:55:12 +01:00
|
|
|
<%@ page import="java.util.ArrayList" %>
|
|
|
|
<%@ page import="java.util.List" %>
|
2018-03-22 23:26:30 +00:00
|
|
|
<%@ page import="java.util.Set" %>
|
|
|
|
<%@ page import="net.socialgamer.cah.CahModule.Admins" %>
|
2012-07-02 07:55:12 +01:00
|
|
|
<%@ page import="net.socialgamer.cah.HibernateUtil" %>
|
2018-03-22 23:26:30 +00:00
|
|
|
<%@ page import="net.socialgamer.cah.StartupUtils" %>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%@ page import="net.socialgamer.cah.db.PyxBlackCard" %>
|
|
|
|
<%@ page import="net.socialgamer.cah.db.PyxCardSet" %>
|
|
|
|
<%@ page import="net.socialgamer.cah.db.PyxWhiteCard" %>
|
2012-10-02 04:12:14 +01:00
|
|
|
<%@ page import="net.socialgamer.cah.RequestWrapper" %>
|
2012-07-02 07:55:12 +01:00
|
|
|
<%@ page import="org.apache.commons.lang3.StringEscapeUtils" %>
|
|
|
|
<%@ page import="org.hibernate.Session" %>
|
|
|
|
<%@ page import="org.hibernate.Transaction" %>
|
|
|
|
<%
|
2018-03-22 23:26:30 +00:00
|
|
|
RequestWrapper wrapper = new RequestWrapper(request);
|
|
|
|
ServletContext servletContext = pageContext.getServletContext();
|
|
|
|
Injector injector = (Injector) servletContext.getAttribute(StartupUtils.INJECTOR);
|
|
|
|
Set<String> admins = injector.getInstance(Key.get(new TypeLiteral<Set<String>>(){}, Admins.class));
|
|
|
|
if (!admins.contains(wrapper.getRemoteAddr())) {
|
2012-07-02 07:55:12 +01:00
|
|
|
response.sendError(403, "Access is restricted to known hosts");
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
List<String> messages = new ArrayList<String>();
|
|
|
|
|
|
|
|
Session hibernateSession = HibernateUtil.instance.sessionFactory.openSession();
|
|
|
|
|
2012-07-14 23:04:11 +01:00
|
|
|
// cheap way to make sure we can close the hibernate session at the end of the page
|
|
|
|
try {
|
|
|
|
String editParam = request.getParameter("edit");
|
2014-07-20 00:19:08 +01:00
|
|
|
PyxCardSet editCardSet = null;
|
2012-07-14 23:04:11 +01:00
|
|
|
if (null != editParam) {
|
|
|
|
try {
|
2014-07-20 00:19:08 +01:00
|
|
|
editCardSet = (PyxCardSet)hibernateSession.load(PyxCardSet.class, Integer.parseInt(editParam));
|
2012-07-14 23:04:11 +01:00
|
|
|
} catch (NumberFormatException nfe) {
|
|
|
|
messages.add("Unable to parse or locate requested card set to edit.");
|
|
|
|
}
|
2012-07-02 07:55:12 +01:00
|
|
|
}
|
2012-07-14 23:04:11 +01:00
|
|
|
|
|
|
|
String deleteParam = request.getParameter("delete");
|
|
|
|
if (null != deleteParam) {
|
|
|
|
try {
|
2014-07-20 00:19:08 +01:00
|
|
|
editCardSet = (PyxCardSet)hibernateSession.load(PyxCardSet.class, Integer.parseInt(deleteParam));
|
2012-07-14 23:04:11 +01:00
|
|
|
Transaction t = hibernateSession.beginTransaction();
|
|
|
|
hibernateSession.delete(editCardSet);
|
|
|
|
t.commit();
|
|
|
|
response.sendRedirect("cardsets.jsp");
|
|
|
|
return;
|
|
|
|
} catch (NumberFormatException nfe) {
|
|
|
|
messages.add("Invalid id.");
|
2012-07-02 07:55:12 +01:00
|
|
|
}
|
2012-07-14 23:04:11 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
String actionParam = request.getParameter("action");
|
|
|
|
if ("edit".equals(actionParam)) {
|
|
|
|
String idParam = request.getParameter("cardSetId");
|
|
|
|
int id = 0;
|
|
|
|
try {
|
|
|
|
id = Integer.parseInt(idParam);
|
|
|
|
if (-1 == id) {
|
2014-07-20 00:19:08 +01:00
|
|
|
editCardSet = new PyxCardSet();
|
2012-07-02 07:55:12 +01:00
|
|
|
} else {
|
2014-07-20 00:19:08 +01:00
|
|
|
editCardSet = (PyxCardSet)hibernateSession.load(PyxCardSet.class, id);
|
2012-07-14 23:04:11 +01:00
|
|
|
}
|
|
|
|
if (null != editCardSet) {
|
|
|
|
String nameParam = request.getParameter("cardSetName");
|
2013-03-27 00:19:01 +00:00
|
|
|
String descriptionParam = request.getParameter("cardSetDescription");
|
2013-04-28 07:10:56 +01:00
|
|
|
String weightParam = request.getParameter("cardSetWeight");
|
2012-07-14 23:04:11 +01:00
|
|
|
String activeParam = request.getParameter("active");
|
|
|
|
String baseDeckParam = request.getParameter("baseDeck");
|
|
|
|
String[] selectedBlackCardsParam = request.getParameterValues("selectedBlackCards");
|
|
|
|
String[] selectedWhiteCardsParam = request.getParameterValues("selectedWhiteCards");
|
2013-04-28 07:10:56 +01:00
|
|
|
int weight = -1;
|
|
|
|
try {
|
|
|
|
weight = Integer.valueOf(weightParam);
|
|
|
|
} catch (Exception e) {
|
|
|
|
// pass
|
|
|
|
}
|
|
|
|
if (weight <= 0 || weight > 9999) {
|
|
|
|
messages.add("Weight must be a positive integer less than 10000.");
|
|
|
|
} else if (null == nameParam || nameParam.isEmpty() || null == selectedBlackCardsParam ||
|
2012-07-14 23:04:11 +01:00
|
|
|
null == selectedWhiteCardsParam) {
|
|
|
|
messages.add("You didn't specify something.");
|
|
|
|
if (-1 == id) {
|
|
|
|
editCardSet = null;
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
editCardSet.setName(nameParam);
|
2013-03-27 00:19:01 +00:00
|
|
|
editCardSet.setDescription(descriptionParam);
|
2013-04-28 07:10:56 +01:00
|
|
|
editCardSet.setWeight(weight);
|
2012-07-14 23:04:11 +01:00
|
|
|
editCardSet.setActive("on".equals(activeParam));
|
|
|
|
editCardSet.setBaseDeck("on".equals(baseDeckParam));
|
|
|
|
List<Integer> blackCardIds = new ArrayList<Integer>(selectedBlackCardsParam.length);
|
|
|
|
for (String bc : selectedBlackCardsParam) {
|
|
|
|
blackCardIds.add(Integer.parseInt(bc));
|
|
|
|
}
|
|
|
|
List<Integer> whiteCardIds = new ArrayList<Integer>(selectedWhiteCardsParam.length);
|
|
|
|
for (String wc : selectedWhiteCardsParam) {
|
|
|
|
whiteCardIds.add(Integer.parseInt(wc));
|
|
|
|
}
|
|
|
|
@SuppressWarnings("unchecked")
|
2014-07-20 00:19:08 +01:00
|
|
|
List<PyxBlackCard> realBlackCards = hibernateSession.createQuery(
|
2015-02-16 02:48:30 +00:00
|
|
|
"from PyxBlackCard where id in (:ids)").setParameterList("ids", blackCardIds).
|
2012-07-14 23:04:11 +01:00
|
|
|
setReadOnly(true).list();
|
|
|
|
@SuppressWarnings("unchecked")
|
2014-07-20 00:19:08 +01:00
|
|
|
List<PyxWhiteCard> realWhiteCards = hibernateSession.createQuery(
|
2015-02-16 02:48:30 +00:00
|
|
|
"from PyxWhiteCard where id in (:ids)").setParameterList("ids", whiteCardIds).
|
2012-07-14 23:04:11 +01:00
|
|
|
setReadOnly(true).list();
|
|
|
|
editCardSet.getBlackCards().clear();
|
|
|
|
editCardSet.getBlackCards().addAll(realBlackCards);
|
|
|
|
editCardSet.getWhiteCards().clear();
|
|
|
|
editCardSet.getWhiteCards().addAll(realWhiteCards);
|
|
|
|
Transaction t = hibernateSession.beginTransaction();
|
|
|
|
hibernateSession.saveOrUpdate(editCardSet);
|
|
|
|
t.commit();
|
|
|
|
hibernateSession.flush();
|
|
|
|
response.sendRedirect("cardsets.jsp");
|
|
|
|
return;
|
2012-07-02 07:55:12 +01:00
|
|
|
}
|
2012-07-14 23:04:11 +01:00
|
|
|
} else {
|
|
|
|
messages.add("Unable to find card set with id " + id + ".");
|
2012-07-02 07:55:12 +01:00
|
|
|
}
|
2012-07-14 23:04:11 +01:00
|
|
|
} catch (Exception e) {
|
|
|
|
messages.add("Something went wrong. " + e.toString());
|
2012-07-02 07:55:12 +01:00
|
|
|
}
|
|
|
|
}
|
2012-07-14 23:04:11 +01:00
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
2018-02-22 00:49:38 +00:00
|
|
|
List<PyxCardSet> cardSets = hibernateSession.createQuery("from PyxCardSet order by weight, name")
|
2012-07-14 23:04:11 +01:00
|
|
|
.setReadOnly(true).list();
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
2015-02-16 02:48:30 +00:00
|
|
|
List<PyxBlackCard> blackCards = hibernateSession.createQuery("from PyxBlackCard order by id")
|
2012-07-14 23:04:11 +01:00
|
|
|
.setReadOnly(true).list();
|
|
|
|
|
|
|
|
@SuppressWarnings("unchecked")
|
2015-02-16 02:48:30 +00:00
|
|
|
List<PyxWhiteCard> whiteCards = hibernateSession.createQuery("from PyxWhiteCard order by id")
|
2012-07-14 23:04:11 +01:00
|
|
|
.setReadOnly(true).list();
|
2012-07-02 07:55:12 +01:00
|
|
|
%>
|
|
|
|
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
|
|
|
|
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
|
|
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
|
|
|
<head>
|
|
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
|
|
|
|
<title>PYX - Edit Card Sets</title>
|
2016-01-03 01:25:32 +00:00
|
|
|
<script type="text/javascript" src="js/jquery-1.11.3.min.js"></script>
|
2012-07-02 07:55:12 +01:00
|
|
|
<script type="text/javascript">
|
|
|
|
$(document).ready(function() {
|
|
|
|
$('#addBlackCards').click(function() {
|
|
|
|
addItem('allBlackCards', 'selectedBlackCards', 'bc');
|
|
|
|
});
|
|
|
|
$('#removeBlackCards').click(function() {
|
|
|
|
removeItem('selectedBlackCards');
|
|
|
|
});
|
|
|
|
$('#addWhiteCards').click(function() {
|
|
|
|
addItem('allWhiteCards', 'selectedWhiteCards', 'wc');
|
|
|
|
});
|
|
|
|
$('#removeWhiteCards').click(function() {
|
|
|
|
removeItem('selectedWhiteCards');
|
|
|
|
});
|
|
|
|
$('#editForm').submit(function() {
|
|
|
|
$('#selectedBlackCards option').each(function() {
|
|
|
|
this.selected = true;
|
|
|
|
});
|
|
|
|
$('#selectedWhiteCards option').each(function() {
|
|
|
|
this.selected = true;
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Add selected items from sourceList to destList, ignoring duplicates.
|
|
|
|
*/
|
|
|
|
function addItem(sourceListId, destListId, idPrefix) {
|
|
|
|
//
|
|
|
|
$('#' + sourceListId + ' option').filter(':selected').each(function() {
|
|
|
|
var existing = $('#' + idPrefix + '_' + this.value);
|
|
|
|
if (existing.length == 0) {
|
|
|
|
$('#' + destListId).append(
|
|
|
|
'<option value="' + this.value + '" id="' + idPrefix + '_' + this.value + '">' +
|
|
|
|
this.text + '</option>');
|
|
|
|
}
|
|
|
|
});
|
|
|
|
$('#' + destListId + ' option').sort(function (a, b) {
|
|
|
|
return Number(b.value) < Number(a.value);
|
|
|
|
}).appendTo('#' + destListId);
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Remove selected items from list.
|
|
|
|
*/
|
|
|
|
function removeItem(listId) {
|
|
|
|
$('#' + listId + ' option').filter(':selected').each(function() {
|
|
|
|
this.parentElement.removeChild(this);
|
|
|
|
});
|
|
|
|
}
|
|
|
|
</script>
|
|
|
|
<style>
|
|
|
|
select {
|
|
|
|
height: 300px;
|
|
|
|
}
|
|
|
|
</style>
|
|
|
|
</head>
|
|
|
|
<body>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
for (String message : messages) {
|
|
|
|
%>
|
|
|
|
<h3><%=message%></h3>
|
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
<h2>Existing card sets</h2>
|
2012-07-07 18:19:25 +01:00
|
|
|
<table style="1px solid black">
|
2012-07-02 07:55:12 +01:00
|
|
|
<thead>
|
|
|
|
<tr>
|
|
|
|
<th>Name</th>
|
|
|
|
<th>Delete</th>
|
|
|
|
<th>Edit</th>
|
2013-04-28 07:10:56 +01:00
|
|
|
<th>Weight</th>
|
2018-02-22 00:49:38 +00:00
|
|
|
<th>Blacks</th>
|
|
|
|
<th>Whites</th>
|
2015-05-03 21:52:05 +01:00
|
|
|
<th>Active</th>
|
2012-07-02 07:55:12 +01:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
for (PyxCardSet cardSet : cardSets) {
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
<tr>
|
2014-07-20 00:19:08 +01:00
|
|
|
<td><%=cardSet.getName()%></td>
|
|
|
|
<td><a href="?delete=<%=cardSet.getId()%>" onclick="return confirm('Are you sure?')">Delete</a></td>
|
|
|
|
<td><a href="?edit=<%=cardSet.getId()%>">Edit</a></td>
|
|
|
|
<td><%=cardSet.getWeight()%></td>
|
2018-02-22 00:49:38 +00:00
|
|
|
<td><%=cardSet.getBlackCards().size()%></td>
|
|
|
|
<td><%=cardSet.getWhiteCards().size()%></td>
|
2015-05-03 21:52:05 +01:00
|
|
|
<td><%=cardSet.isActive()%></td>
|
2012-07-02 07:55:12 +01:00
|
|
|
</tr>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</tbody>
|
|
|
|
</table>
|
|
|
|
<a href="cardsets.jsp">Create New</a>
|
|
|
|
<form action="cardsets.jsp" method="post" id="editForm">
|
|
|
|
<input type="hidden" name="action" value="edit" />
|
|
|
|
<input type="hidden" name="cardSetId"
|
2014-07-20 00:19:08 +01:00
|
|
|
value="<%=editCardSet != null ? editCardSet.getId() : -1%>" />
|
2012-07-02 07:55:12 +01:00
|
|
|
<h2>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
if (editCardSet != null) {
|
|
|
|
%>
|
|
|
|
Editing <span style="text-decoration:italic"><%=editCardSet.getName()%></span>
|
|
|
|
<%
|
|
|
|
} else {
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
Creating new card set
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</h2>
|
|
|
|
<label for="cardSetName">Name:</label>
|
2013-03-27 01:07:09 +00:00
|
|
|
<input type="text" name="cardSetName" id="cardSetName" size="50"
|
2017-02-27 06:13:18 +00:00
|
|
|
value="<%=editCardSet != null ? StringEscapeUtils.escapeXml11(editCardSet.getName()) : ""%>" />
|
2012-07-02 07:55:12 +01:00
|
|
|
<br/>
|
2013-03-27 00:19:01 +00:00
|
|
|
<label for="cardSetDescription">Description:</label>
|
2013-03-27 01:07:09 +00:00
|
|
|
<input type="text" name="cardSetDescription" id="cardSetDescription" size="50"
|
2017-02-27 06:13:18 +00:00
|
|
|
value="<%=editCardSet != null ? StringEscapeUtils.escapeXml11(editCardSet.getDescription()) : ""%>" />
|
2013-03-27 00:19:01 +00:00
|
|
|
<br/>
|
2013-04-28 07:10:56 +01:00
|
|
|
<label for="cardSetWeight">Weight:</label>
|
|
|
|
<input type="text" name="cardSetWeight" id="cardSetWeight" size="4"
|
2014-07-20 00:19:08 +01:00
|
|
|
value="<%=editCardSet != null ? editCardSet.getWeight() : "1000"%>" />
|
2013-04-28 07:10:56 +01:00
|
|
|
<br/>
|
2012-07-02 07:55:12 +01:00
|
|
|
<label for="active">Active</label>
|
|
|
|
<input type="checkbox" name="active" id="active"
|
2014-07-20 00:19:08 +01:00
|
|
|
<%=editCardSet != null && editCardSet.isActive() ? "checked='checked'" : ""%> />
|
2012-07-07 18:19:25 +01:00
|
|
|
<br/>
|
|
|
|
<label for="baseDeck" title="This deck is sufficient for playing the game.">Base Deck</label>
|
|
|
|
<input type="checkbox" name="baseDeck" id="baseDeck"
|
2014-07-20 00:19:08 +01:00
|
|
|
<%=editCardSet != null && editCardSet.isBaseDeck() ? "checked='checked'" : ""%> />
|
2012-07-02 07:55:12 +01:00
|
|
|
<br/>
|
|
|
|
Available Black Cards:
|
|
|
|
<br/>
|
|
|
|
<select id="allBlackCards" multiple="multiple" style="height:300px">
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
for (PyxBlackCard blackCard : blackCards) {
|
|
|
|
%>
|
|
|
|
<option value="<%=blackCard.getId()%>">
|
2017-02-27 06:13:18 +00:00
|
|
|
<%=StringEscapeUtils.escapeXml11(blackCard.toString())%>
|
2013-03-27 01:07:09 +00:00
|
|
|
</option>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</select>
|
|
|
|
<br/>
|
|
|
|
<input type="button" id="addBlackCards" value="Add Black Cards" />
|
|
|
|
<input type="button" id="removeBlackCards" value="Remove Black Cards" />
|
|
|
|
<br/>
|
|
|
|
Black Cards in Card Set:
|
|
|
|
<br/>
|
|
|
|
<select id="selectedBlackCards" name="selectedBlackCards" multiple="multiple">
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
if (editCardSet != null) {
|
|
|
|
%>
|
|
|
|
<%
|
|
|
|
for (PyxBlackCard blackCard : editCardSet.getBlackCards()) {
|
|
|
|
%>
|
|
|
|
<option value="<%=blackCard.getId()%>" id="bc_<%=blackCard.getId()%>">
|
2017-02-27 06:13:18 +00:00
|
|
|
<%=StringEscapeUtils.escapeXml11(blackCard.toString())%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</option>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</select>
|
|
|
|
<br/>
|
|
|
|
Available White Cards:
|
|
|
|
<br/>
|
|
|
|
<select id="allWhiteCards" multiple="multiple" style="height:300px">
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
for (PyxWhiteCard whiteCard : whiteCards) {
|
|
|
|
%>
|
|
|
|
<option value="<%=whiteCard.getId()%>">
|
2017-02-27 06:13:18 +00:00
|
|
|
<%=StringEscapeUtils.escapeXml11(whiteCard.toString())%>
|
2013-03-27 01:07:09 +00:00
|
|
|
</option>
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
}
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
</select>
|
|
|
|
<br/>
|
|
|
|
<input type="button" id="addWhiteCards" value="Add White Cards" />
|
|
|
|
<input type="button" id="removeWhiteCards" value="Remove White Cards" />
|
|
|
|
<br/>
|
|
|
|
White Cards in Card Set:
|
|
|
|
<br/>
|
|
|
|
<select id="selectedWhiteCards" name="selectedWhiteCards" multiple="multiple">
|
2014-07-20 00:19:08 +01:00
|
|
|
<%
|
|
|
|
if (editCardSet != null) {
|
|
|
|
%>
|
|
|
|
<%
|
|
|
|
for (PyxWhiteCard whiteCard : editCardSet.getWhiteCards()) {
|
|
|
|
%>
|
2012-07-02 07:55:12 +01:00
|
|
|
<option value="<%= whiteCard.getId() %>" id="wc_<%= whiteCard.getId() %>">
|
2017-02-27 06:13:18 +00:00
|
|
|
<%= StringEscapeUtils.escapeXml11(whiteCard.toString()) %>
|
2012-07-02 07:55:12 +01:00
|
|
|
</option>
|
|
|
|
<% } %>
|
|
|
|
<% } %>
|
|
|
|
</select>
|
|
|
|
<br/>
|
|
|
|
<input type="submit" />
|
|
|
|
</form>
|
|
|
|
</body>
|
|
|
|
</html>
|
2012-07-14 23:04:11 +01:00
|
|
|
<%
|
|
|
|
} finally {
|
|
|
|
hibernateSession.close();
|
|
|
|
}
|
|
|
|
%>
|