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

42 lines
1.3 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 %>
<%= link_to problem do %>
<i><%= problem.original_title %> <%= t 'problems.not_translated_yet' %></i>
<% end %>
<% end %>
</td>
</tr>
<% end %>
</tbody>
</table>
<%= render 'problem_pagination' %>
<br>