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 +4 -4
- data/CHANGELOG.md +4 -0
- data/README.md +0 -2
- data/app/assets/javascript/trestle/mobility.js +1 -1
- data/app/assets/stylesheets/trestle/mobility.scss +51 -17
- data/app/views/trestle/mobility/_check_box.html.erb +8 -8
- data/app/views/trestle/mobility/_deepl_translation_action.html.erb +6 -7
- data/app/views/trestle/mobility/_text_area.html.erb +12 -10
- data/app/views/trestle/mobility/_text_field.html.erb +6 -6
- data/lib/trestle/mobility/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 534bbecb7fccb11699d0fbfc244f64bbf0655cde3acc2374c3673d1aa4697082
|
4
|
+
data.tar.gz: 51120c779a740d504aa7e9e29d74c68a855323a8e7bff76845a393c39e2f7446
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 80ca367f0af684735c30f2170f2008c5aaed9392a1f184b2d9c52b1894fe87c821269c01d90a0f7eb0ddc8ab7abc02e8276e7b115b3301d5fe88dac55a12d96b
|
7
|
+
data.tar.gz: 634582ad49e6fd9865bf0278a470b17c37ce5c0ea3cdfcad9663c85a820dfbf9a6281a23fa27040f2c364011154c5a61b71791c6efbb09a27bd34eb2363a5e94
|
data/CHANGELOG.md
CHANGED
@@ -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
|
7
|
-
color
|
35
|
+
background-color: #d9d9d9 !important;
|
36
|
+
color: #aaa !important;
|
8
37
|
opacity: 0.7;
|
9
38
|
cursor: default;
|
10
39
|
}
|
11
|
-
}
|
12
40
|
|
13
|
-
.
|
14
|
-
|
15
|
-
|
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-
|
19
|
-
|
48
|
+
.mobility-field {
|
49
|
+
&--hidden {
|
50
|
+
display: none !important;
|
51
|
+
}
|
20
52
|
}
|
21
53
|
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
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
|
-
.
|
34
|
-
display:
|
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
|
-
.
|
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-
|
4
|
-
<button
|
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
|
-
<
|
7
|
+
<div class="dropdown-menu mobility__languages">
|
8
8
|
<% locales.each do |locale| %>
|
9
|
-
<
|
9
|
+
<a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
|
10
10
|
<% end %>
|
11
|
-
</
|
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-
|
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-
|
6
|
-
|
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
|
-
<
|
7
|
+
<div class="dropdown-menu mobility__deepl-languages">
|
9
8
|
<% locales.each do |locale| %>
|
10
|
-
<
|
9
|
+
<a href="javascript:void(0)" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
|
11
10
|
<% end %>
|
12
|
-
</
|
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
|
-
<
|
4
|
-
<
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
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-
|
4
|
-
<button
|
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
|
-
<
|
7
|
+
<div class="dropdown-menu mobility__languages">
|
8
8
|
<% locales.each do |locale| %>
|
9
|
-
<
|
9
|
+
<a href="#<%= "#{field_name}_#{locale}" %>" class="dropdown-item" data-locale="<%= locale %>"><%= "#{EmojiFlag.new(locale)} #{locale.upcase}" %></a>
|
10
10
|
<% end %>
|
11
|
-
</
|
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
|
)
|
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.
|
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
|
11
|
+
date: 2019-11-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: emoji_flag
|