diff --git a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js
index cd0066887..bf2f63f5b 100644
--- a/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js
+++ b/gemp-lotr/gemp-lotr-async/src/main/web/js/gemp-022/hallUi.js
@@ -544,12 +544,15 @@ var GempLotrHallUI = Class.extend({
}
var rowstr = "
| " + queue.getAttribute("format") + " | ";
- if(isWC) {
- rowstr = "
| " + queue.getAttribute("format") + " | " +
- "" + queue.getAttribute("queue") + " | " +
- "" + queue.getAttribute("start") + " | " +
- "" + queue.getAttribute("system") + " | " +
- "" + queue.getAttribute("playerCount") + " | " +
+ var startTd = "" + queue.getAttribute("start") + " | ";
+ var systemTd = "" + queue.getAttribute("system") + " | ";
+ var playersTd = "" + queue.getAttribute("playerCount") + " | ";
+ var costPrizesTds = "" + formatPrice(queue.getAttribute("cost")) + " | " + queue.getAttribute("prizes") + " | ";
+ if (isWC) { // assumes that wc queue is always constructed
+ rowstr += "" + queue.getAttribute("queue") + " | " +
+ startTd +
+ systemTd +
+ playersTd +
"
";
} else if (type.includes("Sealed") || type.includes("Draft")) {
// No prizes and cost displayed for limited games
@@ -559,19 +562,18 @@ var GempLotrHallUI = Class.extend({
rowstr += " class='draftFormatInfo' draftCode='"+ queue.getAttribute("draftCode") + "'";
}
rowstr += ">" + queue.getAttribute("queue") + "" +
- "" + queue.getAttribute("start") + " | " +
- "" + queue.getAttribute("system") + " | " +
- "" + queue.getAttribute("playerCount") + " | " +
+ startTd +
+ systemTd +
+ playersTd +
"";
} else {
- rowstr += "" + queue.getAttribute("collection") + " | ";
- rowstr += "" + queue.getAttribute("queue") + " | " +
- "" + queue.getAttribute("start") + " | " +
- "" + queue.getAttribute("system") + " | " +
- "" + queue.getAttribute("playerCount") + " | " +
- "" + formatPrice(queue.getAttribute("cost")) + " | " +
- "" + queue.getAttribute("prizes") + " | " +
+ rowstr += "" + queue.getAttribute("collection") + " | " +
+ "" + queue.getAttribute("queue") + " | " +
+ startTd +
+ systemTd +
+ playersTd +
+ costPrizesTds +
"";
}
@@ -581,7 +583,13 @@ var GempLotrHallUI = Class.extend({
// Row for tournament queue waiting table
var tablesRow = $("
");
tablesRow.append("" + queue.getAttribute("format") + " | ");
- let htmlTd = " Tournament - " + type + " - | " + tournament.getAttribute("format") + " | " +
- " " + tournament.getAttribute("name") + " | " +
- " " + tournament.getAttribute("system") + " | " +
- " " + tournament.getAttribute("stage") + " | " +
- " " + tournament.getAttribute("round") + " | " +
- " " + tournament.getAttribute("playerCount") + " | " +
- "");
- }
- else {
- rowhtml = " | " + tournament.getAttribute("format") + " | ";
+ rowstr += " | " + tournament.getAttribute("format") + " | ";
+ } else {
+ rowstr += " | " + tournament.getAttribute("format") + " | ";
if(type === "sealed") {
- rowhtml += "Sealed | ";
+ rowstr += "Sealed | ";
}
else if (type === "solodraft") {
- rowhtml += "Solo Draft | ";
+ rowstr += "Solo Draft | ";
}
else if (type === "table_solodraft") {
- rowhtml += "Solo Table Draft | ";
+ rowstr += "Solo Table Draft | ";
}
else if (type === "table_draft") {
- rowhtml += "Table Draft | ";
+ rowstr += "Table Draft | ";
}
else {
- rowhtml += "" + tournament.getAttribute("collection") + " | ";
+ rowstr += "" + tournament.getAttribute("collection") + " | ";
}
-
- rowhtml += "" + tournament.getAttribute("name") + " | " +
- "" + tournament.getAttribute("system") + " | ";
- if (tournament.hasAttribute("timeRemaining")) {
- rowhtml += "" + tournament.getAttribute("stage") + " - " + tournament.getAttribute("timeRemaining") + " | ";
- } else {
- rowhtml += "" + tournament.getAttribute("stage") + " | ";
- }
- rowhtml += "" + tournament.getAttribute("round") + " | " +
- "" + tournament.getAttribute("playerCount") + " | " +
- " ";
-
- rowstr = $(rowhtml);
}
+ rowstr += " " + tournament.getAttribute("name") + " | " +
+ " " + tournament.getAttribute("system") + " | ";
+ if (tournament.hasAttribute("timeRemaining")) {
+ rowstr += " " + tournament.getAttribute("stage") + " - " + tournament.getAttribute("timeRemaining") + " | ";
+ } else {
+ rowstr += " " + tournament.getAttribute("stage") + " | ";
+ }
+ rowstr += " " + tournament.getAttribute("round") + " | " +
+ " " + tournament.getAttribute("playerCount") + " | ";
var row = $(rowstr);
row.append(actionsField);
@@ -868,62 +850,50 @@ var GempLotrHallUI = Class.extend({
tablesRow.addClass("played"); // red highlight
if (action == "add") {
- if(isWC) {
+ if (isWC) {
$("table.wc-events", this.tablesDiv)
.append(row);
- }
- else {
+ } else {
$("table.tournaments", this.tablesDiv)
.append(row);
- // Display running tournaments also as playing tables
- $("table.playingTables", this.tablesDiv)
- .append(tablesRow)
- if (joined == "true") {
- // Open draft window
- if ((type === "table_solodraft" && (stage === "deck-building" || stage === "registering decks" || stage === "awaiting kickoff"))
- || (type === "table_draft" && stage === "drafting")) {
- var tourneyId = tournament.getAttribute("id");
- window.open("/gemp-lotr/tableDraft.html?eventId=" + tourneyId, '_blank');
- this.PlaySound("gamestart");
- } else if (type === "solodraft" && (stage === "deck-building" || stage === "registering decks" || stage === "awaiting kickoff")) {
- var tourneyId = tournament.getAttribute("id");
- window.open("/gemp-lotr/soloDraft.html?eventId=" + tourneyId, '_blank');
- this.PlaySound("gamestart");
-
- }
- }
}
-
- } else if (action == "update") {
- if(isWC) {
- $(".wc-tournament" + id, this.tablesDiv).replaceWith(row);
- }
- else {
- $(".tournament" + id, this.tablesDiv).replaceWith(row);
+ // Display running tournaments also as playing tables
+ $("table.playingTables", this.tablesDiv)
+ .append(tablesRow)
- // Display tournaments also as playing tables
- var existingRow = $(".table" + id, this.tablesDiv);
- if (existingRow.length > 0) {
- // If the row exists, replace it
- existingRow.replaceWith(tablesRow);
- } else {
- // If the row does not exist, append it
- $("table.playingTables", this.tablesDiv).append(tablesRow);
+ if (joined == "true") {
+ // Open draft window
+ if ((type === "table_solodraft" && (stage === "deck-building" || stage === "registering decks" || stage === "awaiting kickoff"))
+ || (type === "table_draft" && stage === "drafting")) {
+ var tourneyId = tournament.getAttribute("id");
+ window.open("/gemp-lotr/tableDraft.html?eventId=" + tourneyId, '_blank');
+ this.PlaySound("gamestart");
+ } else if (type === "solodraft" && (stage === "deck-building" || stage === "registering decks" || stage === "awaiting kickoff")) {
+ var tourneyId = tournament.getAttribute("id");
+ window.open("/gemp-lotr/soloDraft.html?eventId=" + tourneyId, '_blank');
+ this.PlaySound("gamestart");
}
- }
-
+ }
+
+ } else if (action == "update") {
+ $(".tournament" + id, this.tablesDiv).replaceWith(row);
+
+ // Display tournaments also as playing tables
+ var existingRow = $(".table" + id, this.tablesDiv);
+ if (existingRow.length > 0) {
+ // If the row exists, replace it
+ existingRow.replaceWith(tablesRow);
+ } else {
+ // If the row does not exist, append it
+ $("table.playingTables", this.tablesDiv).append(tablesRow);
+ }
}
this.animateRowUpdate(".tournament" + id);
} else if (action == "remove") {
- if(isWC) {
- $(".wc-tournament" + id, this.tablesDiv).remove();
- }
- else {
- $(".tournament" + id, this.tablesDiv).remove();
- // Remove tournaments displayed as tables
- $(".table" + id, this.tablesDiv).remove();
- }
+ $(".tournament" + id, this.tablesDiv).remove();
+ // Remove tournaments displayed as tables
+ $(".table" + id, this.tablesDiv).remove();
}
}
|