ability-table.component.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <div class="ability-box">
  2. <div cdkDropList class="item-list" (cdkDropListDropped)="drop($event)">
  3. <!-- ITEMS -->
  4. @for (ability of abilities; let index = $index; track ability) {
  5. <div
  6. class="item"
  7. [class]="
  8. ability.currentlyUsedCharges === ability.charges &&
  9. ability.charges !== 0
  10. ? 'used'
  11. : ''
  12. "
  13. (click)="openDetailsPanel(index)"
  14. cdkDrag
  15. >
  16. <div class="header">
  17. <div class="name">{{ ability.name }}</div>
  18. <div class="cost">{{ "time." + ability.cost | translate }}</div>
  19. </div>
  20. <p [innerHTML]="ability.shortDescription"></p>
  21. @if (ability.charges != 0) {
  22. <div class="charges-box t-05">
  23. {{ "abilities.uses" | translate }}
  24. @if (ability.charges > 9) {
  25. <div class="usage-box">
  26. <icon-button
  27. [icon]="'remove'"
  28. [disabled]="ability.currentlyUsedCharges === ability.charges"
  29. (click)="addUsage(index); $event.stopPropagation()"
  30. ></icon-button>
  31. <div class="usage">
  32. {{ ability.charges - ability.currentlyUsedCharges }}/{{
  33. ability.charges
  34. }}
  35. </div>
  36. <icon-button
  37. [icon]="'add'"
  38. [disabled]="ability.currentlyUsedCharges === 0"
  39. (click)="removeUsage(index); $event.stopPropagation()"
  40. ></icon-button>
  41. </div>
  42. } @else {
  43. @for (
  44. _ of getArray(ability.charges);
  45. let chargeIndex = $index;
  46. track _
  47. ) {
  48. <input
  49. [id]="'checkbox' + index + '-' + chargeIndex"
  50. type="checkbox"
  51. (click)="$event.stopPropagation()"
  52. (change)="
  53. $event.stopPropagation();
  54. handleChangedCharges(index, $event.target)
  55. "
  56. />
  57. }
  58. }
  59. </div>
  60. }
  61. </div>
  62. } @empty {
  63. <div class="empty-list">{{ "abilities.empty" | translate }}</div>
  64. }
  65. </div>
  66. <div class="footer">
  67. <ui-button style="width: 60%" (click)="openModal(false)"
  68. >{{ "buttons.add" | translate }}
  69. </ui-button>
  70. </div>
  71. </div>