mumuki-laboratory 9.6.0 → 9.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd241aca9a26c54188bd561d66bdd169636645a0a811ddfdda36380e0ce6cd0d
4
- data.tar.gz: 1b0ac735778e2bf364174ee9477d2366dd98f2e8d6c81c8ee94cfadd96148a11
3
+ metadata.gz: '010359ac9c5634aef6562e79e3bf7bcbda5636811940d65b8b4cea33bf925343'
4
+ data.tar.gz: 985a05cba4d9d05a240b214e8c1fc26b7f1be78f2798945a20cd4d101609920a
5
5
  SHA512:
6
- metadata.gz: '0818e279bf73c4e53d29ac86f25f04204f011a3441fda6aa2a5d32003cd57ecd026f751ccca5beb58c84014f9102548ccaa965239dfc0289ee7efdbae191c501'
7
- data.tar.gz: d071e2c07cb581cb023e5e81719a9e8d7f0d61cfcf8f10edcda4bf01629cd190a38b16ebfef87716d1f3b8d494b0d0fa7e7d114dbc716f3caa68569bc21bf963
6
+ metadata.gz: 075a1767df05f3dbeb70bef5f3d8d4276379df342bc4ea63d7a370bbc94c2d3a92f4357f86ef456c0f33f8b347250869162959823e534138f943abfcb0f6ed9d
7
+ data.tar.gz: 73b01a26563a8af9eed8210fa8c1e1553ef7a444d64ea39b2f97c3e41e5faa33f2cfb9cb37c857602f05947bf9d5d7ae4254db71e3df6219e2b49cd9096aaa6c
@@ -21,13 +21,8 @@
21
21
  width: 157px;
22
22
  border: none;
23
23
  }
24
+
24
25
  .mu-certificate-download-btn-icon {
25
- border-right: 1px solid darken($mu-color-complementary, 10%);
26
26
  padding: 8px 6px 9px 6px;
27
27
  width: 35px;
28
28
  }
29
- .mu-certificate-download-btn-text {
30
- display: inline-block;
31
- width: 115px;
32
- text-align: center;
33
- }
@@ -16,6 +16,7 @@ class ApplicationController < ActionController::Base
16
16
 
17
17
  before_action :set_current_organization!
18
18
  before_action :set_locale!
19
+ before_action :set_time_zone!
19
20
 
20
21
  before_action :ensure_user_enabled!, if: :current_user?
21
22
  before_action :validate_active_organization!
@@ -30,6 +31,7 @@ class ApplicationController < ActionController::Base
30
31
  before_action :visit_organization!, if: :current_user?
31
32
 
32
33
  after_action :leave_organization!
34
+ after_action :unset_time_zone!
33
35
 
34
36
  helper_method :current_workspace,
35
37
  :login_button,
@@ -143,6 +145,14 @@ class ApplicationController < ActionController::Base
143
145
  I18n.locale = Organization.current.locale
144
146
  end
145
147
 
148
+ def set_time_zone!
149
+ Time.zone = Organization.current.time_zone
150
+ end
151
+
152
+ def unset_time_zone!
153
+ Time.zone = nil
154
+ end
155
+
146
156
  def subject #TODO may be used to remove breadcrumbs duplication
147
157
  nil
148
158
  end
@@ -10,7 +10,7 @@ module WithCertificateRender
10
10
  end
11
11
 
12
12
  def qr_for(certificate)
13
- qr = RQRCode::QRCode.new(verify_certificate_url certificate.code).as_svg(color: '0B465D')
13
+ qr = RQRCode::QRCode.new(verify_certificate_url certificate.organization, certificate.code).as_svg(color: '0B465D')
14
14
  "data:image/svg+xml,#{URI.encode(qr)}"
15
15
  end
16
16
 
@@ -1,4 +1,7 @@
1
1
  class ExamAuthorizationRequestsController < ApplicationController
2
+
3
+ before_action :verify_registration_opened!, on: [:create, :update]
4
+
2
5
  def create
3
6
  authorization_request = ExamAuthorizationRequest.find_or_create_by! create_authorization_request_params do |it|
4
7
  it.assign_attributes authorization_request_params
@@ -25,4 +28,9 @@ class ExamAuthorizationRequestsController < ApplicationController
25
28
  .require(:exam_authorization_request).permit(:exam_id, :exam_registration_id)
26
29
  .merge(user: current_user, organization: Organization.current)
27
30
  end
31
+
32
+ def verify_registration_opened!
33
+ exam_registration = ExamRegistration.find(authorization_request_params[:exam_registration_id])
34
+ raise Mumuki::Domain::GoneError if exam_registration.end_time.past?
35
+ end
28
36
  end
@@ -0,0 +1,13 @@
1
+ module ExamRegistrationHelper
2
+ def exam_registration_view
3
+ if @registration.end_time.past?
4
+ { icon: :times_circle, class: :danger, t: :exam_registration_finished_html }
5
+ else
6
+ { icon: :info_circle, class: :info, t: :exam_registration_explanation_html }
7
+ end
8
+ end
9
+
10
+ def current_time_zone_html
11
+ %Q{(<span class="select-date-timezone">#{Organization.current&.time_zone}</span>)}.html_safe
12
+ end
13
+ end
@@ -23,7 +23,7 @@ class UserMailer < ApplicationMailer
23
23
  def certificate(certificate)
24
24
  with_locale certificate.user, certificate.organization do
25
25
  attachments[certificate.filename] = pdf_for(certificate)
26
- mail to: certificate.user.email, subject: t(:certificate)
26
+ mail to: certificate.user.email, subject: certificate.description
27
27
  end
28
28
  end
29
29
 
@@ -38,7 +38,7 @@
38
38
  <div class="mu-certificate-box">
39
39
  <img src="<%= certificate.background_image_url %>" class="background-image"/>
40
40
  <%= render inline: certificate.template_html_erb, locals: certificate.template_locals %>
41
- <a href="<%= verify_certificate_path certificate.code %>" target="_blank">
41
+ <a href="<%= verify_certificate_url certificate.organization, certificate.code %>" target="_blank">
42
42
  <div><img class="qr-code" src="<%= qr_for certificate %>"/></div>
43
43
  </a>
44
44
  </div>
@@ -7,7 +7,7 @@
7
7
  <div class="container">
8
8
  <div class="row mu-certificate-data">
9
9
  <div class="col-md-6">
10
- <div class="row text-center jumbotron">
10
+ <div class="row text-center bg-light p-4 rounded-3 mb-4">
11
11
  <div class="col-md-12">
12
12
  <h3 class="mu-certificate-name">
13
13
  <%= t :completed_by %>
@@ -18,13 +18,12 @@
18
18
  </div>
19
19
  </div>
20
20
  <% if @certificate.for_user? current_user %>
21
- <div class="row mu-certificate-buttons">
22
- <a href="<%= linkedin_post_url @certificate %>" target="_blank">
23
- <img src="https://download.linkedin.com/desktop/add2profile/buttons/<%= t :linkedin_profile_button_locale %>.png" alt="LinkedIn Add to Profile button">
21
+ <div class="mu-certificate-buttons d-flex justify-content-evenly">
22
+ <a class="btn btn-complementary mu-certificate-download-btn mx-2" href="<%= download_certificate_path @certificate.code %>" target="_blank">
23
+ <%= fa_icon(:download, class: 'fa-fw fa-lg mu-certificate-download-btn-icon', text: t(:certificate)) %>
24
24
  </a>
25
- <a class="btn btn-complementary mu-certificate-download-btn pull-right" href="<%= download_certificate_path @certificate.code %>" target="_blank">
26
- <i class="fas fa-fw fa-lg fa-download mu-certificate-download-btn-icon"></i>
27
- <span class="mu-certificate-download-btn-text"><%= t :certificate %></span>
25
+ <a href="<%= linkedin_post_url @certificate %>" class="mx-2" target="_blank">
26
+ <img src="https://download.linkedin.com/desktop/add2profile/buttons/<%= t :linkedin_profile_button_locale %>.png" alt="LinkedIn Add to Profile button">
28
27
  </a>
29
28
  </div>
30
29
  <% end %>
@@ -1 +1,2 @@
1
- <%= t :exam_authorization_request_approved_html, date: l(authorization_request.exam.start_time.in_time_zone(-3), format: :long) %>
1
+ <%= t :exam_authorization_request_approved_html, date: l(authorization_request.exam.start_time, format: :long),
2
+ location: Organization.current.time_zone %>
@@ -1,4 +1,5 @@
1
1
  <%= t :exam_authorization_pending_explanation_html,
2
- date: l(authorization_request.exam.start_time.in_time_zone(-3), format: :long),
3
- end_time: l(authorization_request.exam_registration.end_time.in_time_zone(-3), format: :long),
2
+ date: l(authorization_request.exam.start_time, format: :long),
3
+ end_time: l(authorization_request.exam_registration.end_time, format: :long),
4
+ location: Organization.current.time_zone,
4
5
  edit_path: url_for(authorization_request.exam_registration) %>
@@ -12,25 +12,27 @@
12
12
 
13
13
  <div class="row">
14
14
  <div class="col-lg-12">
15
- <div class="bs-callout bs-callout-info">
16
- <h4 class="text-info">
17
- <strong><%= fa_icon :info_circle %> <%= t :important_info %></strong>
18
- </h4>
15
+ <div class="bs-callout bs-callout-<%= exam_registration_view[:class] %>">
16
+ <h4 class="text-<%= exam_registration_view[:class] %>">
17
+ <strong><%= fa_icon exam_registration_view[:icon] %> <%= t :important_info %></strong>
18
+ </h4>
19
19
  <p>
20
- <%= t :exam_registration_explanation_html, date: l(@registration.end_time.in_time_zone(-3), format: :long) %>
20
+ <%= t exam_registration_view[:t], date: l(@registration.end_time, format: :long), location: Organization.current.time_zone %>
21
21
  </p>
22
22
  </div>
23
- <%= form_for @authorization_request, html: {class: 'mu-form'} do |f| %>
24
- <%= f.hidden_field :exam_registration_id, value: @registration.id %>
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.in_time_zone(-3), format: :long), class: 'form-check-label' %>
31
- </div>
23
+ <% unless @registration.end_time.past? %>
24
+ <%= form_for @authorization_request, html: {class: 'mu-form'} do |f| %>
25
+ <%= f.hidden_field :exam_registration_id, value: @registration.id %>
26
+ <%= f.label :exam_id, t(:exam_registration_choose_exam) %>
27
+ <% @registration.exams.each do |exam| %>
28
+ <div class="form-check">
29
+ <%= f.radio_button(:exam_id, exam.id, id: exam.id, required: true, class: 'form-check-input mu-read-only-input',
30
+ checked: @authorization_request.exam_id == exam.id) %>
31
+ <%= label_tag exam.id, "#{l(exam.start_time, format: :long)} #{current_time_zone_html}".html_safe, class: 'form-check-label' %>
32
+ </div>
33
+ <% end %>
34
+ <button class="btn btn-complementary"> <%= t :save %> </button>
32
35
  <% end %>
33
- <button class="btn btn-complementary"> <%= t :save %> </button>
34
36
  <% end %>
35
37
  </div>
36
38
  </div>
@@ -23,8 +23,8 @@
23
23
 
24
24
  <% if current_user&.moderator_here? %>
25
25
  <div class="discussion-requires-attention float-end">
26
- <%= label_tag :requires_moderator_response, t(:requires_attention) %>
27
- <%= check_box_tag :requires_moderator_response, true, discussion_filter_params[:requires_moderator_response], class: 'form-check-input', onclick: 'mumuki.Forum.discussionsToggleCheckbox($(this))' %>
26
+ <%= label_tag :requires_attention, t(:requires_attention) %>
27
+ <%= check_box_tag :requires_attention, true, discussion_filter_params[:requires_attention], class: 'form-check-input', onclick: 'mumuki.Forum.discussionsToggleCheckbox($(this))' %>
28
28
  </div>
29
29
  <% end %>
30
30
 
@@ -14,7 +14,7 @@
14
14
  <span class="mu-level-number"></span>
15
15
  </div>
16
16
  <% end %>
17
- <%= render partial: 'notifications/dropdown' %>
17
+ <%#= render partial: 'notifications/dropdown' %>
18
18
  <div class="dropdown mu-navbar-element">
19
19
  <div id="profileDropdown" class="profile-dropdown dropdown-toggle" data-bs-toggle="dropdown" aria-label="<%= t(:user) %>" role="menu" tabindex="0">
20
20
  <%= profile_picture_for current_user %>
@@ -76,20 +76,7 @@
76
76
  <table border="0" cellpadding="0" cellspacing="0" class="muMailCaptionRightContentOuter" width="100%">
77
77
  <tbody><tr>
78
78
  <td valign="top" class="muMailCaptionRightContentInner" style="padding:0 9px ;">
79
- <table align="left" border="0" cellpadding="0" cellspacing="0" class="muMailCaptionRightImageContentContainer" width="264">
80
- <tbody><tr>
81
- <td class="muMailCaptionRightImageContent" align="center" valign="top">
82
-
83
-
84
-
85
- <img alt="" src="https://gallery.mailchimp.com/046b6c670d9f80ebd6c5d075b/images/225fe60f-780a-451e-90aa-afb01f88a1b4.png" width="159" style="max-width:159px;" class="muMailImage">
86
-
87
-
88
-
89
- </td>
90
- </tr>
91
- </tbody></table>
92
- <table class="muMailCaptionRightTextContentContainer" align="right" border="0" cellpadding="0" cellspacing="0" width="264">
79
+ <table class="muMailCaptionRightTextContentContainer" align="center" border="0" cellpadding="0" cellspacing="0" width="264">
93
80
  <tbody><tr>
94
81
  <td valign="top" class="muMailTextContent">
95
82
  <h3 class="null" style="text-align: center;"><br>
@@ -115,6 +102,15 @@
115
102
  <tbody class="muMailButtonBlockOuter">
116
103
  <tr>
117
104
  <td style="padding-top:0; padding-right:18px; padding-bottom:18px; padding-left:18px;" valign="top" align="center" class="muMailButtonBlockInner">
105
+ <table border="0" cellpadding="0" cellspacing="0" class="muMailButtonContentContainer" style="border-collapse: separate !important;border-radius: 3px;background-color: #FF5B81;">
106
+ <tbody>
107
+ <tr>
108
+ <td align="center" valign="middle" class="muMailButtonContent" style="font-family: Helvetica; font-size: 18px; padding: 18px;">
109
+ <a class="muMailButton " title=<%= t :my_profile %> href=<%= @organization.url_for('/user') %> target="_self" style="font-weight: bold;letter-spacing: -0.5px;line-height: 100%;text-align: center;text-decoration: none;color: #FFFFFF;"><%= t :my_profile %></a>
110
+ </td>
111
+ </tr>
112
+ </tbody>
113
+ </table>
118
114
  </td>
119
115
  </tr>
120
116
  </tbody>
@@ -22,7 +22,7 @@
22
22
  <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#<%= "exam_authorization_collapse_item_#{index}" %>" aria-expanded="false" aria-controls="<%= "exam_authorization_collapse_item_#{index}" %>">
23
23
  <span class="fa fa-fw fa-<%= it.icon[:class] %> text-<%= it.icon[:type] %>" data-bs-toggle="tooltip" title="<%= t(it.status).humanize %>"></span>
24
24
  <span class="divider-vertical"></span>
25
- <span><strong><%= it.exam_registration.description %></strong> - <small><%= l(it.exam.start_time.in_time_zone(-3), format: :long) %></small></span>
25
+ <span><strong><%= it.exam_registration.description %></strong> - <small><%= l(it.exam.start_time, format: :long) %></small></span>
26
26
  </button>
27
27
  </h2>
28
28
  <div id="<%= "exam_authorization_collapse_item_#{index}" %>" class="accordion-collapse collapse" aria-labelledby="<%= "exam_authorization_accordion_item_#{index}" %>" data-bs-parent="#exam_authorization_accordion">
@@ -0,0 +1,5 @@
1
+ require 'wicked_pdf'
2
+
3
+ WickedPdf.config = {
4
+ encoding: 'utf8'
5
+ }
@@ -108,14 +108,15 @@ en:
108
108
  error_500: 500 error
109
109
  error_description: This is known as a <span class="error-link">%{error}</span>.
110
110
  errored: Oops, your solution didn't work
111
- exam_authorization_pending_explanation_html: You have until <strong>%{end_time}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
112
- exam_authorization_request_approved_html: Your request was approved, don't forget to log in at <strong>%{date}</strong>. Good luck!
111
+ exam_authorization_pending_explanation_html: You have until <strong>%{end_time}</strong> (%{location} time) to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
112
+ exam_authorization_request_approved_html: Your request was approved, don't forget to log in at <strong>%{date}</strong> (%{location} time). Good luck!
113
113
  exam_authorization_request_created: Your registration to the exam has been saved!
114
114
  exam_authorization_request_rejected: Your request was rejected because you didn't meet the requirements.
115
115
  exam_authorization_request_saved: Your registration to the exam has been updated!
116
116
  exam_authorization_request_updated: Your registration to %{description} has been updated
117
117
  exam_registration_choose_exam: Choose date and time to attend to the exam
118
- exam_registration_explanation_html: You have until <strong>%{date}</strong> to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
118
+ exam_registration_explanation_html: You have until <strong>%{date}</strong> (%{location} time) to register. After that date, your request will be processed and you will receive a confirmation. <br> Don't forget to check the notifications!
119
+ exam_registration_finished_html: Registration for this exam ended on <strong>%{date}</strong> (%{location} time)
119
120
  exam_registration_open: Registrations open for %{description}!
120
121
  exam_registration_to: Registration to %{description}
121
122
  exams_will_be_here: Your exams in the organization will appear here.
@@ -216,6 +217,9 @@ en:
216
217
  need_help: I need help!
217
218
  never: never
218
219
  new: New
220
+ new_certificate_mailer_title: 'Congratulations'
221
+ new_certificate_mailer_p1: 'Your new certificate is ready'
222
+ new_certificate_mailer_p2: 'You can find it attached to this email or you can view it in your Mumuki profile'
219
223
  new_message_placeholder: Write a message for your teacher...
220
224
  new_message_received: You have a new message from %{sender}
221
225
  next_exercise: Next
@@ -108,14 +108,15 @@ es-CL:
108
108
  internal_server_error: ¡Ups! Algo no anduvo bien
109
109
  not_found: ¡Ups! La página no existe
110
110
  errored: ¡Ups! Tu solución no se puede ejecutar
111
- exam_authorization_pending_explanation_html: Tienes tiempo hasta el <strong>%{end_time}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
112
- exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
111
+ exam_authorization_pending_explanation_html: Tienes tiempo hasta el <strong>%{end_time}</strong> (hora de %{location}) para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
112
+ exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong> (hora de %{location}). ¡Buena suerte!
113
113
  exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
114
114
  exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
115
115
  exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
116
116
  exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
117
117
  exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
118
- exam_registration_explanation_html: Tienes tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
118
+ exam_registration_explanation_html: Tienes tiempo hasta el <strong>%{date}</strong> (hora de %{location}) para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No olvides revisar las notificaciones!
119
+ exam_registration_finished_html: La inscripción a este examen finalizó el <strong>%{date}</strong> (hora de %{location})
119
120
  exam_registration_open: ¡Ya puedes inscribirte a %{description}!
120
121
  exam_registration_to: Inscripción a %{description}
121
122
  exams_will_be_here: Tus exámenes en esta organización aparecerán acá
@@ -220,6 +221,9 @@ es-CL:
220
221
  new: Nuevo
221
222
  new_discussion: Nueva consulta
222
223
  new_message: ¿Tienes dudas? ¡Levanta la mano!
224
+ new_certificate_mailer_title: 'Felicitaciones'
225
+ new_certificate_mailer_p1: 'Ya está listo tu nuevo certificado'
226
+ new_certificate_mailer_p2: 'Podés descargarlo desde el adjunto de este mail o bien visualizarlo en tu perfil de Mumuki'
223
227
  new_message_placeholder: Escribe el mensaje para tu docente acá...
224
228
  new_message_received: Tienes un nuevo mensaje de %{sender}
225
229
  next_exercise: Siguiente
@@ -116,14 +116,15 @@ es:
116
116
  internal_server_error: ¡Ups! Algo no anduvo bien
117
117
  not_found: ¡Ups! La página no existe
118
118
  errored: ¡Ups! Tu solución no se puede ejecutar
119
- exam_authorization_pending_explanation_html: Tenés tiempo hasta el <strong>%{end_time}</strong> para cambiar el turno haciendo click <strong><a href="%{edit_path}">acá</a></strong>. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
120
- exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong>. ¡Buena suerte!
119
+ exam_authorization_pending_explanation_html: Tenés tiempo hasta el <strong>%{end_time}</strong> (hora de %{location}) para cambiar el turno haciendo click <strong><a href="%{edit_path}">acá</a></strong>. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
120
+ exam_authorization_request_approved_html: Tu solicitud fue aprobada, no olvides conectarte el <strong>%{date}</strong> (hora de %{location}). ¡Buena suerte!
121
121
  exam_authorization_request_created: ¡Tu inscripción al exámen se registró exitosamente!
122
122
  exam_authorization_request_rejected: Tu solicitud fue rechazada porque no cumpliste con los requisitos para rendir el examen.
123
123
  exam_authorization_request_saved: ¡Tu inscripción al exámen se modificó exitosamente!
124
124
  exam_authorization_request_updated: Hay novedades sobre tu inscripción a %{description}
125
125
  exam_registration_choose_exam: Seleccioná día y horario en el que te gustaría rendir el exámen
126
- exam_registration_explanation_html: Tenés tiempo hasta el <strong>%{date}</strong> para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
126
+ exam_registration_explanation_html: Tenés tiempo hasta el <strong>%{date}</strong> (hora de %{location}) para inscribirte. Pasada esa fecha, tu solicitud será evaluada y recibirás una confirmación. <br> ¡No te olvides de revisar las notificaciones!
127
+ exam_registration_finished_html: La inscripción a este examen finalizó el <strong>%{date}</strong> (hora de %{location})
127
128
  exam_registration_open: ¡Ya podés inscribirte a %{description}!
128
129
  exam_registration_to: Inscripción a %{description}
129
130
  exams_will_be_here: Tus exámenes en esta organización aparecerán acá
@@ -228,6 +229,9 @@ es:
228
229
  need_help: No entiendo, ¡necesito ayuda!
229
230
  never: nunca
230
231
  new: Nuevo
232
+ new_certificate_mailer_title: 'Felicitaciones'
233
+ new_certificate_mailer_p1: 'Ya está listo tu nuevo certificado'
234
+ new_certificate_mailer_p2: 'Podés descargarlo desde el adjunto de este mail o bien visualizarlo en tu perfil de Mumuki'
231
235
  new_discussion: Nueva consulta
232
236
  new_message: ¿Tenés dudas? ¡Levantá la mano!
233
237
  new_message_placeholder: Escribí el mensaje para tu docente acá...
@@ -111,14 +111,15 @@ pt:
111
111
  error_500: erro 500
112
112
  error_description: Isto é o que é conhecido como <span class = "error-link"> %{error} </ span>.
113
113
  errored: Opa! Sua solução não pode ser executada
114
- exam_authorization_pending_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
115
- exam_authorization_request_approved_html: Sua solicitação foi aprovada, não se esqueça de conectar em <strong>%{date}</strong>. Boa sorte!
114
+ exam_authorization_pending_explanation_html: Você tem tempo até <strong>%{date}</strong> (horário de %{location}) para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
115
+ exam_authorization_request_approved_html: Sua solicitação foi aprovada, não se esqueça de conectar em <strong>%{date}</strong> (horário de %{location}). Boa sorte!
116
116
  exam_authorization_request_created: Seu registro de exame foi salvo com sucesso!
117
117
  exam_authorization_request_rejected: Sua solicitação foi rejeitada porque você não atendeu aos requisitos.
118
118
  exam_authorization_request_saved: Seu registro de exame foi modificado com sucesso!
119
119
  exam_authorization_request_updated: Há notícias sobre seu registro para %{description}
120
120
  exam_registration_choose_exam: Selecione o dia e a hora em que gostaria de fazer o exame
121
- exam_registration_explanation_html: Você tem tempo até <strong>%{date}</strong> para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
121
+ exam_registration_explanation_html: Você tem tempo até <strong>%{date}</strong> (horário de %{location}) para se inscrever. Após essa data, sua inscrição será avaliada e você receberá uma confirmação. <br> Não se esqueça de verificar as notificações!
122
+ exam_registration_finished_html: A inscrição para este exame terminou na <strong>%{date}</strong> (horário de %{location})
122
123
  exam_registration_open: "¡Inscrições abertas para %{description}!"
123
124
  exam_registration_to: Inscrição a %{description}
124
125
  exams_will_be_here: Seus Examesca nesta organização aparecerão aqui
@@ -222,6 +223,9 @@ pt:
222
223
  need_help: Não entendo, preciso de ajuda!
223
224
  never: nunca
224
225
  new: Novo
226
+ new_certificate_mailer_title: 'Parabéns'
227
+ new_certificate_mailer_p1: 'Seu novo certificado está pronto'
228
+ new_certificate_mailer_p2: 'Você pode baixá-lo do anexo deste e-mail ou visualizá-lo em seu perfil Mumuki'
225
229
  new_message: Você tem dúvidas? Levante a mão!
226
230
  new_message_placeholder: Escreva sua mensagem para o seu professor aqui ...
227
231
  new_message_received: Você tem uma nova mensagem de %{sender}
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.6.0'
3
+ VERSION = '9.8.1'
4
4
  end
5
5
  end
@@ -10,14 +10,64 @@ describe ExamAuthorizationRequestsController, type: :controller, organization_wo
10
10
  describe 'create' do
11
11
  let!(:notification) { create(:notification, target: exam_registration, user: user) }
12
12
 
13
- before do
13
+ def do_post
14
14
  post :create, params: {
15
15
  exam_authorization_request: { exam_id: exam.id, exam_registration_id: exam_registration.id }
16
16
  }
17
17
  end
18
18
 
19
+ before { do_post }
20
+
21
+ describe 'called once' do
22
+ it { expect(response.status).to eq 302 }
23
+ it { expect(exam_registration.authorization_requests.size).to be 1 }
24
+ it { expect(notification.reload.read).to be_truthy }
25
+ end
26
+
27
+ describe 'called twice' do
28
+ before { do_post }
29
+ it { expect(response.status).to eq 302 }
30
+ it { expect(exam_registration.authorization_requests.size).to be 1 }
31
+ it { expect(notification.reload.read).to be_truthy }
32
+ end
33
+ end
34
+
35
+ describe 'update' do
36
+ let(:exam_authorization_request) { create :exam_authorization_request, exam: exam, exam_registration: exam_registration, user: user }
37
+
38
+ before do
39
+ put :update, params: {
40
+ id: exam_authorization_request.id,
41
+ exam_authorization_request: { exam_id: exam.id, exam_registration_id: exam_registration.id }
42
+ }
43
+ end
44
+
19
45
  it { expect(response.status).to eq 302 }
20
- it { expect(exam_registration.authorization_requests.length).to be 1 }
21
- it { expect(notification.reload.read).to be_truthy }
46
+ it { expect(exam_registration.authorization_requests.size).to be 1 }
47
+ end
48
+
49
+ describe 'fails if exam_registration time ended' do
50
+ let(:exam_registration) { create(:exam_registration, exams: [exam], end_time: 2.minutes.ago) }
51
+ let(:exam_authorization_request) { create :exam_authorization_request, exam: exam, exam_registration: exam_registration, user: user }
52
+
53
+ describe 'create' do
54
+ before do
55
+ post :create, params: {
56
+ exam_authorization_request: { exam_id: exam.id, exam_registration_id: exam_registration.id }
57
+ }
58
+ end
59
+ it { expect(response.status).to eq 410 }
60
+ end
61
+
62
+ describe 'update' do
63
+ before do
64
+ put :update, params: {
65
+ id: exam_authorization_request.id,
66
+ exam_authorization_request: { exam_id: exam.id, exam_registration_id: exam_registration.id }
67
+ }
68
+ end
69
+ it { expect(response.status).to eq 410 }
70
+ end
22
71
  end
72
+
23
73
  end
@@ -198,6 +198,7 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
198
198
  terms_of_service: 'A TOS',
199
199
  public: false,
200
200
  login_methods: ['facebook', 'user_pass'],
201
+ time_zone: 'UTC',
201
202
  book: book }
202
203
  let(:updated_organizaton) { organization.reload }
203
204
  let(:update_json) { {contact_email: 'second_email@gmail.com', immersive: true, locale: 'en'} }
@@ -214,7 +215,8 @@ describe Api::OrganizationsController, type: :controller, organization_workspace
214
215
  description: "a great org",
215
216
  locale: 'en',
216
217
  contact_email: "second_email@gmail.com",
217
- terms_of_service: 'A TOS'
218
+ terms_of_service: 'A TOS',
219
+ time_zone: 'UTC'
218
220
  },
219
221
  settings: {
220
222
  login_methods: ["facebook", "user_pass"],
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mumuki-laboratory
3
3
  version: !ruby/object:Gem::Version
4
- version: 9.6.0
4
+ version: 9.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Franco Bulgarelli
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-06-17 00:00:00.000000000 Z
11
+ date: 2021-07-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 9.6.0
33
+ version: 9.8.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 9.6.0
40
+ version: 9.8.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: mumukit-bridge
43
43
  requirement: !ruby/object:Gem::Requirement
@@ -553,6 +553,7 @@ files:
553
553
  - app/helpers/editor_helper.rb
554
554
  - app/helpers/editor_tabs_helper.rb
555
555
  - app/helpers/email_helper.rb
556
+ - app/helpers/exam_registration_helper.rb
556
557
  - app/helpers/exercise_input_helper.rb
557
558
  - app/helpers/gamification_helper.rb
558
559
  - app/helpers/globals_helper.rb
@@ -726,6 +727,7 @@ files:
726
727
  - config/initializers/inflections.rb
727
728
  - config/initializers/omniauth.rb
728
729
  - config/initializers/session_store.rb
730
+ - config/initializers/wicked_pdf.rb
729
731
  - config/routes.rb
730
732
  - lib/mumuki/laboratory.rb
731
733
  - lib/mumuki/laboratory/controllers.rb
@@ -956,139 +958,139 @@ required_rubygems_version: !ruby/object:Gem::Requirement
956
958
  - !ruby/object:Gem::Version
957
959
  version: '0'
958
960
  requirements: []
959
- rubygems_version: 3.1.2
961
+ rubygems_version: 3.0.6
960
962
  signing_key:
961
963
  specification_version: 4
962
964
  summary: Code assement web application for the Mumuki Platform.
963
965
  test_files:
964
- - spec/controllers/exercise_solutions_controller_spec.rb
965
- - spec/controllers/courses_api_controller_spec.rb
966
- - spec/controllers/users_api_controller_spec.rb
967
- - spec/controllers/exam_authorization_requests_controller_spec.rb
968
- - spec/controllers/chapters_controller_spec.rb
969
- - spec/controllers/users_controller_spec.rb
970
- - spec/controllers/confirmations_controller_spec.rb
971
- - spec/controllers/exam_registrations_controller_spec.rb
972
- - spec/controllers/discussions_messages_controller_spec.rb
973
- - spec/controllers/organizations_api_controller_spec.rb
974
- - spec/controllers/discussions_controller_spec.rb
975
- - spec/controllers/guide_progress_controller_spec.rb
976
- - spec/controllers/certificates_controller_spec.rb
977
- - spec/controllers/messages_controller_spec.rb
978
- - spec/controllers/api_clients_controller.rb
979
- - spec/controllers/invitations_controller_spec.rb
980
- - spec/controllers/students_api_controller_spec.rb
981
- - spec/javascripts/elipsis-spec.js
982
- - spec/javascripts/exercise-spec.js
983
- - spec/javascripts/results-renderers-spec.js
984
- - spec/javascripts/speech-bubble-renderer-spec.js
966
+ - spec/spec_helper.rb
967
+ - spec/api_helper.rb
968
+ - spec/mailers/user_mailer_spec.rb
969
+ - spec/mailers/previews/user_mailer_preview.rb
985
970
  - spec/javascripts/kids-button-spec.js
986
- - spec/javascripts/sync-mode-spec.js
987
- - spec/javascripts/global-spec.js
988
- - spec/javascripts/upload-spec.js
971
+ - spec/javascripts/speech-bubble-renderer-spec.js
972
+ - spec/javascripts/bridge-spec.js
989
973
  - spec/javascripts/timer-spec.js
990
- - spec/javascripts/events-spec.js
991
- - spec/javascripts/i18n-spec.js
974
+ - spec/javascripts/editors-spec.js
975
+ - spec/javascripts/upload-spec.js
976
+ - spec/javascripts/spec-helper.js
977
+ - spec/javascripts/results-renderers-spec.js
978
+ - spec/javascripts/sync-mode-spec.js
992
979
  - spec/javascripts/csrf-token-spec.js
993
- - spec/javascripts/bridge-spec.js
980
+ - spec/javascripts/exercise-spec.js
981
+ - spec/javascripts/i18n-spec.js
982
+ - spec/javascripts/submissions-store-spec.js
983
+ - spec/javascripts/events-spec.js
984
+ - spec/javascripts/global-spec.js
994
985
  - spec/javascripts/gamification-spec.js
986
+ - spec/javascripts/elipsis-spec.js
995
987
  - spec/javascripts/timeout-spec.js
996
- - spec/javascripts/editors-spec.js
997
- - spec/javascripts/submissions-store-spec.js
998
- - spec/javascripts/spec-helper.js
999
- - spec/spec_helper.rb
1000
- - spec/dummy/bin/setup
1001
- - spec/dummy/bin/rails
1002
- - spec/dummy/bin/yarn
1003
- - spec/dummy/bin/update
1004
- - spec/dummy/bin/bundle
1005
- - spec/dummy/bin/rake
1006
- - spec/dummy/config/routes.rb
1007
- - spec/dummy/config/database.yml
1008
- - spec/dummy/config/environment.rb
1009
- - spec/dummy/config/locales/en.yml
988
+ - spec/teaspoon_env.rb
989
+ - spec/dummy/config/secrets.yml
1010
990
  - spec/dummy/config/application.rb
1011
- - spec/dummy/config/cable.yml
1012
991
  - spec/dummy/config/rabbit.yml
1013
- - spec/dummy/config/spring.rb
1014
- - spec/dummy/config/secrets.yml
1015
992
  - spec/dummy/config/puma.rb
1016
- - spec/dummy/config/initializers/wrap_parameters.rb
1017
- - spec/dummy/config/initializers/filter_parameter_logging.rb
1018
- - spec/dummy/config/initializers/assets.rb
1019
- - spec/dummy/config/initializers/cookies_serializer.rb
1020
- - spec/dummy/config/environments/development.rb
993
+ - spec/dummy/config/cable.yml
1021
994
  - spec/dummy/config/environments/test.rb
995
+ - spec/dummy/config/environments/development.rb
1022
996
  - spec/dummy/config/boot.rb
997
+ - spec/dummy/config/locales/en.yml
998
+ - spec/dummy/config/spring.rb
999
+ - spec/dummy/config/environment.rb
1000
+ - spec/dummy/config/initializers/cookies_serializer.rb
1001
+ - spec/dummy/config/initializers/assets.rb
1002
+ - spec/dummy/config/initializers/wrap_parameters.rb
1003
+ - spec/dummy/config/initializers/filter_parameter_logging.rb
1004
+ - spec/dummy/config/routes.rb
1005
+ - spec/dummy/config/database.yml
1006
+ - spec/dummy/bin/bundle
1007
+ - spec/dummy/bin/yarn
1008
+ - spec/dummy/bin/rails
1009
+ - spec/dummy/bin/setup
1010
+ - spec/dummy/bin/rake
1011
+ - spec/dummy/bin/update
1023
1012
  - spec/dummy/config.ru
1013
+ - spec/dummy/db/schema.rb
1014
+ - spec/dummy/db/seeds.rb
1024
1015
  - spec/dummy/package.json
1025
- - spec/dummy/public/character/animations.json
1016
+ - spec/dummy/public/character/magnifying_glass/apparition.svg
1017
+ - spec/dummy/public/character/magnifying_glass/loop.svg
1026
1018
  - spec/dummy/public/character/kibi/failure.svg
1019
+ - spec/dummy/public/character/kibi/jump.svg
1027
1020
  - spec/dummy/public/character/kibi/success2_l.svg
1028
- - spec/dummy/public/character/kibi/passed_with_warnings.svg
1029
1021
  - spec/dummy/public/character/kibi/success_l.svg
1030
1022
  - spec/dummy/public/character/kibi/context.svg
1031
- - spec/dummy/public/character/kibi/jump.svg
1032
- - spec/dummy/public/character/magnifying_glass/loop.svg
1033
- - spec/dummy/public/character/magnifying_glass/apparition.svg
1034
- - spec/dummy/public/error/timeout_1.svg
1035
- - spec/dummy/public/error/500.svg
1036
- - spec/dummy/public/error/timeout_3.svg
1023
+ - spec/dummy/public/character/kibi/passed_with_warnings.svg
1024
+ - spec/dummy/public/character/animations.json
1025
+ - spec/dummy/public/medal/outline.svg
1026
+ - spec/dummy/public/error/403.svg
1037
1027
  - spec/dummy/public/error/404.svg
1038
1028
  - spec/dummy/public/error/timeout_2.svg
1029
+ - spec/dummy/public/error/timeout_1.svg
1039
1030
  - spec/dummy/public/error/401.svg
1040
1031
  - spec/dummy/public/error/410.svg
1041
- - spec/dummy/public/error/403.svg
1042
- - spec/dummy/public/medal/outline.svg
1043
- - spec/dummy/db/seeds.rb
1044
- - spec/dummy/db/schema.rb
1032
+ - spec/dummy/public/error/timeout_3.svg
1033
+ - spec/dummy/public/error/500.svg
1045
1034
  - spec/dummy/Rakefile
1046
- - spec/capybara_helper.rb
1047
- - spec/evaluation_helper.rb
1048
- - spec/mailers/previews/user_mailer_preview.rb
1049
- - spec/mailers/user_mailer_spec.rb
1050
- - spec/api_helper.rb
1051
- - spec/teaspoon_env.rb
1052
- - spec/helpers/certificate_helper_spec.rb
1053
- - spec/helpers/email_helper_spec.rb
1054
- - spec/helpers/exercise_input_helper_spec.rb
1055
- - spec/helpers/avatar_helper_spec.rb
1056
- - spec/helpers/user_activity_helper_spec.rb
1057
- - spec/helpers/with_choices_spec.rb
1058
- - spec/helpers/application_helper_spec.rb
1059
- - spec/helpers/with_navigation_spec.rb
1060
- - spec/helpers/test_results_rendering_spec.rb
1061
- - spec/helpers/breadcrumbs_helper_spec.rb
1062
- - spec/helpers/page_title_helper_spec.rb
1063
- - spec/helpers/authors_helper_spec.rb
1064
- - spec/helpers/icons_helper_spec.rb
1065
1035
  - spec/login_helper.rb
1066
- - spec/features/not_found_public_flow_spec.rb
1067
- - spec/features/login_flow_spec.rb
1068
- - spec/features/disable_user_flow_spec.rb
1069
- - spec/features/links_flow_spec.rb
1070
- - spec/features/home_public_flow_spec.rb
1071
- - spec/features/immersive_redirection_spec.rb
1036
+ - spec/features/chapters_flow_spec.rb
1037
+ - spec/features/exams_flow_spec.rb
1038
+ - spec/features/terms_flow_spec.rb
1072
1039
  - spec/features/exercise_flow_spec.rb
1073
- - spec/features/disabled_organization_flow_spec.rb
1074
- - spec/features/home_private_flow_spec.rb
1040
+ - spec/features/menu_bar_spec.rb
1041
+ - spec/features/guides_flow_spec.rb
1042
+ - spec/features/topic_flow_spec.rb
1043
+ - spec/features/dynamic_exam_spec.rb
1044
+ - spec/features/not_found_private_flow_spec.rb
1045
+ - spec/features/immersive_redirection_spec.rb
1075
1046
  - spec/features/discussion_flow_spec.rb
1047
+ - spec/features/complements_flow_spec.rb
1048
+ - spec/features/lessons_flow_spec.rb
1049
+ - spec/features/login_flow_spec.rb
1050
+ - spec/features/profile_flow_spec.rb
1051
+ - spec/features/certificate_programs_flow_spec.rb
1052
+ - spec/features/home_private_flow_spec.rb
1053
+ - spec/features/disabled_organization_flow_spec.rb
1054
+ - spec/features/home_public_flow_spec.rb
1055
+ - spec/features/not_found_public_flow_spec.rb
1056
+ - spec/features/standard_flow_spec.rb
1076
1057
  - spec/features/runner_assets_spec.rb
1058
+ - spec/features/disable_user_flow_spec.rb
1059
+ - spec/features/links_flow_spec.rb
1077
1060
  - spec/features/progressive_tips_spec.rb
1078
- - spec/features/exams_flow_spec.rb
1079
- - spec/features/chapters_flow_spec.rb
1080
- - spec/features/notifications_flow_spec.rb
1081
- - spec/features/lessons_flow_spec.rb
1082
1061
  - spec/features/invitations_flow_spec.rb
1083
- - spec/features/certificate_programs_flow_spec.rb
1084
- - spec/features/profile_flow_spec.rb
1085
- - spec/features/dynamic_exam_spec.rb
1086
- - spec/features/guide_reset_spec.rb
1087
- - spec/features/topic_flow_spec.rb
1088
- - spec/features/guides_flow_spec.rb
1089
- - spec/features/terms_flow_spec.rb
1090
1062
  - spec/features/user_activity_flow_spec.rb
1091
- - spec/features/standard_flow_spec.rb
1092
- - spec/features/complements_flow_spec.rb
1093
- - spec/features/not_found_private_flow_spec.rb
1094
- - spec/features/menu_bar_spec.rb
1063
+ - spec/features/notifications_flow_spec.rb
1064
+ - spec/features/guide_reset_spec.rb
1065
+ - spec/capybara_helper.rb
1066
+ - spec/helpers/breadcrumbs_helper_spec.rb
1067
+ - spec/helpers/page_title_helper_spec.rb
1068
+ - spec/helpers/with_navigation_spec.rb
1069
+ - spec/helpers/icons_helper_spec.rb
1070
+ - spec/helpers/exercise_input_helper_spec.rb
1071
+ - spec/helpers/user_activity_helper_spec.rb
1072
+ - spec/helpers/email_helper_spec.rb
1073
+ - spec/helpers/avatar_helper_spec.rb
1074
+ - spec/helpers/certificate_helper_spec.rb
1075
+ - spec/helpers/application_helper_spec.rb
1076
+ - spec/helpers/with_choices_spec.rb
1077
+ - spec/helpers/test_results_rendering_spec.rb
1078
+ - spec/helpers/authors_helper_spec.rb
1079
+ - spec/evaluation_helper.rb
1080
+ - spec/controllers/exam_registrations_controller_spec.rb
1081
+ - spec/controllers/certificates_controller_spec.rb
1082
+ - spec/controllers/confirmations_controller_spec.rb
1083
+ - spec/controllers/guide_progress_controller_spec.rb
1084
+ - spec/controllers/discussions_controller_spec.rb
1085
+ - spec/controllers/organizations_api_controller_spec.rb
1086
+ - spec/controllers/chapters_controller_spec.rb
1087
+ - spec/controllers/invitations_controller_spec.rb
1088
+ - spec/controllers/messages_controller_spec.rb
1089
+ - spec/controllers/students_api_controller_spec.rb
1090
+ - spec/controllers/users_controller_spec.rb
1091
+ - spec/controllers/api_clients_controller.rb
1092
+ - spec/controllers/discussions_messages_controller_spec.rb
1093
+ - spec/controllers/exercise_solutions_controller_spec.rb
1094
+ - spec/controllers/courses_api_controller_spec.rb
1095
+ - spec/controllers/exam_authorization_requests_controller_spec.rb
1096
+ - spec/controllers/users_api_controller_spec.rb