noesya/osuny

View on GitHub
app/views/admin/research/theses/show.html.erb

Summary

Maintainability
Test Coverage
<% content_for :title, @l10n %>

<div class="row">
  <div class="col-xl-6">
    <%= simple_format @l10n.abstract %>
  </div>
  <div class="offset-xl-1 col-xl-5">
    <% if @thesis.started_at %>
      <%= osuny_label Research::Thesis.human_attribute_name('started_at') %>
      <p><%= l @thesis.started_at %></p>
    <% end %>
    <%= osuny_label Research::Thesis.human_attribute_name('completed') %>
    <p><%= t @thesis.completed %></p>
    <% if @thesis.completed_at %>
      <%= osuny_label Research::Thesis.human_attribute_name('completed_at') %>
      <p><%= l @thesis.completed_at %></p>
    <% end %>
    <%= osuny_label Research::Thesis.human_attribute_name('author') %>
    <p><%= osuny_link_localized_if can?(:read, @thesis.author),
                                   @thesis.author, 
                                admin_research_researcher_path(@thesis.author) %></p>
    <%= osuny_label Research::Thesis.human_attribute_name('laboratory') %>
    <p><%= osuny_link_localized_if can?(:read, @thesis.laboratory),
                                   @thesis.laboratory, 
                                [:admin, @thesis.laboratory] %></p>
    <%= osuny_label Research::Thesis.human_attribute_name('director') %>
    <p><%= osuny_link_localized_if can?(:read, @thesis.director),
                                   @thesis.director, 
                                admin_research_researcher_path(@thesis.director) %></p>
  </div>
</div>

<% content_for :action_bar_left do %>
  <%= destroy_link @thesis %>
<% end %>

<% content_for :action_bar_right do %>
  <%= edit_link @thesis %>
<% end %>