Skip to content

Commit

Permalink
corrige la vue du composant sous-competence
Browse files Browse the repository at this point in the history
  • Loading branch information
etienneCharignon committed Feb 5, 2025
1 parent c99d7c2 commit d4d7c67
Showing 1 changed file with 42 additions and 40 deletions.
82 changes: 42 additions & 40 deletions app/components/sous_competence_component.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -19,52 +19,54 @@
<%= md I18n.t(description_traduction(succes)) %>
<%= image_tag 'fleche-droite.svg', alt: 'fleche', class: 'fleche-droite' %>
<%= I18n.t(tests_proposes_traduction, count: nombre_questions_repondues) %>
</div>
<% if @objet_sous_competence.criteres.present? %>
<div class="sous-competence__critere-accordion">
<%= dsfr_accordion do |accordion| %>
<%= accordion.with_section(title: "Voir le détail") do %>
<div class="fr-table fr-table--bordered fr-table--no-scroll" id="table-bordered-component">
<div class="fr-table__wrapper">
<div class="fr-table__container">
<div class="fr-table__content">
<table id="table-bordered">
<thead>
<tr>
<th scope="col">Critère</th>
<th scope="col">Code&nbsp;Cléa</th>
<th scope="col">Tests&nbsp;proposés</th>
<th scope="col">Résultat</th>
</tr>
</thead>
<tbody>
<% @objet_sous_competence.criteres.each_with_index do |critere, index| %>
<tr id="table-bordered-row-key-<%= index %>" data-row-key="<%= index %>">
<td><%= critere.libelle %></td>
<td><%= critere.code_clea %></td>
<td><%= critere.nombre_tests_proposes %> sur <%= critere.nombre_tests_proposes_max %></td>
<td>
<%=
if critere.acquis?
dsfr_badge(status: :success) { "Acquis" }
else
dsfr_badge(status: :error) { "Non&nbsp;acquis".html_safe }
end
%>
</td>

<% if @objet_sous_competence.criteres.present? %>
<div class="sous-competence__critere-accordion">
<%= dsfr_accordion do |accordion| %>
<%= accordion.with_section(title: "Voir le détail") do %>
<div class="fr-table fr-table--bordered fr-table--no-scroll" id="table-bordered-component">
<div class="fr-table__wrapper">
<div class="fr-table__container">
<div class="fr-table__content">
<table id="table-bordered">
<thead>
<tr>
<th scope="col">Critère</th>
<th scope="col">Code&nbsp;Cléa</th>
<th scope="col">Tests&nbsp;proposés</th>
<th scope="col">Résultat</th>
</tr>
<% end %>
</tbody>
</table>
</thead>
<tbody>
<% @objet_sous_competence.criteres.each_with_index do |critere, index| %>
<tr id="table-bordered-row-key-<%= index %>" data-row-key="<%= index %>">
<td><%= critere.libelle %></td>
<td><%= critere.code_clea %></td>
<td><%= critere.nombre_tests_proposes %> sur <%= critere.nombre_tests_proposes_max %></td>
<td>
<%=
if critere.acquis?
dsfr_badge(status: :success) { "Acquis" }
else
dsfr_badge(status: :error) { "Non&nbsp;acquis".html_safe }
end
%>
</td>
</tr>
<% end %>
</tbody>
</table>
</div>
</div>
</div>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>
</div>
<% end %>
<% end %>
<% end %>
</div>

</div>
</div>
</div>

0 comments on commit d4d7c67

Please sign in to comment.