|
18 | 18 | </section> |
19 | 19 | </div> |
20 | 20 |
|
21 | | -<% unless @user.email_verified? %> |
22 | | - <div class="alert alert-warning" role="alert"> |
23 | | - Your email address is not verified yet. <%= link_to 'Resend verification email', send_verification_email_path(@user), method: :post %>. |
24 | | - </div> |
25 | | -<% end %> |
26 | | - |
27 | | -<section> |
28 | | - <br> |
29 | | - <h2>Points</h2> |
30 | | - <br> |
31 | | - <% for course in @courses %> |
32 | | - <div class="card"> |
33 | | - <div class="card-body"> |
34 | | - <h3 class="card-title"> |
35 | | - <% if can? :read, course %> |
36 | | - <%= link_to course.title, organization_course_path(course.organization, course) %> |
37 | | - <% else %> |
38 | | - <%= course.title %> |
39 | | - <% end %> |
40 | | - </h3> |
41 | | - <br> |
42 | | - <% if can? :see_points, course %> |
43 | | - <span class="progress-label">Awarded points</span> |
44 | | - <div class="progress course-points-progress"> |
45 | | - <div class="progress-bar" role="progressbar" style="width: <%= @percent_completed[course.id] %>%" aria-valuenow="<%= @percent_completed[course.id] %>" aria-valuemin="0" aria-valuemax="100"> |
46 | | - <%= sprintf("%.0f", @percent_completed[course.id]) %>% |
47 | | - </div> |
48 | | - </div> |
49 | | - <% if @group_completion_ratios[course.id] %> |
50 | | - <% @group_completion_ratios[course.id].each do |group, ratio| %> |
51 | | - <br> |
52 | | - <span class="progress-label">Awarded points for <%= group %></span> |
53 | | - <div class="progress course-points-progress"> |
54 | | - <% unless ratio.zero? %> |
55 | | - <div class="progress-bar bg-info" role="progressbar" style="width: <%= ratio * 100 %>%" aria-valuenow="<%= ratio * 100 %>" aria-valuemin="0" aria-valuemax="100"> |
56 | | - <%= sprintf("%.0f", ratio * 100) %>% |
57 | | - </div> |
58 | | - <% end %> |
59 | | - </div> |
60 | | - <% end %> |
61 | | - <br> |
62 | | - <% end %> |
63 | | - <br> |
64 | | - <table class="table table-hover"> |
65 | | - <thead class=""> |
66 | | - <tr> |
67 | | - <th></th> |
68 | | - <th>Point names</th> |
69 | | - </tr> |
70 | | - </thead> |
71 | | - <tbody> |
72 | | - <tr> |
73 | | - <th scope="row">Awarded points</td> |
74 | | - <td><%= points_list(@awarded_points[course.id]) %></td> |
75 | | - </tr> |
76 | | - <tr> |
77 | | - <th scope="row">Missing points</td> |
78 | | - <td><%= points_list(@missing_points[course.id]) %></td> |
79 | | - </tr> |
80 | | - </tbody> |
81 | | - </table> |
82 | | - <% else %> |
83 | | - For this course points are not visible. |
84 | | - <% end %> |
85 | | - </div> |
86 | | - </div> |
87 | | - <br> |
88 | | - <% end %> |
89 | | -</section> |
| 21 | +<%= render 'layouts/points', courses: @courses, title: 'Points', show_course_name: true %> |
90 | 22 |
|
91 | 23 | <section> |
92 | 24 | <h2>Submissions</h2> |
|
0 commit comments