<commit_before><div class="modal-content">
  <div class="modal-header">
    <h5 class="modal-title">{{ info.name | translate }}</h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" 
            aria-label="Close"></button>
  </div>
  <div class="modal-body container-fluid">
    <div class="row">
      <div class="col-4 offset-4">
        <img src="assets/img/army/{{info?.code}}.png"
             title="{{ info?.name | translate }}" 
             alt="{{info?.name | translate }}" />
      </div>
      
      <div class="col-12 text-center fw-bold text-danger">
        <div *ngIf="rEngageNb == 1" translate>Unit engaged</div>
        <div *ngIf="rEngageNb > 1" translate>Units engaged</div>
        <div *ngIf="rLiberateNb == 1" translate>Unit liberated</div>
        <div *ngIf="rLiberateNb > 1" translate>Units liberated</div>
        <div *ngIf="engageNb > rEngagePossible" translate>
          You can't engage as much of this unit
        </div>
        <div *ngIf="info.temple && info.temple.artemis && user.getPropertyNb('artemis') == 0"
             translate>
          You must have the temple of Artemis to engage this unit.
        </div>
        <div *ngIf="info.temple && info.temple.hephaestus && user.getPropertyNb('hephaestus') == 0"
             translate>
          You must have the temple of Hephaestus to engage this unit.
        </div>
        <div *ngIf="info.temple && info.temple.dionysus && user.getPropertyNb('dionysus') == 0"
             translate>
          You must have the temple of Dionysus to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.ares && user.getPropertyNb('ares') == 0">
          You must have the temple of Ares to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.zeus && user.getPropertyNb('zeus') == 0">
          You must have the temple of Zeus to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.hades && user.getPropertyNb('hades') == 0">
          You must have the temple of Hades to engage this unit.
        </div>
        
        <div *ngIf="info.power && info.power == 'gaia_defender' && user.getPropertyNb('gaia_defender') == 0"
             translate>
          You must have the power of Gaia's defense to engage this unit.
        </div>
        
        <div *ngIf="info.power && info.power == 'divine_units' && user.getPropertyNb('divine_units') < info.power_level"
             translate>
          You must have the power of the Divine units level {{ info.power_level }} to engage this unit.
        </div>
        
        <div *ngIf="error == 1" translate>
          You need to enter the number of units you would like to engage or liberate
        </div>
        <div *ngIf="info.camp_level && info.camp_level > user.getPropertyNb('camp_level') " translate>
          You need to update your military camp to engage this unity
        </div>
        
        <div *ngIf="missingResource().length > 0">
          <span translate>Missing resources:</span>
          <span *ngFor="let res of missingResource()">
            <id-to-ress [ress_id]="res"></id-to-ress>
          </span>
        </div>
        
        <span *ngIf="(info.placen && 
                       (user.getPropertyNb('placen')-user.getPropertyNb('placenactu')-(engageNb * info.placen) < 0)) ||
                       (info.placep && 
                       (user.getPropertyNb('placep')-user.getPropertyNb('placepactu')-(engageNb * info.placep) < 0)) ||
                       (info.placec && 
                       (user.getPropertyNb('placec')-user.getPropertyNb('placecactu')-(engageNb * info.placec) < 0))"
              class="bold red" translate>
          You don't have enough empty homes
        </span>
        
        <span *ngIf="((info.condition) && (
                        ((info.condition.ranking) && user.getPropertyNb('ranking') > info.condition.ranking)))"
              translate>
          Only the first XP ranking can engage this unit
        </span>
      </div>
      
      <div class="col-6">
        <div *ngIf="info.cost">
          <strong translate>Commitment</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.cost | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
        <div *ngIf="info.cost">
          <strong translate>Liberation</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.resale | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
        <div *ngIf="info.consumption && info.consumption.length > 0">
          <strong translate>Consumption</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.consumption | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
      </div>
      
      <div class="col-6">
        <div>
          <strong translate>Currently</strong>
          <strong translate>:</strong>
          <span role="button" (click)="setLiberate()">
            {{ user.getPropertyNb(info.code) | number:'': this.translate.currentLang }}
          </span>
          <span *ngIf="info.nbmax">
            / {{ info.nbmax | number:'': this.translate.currentLang }}
          </span>
        </div>
        
        <div *ngIf="rEngagePossible > 0">
          <strong>{{"Max possible"|translate}}{{":"|translate}}</strong>
          {{ rEngagePossible | number:'': this.translate.currentLang }}
        </div>
        
        <div class="input-group">
          <input type="number" placeholder="0" min="0" step="1"
                 [(ngModel)]="engageNb" class="form-control"
                 (keydown.enter)="armyEngage()">
          <span class="input-group-addon btn btn-primary"
                (click)="armyEngage()" translate>Engage</span>
        </div>
        
        <div class="input-group">
          <input type="number" placeholder="0" min="0" step="1"
                 [(ngModel)]="liberatenb" class="form-control"
                 (keydown.enter)="armyLiberate()">
          <span class="input-group-addon btn btn-danger"
                (click)="armyLiberate()" translate>Liberate</span>
        </div>
      </div>
    </div>
  </div>
  
  <div class="modal-footer">
    <div *ngIf="info.code == 'spartan'" translate>
      The Spartans are warriors without fear or pity. It is a race of fierce and ascetic warriors, capable of sacrificing themselves by patriotism to save your city. Their strength will increase proportionally to your level.
    </div>
    <div *ngIf="info.code == 'volunteer'" translate>
      The volunteer is a free citizen or a metic. Since he is not a soldier, he hardly touches his momentary commitment in your army. Nevertheless, it has a low pay and its strength is just as much.
    </div><commit_msg>Can't engage if the level is too low<commit_after><div class="modal-content">
  <div class="modal-header">
    <h5 class="modal-title">{{ info.name | translate }}</h5>
    <button type="button" class="btn-close" data-bs-dismiss="modal" 
            aria-label="Close"></button>
  </div>
  <div class="modal-body container-fluid">
    <div class="row">
      <div class="col-4 offset-4">
        <img src="assets/img/army/{{info?.code}}.png"
             title="{{ info?.name | translate }}" 
             alt="{{info?.name | translate }}" />
      </div>
      
      <div class="col-12 text-center fw-bold text-danger">
        <div *ngIf="rEngageNb == 1" translate>Unit engaged</div>
        <div *ngIf="rEngageNb > 1" translate>Units engaged</div>
        <div *ngIf="rLiberateNb == 1" translate>Unit liberated</div>
        <div *ngIf="rLiberateNb > 1" translate>Units liberated</div>
        <div *ngIf="engageNb > rEngagePossible" translate>
          You can't engage as much of this unit
        </div>
        <div *ngIf="info.temple && info.temple.artemis && user.getPropertyNb('artemis') == 0"
             translate>
          You must have the temple of Artemis to engage this unit.
        </div>
        <div *ngIf="info.temple && info.temple.hephaestus && user.getPropertyNb('hephaestus') == 0"
             translate>
          You must have the temple of Hephaestus to engage this unit.
        </div>
        <div *ngIf="info.temple && info.temple.dionysus && user.getPropertyNb('dionysus') == 0"
             translate>
          You must have the temple of Dionysus to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.ares && user.getPropertyNb('ares') == 0">
          You must have the temple of Ares to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.zeus && user.getPropertyNb('zeus') == 0">
          You must have the temple of Zeus to engage this unit.
        </div>
        
        <div translate
             *ngIf="info.temple && info.temple.hades && user.getPropertyNb('hades') == 0">
          You must have the temple of Hades to engage this unit.
        </div>
        
        <div *ngIf="info.power && info.power == 'gaia_defender' && user.getPropertyNb('gaia_defender') == 0"
             translate>
          You must have the power of Gaia's defense to engage this unit.
        </div>
        
        <div *ngIf="info.power && info.power == 'divine_units' && user.getPropertyNb('divine_units') < info.power_level"
             translate>
          You must have the power of the Divine units level {{ info.power_level }} to engage this unit.
        </div>
        
        <div *ngIf="error == 1" translate>
          You need to enter the number of units you would like to engage or liberate
        </div>
        <div *ngIf="info.camp_level && info.camp_level > user.getPropertyNb('camp_level') " translate>
          You need to update your military camp to engage this unity
        </div>
        
        <div *ngIf="missingResource().length > 0">
          <span translate>Missing resources:</span>
          <span *ngFor="let res of missingResource()">
            <id-to-ress [ress_id]="res"></id-to-ress>
          </span>
        </div>
        
        <span *ngIf="(info.placen && 
                       (user.getPropertyNb('placen')-user.getPropertyNb('placenactu')-(engageNb * info.placen) < 0)) ||
                       (info.placep && 
                       (user.getPropertyNb('placep')-user.getPropertyNb('placepactu')-(engageNb * info.placep) < 0)) ||
                       (info.placec && 
                       (user.getPropertyNb('placec')-user.getPropertyNb('placecactu')-(engageNb * info.placec) < 0))"
              class="bold red" translate>
          You don't have enough empty homes
        </span>
        
        <span *ngIf="((info.condition) && (
                        ((info.condition.ranking) && user.getPropertyNb('ranking') > info.condition.ranking)))"
              translate>
          Only the first XP ranking can engage this unit
        </span>
      </div>
      
      <div class="col-6">
        <div *ngIf="info.cost">
          <strong translate>Commitment</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.cost | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
        <div *ngIf="info.cost">
          <strong translate>Liberation</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.resale | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
        <div *ngIf="info.consumption && info.consumption.length > 0">
          <strong translate>Consumption</strong>
          <strong translate>:</strong>
          <br/>
          <span *ngFor="let resource of info.consumption | keyvalue">
            {{ resource.value ? resource.value : 0 | number:'': this.translate.currentLang }}
            <id-to-ress [ress_id]="resource.key"></id-to-ress>
          </span>
        </div>
        
      </div>
      
      <div class="col-6">
        <div>
          <strong translate>Currently</strong>
          <strong translate>:</strong>
          <span role="button" (click)="setLiberate()">
            {{ user.getPropertyNb(info.code) | number:'': this.translate.currentLang }}
          </span>
          <span *ngIf="info.nbmax">
            / {{ info.nbmax | number:'': this.translate.currentLang }}
          </span>
        </div>
        
        <div *ngIf="rEngagePossible > 0">
          <strong>{{"Max possible"|translate}}{{":"|translate}}</strong>
          {{ rEngagePossible | number:'': this.translate.currentLang }}
        </div>
        
        <div class="input-group" *ngIf="user.getLevel() >= info.lvlmini">
          <input type="number" placeholder="0" min="0" step="1"
                 [(ngModel)]="engageNb" class="form-control"
                 (keydown.enter)="armyEngage()">
          <span class="input-group-addon btn btn-primary"
                (click)="armyEngage()" translate>Engage</span>
        </div>
        
        <div class="input-group">
          <input type="number" placeholder="0" min="0" step="1"
                 [(ngModel)]="liberatenb" class="form-control"
                 (keydown.enter)="armyLiberate()">
          <span class="input-group-addon btn btn-danger"
                (click)="armyLiberate()" translate>Liberate</span>
        </div>
      </div>
    </div>
  </div>
  
  <div class="modal-footer">
    <div *ngIf="info.code == 'spartan'" translate>
      The Spartans are warriors without fear or pity. It is a race of fierce and ascetic warriors, capable of sacrificing themselves by patriotism to save your city. Their strength will increase proportionally to your level.
    </div>
    <div *ngIf="info.code == 'volunteer'" translate>
      The volunteer is a free citizen or a metic. Since he is not a soldier, he hardly touches his momentary commitment in your army. Nevertheless, it has a low pay and its strength is just as much.
    </div>
{'fraction_non_alphanumeric': 0.14502382390443594, 'fraction_numerical': 0.004697671297228374, 'mean_word_length': 2.045575311669732, 'pattern_counts': {'":': 2, '<': 259, '<?xml version=': 0, '>': 268, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '249116', 'n_tokens_mistral': 4478, 'n_tokens_neox': 4367, 'n_words': 1076}