mumuki-laboratory 9.0.2 → 9.0.3

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: 3bfbac4c5667f84f0ef0365430b3b8b22bb421d0149a906bff69f7ad8116200a
4
- data.tar.gz: b3a2468082c345db35724748e1e1d992e1a7fd0e4688a480040e873ac5d94650
3
+ metadata.gz: 07b2e50b039758471cfb6e6ce92b5c72de56a3d6edbcc1ddbcdfd12422b51f34
4
+ data.tar.gz: 69b54d57063273a7f3dee32e42126eff821332dbe8acec8f8337f91f1b929b90
5
5
  SHA512:
6
- metadata.gz: 228622d76f975543bac60f7b62f3f1ff28fb831934b1841e2fe1e4faaf6ed31b4301d30815c160c1aaa0b0751df34b056eec22ae0e56fc660261949deb40dd34
7
- data.tar.gz: a5e86b47de449d68553f162bafa77a69c7dc850bbb65efa3ab1c1401c3091da5979453b50d306a1d8a95973ffc29a66ce6f6b9bd2c29e29192c83c0a68d887e3
6
+ metadata.gz: 4acb2a84b7b526ceebc4be7daf104e9a9d614c5659ab853da9614b16b1d3caffdc42c2cfce3fcdb22ee69e364d1339405291644dcf8b8f213e3756daf29d11de
7
+ data.tar.gz: 83e3a2120935b9b87c004d11fbd599ffe3a92093ab2decc2f787a905a4d0c50edb964390275f06452883213d42c03c35832281ad5963340d8f41f5b691b1e23c
@@ -32,9 +32,8 @@ mumuki.faqs = class {
32
32
  }
33
33
 
34
34
  _createNavbarItem($faqsNavbar, faqGroup) {
35
- const $newLink = $('<a></a>').attr("href",`#${faqGroup.id}`)
36
- .html(`${faqGroup.children[0].textContent}`);
37
- const $navItem = $('<li></li>').html($newLink);
35
+ const $navItem = $(`<li><a href="#${faqGroup.id}">`)
36
+ .html(`${faqGroup.querySelector('h2').textContent}`);
38
37
  $faqsNavbar.append($navItem);
39
38
  return $navItem;
40
39
  }
@@ -51,8 +50,19 @@ mumuki.faqs = class {
51
50
  _createFaqsGroups() {
52
51
  const elemsGroups = this._buildFaqsGroups();
53
52
  elemsGroups.forEach((group, index) => {
54
- $(group).wrapAll(`<div class='mu-faqs-group' id='mu-faqs-group-${index}'>`)
53
+ $(group).wrapAll(`<div class='mu-faqs-group' id='mu-faqs-group-${index}'>`);
55
54
  });
55
+ this._createFaqsIcons();
56
+ }
57
+
58
+ _createFaqsIcons() {
59
+ const $faqIcon = $('<i class="mu-faqs-group-icon fa fa-plus">');
60
+ $faqIcon.click(function(e){
61
+ const $elem = $(this);
62
+ $elem.toggleClass('fa-plus fa-minus');
63
+ $elem.closest('.mu-faqs-group').toggleClass('active');
64
+ })
65
+ $('.mu-faqs-group').prepend($faqIcon);
56
66
  }
57
67
 
58
68
  _buildFaqsGroups() {
@@ -1,9 +1,20 @@
1
1
  mumuki.load(() => {
2
- var hash = document.location.hash;
3
- if (hash) {
4
- $(".nav-tabs a[data-target='" + hash + "']").tab('show');
2
+ const $userMenuHeader = $('.mu-user-menu-header');
3
+ let onUserProfile = document.querySelector('.mu-profile-info') !== null;
4
+
5
+ $userMenuHeader.click(() => {
6
+ $('.mu-user-menu-items').toggleClass('hidden-sm-screen');
7
+ $('#mu-user-menu-header-icon').toggleClass('fa-chevron-up fa-chevron-down');
8
+ });
9
+
10
+ if (onUserProfile) {
11
+ $userMenuHeader.click();
5
12
  }
6
- $('a[data-toggle="tab"]').on('show.bs.tab', function (e) {
7
- window.location.hash = $(e.target).attr('data-target');
13
+
14
+ $('.mu-user-menu-item .active').click((e) => {
15
+ if (onUserProfile) {
16
+ e.preventDefault();
17
+ $userMenuHeader.click();
18
+ }
8
19
  });
9
20
  });
@@ -1,11 +1,14 @@
1
1
  .mu-faqs-container {
2
2
  position: relative;
3
3
  display: table;
4
+ width: 100%;
4
5
 
5
6
  .mu-faqs-content {
6
7
  padding-top: 50px;
7
8
 
8
- @media (min-width: $container-sm) {
9
+ width: 100%;
10
+
11
+ @media (min-width: 768px) {
9
12
  width: 75%;
10
13
  float: right;
11
14
  }
@@ -14,14 +17,37 @@
14
17
  padding: 32px;
15
18
  box-shadow: 0 0.375em 2.8125em 0 #d2d5d9;
16
19
  margin-bottom: 32px;
20
+
21
+ @media (max-width: 767px) {
22
+ &:not(.active) {
23
+ h3, p {
24
+ display: none
25
+ }
26
+ h2 {
27
+ margin-bottom: 0px;
28
+ }
29
+ }
30
+ }
31
+
17
32
  h2 {
18
33
  margin-top: 0;
19
34
  margin-bottom: 20px;
20
35
  }
36
+
21
37
  h3 {
22
38
  color: #1A94A3; // should be $brand-secondary
23
39
  margin-top: 40px;
24
40
  }
41
+
42
+ .mu-faqs-group-icon {
43
+ float: right;
44
+ margin-top: 10px;
45
+ cursor: pointer;
46
+ display: none;
47
+ @media (max-width: 767px) {
48
+ display: unset;
49
+ }
50
+ }
25
51
  }
26
52
  }
27
53
 
@@ -31,10 +57,6 @@
31
57
  width: 25%;
32
58
  padding-top: 50px;
33
59
 
34
- @media (min-width: $container-sm) {
35
- display: hidden;
36
- }
37
-
38
60
  ul {
39
61
  border-left: 1px solid $mu-color-disabled;
40
62
  list-style: none;
@@ -1,12 +1,41 @@
1
1
  .mu-user-menu {
2
2
  display: flex;
3
+ margin-top: 25px;
4
+ }
5
+
6
+ .mu-user-menu-content {
7
+ flex-grow: 1;
3
8
  }
4
9
 
5
10
  .mu-user-menu-header {
6
11
  font-size: 15px;
7
12
  color: $mu-color-disabled;
8
13
  text-transform: uppercase;
9
- margin-bottom: 30px;
14
+ padding-left: 2px;
15
+ cursor: pointer;
16
+
17
+ @media only screen and (min-width: $screen-md-min) {
18
+ padding-left: 15px;
19
+ cursor: auto;
20
+
21
+ i {
22
+ display: none;
23
+ }
24
+
25
+ span {
26
+ padding-left: 0px;
27
+ }
28
+ }
29
+ }
30
+
31
+ .mu-user-menu-items {
32
+ margin-top: 30px;
33
+
34
+ &.hidden-sm-screen {
35
+ @media only screen and (max-width: $screen-sm-max) {
36
+ display: none;
37
+ }
38
+ }
10
39
  }
11
40
 
12
41
  .mu-user-menu-item {
@@ -30,6 +59,5 @@
30
59
  border-top: 2px solid $mu-color-separator;
31
60
 
32
61
  margin: 25px 0;
33
- width: 100%
34
62
  }
35
63
  }
@@ -1,22 +1,36 @@
1
1
  module UserMenuHelper
2
+ def user_menu_header
3
+ content_tag :div, user_menu_header_icon, class: 'mu-user-menu-header'
4
+ end
5
+
6
+ def user_menu_divider
7
+ content_tag :div, '', class: 'mu-user-menu-divider horizontal'
8
+ end
9
+
2
10
  def profile_user_menu_link
3
- user_menu_link t(:my_profile), user_path, 'show'
11
+ user_menu_item t(:my_profile), user_path, 'show'
4
12
  end
5
13
 
6
14
  def messages_user_menu_link
7
- user_menu_link t(:messages), messages_user_path, 'messages'
15
+ user_menu_item t(:messages), messages_user_path, 'messages'
8
16
  end
9
17
 
10
18
  def discussions_user_menu_link
11
- user_menu_link t(:discussions), discussions_user_path, 'discussions'
19
+ user_menu_item t(:discussions), discussions_user_path, 'discussions' if current_user&.can_discuss_here?
12
20
  end
13
21
 
14
22
  def certificates_user_menu_link
15
- user_menu_link t(:certificates), certificates_user_path, 'certificates'
23
+ user_menu_item t(:certificates), certificates_user_path, 'certificates'
16
24
  end
17
25
 
18
- def user_menu_link(label, path, active_on)
26
+ private
27
+
28
+ def user_menu_item(label, path, active_on)
19
29
  link_klass = 'active' if action_name == active_on
20
- link_to label, path, { class: link_klass }.compact
30
+ content_tag :div, link_to(label, path, { class: link_klass }.compact), class: 'mu-user-menu-item'
31
+ end
32
+
33
+ def user_menu_header_icon
34
+ fa_icon('chevron-down', text: t(:my_account), id: 'mu-user-menu-header-icon', right: true)
21
35
  end
22
36
  end
@@ -1,3 +1,7 @@
1
+ <% content_for :breadcrumbs do %>
2
+ <%= header_breadcrumbs %>
3
+ <% end %>
4
+
1
5
  <div class="mu-faqs">
2
6
  <h1><%= t(:faqs) %></h1>
3
7
 
@@ -5,7 +9,7 @@
5
9
  <div class="mu-faqs-content">
6
10
  <%= @faqs %>
7
11
  </div>
8
- <div class="mu-faqs-navbar">
12
+ <div class="mu-faqs-navbar hidden-xs">
9
13
  <nav>
10
14
  <ul>
11
15
  </ul>
@@ -1,25 +1,17 @@
1
- <div class="col-md-3 mu-tab-body mu-user-menu">
2
- <div class="col-md-12">
3
- <div class="mu-user-menu-header">
4
- <%= t(:my_account) %>
5
- </div>
6
- <div class="mu-user-menu-item">
7
- <%= profile_user_menu_link %>
8
- </div>
9
- <div class="mu-user-menu-divider horizontal"></div>
10
- <div class="mu-user-menu-item">
11
- <%= messages_user_menu_link %>
12
- </div>
13
- <% if current_user&.can_discuss_here? %>
14
- <div class="mu-user-menu-item">
1
+ <div class="col-md-3 mu-tab-body">
2
+ <div class="mu-user-menu">
3
+ <div class="mu-user-menu-content">
4
+ <%= user_menu_header %>
5
+ <div class="col-xs-12 mu-user-menu-items hidden-sm-screen">
6
+ <%= profile_user_menu_link %>
7
+ <%= user_menu_divider %>
8
+ <%= messages_user_menu_link %>
15
9
  <%= discussions_user_menu_link %>
10
+ <%= user_menu_divider %>
11
+ <%= certificates_user_menu_link %>
16
12
  </div>
17
- <% end %>
18
- <div class="mu-user-menu-divider horizontal"></div>
19
- <div class="mu-user-menu-item">
20
- <%= certificates_user_menu_link %>
21
13
  </div>
14
+ <div class="mu-user-menu-divider vertical hidden-sm hidden-xs"></div>
22
15
  </div>
23
- <div class="mu-user-menu-divider vertical hidden-sm hidden-xs"></div>
24
16
  </div>
25
17
  <div class="mu-user-menu-divider horizontal visible-sm visible-xs"></div>
@@ -4,15 +4,15 @@
4
4
 
5
5
  <%= render partial: 'layouts/user_menu' %>
6
6
 
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 %>
7
+ <div class="col-md-9 mu-tab-body">
8
+ <div class="mu-user-header">
9
+ <h1><%= t(:certificates) %></h1>
13
10
  </div>
14
- <% else %>
15
- <div class="col-md-9 mu-tab-body">
11
+ <% if @certificates.empty? %>
12
+ <div class="mu-tab-body">
13
+ <%= t :certificates_will_be_here %>
14
+ </div>
15
+ <% else %>
16
16
  <div class="col-md-12">
17
17
  <div class="mu-list-group">
18
18
  <% @certificates.each do |certificate| %>
@@ -28,5 +28,5 @@
28
28
  <% end %>
29
29
  </div>
30
30
  </div>
31
- </div>
32
- <% end %>
31
+ <% end %>
32
+ </div>
@@ -1,5 +1,5 @@
1
1
  module Mumuki
2
2
  module Laboratory
3
- VERSION = '9.0.2'
3
+ VERSION = '9.0.3'
4
4
  end
5
5
  end
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.0.2
4
+ version: 9.0.3
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-03-09 00:00:00.000000000 Z
11
+ date: 2021-03-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails