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
@@ -2,11 +2,8 @@
2
2
  <div class="modal-dialog">
3
3
  <div class="modal-content">
4
4
  <div class="modal-header">
5
- <button type="button" class="close" data-dismiss="modal" aria-label="Close">
6
- <span aria-hidden="true">&times;</span></button>
7
- <div class="guide-corollary-title">
8
- <h3 class="text-left" id="gridSystemModalLabel"><%= t :level_up %></h3>
9
- </div>
5
+ <h3 class="modal-title"><%= t :level_up %></h3>
6
+ <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
10
7
  </div>
11
8
  <div class="modal-body">
12
9
  <div class="container-fluid">
@@ -1,4 +1,4 @@
1
- <div class="modal new-message-modal" tabindex="-1" role="dialog" aria-hidden="true" style="display:block">
1
+ <div class="modal new-message-modal d-block" tabindex="-1" role="dialog" aria-hidden="true">
2
2
  <div class="modal-dialog">
3
3
  <%= form_for(Message.new, html: {role: 'form'}) do |f| %>
4
4
  <div class="modal-content">
@@ -19,16 +19,16 @@
19
19
  </small>
20
20
  </div>
21
21
  </div>
22
- <div class="modal-body hidden">
22
+ <div class="modal-body d-none">
23
23
  <div class="container-fluid">
24
24
  <div class="row">
25
25
  <%= f.text_area :content, class: 'form-control mu-message-textarea', placeholder: t(:new_message_placeholder) %>
26
- <%= f.text_field :exercise_id, value: exercise.id, class: 'hidden' %>
26
+ <%= f.text_field :exercise_id, value: exercise.id, class: 'd-none' %>
27
27
  </div>
28
28
  </div>
29
29
  </div>
30
- <div class="modal-footer hidden">
31
- <button class="btn btn-success btn-block"> <%= t :send %> </button>
30
+ <div class="modal-footer d-none">
31
+ <button class="btn btn-complementary w-100"> <%= t :send %> </button>
32
32
  </div>
33
33
  </div>
34
34
  <% end %>
@@ -1,9 +1,9 @@
1
- <div class="dropdown mu-navbar-element notifications-box <%= 'notifications-box-empty' unless has_notifications? %>">
2
- <div id="notificationsDropdown" class="profile-dropdown" data-toggle="dropdown" aria-label="<%= t(:notifications) %>" role="menu" tabindex="0">
1
+ <div class="dropdown mu-navbar-element notifications-box <%= 'd-none' unless has_notifications? %>">
2
+ <div id="notificationsDropdown" class="profile-dropdown" data-bs-toggle="dropdown" aria-label="<%= t(:notifications) %>" role="menu" tabindex="0">
3
3
  <i class="fas fa-bell fa-fw fa-2x mu-navbar-icon"></i>
4
4
  <span class="badge badge-notifications"><%= notifications_count %></span>
5
5
  </div>
6
- <ul id="notificationsPanel" class="dropdown-menu dropdown-menu-right" aria-labelledby="notificationsDropdown">
6
+ <ul id="notificationsPanel" class="dropdown-menu dropdown-menu-end" aria-labelledby="notificationsDropdown">
7
7
  <% notifications.each do |it| %>
8
8
  <li>
9
9
  <%= notification_preview_for it.target %>
@@ -0,0 +1,17 @@
1
+ <div class="mb-3">
2
+ <div class="row">
3
+ <div class="col-md-12">
4
+ <h3><%= title %></h3>
5
+ </div>
6
+ </div>
7
+ <div class="row">
8
+ <% stats.each do |s| %>
9
+ <div class="col-md-6">
10
+ <div class="mu-user-activity-indicator bg-light">
11
+ <h1 class="display-1"><%= s[:value] %></h1>
12
+ <h4><%= s[:name].downcase %></h4>
13
+ </div>
14
+ </div>
15
+ <% end %>
16
+ </div>
17
+ </div>
@@ -1,22 +1,22 @@
1
- <%= form_for :user, url: user_path, :html => { id: 'mu-user-form' }, method: :put do |f| %>
1
+ <%= form_for :user, url: user_path, :html => { id: 'mu-user-form', class: 'mu-form' }, method: :put do |f| %>
2
2
  <div class="mu-user-header">
3
3
  <h1><%= t(:edit_profile) %></h1>
4
- <div class="mu-profile-actions hidden-xs">
4
+ <div class="mu-profile-actions d-none d-md-block">
5
5
  <%= cancel_edit_profile_button %>
6
6
  <%= save_edit_profile_button f %>
7
7
  </div>
8
8
  </div>
9
9
  <div class="row mu-tab-body">
10
- <div class="col-md-4 text-center">
10
+ <div class="col-md-6 col-lg-4 mu-user-avatar-container">
11
11
  <%= profile_picture_for(@user, id: 'mu-user-avatar', class: 'mu-user-avatar') %>
12
- <i class="fas fa-pencil-alt fa-2x pointer mu-edit-avatar" id="mu-edit-avatar-icon" tabindex="0"></i>
12
+ <button class="fas fa-pencil-alt fa-2x btn mu-edit-avatar" type="button" data-bs-toggle="modal" data-bs-target="#mu-avatar-picker" tabindex="0"></button>
13
13
  </div>
14
- <div class="col-md-8">
14
+ <div class="col-md-6 col-lg-8">
15
15
  <%= render partial: 'profile_fields', locals: {form: f} %>
16
16
  <%= render partial: 'layouts/terms_acceptance_disclaimer', locals: {user: @user} %>
17
17
  </div>
18
18
  </div>
19
- <div class="mu-profile-actions mobile visible-xs">
19
+ <div class="mu-profile-actions mobile d-block d-md-none">
20
20
  <%= cancel_edit_profile_button %>
21
21
  <%= save_edit_profile_button f %>
22
22
  </div>
@@ -1,20 +1,20 @@
1
- <fieldset class="form-group">
1
+ <fieldset>
2
2
  <div><%= form.label(t :first_name) %></div>
3
3
  <div><%= form.text_field :first_name, required: true, class: 'form-control' %></div>
4
4
  </fieldset>
5
- <fieldset class="form-group">
5
+ <fieldset>
6
6
  <div><%= form.label(t :last_name) %></div>
7
7
  <div><%= form.text_field :last_name, required: true, class: 'form-control' %></div>
8
8
  </fieldset>
9
- <fieldset class="form-group">
9
+ <fieldset>
10
10
  <div><%= form.label(t :gender) %></div>
11
- <div><%= form.select :gender, options_for_select(User.genders.map { |gender, _| [t(gender), gender] }, @user.gender), {}, required: true, class: 'form-control' %></div>
11
+ <div><%= form.select :gender, options_for_select(User.genders.map { |gender, _| [t(gender), gender] }, @user.gender), {}, required: true, class: 'form-control form-select' %></div>
12
12
  </fieldset>
13
- <fieldset class="form-group">
13
+ <fieldset>
14
14
  <div><%= form.label(t :birthdate) %></div>
15
15
  <div><%= form.date_field :birthdate, min: Date.new(1900), max: 3.years.ago.end_of_year, required: true, class: 'form-control' %></div>
16
16
  </fieldset>
17
- <fieldset class="form-group">
17
+ <fieldset>
18
18
  <div><%= form.label(t :email) %></div>
19
19
  <div><%= form.text_field :email, readonly: true, class: 'form-control' %></div>
20
20
  </fieldset>
@@ -1,6 +1,6 @@
1
1
  <div class="mu-user-header">
2
2
  <h1><%= t(:my_profile) %></h1>
3
- <div class="mu-profile-actions hidden-xs">
3
+ <div class="mu-profile-actions d-none d-md-block">
4
4
  <%= edit_profile_button %>
5
5
  </div>
6
6
  </div>
@@ -35,6 +35,6 @@
35
35
  </div>
36
36
  </div>
37
37
  </div>
38
- <div class="mu-profile-actions mobile visible-xs">
38
+ <div class="mu-profile-actions mobile d-block d-md-none">
39
39
  <%= edit_profile_button %>
40
40
  </div>
@@ -0,0 +1,37 @@
1
+ <%= content_for :breadcrumbs do %>
2
+ <%= breadcrumbs_for_my_account %>
3
+ <% end %>
4
+
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
7
+
8
+ <div class="col-md-9">
9
+ <div class="mu-user-header">
10
+ <h1><%= t(:activity) %></h1>
11
+ </div>
12
+ <div class="row">
13
+ <div class="col-lg-8 mu-tab-body">
14
+ <%= render partial: 'activity_indicator',
15
+ locals: {
16
+ title: t(:exercises),
17
+ stats: exercises_activity_stats
18
+ } %>
19
+
20
+ <%= render partial: 'activity_indicator',
21
+ locals: {
22
+ title: t(:forum),
23
+ stats: messages_activity_stats
24
+ } %>
25
+ </div>
26
+ <div class="col-lg-4 mu-tab-body">
27
+ <div class="nav nav-pills flex-column">
28
+ <%= link_to t(:total), activity_user_path, class: "mu-user-activity-week-selector #{mark_period_if_active(nil)}" %>
29
+ <% activity_selector_week_range_for.each do |(week_start, week_end)| %>
30
+ <%= link_to t(:week_of, date: l(week_start)), activity_user_path(date_from: week_start, date_to: week_end),
31
+ class: "mu-user-activity-week-selector #{mark_period_if_active(week_start)}" %>
32
+ <% end %>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </div>
37
+ </div>
@@ -2,31 +2,33 @@
2
2
  <%= breadcrumbs_for_my_account %>
3
3
  <% end %>
4
4
 
5
- <%= render partial: 'layouts/user_menu' %>
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
6
7
 
7
- <div class="mu-user-header">
8
- <h1><%= t(:certificates) %></h1>
9
- </div>
10
- <% if @certificates.empty? %>
11
- <div class="mu-tab-body">
12
- <%= t :certificates_will_be_here %>
13
- </div>
14
- <% else %>
15
8
  <div class="col-md-9 mu-tab-body">
16
- <div class="col-md-12">
17
- <div class="mu-list-group">
18
- <% @certificates.each do |certificate| %>
19
- <span class="mu-list-group-item">
20
- <a href="<%= download_certificate_path certificate.code %>" target="_blank"><i class="fas fa-fw fa-download"></i></a>
21
- <span class="mu-divider-vertical"></span>
22
- <a href="<%= linkedin_post_url certificate %>" target="_blank"><i class="fab fa-fw fa-linkedin"></i></a>
23
- <span class="mu-divider-vertical"></span>
24
- <a href="<%= verify_certificate_path certificate.code %>" target="_blank">
25
- <span class="mu-text-capitalize"><%= certificate.title %> - <%= certificate.description %></span>
26
- </a>
27
- </span>
28
- <% end %>
29
- </div>
9
+ <div class="mu-user-header">
10
+ <h1><%= t(:certificates) %></h1>
30
11
  </div>
12
+ <% if @certificates.empty? %>
13
+ <div class="mu-tab-body">
14
+ <%= t :certificates_will_be_here %>
15
+ </div>
16
+ <% else %>
17
+ <div class="col-md-12">
18
+ <div class="mu-list-group">
19
+ <% @certificates.each do |certificate| %>
20
+ <span class="mu-list-group-item">
21
+ <a href="<%= download_certificate_path certificate.code %>" target="_blank"><i class="fas fa-fw fa-download"></i></a>
22
+ <span class="mu-divider-vertical"></span>
23
+ <a href="<%= linkedin_post_url certificate %>" target="_blank"><i class="fab fa-fw fa-linkedin"></i></a>
24
+ <span class="mu-divider-vertical"></span>
25
+ <a href="<%= verify_certificate_path certificate.code %>" target="_blank">
26
+ <span class="mu-text-capitalize"><%= certificate.title %> - <%= certificate.description %></span>
27
+ </a>
28
+ </span>
29
+ <% end %>
30
+ </div>
31
+ </div>
32
+ <% end %>
31
33
  </div>
32
- <% end %>
34
+ </div>
@@ -2,27 +2,29 @@
2
2
  <%= breadcrumbs_for_my_account %>
3
3
  <% end %>
4
4
 
5
- <%= render partial: 'layouts/user_menu' %>
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
6
7
 
7
- <div class="col-md-9 mu-tab-body">
8
- <div class="mu-user-header">
9
- <h1><%= t(:discussions) %></h1>
10
- </div>
11
- <% if @watched_discussions.empty? %>
12
- <div class="mu-tab-body">
13
- <%= t :discussions_will_be_here %>
8
+ <div class="col-md-9 mu-tab-body">
9
+ <div class="mu-user-header">
10
+ <h1><%= t(:discussions) %></h1>
14
11
  </div>
15
- <% else %>
16
- <table class="table table-striped">
17
- <% @watched_discussions.each do |discussion| %>
18
- <tr>
19
- <td>
20
- <%= icon_for_read(discussion.read_by?(@user)) %>
21
- </td>
22
- <td><%= link_to discussion.item.name, item_discussion_path(discussion) %></td>
23
- <td><%= time_ago_in_words discussion.last_message_date %></td>
24
- </tr>
25
- <% end %>
26
- </table>
27
- <% end %>
12
+ <% if @watched_discussions.empty? %>
13
+ <div class="mu-tab-body">
14
+ <%= t :discussions_will_be_here %>
15
+ </div>
16
+ <% else %>
17
+ <table class="table table-striped">
18
+ <% @watched_discussions.each do |discussion| %>
19
+ <tr>
20
+ <td>
21
+ <%= icon_for_read(discussion.read_by?(@user)) %>
22
+ </td>
23
+ <td><%= link_to discussion.item.name, item_discussion_path(discussion) %></td>
24
+ <td><%= time_ago_in_words discussion.last_message_date %></td>
25
+ </tr>
26
+ <% end %>
27
+ </table>
28
+ <% end %>
29
+ </div>
28
30
  </div>
@@ -2,26 +2,28 @@
2
2
  <%= breadcrumbs_for_my_account %>
3
3
  <% end %>
4
4
 
5
- <%= render partial: 'layouts/user_menu' %>
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
6
7
 
7
- <div class="col-md-9 mu-tab-body">
8
- <div class="mu-user-header">
9
- <h1><%= t(:messages) %></h1>
10
- </div>
11
- <% if @messages.empty? %>
12
- <div class="mu-tab-body">
13
- <%= t :no_messages %>
8
+ <div class="col-md-9 mu-tab-body">
9
+ <div class="mu-user-header">
10
+ <h1><%= t(:messages) %></h1>
14
11
  </div>
15
- <% else %>
16
- <table class="table table-striped">
17
- <% @messages.each do |message| %>
18
- <tr>
19
- <td><%= icon_for_read(message.read?) %></td>
20
- <td><%= link_to message.exercise.name, exercise_path(message.exercise.id) %></td>
21
- <td><%= mail_to message.sender %></td>
22
- <td><%= time_ago_in_words message.created_at %></td>
23
- </tr>
24
- <% end %>
25
- </table>
26
- <% end %>
12
+ <% if @messages.empty? %>
13
+ <div class="mu-tab-body">
14
+ <%= t :no_messages %>
15
+ </div>
16
+ <% else %>
17
+ <table class="table table-striped">
18
+ <% @messages.each do |message| %>
19
+ <tr>
20
+ <td><%= icon_for_read(message.read?) %></td>
21
+ <td><%= link_to message.exercise.name, exercise_path(message.exercise.id) %></td>
22
+ <td><%= mail_to message.sender %></td>
23
+ <td><%= time_ago_in_words message.created_at %></td>
24
+ </tr>
25
+ <% end %>
26
+ </table>
27
+ <% end %>
28
+ </div>
27
29
  </div>
@@ -2,8 +2,10 @@
2
2
  <%= breadcrumbs_for_my_account %>
3
3
  <% end %>
4
4
 
5
- <%= render partial: 'layouts/user_menu' %>
5
+ <div class="row">
6
+ <%= render partial: 'layouts/user_menu' %>
6
7
 
7
- <div class="col-md-9 mu-tab-body">
8
- <%= render partial: 'user_form' %>
8
+ <div class="col-md-9 mu-tab-body">
9
+ <%= render partial: 'user_form' %>
10
+ </div>
9
11
  </div>
@@ -20,10 +20,12 @@
20
20
  <div class="terms-acceptance">
21
21
  <%= form_for :user, url: terms_user_path, method: :post do |f| %>
22
22
  <span class="terms-acceptance-checkbox">
23
- <%= f.check_box :terms_of_service, required: true, onInvalid: "this.setCustomValidity('#{t(:terms_and_conditions_must_be_accepted)}')", onChange: "this.setCustomValidity(validity.valueMissing ? '#{t(:terms_and_conditions_must_be_accepted)}' : '')" %>
23
+ <%= f.check_box :terms_of_service, required: true, class: 'form-check-input',
24
+ onInvalid: "this.setCustomValidity('#{t(:terms_and_conditions_must_be_accepted)}')",
25
+ onChange: "this.setCustomValidity(validity.valueMissing ? '#{t(:terms_and_conditions_must_be_accepted)}' : '')" %>
24
26
  <%= t(:accept_terms) %>
25
27
  </span>
26
- <%= f.submit t(:accept), class: 'btn btn-success terms-acceptance-btn' %>
28
+ <%= f.submit t(:accept), class: 'btn btn-complementary terms-acceptance-btn' %>
27
29
  <% end %>
28
30
  </div>
29
31
  <% end %>
@@ -0,0 +1,3 @@
1
+ ActiveSupport::Inflector.inflections(:en) do |inflect|
2
+ inflect.acronym 'FAQs'
3
+ end
data/config/routes.rb CHANGED
@@ -21,6 +21,7 @@ Rails.application.routes.draw do
21
21
  post :question, on: :member
22
22
  end
23
23
  end
24
+ get '/discussions/messages/preview', to: 'discussions_messages#preview', as: :preview_discussion_message
24
25
 
25
26
  resources :exam_registrations, only: [:show]
26
27
  resources :exam_authorization_requests, only: [:show, :create, :update]
@@ -65,7 +66,9 @@ Rails.application.routes.draw do
65
66
 
66
67
  get :messages
67
68
  get :discussions
69
+ get :activity
68
70
  get :certificates
71
+
69
72
  end
70
73
 
71
74
  resources :faqs, only: [:index]
@@ -14,7 +14,7 @@ require 'mumukit/nuntius'
14
14
  require 'mumukit/platform'
15
15
 
16
16
  require 'kaminari'
17
- require 'bootstrap-kaminari-views'
17
+ require 'bootstrap5-kaminari-views'
18
18
 
19
19
  Mumukit::Nuntius.configure do |config|
20
20
  config.app_name = 'laboratory'
@@ -1 +1,2 @@
1
+ require_relative './extensions/date_and_time'
1
2
  require_relative './extensions/request'
@@ -0,0 +1,11 @@
1
+ module DateAndTime
2
+ module Calculations
3
+ # Polyfill, already implemented on Rails 5.2
4
+ # https://api.rubyonrails.org/classes/DateAndTime/Calculations.html#method-i-prev_occurring
5
+ def prev_occurring(day_of_week)
6
+ ago = wday - DAYS_INTO_WEEK.fetch(day_of_week)
7
+ ago += 7 unless ago > 0
8
+ advance(days: -ago)
9
+ end
10
+ end
11
+ end
@@ -14,6 +14,8 @@ en:
14
14
  appendix: Appendix
15
15
  appendix_teaser: Do you want to learn more? <a href="%{link}">Check this chapter's appendix</a>"
16
16
  approved_message: Validated by mentor
17
+ approved_messages:
18
+ other: validated
17
19
  are_you_sure: Are you sure you want to %{action}?
18
20
  ask_a_question: Ask a question!
19
21
  ask_community: Ask community for help
@@ -64,6 +66,18 @@ en:
64
66
  create_submission: Submit
65
67
  created_at: Created at
66
68
  date: Date
69
+ deleted_by: Deleted by %{deleter}
70
+ deleted_message_warning: If you repeateadly violate these or other rules, you may be prohibited from accessing the forum or you may suffer more severe consequences, such as being expulsed from the course.
71
+ deletion_motive:
72
+ inappropriate_content:
73
+ present: Includes inappropriate content
74
+ past: Included inappropriate content
75
+ shares_solution:
76
+ present: Shares the correct solution
77
+ past: Shared the correct solution
78
+ discloses_personal_information:
79
+ present: Discloses personal information
80
+ past: Disclosed personal information
67
81
  description: Description
68
82
  destroy: Destroy
69
83
  destroy_message: delete the message
@@ -77,6 +91,7 @@ en:
77
91
  dont_leave_us: Don't leave us! Learning is fun. You just have to keep at it.
78
92
  download: Download your solution
79
93
  edit: Edit
94
+ edit_message: Edit message
80
95
  edit_profile: Edit profile
81
96
  editor_placeholder: "write your solution here..."
82
97
  email: Email
@@ -173,9 +188,13 @@ en:
173
188
  one: 1 message
174
189
  other: '%{count} messages'
175
190
  message: Message
191
+ message_deleted: This message was deleted because it %{motive}, which violates the %{forum_terms}.
176
192
  messages: Messages
177
193
  messages_error: Previous messages are unavailable. Please try again later.
178
194
  moderation: Mentoring
195
+ messages_pluralized:
196
+ one: Message
197
+ other: Messages
179
198
  moderator: Mentor
180
199
  more_messages: More
181
200
  my_account: My account
@@ -224,6 +243,8 @@ en:
224
243
  permissions: Permissions
225
244
  please_fill_profile_data: Please complete your profile data to continue!
226
245
  please_validate: 'Please validate your data before continue:'
246
+ preview: Preview
247
+ preview_error: The preview cannot be shown. Check your internet connection or try with a shorter message.
227
248
  previous_exercise: Previous
228
249
  problem_with_exercise: '[Mumuki] Problem with exercise: %{title}'
229
250
  processing_your_solution: We are processing you solution
@@ -246,6 +267,7 @@ en:
246
267
  select_file: Select file
247
268
  sending_solution: Sending solution
248
269
  show: Show
270
+ show_message: Show message
249
271
  sign_in: Sign in
250
272
  sign_in_action: sign in
251
273
  sign_out: Sign Out
@@ -256,11 +278,13 @@ en:
256
278
  skipped_solve_anyway: Solve anyway
257
279
  solution: Solution
258
280
  solved: Solved
259
- solved_count: '%{count} solved'
260
281
  solve_doubts: Solve other's doubts
261
282
  solve_more_exercises_to_level_up: Solve <span>number</span> more exercises to advance to the next level.
262
283
  solve_your_doubts: Solve your doubts
263
284
  solve_your_doubts_teaser: Do you have any doubts?
285
+ solved_count: '%{count} solved'
286
+ solved_exercises_count: solved
287
+ solved_exercises_percentage: done
264
288
  something_went_wrong: Something went wrong!
265
289
  sort: Sort
266
290
  sources: Sources
@@ -293,6 +317,7 @@ en:
293
317
  to_pending_review: Mark as solved
294
318
  to_solved: Mark as solved
295
319
  unauthorized_explanation: You have no permissions for this content. Maybe you logged in with another account.
320
+ total: Total
296
321
  undo_upvote: Undo upvote
297
322
  unlocked_medal_as_avatar: You earned this medal! You can now choose it as an avatar.
298
323
  unspecified: I'd rather not say
@@ -308,8 +333,9 @@ en:
308
333
  user_data_updated: Your data was updated successfully
309
334
  username: Username
310
335
  view_details: View details
311
- want_permissions: The next user requires permissions
336
+ want_permissions: The following user requires permissions for the organization
312
337
  we_miss_you: We miss you!
338
+ week_of: Week of %{date}
313
339
  welcome: Welcome to %{name}!
314
340
  working: "Working"
315
341
  wrong_answer: The answer is wrong