|
7 | 7 | <dl class="dl-horizontal"> |
8 | 8 | <dt><%= 'Title' %>:</dt> |
9 | 9 | <dd><%= @exercise.title %></dd> |
10 | | - <dt><%= 'Description' %></dt> |
11 | | - <dd><%= @exercise.description %></dd> |
| 10 | + <% @exercise.descriptions.each do |description|%> |
| 11 | + <dt><%= 'Description in' %> <%= description.language %>:</dt> |
| 12 | + <dd><%= description.text %></dd> |
| 13 | + <% end %> |
12 | 14 | <dt><%= 'Visibility' %>:</dt> |
13 | 15 | <dd><%= @exercise.public ? 'public' : 'private' %></dd> |
14 | 16 | <dt><%= 'Created by' %>:</dt> |
15 | | - <% if @exercise.user %> |
16 | | - <% if @exercise.user.first_name.nil?%> |
| 17 | + <% if !@exercise.user %> |
| 18 | + <dd><%= 'User undefined' %></dd> |
| 19 | + <% elsif @exercise.user.first_name.nil?%> |
17 | 20 | <dd><%= "User#{@exercise.user.id}"%></dd> |
18 | | - <% else %> |
19 | | - <dd><%= @exercise.user.name %></dd> |
20 | | - <% end %> |
21 | 21 | <% else %> |
22 | | - <dd><%= 'User undefined' %></dd> |
| 22 | + <dd><%= @exercise.user.name %></dd> |
23 | 23 | <% end %> |
24 | 24 | <dt><%= 'Created at' %>:</dt> |
25 | 25 | <dd><%= @exercise.created_at %></dd> |
|
77 | 77 | <div class="actions btn-group" role="group"> |
78 | 78 | <% if can? :edit, @exercise %> |
79 | 79 | <%= link_to 'Edit', edit_exercise_path(@exercise), class: 'btn btn-warning' %> |
80 | | - <% end %> |
| 80 | + <%= link_to 'Delete', exercise_path(@exercise), class:'btn btn-danger', method: :delete, data: { confirm: 'Are you sure?' } %> |
| 81 | + |
| 82 | +<% end %> |
81 | 83 | <%= link_to 'Back', exercises_path, class: 'btn btn-default' %> |
82 | 84 |
|
83 | 85 | </div> |
|
0 commit comments