Skip to content

Commit 644bed2

Browse files
committed
Hide login from point lists
1 parent 97627a8 commit 644bed2

File tree

4 files changed

+12
-17
lines changed

4 files changed

+12
-17
lines changed

app/views/participants/show.html.erb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77

88
<section class="participant-entries">
99
<ul class="nobullets">
10-
<li>Username: <%= @user.login %></li>
10+
<% if current_user.administrator? %>
11+
<li>Username: <%= @user.login %> (shown to you beacause you're an admin)</li>
12+
<% end %>
1113
<li>E-mail: <%= mail_to(@user.email, @user.email) %></li>
1214
<% for field in UserField.all %>
1315
<% if field.field_type != :html %>

app/views/points/index.csv.erb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<% require 'portable_csv' %>
22
<%= PortableCSV.generate(:force_quotes => true) do |csv|
3-
arr = ["Username"]
3+
arr = []
44
arr += @user_fields.map(&:label) if @user_fields
55
arr += @summary[:sheets].map {|sheet| sheet[:name] } + ["Total"]
66
csv << arr
@@ -10,7 +10,7 @@
1010
@summary[:awarded_for_user_and_sheet][user.login][sheet[:name]].to_i
1111
end
1212
total = @summary[:total_for_user][user.login].to_i
13-
arr = [user.login]
13+
arr = []
1414
if @user_fields
1515
@user_fields.each do |field|
1616
user_field_value = user.user_field_values.find { |o| o.field_name == field.name }

app/views/points/index.html.erb

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,7 @@
4444
</tr>
4545
<tr>
4646
<th></th>
47-
<th>
48-
Student<br />
49-
<% unless params[:sort_by].blank? %>
50-
[<%= link_to 'sort', organization_course_points_path(@organization, @course) %>]
51-
<% else %>
52-
[sort]
53-
<% end %>
54-
</th>
47+
<th></th>
5548
<% if @user_fields %>
5649
<% @user_fields.each do |field| %>
5750
<th><%= field.label %></th>
@@ -89,9 +82,9 @@
8982
<td><%= index + 1 %></td>
9083
<td>
9184
<% if current_user.id == user.id || can?(:teach, @course) %>
92-
<%= link_to username, participant_path(user) %>
85+
<%= link_to 'Profile', participant_path(user) %>
9386
<% else %>
94-
<%= username %>
87+
&nbsp;
9588
<% end %>
9689
</td>
9790
<% if @user_fields %>

app/views/points/show.html.erb

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<% if params[:sort_by].blank? %>
99
<%= link_to('Sort by points', organization_course_point_path(@organization, @course, @sheetname, sort_by: 'points', show_attempted: params[:show_attempted]), class: "btn btn-primary")%>
1010
<% else %>
11-
<%= link_to('Sort by username', organization_course_point_path(@organization, @course, @sheetname, show_attempted: params[:show_attempted]), class: "btn btn-primary") %>
11+
<%= link_to('Sort by default order', organization_course_point_path(@organization, @course, @sheetname, show_attempted: params[:show_attempted]), class: "btn btn-primary") %>
1212
<% end %>
1313

1414
<% if can? :refresh_gdocs_spreadsheet, @course %>
@@ -26,7 +26,7 @@
2626
<% if tailoring.show_exercise_names_in_points_table %>
2727
<tr>
2828
<th></th>
29-
<th>Username</th>
29+
<th></th>
3030
<% if @user_fields %>
3131
<% @user_fields.each do |field| %>
3232
<th><%= field.label %></th>
@@ -60,9 +60,9 @@
6060
<td><%= index + 1 %></td>
6161
<td>
6262
<% if current_user.id == user.id || can?(:teach, @course) %>
63-
<%= link_to user.login, participant_path(user) %>
63+
<%= link_to 'Profile', participant_path(user) %>
6464
<% else %>
65-
<%= user.login %>
65+
&nbsp;
6666
<% end %>
6767
</td>
6868
<% if @user_fields %>

0 commit comments

Comments
 (0)