mirror of
https://github.com/projekteuler/projekteuler.git
synced 2026-01-27 02:28:50 +01:00
Move translation viewing to admin namespace
This commit is contained in:
2
app/views/admin/dashboard/index.html.erb
Normal file
2
app/views/admin/dashboard/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1><%= t('.administration') %></h1>
|
||||
<%= link_to t('.view_translations'), admin_translations_path %>
|
||||
@@ -0,0 +1 @@
|
||||
<%= will_paginate @translations, renderer: BootstrapPagination::Rails %>
|
||||
22
app/views/admin/translations/index.html.erb
Normal file
22
app/views/admin/translations/index.html.erb
Normal file
@@ -0,0 +1,22 @@
|
||||
<h1><%= Translation.model_name.human(count: 2) %></h1>
|
||||
|
||||
<%= render 'translation_pagination' %>
|
||||
<table class="table table-striped table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= Translation.human_attribute_name(:id) %></th>
|
||||
<th><%= Translation.human_attribute_name(:title) %></th>
|
||||
</tr>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<% @translations.each do |translation| %>
|
||||
<tr>
|
||||
<td><%= translation.id %></td>
|
||||
<td><%= link_to translation.title, [:admin, translation] %></td>
|
||||
</tr>
|
||||
<% end %>
|
||||
</tbody>
|
||||
</table>
|
||||
<%= render 'translation_pagination' %>
|
||||
<br>
|
||||
4
app/views/admin/translations/index.json.jbuilder
Normal file
4
app/views/admin/translations/index.json.jbuilder
Normal file
@@ -0,0 +1,4 @@
|
||||
json.array!(@translations) do |translation|
|
||||
json.extract! translation, :id, :title, :content
|
||||
json.url translation_url(translation, format: :json)
|
||||
end
|
||||
12
app/views/admin/translations/show.html.erb
Normal file
12
app/views/admin/translations/show.html.erb
Normal file
@@ -0,0 +1,12 @@
|
||||
<div class="page-header">
|
||||
<h1><%= @translation.title %> <small><%= t 'problems.show.problem_subtitle', id: @translation.problem_id %></small></h1>
|
||||
</div>
|
||||
|
||||
<%= panel do %>
|
||||
<div class="panel-body problem-content">
|
||||
<%= sanitize @translation.content %>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="text-center">
|
||||
<%= link_to t('problems.show.view_original_problem'), @translation.problem.original_url, target: '_blank' %>
|
||||
</div>
|
||||
1
app/views/admin/translations/show.json.jbuilder
Normal file
1
app/views/admin/translations/show.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.extract! @translation, :id, :title, :content, :created_at, :updated_at
|
||||
Reference in New Issue
Block a user