1
0
mirror of https://github.com/projekteuler/projekteuler.git synced 2026-01-27 02:28:50 +01:00

Update header and footer, use cards for problems

This commit is contained in:
2019-12-24 10:03:01 +01:00
parent f08254ffef
commit 0ed3c14508
9 changed files with 54 additions and 41 deletions

View File

@@ -1,29 +1,31 @@
<% provide(:title, t('problems.show.problem_subtitle', id: @translation.problem_id)) %>
<div class="pb-2 mt-4 mb-2">
<p class="text-muted">
<%= render 'shared/authors', authors: Array(@translation.author) %>
</p>
<h1><%= @translation.title %> <small><%= t 'problems.show.problem_subtitle', id: @translation.problem_id %></small></h1>
<h1><%= @translation.title %></h1>
</div>
<% if @translation.pending? %>
<div class="problem-buttons">
<div class="btn-group problem-buttons-inner">
<%= link_to admin_translation_decline_path(@translation), method: :post, class: 'btn btn-danger btn-sm' do %>
<%= icon('fas', 'times') %> <%= t '.decline_translation' %>
<% end %>
<%= link_to admin_translation_accept_path(@translation), method: :post, class: 'btn btn-success btn-sm' do %>
<%= icon('fas', 'check') %> <%= t '.accept_translation' %>
<% end %>
</div>
</div>
<% end %>
<div class="card mb-3">
<div class="card-body problem-content">
<%= sanitize @translation.content, scrubber: TranslationContentScrubber.new %>
<div class="card-header">
<%= t 'problems.show.problem_subtitle', id: @translation.problem_id %>
</div>
<% if @translation.pending? %>
<div class="problem-buttons">
<div class="btn-group problem-buttons-inner">
<%= link_to admin_translation_decline_path(@translation), method: :post, class: 'btn btn-danger btn-sm' do %>
<%= icon('fas', 'times') %> <%= t '.decline_translation' %>
<% end %>
<%= link_to admin_translation_accept_path(@translation), method: :post, class: 'btn btn-success btn-sm' do %>
<%= icon('fas', 'check') %> <%= t '.accept_translation' %>
<% end %>
</div>
</div>
<% end %>
<div class="card-body problem-content">
<%= sanitize @translation.content, scrubber: TranslationContentScrubber.new %>
</div>
<div class="card-footer text-muted">
<%= render 'shared/authors', authors: Array(@translation.author) %>
</div>
</div>
<% if @translation.problem.is_translated? %>