| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- @page "/pouvoir-list"
- @using DataLayer.Interfaces
- @using Domain.XML_Model
- @attribute [StreamRendering(true)]
- <div>
- <h3>Pouvoir</h3>
- </div>
- <div>
- @if (Pouvoirs == null)
- {
- <p><em>Loading...</em></p>
- }
- else
- {
- <table class="table table-striped">
- <thead>
- <tr>
- <th>Nom</th>
- <th>Discipline</th>
- <th>Seuil</th>
- <th>Action</th>
- <th>Opposé</th>
- <th>Portée</th>
- <th>Prolongeable</th>
- <th>Description</th>
- </tr>
- </thead>
- <tbody>
- @foreach (var pouvoir in Pouvoirs)
- {
- <tr>
- <td>@pouvoir.Nom</td>
- <td>@pouvoir.Discipline</td>
- <td>@pouvoir.Seuil</td>
- <td>@pouvoir.Action</td>
- <td>@pouvoir.Opposé</td>
- <td>@pouvoir.Portée</td>
- <td>@pouvoir.Prolongeable</td>
- <td>@pouvoir.Description</td>
- </tr>
- }
- </tbody>
- </table>
- }
- </div>
- @code {
- private List<Pouvoir> Pouvoirs { get; set; }
- [Inject]
- public IAbstractRepository<Pouvoir> _pouvoirRepository { get; set; }
- protected override async Task OnInitializedAsync()
- {
- // Load the pouvoirs data here
- Pouvoirs = await LoadPouvoirsAsync();
- }
- private async Task<List<Pouvoir>> LoadPouvoirsAsync()
- {
- // Implement the logic to load pouvoirs data
- var powers = await _pouvoirRepository.GetAll();
- return powers.OrderBy(p => p.Nom).ToList();
- }
- }
|