-
Notifications
You must be signed in to change notification settings - Fork 398
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Fix some cases of not all decks being listed because the javascript…
… code assumed that duplicate weights would never occur. * Re-enable view cards page.
- Loading branch information
Showing
3 changed files
with
16 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
<?xml version="1.0" encoding="UTF-8" ?> | ||
<%-- | ||
Copyright (c) 2013, Andy Janata | ||
Copyright (c) 2013-2018, Andy Janata | ||
All rights reserved. | ||
Redistribution and use in source and binary forms, with or without modification, are permitted | ||
|
@@ -26,7 +26,7 @@ Interface to view and search all existing cards and card sets. | |
@author Andy Janata ([email protected]) | ||
--%> | ||
<%-- | ||
|
||
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %> | ||
<%@ page import="java.util.ArrayList" %> | ||
<%@ page import="java.util.HashMap" %> | ||
|
@@ -36,6 +36,8 @@ Interface to view and search all existing cards and card sets. | |
<%@ page import="java.util.Map" %> | ||
<%@ page import="java.util.Set" %> | ||
<%@ page import="com.google.inject.Injector" %> | ||
<%@ page import="com.google.inject.Key" %> | ||
<%@ page import="net.socialgamer.cah.CahModule.IncludeInactiveCardsets" %> | ||
<%@ page import="net.socialgamer.cah.HibernateUtil" %> | ||
<%@ page import="net.socialgamer.cah.StartupUtils" %> | ||
<%@ page import="net.socialgamer.cah.db.PyxBlackCard" %> | ||
|
@@ -48,15 +50,16 @@ Interface to view and search all existing cards and card sets. | |
ServletContext servletContext = pageContext.getServletContext(); | ||
Injector injector = (Injector) servletContext.getAttribute(StartupUtils.INJECTOR); | ||
Properties props = injector.getInstance(Properties.class); | ||
boolean includeInactive = injector.getInstance(Key.get(Boolean.TYPE, IncludeInactiveCardsets.class)); | ||
// cheap way to make sure we can close the hibernate session at the end of the page | ||
try { | ||
// load from db | ||
@SuppressWarnings("unchecked") | ||
List<PyxCardSet> cardSets = hibernateSession | ||
.createQuery(PyxCardSet.getCardsetQuery(props)) | ||
.createQuery(PyxCardSet.getCardsetQuery(includeInactive)) | ||
.setReadOnly(true) | ||
.setCacheable(true) | ||
.list(); | ||
// all of the data to send to the client | ||
|
@@ -72,6 +75,7 @@ try { | |
Map<Integer, Object> cardSetsData = new HashMap<Integer, Object>(); | ||
data.put("cardSets", cardSetsData); | ||
int i = 0; | ||
for (PyxCardSet cardSet: cardSets) { | ||
Map<String, Object> cardSetData = new HashMap<String, Object>(); | ||
cardSetData.put("name", cardSet.getName()); | ||
|
@@ -100,7 +104,7 @@ try { | |
} | ||
cardSetData.put("blackCards", blackCardIds); | ||
cardSetsData.put(cardSet.getWeight(), cardSetData); | ||
cardSetsData.put(i++, cardSetData); | ||
} | ||
Map<Integer, Object> blackCardsData = new HashMap<Integer, Object>(); | ||
|
@@ -142,6 +146,7 @@ try { | |
<script type="text/javascript" src="js/QTransform.js"></script> | ||
<script type="text/javascript" src="js/jquery-ui.min.js"></script> | ||
<script type="text/javascript" src="js/jquery.tablesorter.js"></script> | ||
<link rel="stylesheet" type="text/css" href="cah.css" media="screen" /> | ||
<link rel="stylesheet" type="text/css" href="jquery-ui.min.css" media="screen" /> | ||
<jsp:include page="analytics.jsp" /> | ||
<script type="text/javascript"> | ||
|
@@ -208,7 +213,7 @@ table td { | |
} | ||
</style> | ||
</head> | ||
<body> | ||
<body style="overflow: scroll"> | ||
<div style="float: left;"> | ||
Show only cards from card sets (hold ctrl or cmd to select multiple): | ||
<br/> | ||
|
@@ -243,15 +248,3 @@ table td { | |
hibernateSession.close(); | ||
} | ||
%> | ||
--%> | ||
<!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>Pretend You're Xyzzy: View Cards</title> | ||
</head> | ||
<body> | ||
<p>This page has been disabled as it causes excess strain on server resources.</p> | ||
</body> | ||
</html> |