diff --git a/app/views/comments/comments_all.html.erb b/app/views/comments/comments_all.html.erb index 747f81fce..43a895db7 100644 --- a/app/views/comments/comments_all.html.erb +++ b/app/views/comments/comments_all.html.erb @@ -22,6 +22,8 @@ <%= comment.text %> <% if !comment.user %> <%= 'User undefined' %> + <% elsif @exercise.user == current_user %> + <%= 'yourself' %> <% elsif comment.user.first_name.nil?%> <%= link_to "User#{comment.user.id}", user_path(comment.user)%> <% else %> diff --git a/app/views/comments/index.html.erb b/app/views/comments/index.html.erb index 861e8913f..b9e42d412 100644 --- a/app/views/comments/index.html.erb +++ b/app/views/comments/index.html.erb @@ -27,6 +27,8 @@ <%= comment.text %> <% if !comment.user %> <%= 'User undefined' %> + <% elsif @exercise.user == current_user %> + <%= 'yourself' %> <% elsif comment.user.first_name.nil? || current_user.role === 'user'%> <%= "User#{comment.user.id}"%> <% else %> diff --git a/app/views/exercises/exercises_all.html.erb b/app/views/exercises/exercises_all.html.erb index 59e43ae9c..7d292df3f 100644 --- a/app/views/exercises/exercises_all.html.erb +++ b/app/views/exercises/exercises_all.html.erb @@ -17,6 +17,8 @@ <%= link_to exercise.title, exercise %> <% if !exercise.user %> <%= 'User undefined' %> + <% elsif @exercise.user == current_user %> + <%= 'yourself' %> <% elsif exercise.user.first_name.nil?%> <%= link_to "User#{exercise.user.id}", user_path(exercise.user)%> <% else %> diff --git a/app/views/exercises/show.html.erb b/app/views/exercises/show.html.erb index c90e2c91d..27d718730 100644 --- a/app/views/exercises/show.html.erb +++ b/app/views/exercises/show.html.erb @@ -16,6 +16,8 @@
<%= 'Created by' %>:
<% if !@exercise.user %>
<%= 'User undefined' %>
+ <% elsif @exercise.user == current_user %> +
<%= 'yourself' %>
<% elsif @exercise.user.first_name.nil? || current_user.role === 'user'%>
<%= "User#{@exercise.user.id}"%>
<% else %>