|
1 | 1 | <div class="row">
|
2 | 2 | <div class="col-md-12">
|
| 3 | + <% if can? :edit, @course %> |
| 4 | + <%= link_to 'Edit details', edit_setup_organization_course_course_details_path(@organization, @course), class: "btn btn-primary pull-right" %> |
| 5 | + <% end %> |
3 | 6 | <h1><%= @course.title %></h1>
|
4 | 7 |
|
5 |
| - <div> |
6 |
| - <% unless @course.initial_refresh_ready? %> |
7 |
| - <p class='course-initial-refresh-warning'><strong> |
8 |
| - Course is being updated and it is not fully functional yet! Please wait.</strong> |
9 |
| - <br>This operation usually takes about 15 minutes but it can take up to an hour. |
10 |
| - </p> |
11 |
| - <% end %> |
| 8 | + <div class="card"> |
| 9 | + <div class="card-body"> |
12 | 10 | <% unless @course.description.blank? %>
|
13 |
| - <p><%= @course.description %></p> |
| 11 | + <p class="card-text"><%= @course.description %></p> |
14 | 12 | <% end %>
|
15 |
| - <ul> |
16 |
| - <% unless @course.material_url.blank? %> |
17 |
| - <li><%= link_to 'Course material', @course.material_url, target: '_blank' %></li> |
| 13 | + </div> |
| 14 | + </div> |
| 15 | + <br> |
| 16 | + |
| 17 | + <div class="course-options-card"> |
| 18 | + <% unless @course.initial_refresh_ready? %> |
| 19 | + <p class='course-initial-refresh-warning'><strong> |
| 20 | + Course is being updated and it is not fully functional yet! Please wait.</strong> |
| 21 | + <br>This operation usually takes about 15 minutes but it can take up to an hour. |
| 22 | + </p> |
| 23 | + <% end %> |
| 24 | + |
| 25 | + <% unless @course.material_url.blank? %> |
| 26 | + <%= link_to @course.material_url, target: '_blank', class: 'btn btn-primary' do %> |
| 27 | + <%= fa_icon 'book', text: 'Course material' %> |
18 | 28 | <% end %>
|
19 |
| - <% if @course.has_external_scoreboard_url? %> |
20 |
| - <% if can? :view_external_scoreboard_url, @course %> |
21 |
| - <li> |
22 |
| - <%= link_to 'View points', @course.parsed_external_scoreboard_url(@organization, @course, current_user), target: '_blank' %> |
23 |
| - </li> |
24 |
| - <% end %> |
25 |
| - <% else %> |
26 |
| - <% if can? :see_points, @course %> |
27 |
| - <li><%= link_to 'View points', organization_course_points_path(@organization, @course) %></li> |
| 29 | + <% end %> |
| 30 | + <% if @course.has_external_scoreboard_url? %> |
| 31 | + <% if can? :view_external_scoreboard_url, @course %> |
| 32 | + <%= link_to @course.parsed_external_scoreboard_url(@organization, @course, current_user), target: '_blank', class: 'btn btn-primary' do %> |
| 33 | + <%= fa_icon 'list', text: 'Points list' %> |
| 34 | + <% end %> |
| 35 | + <% end %> |
| 36 | + <% else %> |
| 37 | + <% if can? :see_points, @course %> |
| 38 | + <%= link_to organization_course_points_path(@organization, @course), class: 'btn btn-primary' do %> |
| 39 | + <%= fa_icon 'list', text: 'Points list' %> |
28 | 40 | <% end %>
|
29 | 41 | <% end %>
|
30 |
| - <li> |
31 |
| - <%= link_to 'View help page', organization_course_help_path(@organization, @course)%> |
32 |
| - </li> |
33 |
| - </ul> |
| 42 | + <% end %> |
34 | 43 | </div>
|
| 44 | + <br > |
| 45 | + |
| 46 | + <% if @course.disabled? %> |
| 47 | + <div class="card text-danger border-danger mb-3"> |
| 48 | + <div class="card-body"> |
| 49 | + <h3 class="card-title"><%= fa_icon 'warning', text: 'This course is disabled' %></h3> |
| 50 | + <p class="card-text"> |
| 51 | + It is not possible to start this course while it is disabled and the course is hidden from the course list. |
| 52 | + However, old results should still be visible. |
| 53 | + </p> |
| 54 | + <%= link_to 'Enable course', enable_organization_course_path(@organization, @course), method: :post, class: "btn btn-danger" if can? :teach, @course %> |
| 55 | + </div> |
| 56 | + </div> |
| 57 | + <% end %> |
| 58 | + |
| 59 | + <% if can? :teach, @course %> |
| 60 | + <% if @course.hide_submission_results? %> |
| 61 | + <div class="card text-danger border-danger mb-3"> |
| 62 | + <div class="card-body"> |
| 63 | + <h3 class="card-title"><%= fa_icon 'warning', text: 'Submission results are hidden' %></h3> |
| 64 | + <p class="card-text"> |
| 65 | + This is rarely a good idea as this feature is usually used only for exams. |
| 66 | + </p> |
| 67 | + <%= link_to 'Make submission results visible', toggle_submission_result_visibility_organization_course_path(@organization, @course), method: :post, class: "btn btn-danger" if can? :teach, @course %> |
| 68 | + </div> |
| 69 | + </div> |
| 70 | + <% end %> |
| 71 | + |
| 72 | + <% if @course.hidden? %> |
| 73 | + <div class="card text-danger border-danger mb-3"> |
| 74 | + <div class="card-body"> |
| 75 | + <h3 class="card-title"><%= fa_icon 'warning', text: 'Course is hidden' %></h3> |
| 76 | + <p class="card-text"> |
| 77 | + This is rarely a good idea. Consider disabling it instead. |
| 78 | + </p> |
| 79 | + <%= link_to 'Make course visible', toggle_hidden_organization_course_path(@organization, @course), method: :post, class: "btn btn-danger" if can? :teach, @course %> |
| 80 | + </div> |
| 81 | + </div> |
| 82 | + <% end %> |
| 83 | + <% end %> |
35 | 84 |
|
36 | 85 | <% if can? :teach, @course %>
|
37 | 86 | <div class="teacher-panel">
|
38 |
| - <h4>Teacher functions</h4> |
| 87 | + <h4><%= fa_icon 'graduation-cap', text: 'Teacher functions' %></h4> |
39 | 88 |
|
40 | 89 | <% if @refresh_report && (can? :refresh, @course) %>
|
41 | 90 | <%= render :partial => 'courses/refresh_report', :locals => { :report => @refresh_report } %>
|
|
102 | 151 | <li>
|
103 | 152 | <% if can? :toggle_submission_result_visibility, @course %>
|
104 | 153 | <% if @course.hide_submission_results? %>
|
105 |
| - <%= link_to 'Unhide submission results', toggle_submission_result_visibility_organization_course_path(@organization, @course), method: :post, class: "btn btn-primary btn-sm" %> |
| 154 | + <%= link_to 'Make submission results visible', toggle_submission_result_visibility_organization_course_path(@organization, @course), method: :post, class: "btn btn-primary btn-sm" %> |
106 | 155 | <% else %>
|
107 | 156 | <%= link_to 'Hide submission results', toggle_submission_result_visibility_organization_course_path(@organization, @course), method: :post, class: "btn btn-warning btn-sm" %>
|
108 | 157 | <% end %>
|
|
119 | 168 | link_to 'Disable Course', disable_organization_course_path(@organization, @course), method: :post,
|
120 | 169 | class: "btn btn-danger btn-sm", data: { confirm: "Are you sure you want to disable the course?" } %>
|
121 | 170 | <% end %>
|
122 |
| - <% if @course.hidden? %> |
123 |
| - <%= |
124 |
| - link_to 'Make Course visible', toggle_hidden_organization_course_path(@organization, @course), method: :post, |
125 |
| - class: "btn btn-info btn-sm" %> |
126 |
| - <% else %> |
127 |
| - <%= |
128 |
| - link_to 'Hide Course', toggle_hidden_organization_course_path(@organization, @course), method: :post, |
129 |
| - class: "btn btn-danger btn-sm", data: { confirm: "Are you sure you want to hide the course?" } %> |
130 |
| - <% end %> |
131 | 171 | </li>
|
132 | 172 |
|
133 | 173 | <% unlockables = @course.unlockable_exercises_for(current_user) %>
|
|
170 | 210 |
|
171 | 211 | <% if current_user.administrator? %>
|
172 | 212 | <div class="admin-panel">
|
173 |
| - <h4>Admin functions</h4> |
| 213 | + <h4><%= fa_icon 'exclamation-circle', text: 'Admin functions' %></h4> |
174 | 214 | <ul>
|
175 | 215 | <% if current_user.administrator? %>
|
176 | 216 | <li>Source type: <%= @course.source_backend.upcase %> </li>
|
|
194 | 234 | </div>
|
195 | 235 | <% end %>
|
196 | 236 |
|
197 |
| - <% if signed_in? %> |
198 |
| - <div class="alternative-format-links">[<%= link_to 'json', "#{one_course_json_organization_course_path organization_id: @organization.slug, id: @course.id, api_version: ApiVersion::API_VERSION}" %>]</div> |
199 |
| - <% end %> |
200 |
| - |
201 | 237 | <h2>All exercises</h2>
|
202 | 238 | <div>
|
203 | 239 | <%=
|
|
0 commit comments