-
Notifications
You must be signed in to change notification settings - Fork 42
Expand file tree
/
Copy path_points.html.erb
More file actions
70 lines (70 loc) · 2.57 KB
/
_points.html.erb
File metadata and controls
70 lines (70 loc) · 2.57 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
<section>
<br>
<h2><%= title %></h2>
<br>
<% for course in courses %>
<% if course && @percent_completed[course.id] %>
<div class="card">
<div class="card-body">
<% if show_course_name %>
<h3 class="card-title">
<% if can? :read, course %>
<%= link_to course.title, organization_course_path(course.organization, course) %>
<% else %>
<%= course.title %>
<% end %>
</h3>
<br>
<% end %>
<% if can? :see_points, course%>
<span class="progress-label">Awarded points</span>
<div class="progress course-points-progress">
<div class="progress-bar" role="progressbar" style="width: <%= @percent_completed[course.id] %>%" aria-valuenow="<%= @percent_completed[course.id] %>" aria-valuemin="0" aria-valuemax="100">
<%= sprintf("%.0f", @percent_completed[course.id]) %>%
</div>
</div>
<% if @group_completion_ratios[course.id] %>
<% @group_completion_ratios[course.id].each do |group, ratio| %>
<br>
<span class="progress-label">Awarded points for <%= group %></span>
<div class="progress course-points-progress">
<% unless ratio.zero? %>
<div class="progress-bar bg-info" role="progressbar" style="width: <%= ratio * 100 %>%" aria-valuenow="<%= ratio * 100 %>" aria-valuemin="0" aria-valuemax="100">
<%= sprintf("%.0f", ratio * 100) %>%
</div>
<% end %>
</div>
<% end %>
<br>
<% end %>
<br>
<table class="table table-hover">
<thead class="">
<tr>
<th></th>
<th>Point names</th>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">Awarded points</td>
<td><%= points_list(@awarded_points[course.id]) %></td>
</tr>
<tr>
<th scope="row">Missing points</td>
<td><%= points_list(@missing_points[course.id]) %></td>
</tr>
</tbody>
</table>
<% else %>
For this course points are not visible.
<% end %>
</div>
</div>
<%else%>
You don't have any points for this course
<br>
<% end %>
<br>
<% end %>
</section>