Skip to content

Commit

Permalink
Added shiaijo to group list
Browse files Browse the repository at this point in the history
  • Loading branch information
softwaremagico committed Jun 10, 2024
1 parent 76d1a4f commit ac4fd75
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,8 @@ public void createBodyRows(Document document, PdfPTable mainTable, float width,
}

for (final FightDTO fight : fights) {
if (groupsOfLevel.get(i).getFights().contains(fight)) {
if (i < groupsOfLevel.size() && groupsOfLevel.get(i).getFights() != null
&& groupsOfLevel.get(i).getFights().contains(fight)) {
final PdfPCell cell = new PdfPCell(fightTable(fight, true));
cell.setBorderWidth(BORDER_WIDTH);
cell.setColspan(getTableWidths().length);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
import com.softwaremagico.kt.pdf.EmptyPdfBodyException;
import com.softwaremagico.kt.pdf.ParentList;
import com.softwaremagico.kt.utils.GroupUtils;
import com.softwaremagico.kt.utils.ShiaijoName;
import org.springframework.context.MessageSource;

import java.util.List;
Expand Down Expand Up @@ -75,7 +76,9 @@ public void setTableProperties(PdfPTable mainTable) {
public PdfPTable groupTable(GroupDTO groupDTO) {
final PdfPTable teamTable = new PdfPTable(1);

teamTable.addCell(getHeader4(messageSource.getMessage("tournament.group", null, locale) + " " + (groupDTO.getIndex() + 1), 0));
teamTable.addCell(getHeader4(messageSource.getMessage("tournament.group", null, locale) + " " + (groupDTO.getIndex() + 1)
+ (tournament.getShiaijos() > 1 ? " (" + messageSource.getMessage("tournament.shiaijo", null, locale) + ": "
+ ShiaijoName.getShiaijoName(groupDTO.getShiaijo()) + ")" : ""), 0));

for (final TeamDTO teamDTO : groupDTO.getTeams()) {
teamTable.addCell(getCell(teamDTO.getName()));
Expand Down

0 comments on commit ac4fd75

Please sign in to comment.