mumuki-laboratory 9.0.2 → 9.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mumuki_laboratory/application/codemirror.js +10 -2
  3. data/app/assets/javascripts/mumuki_laboratory/application/discussions.js +49 -8
  4. data/app/assets/javascripts/mumuki_laboratory/application/faqs.js +14 -4
  5. data/app/assets/javascripts/mumuki_laboratory/application/gamification.js +3 -3
  6. data/app/assets/javascripts/mumuki_laboratory/application/kids.js +11 -7
  7. data/app/assets/javascripts/mumuki_laboratory/application/kindergarten.js +3 -3
  8. data/app/assets/javascripts/mumuki_laboratory/application/messages.js +3 -3
  9. data/app/assets/javascripts/mumuki_laboratory/application/mu-modal-carrousel.js +4 -4
  10. data/app/assets/javascripts/mumuki_laboratory/application/multiple-files.js +18 -5
  11. data/app/assets/javascripts/mumuki_laboratory/application/multiple-scenarios.js +1 -1
  12. data/app/assets/javascripts/mumuki_laboratory/application/organization.js +32 -0
  13. data/app/assets/javascripts/mumuki_laboratory/application/primary.js +4 -4
  14. data/app/assets/javascripts/mumuki_laboratory/application/profile.js +0 -6
  15. data/app/assets/javascripts/mumuki_laboratory/application/progress.js +1 -1
  16. data/app/assets/javascripts/mumuki_laboratory/application/speech-bubble-renderer.js +1 -1
  17. data/app/assets/javascripts/mumuki_laboratory/application/submission.js +4 -3
  18. data/app/assets/javascripts/mumuki_laboratory/application/submissions-store.js +1 -1
  19. data/app/assets/javascripts/mumuki_laboratory/application/toast.js +3 -0
  20. data/app/assets/javascripts/mumuki_laboratory/application/tooltip.js +1 -1
  21. data/app/assets/javascripts/mumuki_laboratory/application/upload.js +2 -2
  22. data/app/assets/javascripts/mumuki_laboratory/application/user.js +49 -5
  23. data/app/assets/stylesheets/mumuki_laboratory/application.scss +0 -1
  24. data/app/assets/stylesheets/mumuki_laboratory/application/_errors.scss +1 -1
  25. data/app/assets/stylesheets/mumuki_laboratory/application/_layout.scss +1 -27
  26. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +1 -2
  27. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_activity.scss +14 -0
  28. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_avatar.scss +5 -0
  29. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_breadcrumb.scss +2 -2
  30. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_datepicker.scss +0 -4
  31. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_discussion.scss +49 -59
  32. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_editor.scss +16 -18
  33. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_assignment.scss +2 -11
  34. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_exercise_results.scss +1 -7
  35. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +30 -8
  36. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_flash.scss +7 -46
  37. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids.scss +19 -4
  38. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kids_results.scss +18 -23
  39. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_kindergarten.scss +1 -9
  40. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_overlap.scss +1 -1
  41. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_progress_bar.scss +5 -5
  42. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_terms.scss +3 -2
  43. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_timer.scss +1 -3
  44. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_menu.scss +38 -3
  45. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_user_profile.scss +1 -2
  46. data/app/controllers/application_controller.rb +4 -2
  47. data/app/controllers/discussions_messages_controller.rb +9 -3
  48. data/app/controllers/users_controller.rb +13 -0
  49. data/app/helpers/application_helper.rb +5 -5
  50. data/app/helpers/assignment_result_helper.rb +3 -2
  51. data/app/helpers/assistance_box_helper.rb +1 -1
  52. data/app/helpers/concerns/with_student_path_navigation.rb +8 -3
  53. data/app/helpers/concerns/with_student_path_navigation/continue_navigation.rb +1 -1
  54. data/app/helpers/concerns/with_student_path_navigation/finish_navigation.rb +1 -1
  55. data/app/helpers/concerns/with_student_path_navigation/next_parent_navigation.rb +7 -0
  56. data/app/helpers/concerns/with_student_path_navigation/revisit_navigation.rb +1 -1
  57. data/app/helpers/discussions_helper.rb +64 -23
  58. data/app/helpers/editor_tabs_helper.rb +10 -6
  59. data/app/helpers/email_helper.rb +2 -2
  60. data/app/helpers/exercise_input_helper.rb +2 -3
  61. data/app/helpers/links_helper.rb +12 -9
  62. data/app/helpers/menu_bar_helper.rb +1 -1
  63. data/app/helpers/messages_helper.rb +1 -1
  64. data/app/helpers/multiple_file_editor_helper.rb +2 -1
  65. data/app/helpers/overlapped_buttons_helper.rb +22 -12
  66. data/app/helpers/profile_helper.rb +3 -3
  67. data/app/helpers/toast_helper.rb +27 -0
  68. data/app/helpers/user_activity_helper.rb +48 -0
  69. data/app/helpers/user_menu_helper.rb +24 -6
  70. data/app/views/book/show.html.erb +2 -2
  71. data/app/views/certificates/verify.html.erb +1 -1
  72. data/app/views/chapters/show.html.erb +2 -2
  73. data/app/views/discussions/_description_message.html.erb +1 -1
  74. data/app/views/discussions/_message.html.erb +32 -7
  75. data/app/views/discussions/_new_message.html.erb +13 -2
  76. data/app/views/discussions/index.html.erb +8 -10
  77. data/app/views/discussions/new.html.erb +2 -2
  78. data/app/views/discussions/show.html.erb +20 -12
  79. data/app/views/exam_registrations/show.html.erb +10 -11
  80. data/app/views/exercise_solutions/_assistant_rules_box.html.erb +1 -1
  81. data/app/views/exercise_solutions/_contextualization_results_body.html.erb +1 -1
  82. data/app/views/exercise_solutions/_contextualization_results_container.html.erb +1 -1
  83. data/app/views/exercise_solutions/_kids_results_button.html.erb +2 -2
  84. data/app/views/exercise_solutions/_results.html.erb +1 -1
  85. data/app/views/exercises/_exercise_assignment.html.erb +2 -2
  86. data/app/views/exercises/_exercise_skipped.html.erb +1 -1
  87. data/app/views/exercises/_read_only.html.erb +108 -105
  88. data/app/views/exercises/show.html.erb +7 -7
  89. data/app/views/faqs/index.html.erb +5 -1
  90. data/app/views/guides/_guide.html.erb +1 -1
  91. data/app/views/guides/_guide_container.html.erb +4 -4
  92. data/app/views/invitations/_invitation_form.html.erb +5 -4
  93. data/app/views/layouts/_authoring.html.erb +1 -1
  94. data/app/views/layouts/_discussions.html.erb +7 -7
  95. data/app/views/layouts/_kids.html.erb +5 -5
  96. data/app/views/layouts/_kindergarten.html.erb +10 -6
  97. data/app/views/layouts/_main.html.erb +10 -10
  98. data/app/views/layouts/_organizations_listing.html.erb +2 -2
  99. data/app/views/layouts/_progress_bar.html.erb +2 -0
  100. data/app/views/layouts/_submission_result_error.html.erb +1 -1
  101. data/app/views/layouts/_test_results.html.erb +1 -1
  102. data/app/views/layouts/_timer.html.erb +1 -1
  103. data/app/views/layouts/_user_menu.html.erb +13 -20
  104. data/app/views/layouts/application.html.erb +39 -42
  105. data/app/views/layouts/exercise_inputs/editors/_code.html.erb +4 -4
  106. data/app/views/layouts/exercise_inputs/editors/_free_form.html.erb +1 -1
  107. data/app/views/layouts/exercise_inputs/editors/_multiple_choice.html.erb +7 -9
  108. data/app/views/layouts/exercise_inputs/editors/_multiple_files.html.erb +10 -10
  109. data/app/views/layouts/exercise_inputs/editors/_single_choice.html.erb +6 -8
  110. data/app/views/layouts/exercise_inputs/editors/_text.html.erb +2 -3
  111. data/app/views/layouts/exercise_inputs/editors/_upload.html.erb +5 -5
  112. data/app/views/layouts/exercise_inputs/forms/_form.html.erb +1 -1
  113. data/app/views/layouts/exercise_inputs/forms/_interactive_form.html.erb +2 -2
  114. data/app/views/layouts/exercise_inputs/forms/_kids_form.html.erb +1 -1
  115. data/app/views/layouts/exercise_inputs/forms/_playground_form.html.erb +2 -2
  116. data/app/views/layouts/exercise_inputs/forms/_problem_form.html.erb +13 -9
  117. data/app/views/layouts/exercise_inputs/layouts/_input_primary.html.erb +2 -2
  118. data/app/views/layouts/exercise_inputs/layouts/_input_right.html.erb +2 -2
  119. data/app/views/layouts/exercise_inputs/read_only_editors/_code.html.erb +1 -1
  120. data/app/views/layouts/exercise_inputs/read_only_editors/_free_form.html.erb +1 -1
  121. data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_choice.html.erb +4 -4
  122. data/app/views/layouts/exercise_inputs/read_only_editors/_multiple_files.html.erb +2 -2
  123. data/app/views/layouts/exercise_inputs/read_only_editors/_single_choice.html.erb +4 -4
  124. data/app/views/layouts/exercise_inputs/read_only_editors/_text.erb +1 -1
  125. data/app/views/layouts/modals/_avatar_picker.html.erb +2 -5
  126. data/app/views/layouts/modals/_guide_corollary.html.erb +4 -8
  127. data/app/views/layouts/modals/_kids_context.html.erb +7 -5
  128. data/app/views/layouts/modals/_kids_results.html.erb +2 -2
  129. data/app/views/layouts/modals/_kids_results_aborted.html.erb +2 -2
  130. data/app/views/layouts/modals/_kindergarten_context.html.erb +3 -3
  131. data/app/views/layouts/modals/_kindergarten_results.html.erb +3 -3
  132. data/app/views/layouts/modals/_kindergarten_results_aborted.html.erb +2 -2
  133. data/app/views/layouts/modals/_level_up.html.erb +2 -5
  134. data/app/views/layouts/modals/_new_message.html.erb +5 -5
  135. data/app/views/notifications/_dropdown.html.erb +3 -3
  136. data/app/views/users/_activity_indicator.html.erb +17 -0
  137. data/app/views/users/_edit_user_form.html.erb +6 -6
  138. data/app/views/users/_profile_fields.html.erb +6 -6
  139. data/app/views/users/_user_form.html.erb +2 -2
  140. data/app/views/users/activity.html.erb +37 -0
  141. data/app/views/users/certificates.html.erb +26 -24
  142. data/app/views/users/discussions.html.erb +23 -21
  143. data/app/views/users/messages.html.erb +22 -20
  144. data/app/views/users/show.html.erb +5 -3
  145. data/app/views/users/terms.html.erb +4 -2
  146. data/config/initializers/inflections.rb +3 -0
  147. data/config/routes.rb +3 -0
  148. data/lib/mumuki/laboratory.rb +1 -1
  149. data/lib/mumuki/laboratory/extensions.rb +1 -0
  150. data/lib/mumuki/laboratory/extensions/date_and_time.rb +11 -0
  151. data/lib/mumuki/laboratory/locales/en.yml +28 -2
  152. data/lib/mumuki/laboratory/locales/es-CL.yml +33 -4
  153. data/lib/mumuki/laboratory/locales/es.yml +33 -4
  154. data/lib/mumuki/laboratory/locales/pt.yml +34 -3
  155. data/lib/mumuki/laboratory/version.rb +1 -1
  156. data/spec/capybara_helper.rb +1 -0
  157. data/spec/controllers/discussions_messages_controller_spec.rb +84 -3
  158. data/spec/dummy/db/schema.rb +23 -3
  159. data/spec/features/discussion_flow_spec.rb +22 -2
  160. data/spec/features/exercise_flow_spec.rb +1 -1
  161. data/spec/features/guide_reset_spec.rb +1 -1
  162. data/spec/features/terms_flow_spec.rb +1 -2
  163. data/spec/features/user_activity_flow_spec.rb +65 -0
  164. data/spec/helpers/breadcrumbs_helper_spec.rb +2 -2
  165. data/spec/helpers/user_activity_helper_spec.rb +32 -0
  166. data/spec/helpers/with_navigation_spec.rb +36 -13
  167. data/spec/javascripts/editors-spec.js +3 -3
  168. data/spec/javascripts/kids-button-spec.js +2 -2
  169. data/spec/javascripts/upload-spec.js +8 -8
  170. metadata +133 -123
  171. data/app/assets/stylesheets/mumuki_laboratory/application/hovers.scss +0 -12
  172. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_checkboxes.scss +0 -34
  173. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_guide_corollary.scss +0 -9
@@ -3,22 +3,20 @@
3
3
  <% end %>
4
4
 
5
5
  <div class="row">
6
- <div class="mu-inline-block-left">
7
- <h1><%= t :forum %></h1>
8
- </div>
6
+ <h1><%= t :forum %></h1>
9
7
  </div>
10
- <div class="row">
11
- <% if @debatable.respond_to? :language %>
12
- <div class="mu-inline-block-right hidden-xs">
13
- <h3><%= language_icon @debatable.language %></h3>
14
- </div>
15
- <% end %>
8
+ <div class="d-flex">
16
9
  <div class="mu-inline-block-left">
17
10
  <h3>
18
- <span class="hidden-xs"><%= t("#{@debatable_class.downcase}_number", number: @debatable.number) %>:&nbsp;</span>
11
+ <span class="d-none d-sm-inline"><%= t("#{@debatable_class.downcase}_number", number: @debatable.number) %>:&nbsp;</span>
19
12
  <span><%= @debatable.name %></span>
20
13
  </h3>
21
14
  </div>
15
+ <% if @debatable.respond_to? :language %>
16
+ <div class="d-none d-sm-block ms-3">
17
+ <h3><%= language_icon @debatable.language %></h3>
18
+ </div>
19
+ <% end %>
22
20
  </div>
23
21
 
24
22
  <% if @discussions.empty? %>
@@ -22,12 +22,12 @@
22
22
  <div class="container-fluid">
23
23
  <div class="row">
24
24
  <div class="discussion-new-message-content">
25
- <%= f.editor :description, '', {id: 'new-discussion-message', class: 'form-control', placeholder: t(:discussion_description_placeholder)} %>
25
+ <%= f.editor :description, '', {id: 'discussion-new-message', class: 'form-control', placeholder: t(:discussion_description_placeholder)} %>
26
26
  </div>
27
27
  </div>
28
28
  </div>
29
29
  </div>
30
30
  </div>
31
- <%= f.submit t(:save), class: 'btn btn-success btn-block discussion-new-message-button' %>
31
+ <%= f.submit t(:save), class: 'btn btn-complementary w-100 discussion-new-message-button' %>
32
32
  <% end %>
33
33
  <% end %>
@@ -11,16 +11,24 @@
11
11
  <% if @discussion.has_messages? || @discussion.commentable_by?(current_user) %>
12
12
  <hr class="message-divider">
13
13
 
14
- <div>
15
- <h3>
16
- <%= t :messages %>
17
- <% if @discussion.last_moderator_access_visible_for?(current_user) %>
18
- <small class="pull-right">
19
- <span><%= t :last_seen, name: @discussion.last_moderator_access_by.full_name %></span>
20
- <span><%= t :time_since, time: time_ago_in_words(@discussion.last_moderator_access_at) %></span>
21
- </small>
22
- <% end %>
23
- </h3>
14
+ <div class="d-flex flex-wrap">
15
+ <h3 class="flex-grow-1 me-3"><%= t :messages %></h3>
16
+ <% if current_user && @discussion.persisted? %>
17
+ <span class="d-flex">
18
+ <% if @discussion.subscribable? %>
19
+ <div class="discussion-subscription me-1">
20
+ <%= btn_toggle subscription_icon, unsubscription_icon, current_user.subscribed_to?(@discussion), class: 'btn-sm',
21
+ onclick: "mumuki.Forum.discussionSubscription('#{subscription_discussion_url(@discussion)}')" %>
22
+ </div>
23
+ <% end %>
24
+ <% if @discussion.solved? %>
25
+ <div class="discussion-upvote">
26
+ <%= btn_toggle upvote_icon, undo_upvote_icon, current_user.upvoted?(@discussion), class: 'btn-sm',
27
+ onclick: "mumuki.Forum.discussionUpvote('#{upvote_discussion_url(@discussion)}')" %>
28
+ </div>
29
+ <% end %>
30
+ </span>
31
+ <% end %>
24
32
  </div>
25
33
 
26
34
  <% if @discussion.has_messages? %>
@@ -28,8 +36,8 @@
28
36
  <% if @discussion.description.present? %>
29
37
  <%= render partial: 'discussions/description_message', locals: {discussion: @discussion} %>
30
38
  <% end %>
31
- <% @discussion.messages.each do |message| %>
32
- <%= render partial: 'discussions/message', locals: {user: message.sender_user, message: message} %>
39
+ <% @discussion.visible_messages.each do |message| %>
40
+ <%= render partial: 'discussions/message', locals: {user: message.sender_user, message: message} %>
33
41
  <% end %>
34
42
  <% if @discussion.commentable_by?(current_user) %>
35
43
  <hr class="message-divider">
@@ -20,18 +20,17 @@
20
20
  <%= t :exam_registration_explanation_html, date: l(@registration.end_time, format: :long) %>
21
21
  </p>
22
22
  </div>
23
- <%= form_for @authorization_request do |f| %>
23
+ <%= form_for @authorization_request, html: {class: 'mu-form'} do |f| %>
24
24
  <%= f.hidden_field :exam_registration_id, value: @registration.id %>
25
- <div class="form-group">
26
- <%= f.label :exam_id, t(:exam_registration_choose_exam) %>
27
- <% @registration.exams.each do |exam| %>
28
- <div class="field radio complementary complementary-radio">
29
- <%= f.radio_button(:exam_id, exam.id, id: exam.id, required: true, checked: @authorization_request.exam_id == exam.id) %>
30
- <%= label_tag exam.id, l(exam.start_time, format: :long) %>
31
- </div>
32
- <% end %>
33
- </div>
34
- <button class="btn btn-success"> <%= t :save %> </button>
25
+ <%= f.label :exam_id, t(:exam_registration_choose_exam) %>
26
+ <% @registration.exams.each do |exam| %>
27
+ <div class="form-check">
28
+ <%= f.radio_button(:exam_id, exam.id, id: exam.id, required: true, class: 'form-check-input mu-read-only-input',
29
+ checked: @authorization_request.exam_id == exam.id) %>
30
+ <%= label_tag exam.id, l(exam.start_time, format: :long), class: 'form-check-label' %>
31
+ </div>
32
+ <% end %>
33
+ <button class="btn btn-complementary"> <%= t :save %> </button>
35
34
  <% end %>
36
35
  </div>
37
36
  </div>
@@ -1,7 +1,7 @@
1
1
  <% if should_display_assistance_box? assignment %>
2
2
  <hr>
3
3
  <%= assistance_box assignment %>
4
- <a data-toggle="collapse" href="#assistance-details-section" class="example-see-more">
4
+ <a data-bs-toggle="collapse" href="#assistance-details-section" class="badge bg-light text-dark mu-view-details">
5
5
  <%= t :view_details %>
6
6
  </a>
7
7
  <div id="assistance-details-section" class="<%= 'collapse' if should_display_assistance_box?(assignment) %> in results-item">
@@ -7,7 +7,7 @@
7
7
  <div>
8
8
  <%= contextualization.feedback_html %>
9
9
  </div>
10
- <a data-toggle="collapse" href="#results-section" class="text-danger">
10
+ <a data-bs-toggle="collapse" href="#results-section" class="text-danger">
11
11
  <%= fa_icon 'question-circle' %> <%= t :details %>
12
12
  </a>
13
13
  </div>
@@ -2,7 +2,7 @@
2
2
  <%= render partial: 'exercise_solutions/results_title', locals: {contextualization: contextualization} %>
3
3
 
4
4
  <% if in_gamified_context? %>
5
- <div id="mu-exp-earned-message" class="hidden">
5
+ <div id="mu-exp-earned-message" class="d-none">
6
6
  <span><%= t(:you_earned) %></span>
7
7
  <strong><span id="mu-exp-points"></span></strong>
8
8
  <span><%= t(:exp_points) %></span>
@@ -1,10 +1,10 @@
1
- <div class="row">
1
+ <div class="row w-100">
2
2
  <div class="col-md-12">
3
3
  <div class="actions">
4
4
  <% if assignment.solved? %>
5
5
  <%= next_exercise_button(@exercise) || close_modal_button %>
6
6
  <% else %>
7
- <button class="btn btn-success btn-block submission-control" id="kids-btn-retry" data-dismiss="modal" aria-label="<%= t :retry_exercise %>"> <%= t :retry_exercise %> </button>
7
+ <button class="btn btn-complementary submission-control" id="kids-btn-retry" data-bs-dismiss="modal" aria-label="<%= t :retry_exercise %>"> <%= t :retry_exercise %> </button>
8
8
  <% end %>
9
9
  </div>
10
10
  </div>
@@ -16,7 +16,7 @@
16
16
  <% if should_render_need_help_dropdown?(assignment) %>
17
17
  <div class="notify-problem-box">
18
18
  <div class="dropdown">
19
- <%= link_to fa_icon(:'question-circle', text: t(:need_help)), "", {'data-toggle': 'dropdown'} %>
19
+ <%= link_to fa_icon(:'question-circle', text: t(:need_help)), "", {'data-bs-toggle': 'dropdown'} %>
20
20
  <ul class="dropdown-menu" aria-labelledby="helpDropdown">
21
21
  <li>
22
22
  <%= read_discussions_link(@exercise) %>
@@ -3,9 +3,9 @@
3
3
  </div>
4
4
  <div class="row">
5
5
  <div class="col-md-12">
6
- <div class="hint-box <%= 'hidden' if exercise.hint.blank? %>">
6
+ <div class="hint-box <%= 'd-none' if exercise.hint.blank? %>">
7
7
  <% if exercise.hint.present? %>
8
- <a data-toggle="collapse" href="#hint-section" class="text-info">
8
+ <a data-bs-toggle="collapse" href="#hint-section" class="text-info">
9
9
  <%= fa_icon 'lightbulb', type: :regular %> <%= t :need_a_hint %>
10
10
  </a>
11
11
 
@@ -7,7 +7,7 @@
7
7
  <div class="modal-body">
8
8
  <div class="container-fluid">
9
9
  <%= t :skipped_description %>
10
- <%= link_to (t :skipped_solve_anyway), "", "data-dismiss" => "modal" %>
10
+ <%= link_to (t :skipped_solve_anyway), "", "data-bs-dismiss" => "modal" %>
11
11
  </div>
12
12
  </div>
13
13
  <div class="modal-footer">
@@ -7,127 +7,130 @@
7
7
  <%= hidden_field_tag(:exercise_language, exercise.highlight_mode) %>
8
8
  <%= hidden_field_tag :console_endpoint, exercise_queries_path(exercise) %>
9
9
 
10
- <details open>
11
- <summary class="discussion-summary">
12
- <h3 class="discussion-exercise-title">
13
- <span>
14
- <span class="hidden-xs"><%= t(:exercise_number, number: exercise.number) %>:&nbsp;</span>
15
- <span><%= exercise.name %></span>
16
- </span>
17
- <span class="mu-inline-block-right hidden-xs">
18
- <h1 class="no-margin"><%= language_icon exercise.language %></h1>
19
- </span>
20
- </h3>
21
- <div class="discussion-description">
22
- <%= label_for_contextualization(@discussion, class: 'hidden-xs') %> ·
23
- <span class="discussion-info">
24
- <span class="discussion-initiator-name">
25
- <%= @discussion.initiator.name %>
26
- </span>
27
- <span class="hidden-xs"><%= discussion_info(@discussion) unless @discussion.new_record? %></span>
28
- </span>
29
- <% if current_user && @discussion.persisted? %>
30
- <span class="mu-inline-block-right discussion-user-menu no-margin">
31
- <% if @discussion.subscribable? %>
32
- <a class="discussion-subscription" onclick="mumuki.Forum.discussionSubscription('<%= subscription_discussion_url(@discussion) %>')">
33
- <%= fa_icon(:eye, class: 'fa-xs') %>
34
- <%= span_toggle t(:subscribe), t(:unsubscribe), current_user.subscribed_to?(@discussion), class: 'hidden-sm hidden-xs' %>
35
- </a>
36
- <% end %>
37
- <% if @discussion.solved? %>
38
- <a class="discussion-upvote" onclick="mumuki.Forum.discussionUpvote('<%= upvote_discussion_url(@discussion) %>')">
39
- <%= fa_icon('thumbs-up', type: :regular, class: 'fa-xs') %>
40
- <%= span_toggle t(:upvote), t(:undo_upvote), current_user.upvoted?(@discussion), class: 'hidden-sm hidden-xs' %>
41
- </a>
10
+ <div class="accordion mu-discussion-accordion" id="mu-discussion-accordion">
11
+ <div class="accordion-item">
12
+ <h2 class="accordion-header" id="mu-discussion-accordion-header">
13
+ <button class="accordion-button" type="button" data-bs-toggle="collapse" aria-expanded="true"
14
+ data-bs-target="#mu-discussion-accordion-body" aria-controls="mu-discussion-accordion-body">
15
+ <div class="flex-grow-1">
16
+ <h3 class="d-flex">
17
+ <span class="flex-grow-1">
18
+ <span class="d-none d-sm-inline"><%= t(:exercise_number, number: exercise.number) %>:&nbsp;</span>
19
+ <span><%= exercise.name %></span>
20
+ </span>
21
+ <span class="d-none d-sm-inline mx-3">
22
+ <h1 class="m-0"><%= language_icon exercise.language %></h1>
23
+ </span>
24
+ </h3>
25
+ <div class="discussion-description">
26
+ <%= label_for_contextualization(@discussion, class: 'd-none d-sm-inline') %> ·
27
+ <span class="discussion-info">
28
+ <span class="discussion-initiator-name">
29
+ <%= @discussion.initiator.name %>
30
+ </span>
31
+ <span class="d-none d-sm-inline"><%= discussion_info(@discussion) unless @discussion.new_record? %></span>
32
+ </span>
33
+ </div>
34
+ <% if @discussion.last_moderator_access_visible_for?(current_user) %>
35
+ <h5 class="my-2 me-3">
36
+ <span class="badge bg-primary text-wrap">
37
+ <%= t :last_seen, name: @discussion.last_moderator_access_by.full_name %>
38
+ <%= t :time_since, time: time_ago_in_words(@discussion.last_moderator_access_at) %>
39
+ </span>
40
+ </h5>
42
41
  <% end %>
43
- </span>
44
- <% end %>
45
- </div>
46
- </summary>
42
+ </div>
43
+ </button>
44
+ </h2>
47
45
 
48
- <% if should_render_read_only_exercise_tabs?(@discussion) %>
46
+ <div class="accordion-body accordion-collapse collapse show" id="mu-discussion-accordion-body"
47
+ aria-labelledby="#mu-discussion-accordion-header" data-bs-parent="#mu-discussion-accordion">
49
48
 
50
- <ul class="nav nav-tabs discussion-tabs" role="tablist">
51
- <% if @discussion.has_submission? %>
52
- <li role="presentation" class="active">
53
- <a data-target="#solution" aria-controls="solution" role="tab" data-toggle="tab" class="editor-tab">
54
- <%= t :solution %>
55
- </a>
56
- </li>
57
- <li role="presentation">
58
- <a data-target="#results" aria-controls="results" role="tab" data-toggle="tab" class="editor-tab">
59
- <%= t :results %>
60
- </a>
61
- </li>
62
- <% end %>
49
+ <% if should_render_read_only_exercise_tabs?(@discussion) %>
50
+ <ul class="nav nav-tabs discussion-tabs" role="tablist">
63
51
 
64
- <li role="presentation" <%= "class=active" unless @discussion.has_submission? %>>
65
- <a data-target="#content" aria-controls="content" role="tab" data-toggle="tab" class="editor-tab">
66
- <%= t :description %>
67
- </a>
68
- </li>
52
+ <% if @discussion.has_submission? %>
53
+ <li role="presentation">
54
+ <a class="editor-tab nav-link active" data-bs-target="#solution" aria-controls="solution" role="tab" data-bs-toggle="tab">
55
+ <%= t :solution %>
56
+ </a>
57
+ </li>
58
+ <li role="presentation">
59
+ <a class="editor-tab nav-link" data-bs-target="#results" aria-controls="results" role="tab" data-bs-toggle="tab">
60
+ <%= t :results %>
61
+ </a>
62
+ </li>
63
+ <% end %>
69
64
 
70
- <% if exercise.extra_visible? %>
71
- <%= extra_code_tab %>
72
- <% end %>
65
+ <li role="presentation">
66
+ <a class="editor-tab nav-link <%= "active" unless @discussion.has_submission? %>" data-bs-target="#content" aria-controls="content" role="tab" data-bs-toggle="tab">
67
+ <%= t :description %>
68
+ </a>
69
+ </li>
73
70
 
74
- <% if exercise.queriable? %>
75
- <%= console_tab %>
76
- <% end %>
77
- </ul>
71
+ <% if exercise.extra_visible? %>
72
+ <%= extra_code_tab %>
73
+ <% end %>
78
74
 
79
- <div class="tab-content">
75
+ <% if exercise.queriable? %>
76
+ <%= console_tab %>
77
+ <% end %>
78
+ </ul>
80
79
 
81
- <% if @discussion.has_submission? %>
82
- <div role="tabpanel" class="tab-pane active" id="solution">
83
- <div class="mu-tab-body">
84
- <div role="tabpanel" class="tab-pane mu-input-panel fade in active" id="editor">
85
- <div class="mu-read-only-editor">
86
- <%= render_exercise_read_only_editor exercise, @discussion.solution %>
80
+ <div class="tab-content">
81
+ <% if @discussion.has_submission? %>
82
+ <div role="tabpanel" class="tab-pane active" id="solution">
83
+ <div class="mu-tab-body">
84
+ <div role="tabpanel" class="tab-pane mu-input-panel fade show active" id="editor">
85
+ <div class="mu-read-only-editor">
86
+ <%= render_exercise_read_only_editor exercise, @discussion.solution %>
87
+ </div>
88
+ </div>
87
89
  </div>
88
90
  </div>
89
- </div>
90
- </div>
91
91
 
92
- <div role="tabpanel" class="tab-pane" id="results">
93
- <div class="mu-tab-body">
94
- <%= render layout: 'exercise_solutions/contextualization_results_container', locals: {contextualization: @discussion} do %>
95
- <div class="row">
96
- <div class="col-md-12 submission-results">
97
- <%= render partial: 'exercise_solutions/contextualization_results_body',
98
- locals: {contextualization: @discussion, guide_finished_by_solution: false} %>
99
- </div>
92
+ <div role="tabpanel" class="tab-pane" id="results">
93
+ <div class="mu-tab-body">
94
+ <%= render layout: 'exercise_solutions/contextualization_results_container', locals: { contextualization: @discussion } do %>
95
+ <div class="row">
96
+ <div class="col-md-12 submission-results">
97
+ <%= render partial: 'exercise_solutions/contextualization_results_body',
98
+ locals: { contextualization: @discussion, guide_finished_by_solution: false } %>
99
+ </div>
100
+ </div>
101
+ <% end %>
100
102
  </div>
101
- <% end %>
102
- </div>
103
- </div>
104
- <% end %>
103
+ </div>
104
+ <% end %>
105
105
 
106
- <div role="tabpanel" class="tab-pane <%= 'active' unless @discussion.has_submission? %>" id="content">
107
- <div class="mu-tab-body">
108
- <div class="exercise-assignment">
109
- <%= render partial: 'exercises/exercise_assignment', locals: {exercise: exercise} %>
106
+ <div role="tabpanel" class="tab-pane <%= 'active' unless @discussion.has_submission? %>" id="content">
107
+ <div class="mu-tab-body">
108
+ <div class="exercise-assignment">
109
+ <%= render partial: 'exercises/exercise_assignment', locals: { exercise: exercise } %>
110
+ </div>
111
+ </div>
110
112
  </div>
111
- </div>
112
- </div>
113
113
 
114
- <div role="tabpanel" class="tab-pane mu-input-panel fade" id="console">
115
- <div class="mu-overlapped-container">
116
- <div class="console">
114
+ <div role="tabpanel" class="tab-pane mu-input-panel fade" id="console">
115
+ <div class="mu-overlapped-container">
116
+ <div class="console">
117
+ </div>
118
+ <div class="mu-overlapped">
119
+ <%= restart_icon %>
120
+ </div>
121
+ </div>
117
122
  </div>
118
- <div class="mu-overlapped">
119
- <a class="console-reset submission-reset"><%= restart_icon %></a>
123
+
124
+ <div role="tabpanel" class="tab-pane mu-input-panel fade mu-elipsis" id="visible-extra">
125
+ <%= @discussion.extra_preview_html %>
120
126
  </div>
121
127
  </div>
122
- </div>
123
-
124
- <div role="tabpanel" class="tab-pane mu-input-panel fade mu-elipsis" id="visible-extra">
125
- <%= @discussion.extra_preview_html %>
126
- </div>
127
- </div>
128
- <% else %>
129
- <div class="exercise-assignment">
130
- <%= render partial: 'exercises/exercise_assignment', locals: {exercise: exercise} %>
128
+ <% else %>
129
+ <div class="exercise-assignment">
130
+ <%= render partial: 'exercises/exercise_assignment', locals: { exercise: exercise } %>
131
+ </div>
132
+ <% end %>
131
133
  </div>
132
- <% end %>
133
- </details>
134
+ </div>
135
+ </div>
136
+
@@ -13,15 +13,15 @@
13
13
  <% end %>
14
14
 
15
15
  <% unless @exercise.input_kids? %>
16
- <div class="row">
17
- <div class="mu-inline-block-right hidden-xs">
18
- <h1><%= language_icon @exercise.language %></h1>
19
- </div>
16
+ <div class="d-flex">
20
17
  <div class="mu-inline-block-left">
21
- <h1 class="hidden-xs"><%= full_title_for @exercise %></h1>
22
- <h1 class="visible-xs"><%= short_title_for @exercise %></h1>
18
+ <h1 class="d-none d-sm-block"><%= full_title_for @exercise %></h1>
19
+ <h1 class="d-block d-sm-none"><%= short_title_for @exercise %></h1>
23
20
  <%= render partial: 'exercises/exercise_title_icons' %>
24
21
  </div>
22
+ <div class="d-none d-sm-block">
23
+ <h1><%= language_icon @exercise.language %></h1>
24
+ </div>
25
25
  </div>
26
26
  <% end %>
27
27
 
@@ -46,7 +46,7 @@
46
46
  <%= hidden_field_tag "mu-exercise-layout", @exercise.layout %>
47
47
  <%= hidden_field_tag "mu-exercise-settings", @exercise.settings.to_json %>
48
48
 
49
- <div style="display: none" id="processing-template">
49
+ <div class="d-none" id="processing-template">
50
50
  <div class="bs-callout bs-callout-info">
51
51
  <h4><i class="fas fa-sync-alt fa-spin"></i> <strong><%= t :processing_your_solution %></strong></h4>
52
52
  <%= t :refresh_or_wait %>