Skip to content

Commit fa399c9

Browse files
committed
Add option to see students without points on list
1 parent ec60c6c commit fa399c9

File tree

5 files changed

+17
-8
lines changed

5 files changed

+17
-8
lines changed

app/assets/stylesheets/main.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ div.link-back {
116116
margin-top: 30px;
117117
}
118118

119-
div.alternative-format-links {
119+
div.alternative-options-links {
120120
float: right;
121121
}
122122

app/views/emails/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
<div class="alternative-format-links">
1+
<div class="alternative-options-links">
22
[<%= link_to 'plain text', organization_emails_path(format: :txt) %> |
33
<%= link_to 'csv', organization_emails_path(format: :csv) %>]
44
</div>

app/views/participants/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@
7272
<% end %>
7373
</tbody>
7474
</table>
75-
<div class="alternative-format-links">
75+
<div class="alternative-options-links">
7676
[
7777
<%= link_to "json", "#{participants_path params.merge(:format => :json, :api_version => ApiVersion::API_VERSION)}" %>
7878
|

app/views/points/index.html.erb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<div class="course-point-header">
44
<h1>Summary of points for <%= @course.title %></h1>
55
<% if can?(:teach, @course) %>
6-
<div class="alternative-format-links"><%= link_to('Export as CSV', organization_course_points_path(@organization, @course, :sort_by => params[:sort_by], :format => 'csv'), class: "btn btn-primary") %></div>
6+
<div class="alternative-options-links"><%= link_to('Export as CSV', organization_course_points_path(@organization, @course, :sort_by => params[:sort_by], :format => 'csv'), class: "btn btn-primary") %></div>
77
<% end %>
88
</div>
99
<% end %>

app/views/points/show.html.erb

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,16 +4,25 @@
44
<h1>Points for <%= @sheetname %> of <%= @course.title %></h1>
55
<% end %>
66

7-
<div class="alternative-format-links">
7+
<div class="alternative-options-links">
88
<% if params[:sort_by].blank? %>
9-
<%= link_to 'Sort by points', organization_course_point_path(@organization, @course, @sheetname, :sort_by => 'points'), class: "btn btn-primary" %>
9+
<%= 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, class: "btn btn-primary") %>
11+
<%= link_to('Sort by username', organization_course_point_path(@organization, @course, @sheetname, show_attempted: params[:show_attempted]), class: "btn btn-primary") %>
1212
<% end %>
13-
</div>
13+
1414
<% if can? :refresh_gdocs_spreadsheet, @course %>
1515
<% link_to 'Refresh Google Docs worksheet', refresh_gdocs_organization_course_point_path(@organization, @course, @sheetname), class: "btn btn-primary" %>
1616
<% end %>
17+
18+
<% if can?(:teach, @organization )%>
19+
<% if params[:show_attempted].nil? %>
20+
<%= link_to('Show students without any points', organization_course_point_path(@organization, @course, @sheetname, show_attempted: 1, sort_by: params[:sort_by]), class: "btn btn-primary") %>
21+
<% else %>
22+
<%= link_to('Hide students without any points', organization_course_point_path(@organization, @course, @sheetname, sort_by: params[:sort_by]), class: "btn btn-primary") %>
23+
<% end %>
24+
<% end %>
25+
</div>
1726
</div>
1827

1928
<% @user_fields_length = @user_fields ? @user_fields.length : 0 %>

0 commit comments

Comments
 (0)