1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2025-12-10 16:46:42 +01:00
projekteuler/app/views/problems/index.html.erb

44 lines
1.4 KiB
Plaintext

<% provide(:title, Problem.model_name.human(count: 2)) %>
<div class="pb-2 mt-4 mb-2 border-bottom">
<h1><%= Problem.model_name.human(count: 2) %></h1>
</div>
<p><%= t('problems.index.translated_count', translated: Problem.translated_count, total: Problem.count) %></p>
<div class="progress mb-3">
<div class="progress-bar progress-bar-striped bg-primary" role="progressbar" style="width: <%= @translated_percentage %>%" aria-valuenow="<%= @translated_percentage %>>" aria-valuemin="0" aria-valuemax="100">
<%= @translated_percentage %>%
</div>
</div>
<%= render 'problem_pagination' %>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th><%= Problem.human_attribute_name(:id) %></th>
<th><%= Problem.human_attribute_name(:title) %></th>
</tr>
</thead>
<tbody>
<% @problems.each do |problem| %>
<tr>
<td><%= problem.id %></td>
<td>
<% if problem.is_translated? %>
<%= link_to problem.title, problem %>
<% else %>
<i><%= t 'problems.not_yet_translated' %></i>
<%= link_to new_problem_translation_path(problem), class: 'btn btn-primary btn-sm' do %>
<%= icon('fas', 'edit') %> <%= t '.suggest_translation' %>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= render 'problem_pagination' %>
<br>