mumuki-laboratory 9.0.1 → 9.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (39) hide show
  1. checksums.yaml +4 -4
  2. data/app/assets/javascripts/mumuki_laboratory/application/certificate.js +17 -0
  3. data/app/assets/javascripts/mumuki_laboratory/application/faqs.js +80 -0
  4. data/app/assets/stylesheets/mumuki_laboratory/application/_modules.scss +2 -0
  5. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_certificate.scss +33 -0
  6. data/app/assets/stylesheets/mumuki_laboratory/application/modules/_faqs.scss +62 -0
  7. data/app/controllers/certificates_controller.rb +28 -0
  8. data/app/controllers/concerns/with_certificate_render.rb +25 -0
  9. data/app/controllers/faqs_controller.rb +6 -0
  10. data/app/controllers/users_controller.rb +4 -0
  11. data/app/helpers/certificate_helper.rb +13 -0
  12. data/app/helpers/links_helper.rb +8 -0
  13. data/app/helpers/menu_bar_helper.rb +14 -10
  14. data/app/helpers/user_menu_helper.rb +4 -0
  15. data/app/mailers/application_mailer.rb +0 -1
  16. data/app/mailers/user_mailer.rb +9 -0
  17. data/app/views/certificates/_certificate.html.erb +44 -0
  18. data/app/views/certificates/_download.html.erb +20 -0
  19. data/app/views/certificates/verify.html.erb +40 -0
  20. data/app/views/faqs/index.html.erb +16 -0
  21. data/app/views/layouts/_user_menu.html.erb +4 -0
  22. data/app/views/layouts/application.html.erb +6 -1
  23. data/app/views/layouts/exercise_inputs/editors/_code.html.erb +2 -1
  24. data/app/views/user_mailer/certificate.html.erb +339 -0
  25. data/app/views/user_mailer/certificate.text.erb +10 -0
  26. data/app/views/users/certificates.html.erb +32 -0
  27. data/config/routes.rb +6 -0
  28. data/lib/mumuki/laboratory/locales/en.yml +7 -0
  29. data/lib/mumuki/laboratory/locales/es-CL.yml +7 -0
  30. data/lib/mumuki/laboratory/locales/es.yml +7 -0
  31. data/lib/mumuki/laboratory/locales/pt.yml +7 -0
  32. data/lib/mumuki/laboratory/version.rb +1 -1
  33. data/spec/controllers/certificates_controller_spec.rb +15 -0
  34. data/spec/dummy/db/schema.rb +2 -1
  35. data/spec/features/certificate_programs_flow_spec.rb +17 -0
  36. data/spec/features/menu_bar_spec.rb +20 -0
  37. data/spec/features/profile_flow_spec.rb +12 -0
  38. data/spec/helpers/certificate_helper_spec.rb +15 -0
  39. metadata +67 -4
@@ -0,0 +1,20 @@
1
+ <%= wicked_pdf_stylesheet_link_tag 'pdf' -%>
2
+ <%= wicked_pdf_stylesheet_link_tag 'mumuki_laboratory/application', media: 'all' %>
3
+ <style>
4
+ html, body {
5
+ overflow: hidden;
6
+ height: 210mm;
7
+ width: 297mm;
8
+ max-height: 210mm;
9
+ max-width: 297mm;
10
+ min-height: 210mm;
11
+ min-width: 297mm;
12
+ margin: 0;
13
+ padding: 0;
14
+ box-sizing: border-box;
15
+ position: relative;
16
+ }
17
+ </style>
18
+
19
+ <%= render partial: 'certificates/certificate', locals: { certificate: certificate } %>
20
+
@@ -0,0 +1,40 @@
1
+ <%= content_for :breadcrumbs do %>
2
+ <%= home_breadcrumb %>
3
+ <% end %>
4
+
5
+ <h1><%= t :certificate %>: <%= @certificate.title %></h1>
6
+
7
+ <div class="container">
8
+ <div class="row mu-certificate-data">
9
+ <div class="col-md-6">
10
+ <div class="row text-center jumbotron">
11
+ <div class="col-md-12">
12
+ <h3 class="mu-certificate-name">
13
+ <%= t :completed_by %>
14
+ <strong><%= @certificate.user.formal_full_name %></strong>
15
+ </h3>
16
+ <div><small><%= @certificate.created_at.to_date %></small></div>
17
+ <span><%= t(:certificate_verified_legend, description: @certificate.description, full_name: @certificate.user.formal_full_name).html_safe %></span>
18
+ </div>
19
+ </div>
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">
24
+ </a>
25
+ <a class="btn btn-success 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>
28
+ </a>
29
+ </div>
30
+ <% end %>
31
+ </div>
32
+ <div class="certificate-preview col-md-6">
33
+ <%= render partial: 'certificates/certificate', locals: { certificate: @certificate } %>
34
+ </div>
35
+ </div>
36
+ </div>
37
+
38
+ <%= content_for :profile do %>
39
+ <%= home_breadcrumb %>
40
+ <% end %>
@@ -0,0 +1,16 @@
1
+ <div class="mu-faqs">
2
+ <h1><%= t(:faqs) %></h1>
3
+
4
+ <div class="mu-faqs-container">
5
+ <div class="mu-faqs-content">
6
+ <%= @faqs %>
7
+ </div>
8
+ <div class="mu-faqs-navbar">
9
+ <nav>
10
+ <ul>
11
+ </ul>
12
+ </nav>
13
+ </div>
14
+ </div>
15
+
16
+ </div>
@@ -15,6 +15,10 @@
15
15
  <%= discussions_user_menu_link %>
16
16
  </div>
17
17
  <% end %>
18
+ <div class="mu-user-menu-divider horizontal"></div>
19
+ <div class="mu-user-menu-item">
20
+ <%= certificates_user_menu_link %>
21
+ </div>
18
22
  </div>
19
23
  <div class="mu-user-menu-divider vertical hidden-sm hidden-xs"></div>
20
24
  </div>
@@ -36,7 +36,11 @@
36
36
  <% if any_menu_bar_links? %>
37
37
  <li class="divider"></li>
38
38
  <% end %>
39
- <%= logout_link %>
39
+ <% if faqs_enabled_here? %>
40
+ <%= menu_link_to_faqs %>
41
+ <li class="divider"></li>
42
+ <% end %>
43
+ <%= logout_menu_link %>
40
44
  </ul>
41
45
  </div>
42
46
  <% else %>
@@ -62,6 +66,7 @@
62
66
  </div>
63
67
 
64
68
  <div class="mu-footer-terms">
69
+ <div><%= link_to_faqs %></div>
65
70
  <div><%= link_to_profile_terms %></div>
66
71
  <% if current_user&.can_discuss_here? %>
67
72
  <div><%= link_to_forum_terms %></div>
@@ -3,7 +3,8 @@
3
3
  placeholder: t(:editor_placeholder),
4
4
  class: 'form-control editor',
5
5
  value: @current_content,
6
- data: {lines: 17} %>
6
+ data: {lines: 17},
7
+ autocomplete: 'off' %>
7
8
  <div class="mu-overlapped">
8
9
  <a class="editor-resize"> <%= expand_icon %></a>
9
10
  <a class="editor-format"><%= format_icon %></a>
@@ -0,0 +1,339 @@
1
+ <center>
2
+ <table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" id="bodyTable">
3
+ <tbody><tr>
4
+ <td align="center" valign="top" id="bodyCell">
5
+ <!-- BEGIN TEMPLATE // -->
6
+ <table border="0" cellpadding="0" cellspacing="0" width="100%">
7
+ <tbody><tr>
8
+ <td align="center" valign="top" id="templateHeader" data-template-container="">
9
+ <!--[if (gte mso 9)|(IE)]>
10
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
11
+ <tr>
12
+ <td align="center" valign="top" width="600" style="width:600px;">
13
+ <![endif]-->
14
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
15
+ <tbody><tr>
16
+ <td valign="top" class="headerContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailTextBlock" style="min-width:100%;">
17
+ <tbody class="muMailTextBlockOuter">
18
+ <tr>
19
+ <td valign="top" class="muMailTextBlockInner" style="padding-top:9px;">
20
+ <!--[if mso]>
21
+ <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
22
+ <tr>
23
+ <![endif]-->
24
+
25
+ <!--[if mso]>
26
+ <td valign="top" width="600" style="width:600px;">
27
+ <![endif]-->
28
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%; min-width:100%;" width="100%" class="muMailTextContentContainer">
29
+ <tbody><tr>
30
+
31
+ <td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
32
+
33
+ <h1><span style="color:#FFFFFF"><%= t :new_certificate_mailer_title %></span></h1>
34
+
35
+ </td>
36
+ </tr>
37
+ </tbody></table>
38
+ <!--[if mso]>
39
+ </td>
40
+ <![endif]-->
41
+
42
+ <!--[if mso]>
43
+ </tr>
44
+ </table>
45
+ <![endif]-->
46
+ </td>
47
+ </tr>
48
+ </tbody>
49
+ </table></td>
50
+ </tr>
51
+ </tbody></table>
52
+ <!--[if (gte mso 9)|(IE)]>
53
+ </td>
54
+ </tr>
55
+ </table>
56
+ <![endif]-->
57
+ </td>
58
+ </tr>
59
+ <tr>
60
+ <td align="center" valign="top" id="templateBody" data-template-container="">
61
+ <!--[if (gte mso 9)|(IE)]>
62
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
63
+ <tr>
64
+ <td align="center" valign="top" width="600" style="width:600px;">
65
+ <![endif]-->
66
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
67
+ <tbody><tr>
68
+ <td valign="top" class="bodyContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailCaptionBlock">
69
+ <tbody class="muMailCaptionBlockOuter">
70
+ <tr>
71
+ <td class="muMailCaptionBlockInner" valign="top" style="padding:9px;">
72
+
73
+
74
+
75
+
76
+ <table border="0" cellpadding="0" cellspacing="0" class="muMailCaptionRightContentOuter" width="100%">
77
+ <tbody><tr>
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">
93
+ <tbody><tr>
94
+ <td valign="top" class="muMailTextContent">
95
+ <h3 class="null" style="text-align: center;"><br>
96
+ <span style="font-size:24px"><%= t :new_certificate_mailer_p1 %></span></h3>
97
+
98
+ <div style="text-align: center;"><br>
99
+ <span style="font-size:16px"><%= t :new_certificate_mailer_p2 %></span></div>
100
+
101
+ </td>
102
+ </tr>
103
+ </tbody></table>
104
+ </td>
105
+ </tr>
106
+ </tbody></table>
107
+
108
+
109
+
110
+
111
+ </td>
112
+ </tr>
113
+ </tbody>
114
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailButtonBlock" style="min-width:100%;">
115
+ <tbody class="muMailButtonBlockOuter">
116
+ <tr>
117
+ <td style="padding-top:0; padding-right:18px; padding-bottom:18px; padding-left:18px;" valign="top" align="center" class="muMailButtonBlockInner">
118
+ </td>
119
+ </tr>
120
+ </tbody>
121
+ </table></td>
122
+ </tr>
123
+ </tbody></table>
124
+ <!--[if (gte mso 9)|(IE)]>
125
+ </td>
126
+ </tr>
127
+ </table>
128
+ <![endif]-->
129
+ </td>
130
+ </tr>
131
+ <tr>
132
+ <td align="center" valign="top" id="templateFooter" data-template-container="">
133
+ <!--[if (gte mso 9)|(IE)]>
134
+ <table align="center" border="0" cellspacing="0" cellpadding="0" width="600" style="width:600px;">
135
+ <tr>
136
+ <td align="center" valign="top" width="600" style="width:600px;">
137
+ <![endif]-->
138
+ <table align="center" border="0" cellpadding="0" cellspacing="0" width="100%" class="templateContainer">
139
+ <tbody><tr>
140
+ <td valign="top" class="footerContainer"><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowBlock" style="min-width:100%;">
141
+ <tbody class="muMailFollowBlockOuter">
142
+ <tr>
143
+ <td align="center" valign="top" style="padding:9px" class="muMailFollowBlockInner">
144
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentContainer" style="min-width:100%;">
145
+ <tbody><tr>
146
+ <td align="center" style="padding-left:9px;padding-right:9px;">
147
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width:100%;" class="muMailFollowContent">
148
+ <tbody><tr>
149
+ <td align="center" valign="top" style="padding-top:9px; padding-right:9px; padding-left:9px;">
150
+ <table align="center" border="0" cellpadding="0" cellspacing="0">
151
+ <tbody><tr>
152
+ <td align="center" valign="top">
153
+ <!--[if mso]>
154
+ <table align="center" border="0" cellspacing="0" cellpadding="0">
155
+ <tr>
156
+ <![endif]-->
157
+
158
+ <!--[if mso]>
159
+ <td align="center" valign="top">
160
+ <![endif]-->
161
+
162
+
163
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
164
+ <tbody><tr>
165
+ <td valign="top" style="padding-right:10px; padding-bottom:9px;" class="muMailFollowContentItemContainer">
166
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
167
+ <tbody><tr>
168
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
169
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
170
+ <tbody><tr>
171
+
172
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
173
+ <a href="http://www.facebook.com/MumukiOrg" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-facebook-48.png" style="display:block;" height="24" width="24" class=""></a>
174
+ </td>
175
+
176
+
177
+ </tr>
178
+ </tbody></table>
179
+ </td>
180
+ </tr>
181
+ </tbody></table>
182
+ </td>
183
+ </tr>
184
+ </tbody></table>
185
+
186
+ <!--[if mso]>
187
+ </td>
188
+ <![endif]-->
189
+
190
+ <!--[if mso]>
191
+ <td align="center" valign="top">
192
+ <![endif]-->
193
+
194
+
195
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
196
+ <tbody><tr>
197
+ <td valign="top" style="padding-right:10px; padding-bottom:9px;" class="muMailFollowContentItemContainer">
198
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
199
+ <tbody><tr>
200
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
201
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
202
+ <tbody><tr>
203
+
204
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
205
+ <a href="http://www.twitter.com/MumukiOrg" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-twitter-48.png" style="display:block;" height="24" width="24" class=""></a>
206
+ </td>
207
+
208
+
209
+ </tr>
210
+ </tbody></table>
211
+ </td>
212
+ </tr>
213
+ </tbody></table>
214
+ </td>
215
+ </tr>
216
+ </tbody></table>
217
+
218
+ <!--[if mso]>
219
+ </td>
220
+ <![endif]-->
221
+
222
+ <!--[if mso]>
223
+ <td align="center" valign="top">
224
+ <![endif]-->
225
+
226
+
227
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="display:inline;">
228
+ <tbody><tr>
229
+ <td valign="top" style="padding-right:0; padding-bottom:9px;" class="muMailFollowContentItemContainer">
230
+ <table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailFollowContentItem">
231
+ <tbody><tr>
232
+ <td align="left" valign="middle" style="padding-top:5px; padding-right:10px; padding-bottom:5px; padding-left:9px;">
233
+ <table align="left" border="0" cellpadding="0" cellspacing="0" width="">
234
+ <tbody><tr>
235
+
236
+ <td align="center" valign="middle" width="24" class="muMailFollowIconContent">
237
+ <a href="https://www.youtube.com/channel/UCQmkknsaTT2TDLT_-MDSGvQ" target="_blank"><img src="https://cdn-images.mailchimp.com/icons/social-block-v2/outline-light-youtube-48.png" style="display:block;" height="24" width="24" class=""></a>
238
+ </td>
239
+
240
+
241
+ </tr>
242
+ </tbody></table>
243
+ </td>
244
+ </tr>
245
+ </tbody></table>
246
+ </td>
247
+ </tr>
248
+ </tbody></table>
249
+
250
+ <!--[if mso]>
251
+ </td>
252
+ <![endif]-->
253
+
254
+ <!--[if mso]>
255
+ </tr>
256
+ </table>
257
+ <![endif]-->
258
+ </td>
259
+ </tr>
260
+ </tbody></table>
261
+ </td>
262
+ </tr>
263
+ </tbody></table>
264
+ </td>
265
+ </tr>
266
+ </tbody></table>
267
+
268
+ </td>
269
+ </tr>
270
+ </tbody>
271
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailDividerBlock" style="min-width:100%;">
272
+ <tbody class="muMailDividerBlockOuter">
273
+ <tr>
274
+ <td class="muMailDividerBlockInner" style="min-width:100%; padding:18px;">
275
+ <table class="muMailDividerContent" border="0" cellpadding="0" cellspacing="0" width="100%" style="min-width: 100%;border-top: 2px solid #505050;">
276
+ <tbody><tr>
277
+ <td>
278
+ <span></span>
279
+ </td>
280
+ </tr>
281
+ </tbody></table>
282
+ <!--
283
+ <td class="muMailDividerBlockInner" style="padding: 18px;">
284
+ <hr class="muMailDividerContent" style="border-bottom-color:none; border-left-color:none; border-right-color:none; border-bottom-width:0; border-left-width:0; border-right-width:0; margin-top:0; margin-right:0; margin-bottom:0; margin-left:0;" />
285
+ -->
286
+ </td>
287
+ </tr>
288
+ </tbody>
289
+ </table><table border="0" cellpadding="0" cellspacing="0" width="100%" class="muMailTextBlock" style="min-width:100%;">
290
+ <tbody class="muMailTextBlockOuter">
291
+ <tr>
292
+ <td valign="top" class="muMailTextBlockInner" style="padding-top:9px;">
293
+ <!--[if mso]>
294
+ <table align="left" border="0" cellspacing="0" cellpadding="0" width="100%" style="width:100%;">
295
+ <tr>
296
+ <![endif]-->
297
+
298
+ <!--[if mso]>
299
+ <td valign="top" width="600" style="width:600px;">
300
+ <![endif]-->
301
+ <table align="left" border="0" cellpadding="0" cellspacing="0" style="max-width:100%; min-width:100%;" width="100%" class="muMailTextContentContainer">
302
+ <tbody><tr>
303
+
304
+ <td valign="top" class="muMailTextContent" style="padding-top:0; padding-right:18px; padding-bottom:9px; padding-left:18px;">
305
+
306
+ © Copyright 2015-<%= DateTime.now.year %>&nbsp;<a href="https://mumuki.org/home/">Mumuki</a><em>.</em><br>
307
+ <br>
308
+ <%= t :stop_emails? %><br>
309
+ <%= link_to t(:cancel_subscription), @organization.url_for("/user/unsubscribe?id=#{@unsubscribe_code}"), target: :_blank %>
310
+ </td>
311
+ </tr>
312
+ </tbody></table>
313
+ <!--[if mso]>
314
+ </td>
315
+ <![endif]-->
316
+
317
+ <!--[if mso]>
318
+ </tr>
319
+ </table>
320
+ <![endif]-->
321
+ </td>
322
+ </tr>
323
+ </tbody>
324
+ </table></td>
325
+ </tr>
326
+ </tbody></table>
327
+ <!--[if (gte mso 9)|(IE)]>
328
+ </td>
329
+ </tr>
330
+ </table>
331
+ <![endif]-->
332
+ </td>
333
+ </tr>
334
+ </tbody></table>
335
+ <!-- // END TEMPLATE -->
336
+ </td>
337
+ </tr>
338
+ </tbody></table>
339
+ </center>