trestle-mobility 1.2.0 → 1.3.0

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: a1d5aa705c867a39c105fcdc6e621d783f6485d40347ca6c62ebdbe5b9cd0fe7
4
- data.tar.gz: 958dfef164ef8b039adaa59e347644f84bdb4c341db3b6aa41a5d98381612177
3
+ metadata.gz: 534bbecb7fccb11699d0fbfc244f64bbf0655cde3acc2374c3673d1aa4697082
4
+ data.tar.gz: 51120c779a740d504aa7e9e29d74c68a855323a8e7bff76845a393c39e2f7446
5
5
  SHA512:
6
- metadata.gz: ad09d055e86c09e63e1b29a13e787757afd0247b99f2c5c74257c7823b5dbbbf5b2540fa3d5287011d04772c584c82d3dd7a940e0ba671273b934e2c60550e00
7
- data.tar.gz: 40636a3d7d8763c587e04d852e83d0cb786bba4eb2757131efae349a9564d26f9446bd2d311d82636dadb67ce73b9af3e4a4a44e9c1afc2c2e9be9c0f953f258
6
+ metadata.gz: 80ca367f0af684735c30f2170f2008c5aaed9392a1f184b2d9c52b1894fe87c821269c01d90a0f7eb0ddc8ab7abc02e8276e7b115b3301d5fe88dac55a12d96b
7
+ data.tar.gz: 634582ad49e6fd9865bf0278a470b17c37ce5c0ea3cdfcad9663c85a820dfbf9a6281a23fa27040f2c364011154c5a61b71791c6efbb09a27bd34eb2363a5e94
@@ -6,6 +6,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
 
7
7
  ## [Unreleased]
8
8
 
9
+ ## [1.3.0] - 2019-11-08
10
+ ### Added
11
+ - Support for Bootstrap 4 (that comes with Trestle 0.9.0)
12
+
9
13
  ## [1.2.0] - 2019-08-14
10
14
  ### Added
11
15
  - Start documenting changes
data/README.md CHANGED
@@ -9,8 +9,6 @@
9
9
  - Manage Mobility translations with a space-efficient dropdown interface in Trestle
10
10
  - Supports text fields, text area's and check boxes
11
11
  - Integrates with [DeepL Pro](https://www.deepl.com/pro.html) to automatically translate fields
12
- - Developed for usage with Mobility's Postgres container back-end
13
- - Probably works with other back-ends but has not been tested
14
12
 
15
13
  <img src="/screenshot.png?raw=true" width="529" height="242" alt="Trestle Mobility screenshot" />
16
14
 
@@ -22,7 +22,7 @@ Trestle.init(function(e, root) {
22
22
  this.$inputFields.each(function() {
23
23
  var field = $(this);
24
24
  var active = field.data('locale') !== self.activeLocale;
25
- field.toggleClass('hidden', active)
25
+ field.toggleClass('mobility-field--hidden', active)
26
26
  })
27
27
 
28
28
  this.$dropdownItems.each(function() {
@@ -1,28 +1,64 @@
1
1
  .mobility {
2
+ .input-group-prepend {
3
+ display: flex;
4
+
5
+ .btn {
6
+ border-top-right-radius: 0;
7
+ border-bottom-right-radius: 0;
8
+ }
9
+ }
10
+
11
+ .dropdown-toggle {
12
+ border-width: 1px;
13
+ }
14
+
15
+ .dropdown-item {
16
+ display: block;
17
+ width: 100%;
18
+ padding: .25rem 1.5rem;
19
+ clear: both;
20
+ font-weight: 400;
21
+ text-align: inherit;
22
+ white-space: nowrap;
23
+ border: 0;
24
+
25
+ &:not(:hover, .active) {
26
+ color: #212529;
27
+ background-color: transparent;
28
+ }
29
+ }
30
+
2
31
  .dropdown-item.disabled,
3
32
  .dropdown-item.disabled:visited,
4
33
  .dropdown-item.disabled:active,
5
34
  .dropdown-item.disabled:hover {
6
- background-color:#d9d9d9 !important;
7
- color:#aaa !important;
35
+ background-color: #d9d9d9 !important;
36
+ color: #aaa !important;
8
37
  opacity: 0.7;
9
38
  cursor: default;
10
39
  }
11
- }
12
40
 
13
- .mobility-checkbox {
14
- display: flex;
15
- align-items:center;
41
+ .form-control {
42
+ border-left-width: 0;
43
+ border-top-right-radius: .25rem !important;
44
+ border-bottom-right-radius: .25rem !important;
45
+ }
16
46
  }
17
47
 
18
- .mobility-checkbox__label {
19
- margin-left: 8px;
48
+ .mobility-field {
49
+ &--hidden {
50
+ display: none !important;
51
+ }
20
52
  }
21
53
 
22
-
23
- .mobility__deepl-progress {
24
- display: none;
25
- margin-right: 4px;
54
+ .mobility-checkbox {
55
+ margin-right: 0;
56
+ flex: 1;
57
+ padding: 0 8px;
58
+ border: solid #ccc;
59
+ border-width: 1px 1px 1px;
60
+ border-top-right-radius: .25rem;
61
+ border-bottom-right-radius: .25rem;
26
62
  }
27
63
 
28
64
  .mobility__deepl {
@@ -30,10 +66,8 @@
30
66
  margin-top: 4px;
31
67
  text-align: right;
32
68
 
33
- .progress {
34
- display: inline-block;
35
- width: 97px;
36
- margin-right: 4px;
69
+ .spinner-border {
70
+ display: none;
37
71
  }
38
72
 
39
73
  &--actionable {
@@ -41,7 +75,7 @@
41
75
  }
42
76
 
43
77
  &--active {
44
- .mobility__deepl-progress {
78
+ .spinner-border {
45
79
  display: inline-block;
46
80
  }
47
81
  }
@@ -1,20 +1,20 @@
1
1
  <div class="form-group mobility" data-active="<%= selected %>">
2
2
  <div class="input-group">
3
- <div class="input-group-btn">
4
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
3
+ <div class="input-group-prepend">
4
+ <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5
5
  <span class="mobility-active"><%= "#{EmojiFlag.new(selected)} #{selected.upcase}" %></span> <span class="caret"></span>
6
6
  </button>
7
- <ul class="dropdown-menu mobility__languages">
7
+ <div class="dropdown-menu mobility__languages">
8
8
  <% locales.each do |locale| %>
9
- <li><a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a></li>
9
+ <a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
10
10
  <% end %>
11
- </ul>
11
+ </div>
12
12
  </div>
13
13
  <% locales.each do |locale| %>
14
14
  <%=
15
- content_tag(:div, "#{field_name.to_s.humanize} (#{locale.upcase})", { class: "form-control mobility-checkbox mobility-field#{locale == selected ? '' : ' hidden'}", data: { locale: locale } }) do
16
- builder.raw_check_box("#{field_name}_#{locale}", { class: "mobility-checkbox__input" }, "1", "0") +
17
- builder.label("#{field_name}_#{locale}", "#{label} (#{locale.upcase})", class: "mobility-checkbox__label")
15
+ content_tag(:div, "#{field_name.to_s.humanize} (#{locale.upcase})", { class: "form-check form-check-inline mobility-checkbox mobility-field#{locale == selected ? '' : ' mobility-field--hidden'}", data: { locale: locale } }) do
16
+ builder.raw_check_box("#{field_name}_#{locale}", { class: "form-check-input mobility-checkbox__input" }, "1", "0") +
17
+ builder.label("#{field_name}_#{locale}", "#{label} (#{locale.upcase})", class: "form-check-label mobility-checkbox__label")
18
18
  end
19
19
  %>
20
20
  <% end %>
@@ -1,14 +1,13 @@
1
1
  <div class="mobility__deepl" data-remote-path="<%= trestle.translate_path %>" data-deepl-query-params="<%= deepl_query_params %>">
2
- <small class="mobility__deepl-progress">Translating…</small>
3
-
4
2
  <div class="btn-group">
5
- <button class="btn btn-default btn-xs dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
6
- Translate from <span class="caret"></span>
3
+ <button class="btn btn-secondary btn-sm dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4
+ <span class="spinner-border spinner-border-sm" role="status" aria-hidden="true"></span>
5
+ Translate from
7
6
  </button>
8
- <ul class="dropdown-menu mobility__deepl-languages">
7
+ <div class="dropdown-menu mobility__deepl-languages">
9
8
  <% locales.each do |locale| %>
10
- <li><a href="javascript:void(0)" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a></li>
9
+ <a href="javascript:void(0)" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
11
10
  <% end %>
12
- </ul>
11
+ </div>
13
12
  </div>
14
13
  </div>
@@ -1,19 +1,21 @@
1
1
  <div class="form-group mobility" data-active="<%= selected %>">
2
2
  <div class="input-group">
3
- <button type="button" class="btn btn-default dropdown-toggle input-group-addon" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
4
- <span class="mobility-active"><%= "#{EmojiFlag.new(selected)} #{selected.upcase}" %></span> <span class="caret"></span>
5
- </button>
6
- <ul class="dropdown-menu mobility__languages">
7
- <% locales.each do |locale| %>
8
- <li><a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a></li>
9
- <% end %>
10
- </ul>
11
- <% locales.each do |locale, index| %>
3
+ <div class="input-group-prepend">
4
+ <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5
+ <span class="mobility-active"><%= "#{EmojiFlag.new(selected)} #{selected.upcase}" %></span> <span class="caret"></span>
6
+ </button>
7
+ <div class="dropdown-menu mobility__languages">
8
+ <% locales.each do |locale| %>
9
+ <a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
10
+ <% end %>
11
+ </div>
12
+ </div>
13
+ <% locales.each do |locale| %>
12
14
  <%=
13
15
  builder.raw_text_area(
14
16
  "#{field_name}_#{locale}",
15
17
  options.merge(
16
- class: "form-control mobility-field#{locale == selected ? '' : ' hidden'}",
18
+ class: "form-control mobility-field#{locale == selected ? '' : ' mobility-field--hidden'}",
17
19
  placeholder: "#{label} (#{locale.upcase})",
18
20
  data: { locale: locale }
19
21
  )
@@ -1,21 +1,21 @@
1
1
  <div class="form-group mobility" data-active="<%= selected %>">
2
2
  <div class="input-group">
3
- <div class="input-group-btn">
4
- <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
3
+ <div class="input-group-prepend">
4
+ <button class="btn btn-outline-secondary dropdown-toggle" type="button" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
5
5
  <span class="mobility-active"><%= "#{EmojiFlag.new(selected)} #{selected.upcase}" %></span> <span class="caret"></span>
6
6
  </button>
7
- <ul class="dropdown-menu mobility__languages">
7
+ <div class="dropdown-menu mobility__languages">
8
8
  <% locales.each do |locale| %>
9
- <li><a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a></li>
9
+ <a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
10
10
  <% end %>
11
- </ul>
11
+ </div>
12
12
  </div>
13
13
  <% locales.each do |locale| %>
14
14
  <%=
15
15
  builder.raw_text_field(
16
16
  "#{field_name}_#{locale}",
17
17
  options.merge(
18
- class: "form-control mobility-field#{locale == selected ? '' : ' hidden'}",
18
+ class: "form-control mobility-field#{locale == selected ? '' : ' mobility-field--hidden'}",
19
19
  placeholder: "#{label} (#{locale.upcase})",
20
20
  data: { locale: locale }
21
21
  )
@@ -1,5 +1,5 @@
1
1
  module Trestle
2
2
  module Mobility
3
- VERSION = "1.2.0"
3
+ VERSION = "1.3.0"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trestle-mobility
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.0
4
+ version: 1.3.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Richard Venneman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-14 00:00:00.000000000 Z
11
+ date: 2019-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: emoji_flag