ability-table.component.html 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  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">{{ "cost." + ability.cost | translate }}</div>
  19. </div>
  20. <p [innerHTML]="ability.shortDescription"></p>
  21. <div class="charges-box" *ngIf="ability.charges != 0">
  22. {{ "abilities.uses" | translate }}
  23. @if (ability.charges > 9) {
  24. <div class="usage-box">
  25. <icon-button
  26. [icon]="'remove'"
  27. [disabled]="ability.currentlyUsedCharges === ability.charges"
  28. (click)="addUsage(index); $event.stopPropagation()"
  29. ></icon-button>
  30. <div class="usage">
  31. {{ ability.charges - ability.currentlyUsedCharges }}/{{
  32. ability.charges
  33. }}
  34. </div>
  35. <icon-button
  36. [icon]="'add'"
  37. [disabled]="ability.currentlyUsedCharges === 0"
  38. (click)="removeUsage(index); $event.stopPropagation()"
  39. ></icon-button>
  40. </div>
  41. } @else {
  42. @for (
  43. _ of getArray(ability.charges);
  44. let chargeIndex = $index;
  45. track _
  46. ) {
  47. <input
  48. [id]="'checkbox' + index + '-' + chargeIndex"
  49. type="checkbox"
  50. (click)="$event.stopPropagation()"
  51. (change)="
  52. $event.stopPropagation();
  53. handleChangedCharges(index, $event.target)
  54. "
  55. />
  56. }
  57. }
  58. </div>
  59. </div>
  60. } @empty {
  61. <div class="empty-list">{{ "abilities.empty" | translate }}</div>
  62. }
  63. </div>
  64. <div class="footer">
  65. <ui-button
  66. [color]="'green'"
  67. [type]="'add'"
  68. style="width: 80%"
  69. (click)="openModal(false)"
  70. >
  71. </ui-button>
  72. </div>
  73. </div>