zutils 0.2.9 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +0 -0
- data/CODE_OF_CONDUCT.md +0 -0
- data/Gemfile +0 -0
- data/LICENSE.txt +0 -0
- data/README.md +0 -0
- data/Rakefile +0 -0
- data/app/assets/javascripts/zutils.js +15 -15
- data/app/assets/stylesheets/zutils.scss +0 -0
- data/app/views/shared/_action_links.html.erb +0 -0
- data/app/views/shared/_fields.html.erb +0 -0
- data/app/views/shared/_form.html.erb +0 -0
- data/app/views/shared/_index.html.erb +0 -0
- data/app/views/shared/_list.html.erb +0 -0
- data/app/views/shared/_modal.html.erb +2 -1
- data/app/views/shared/_show.html.erb +0 -0
- data/bin/console +0 -0
- data/bin/setup +0 -0
- data/lib/zutils/engine.rb +0 -0
- data/lib/zutils/version.rb +1 -1
- data/lib/zutils.rb +0 -0
- data/zutils.gemspec +0 -0
- 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: 1d42c0ca73acc3b60f21f106ccfb6804837fd6c0e6b258d40a4af40368eeeeb5
|
4
|
+
data.tar.gz: deeceb71569ee50e98da90961156861495dcc00ed980b5203e11702b9ca71d1b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: fc216d04eea9dd9998e4097f6559235e1d51ca68fcefd991e24a189b669b839cd9bd8da399b5caa11d6603ce367dead9af8697baddd312e0c1a0a418a20140bf
|
7
|
+
data.tar.gz: 99e17283c693805e48c7d907d9dffda992475b257a1600bed2c0861d107364d9e94bef11ff83ff6fa25a0bdb57fc124b817096a4dfd584ead750d952c91bea23
|
data/.gitignore
CHANGED
File without changes
|
data/CODE_OF_CONDUCT.md
CHANGED
File without changes
|
data/Gemfile
CHANGED
File without changes
|
data/LICENSE.txt
CHANGED
File without changes
|
data/README.md
CHANGED
File without changes
|
data/Rakefile
CHANGED
File without changes
|
@@ -8,26 +8,26 @@ $(document).ready(function () {
|
|
8
8
|
create: function(input, callback) {
|
9
9
|
selectizeCallback = callback;
|
10
10
|
|
11
|
-
$("." + $(item).data('
|
12
|
-
$("#" + $(item).data('
|
11
|
+
$("." + $(item).data('name') + "-modal").modal();
|
12
|
+
$("#" + $(item).data('name') + "_cpf").val(input);
|
13
13
|
}
|
14
14
|
});
|
15
15
|
|
16
|
-
$("." + $(item).data('
|
16
|
+
$("." + $(item).data('name') + "-modal").on("hide.bs.modal", function(e) {
|
17
17
|
if (selectizeCallback != null) {
|
18
18
|
selectizeCallback();
|
19
19
|
selecitzeCallback = null;
|
20
20
|
}
|
21
21
|
|
22
|
-
$("
|
23
|
-
$("
|
24
|
-
$.rails.enableFormElements($("
|
22
|
+
$("." + $(item).data('name') + "-modal form").trigger("reset");
|
23
|
+
$("." + $(item).data('name') + "-modal form select").val(null).trigger('change');
|
24
|
+
$.rails.enableFormElements($("." + $(item).data('name') + "-modal form"));
|
25
25
|
});
|
26
26
|
|
27
|
-
$("
|
27
|
+
$("." + $(item).data('name') + "-modal form").on("submit", function(e) {
|
28
28
|
e.preventDefault();
|
29
|
-
$("
|
30
|
-
$("
|
29
|
+
$("." + $(item).data('name') + "-modal form").find('.has-error').removeClass('has-error');
|
30
|
+
$("." + $(item).data('name') + "-modal form").find('.help-block').text("");
|
31
31
|
$.ajax({
|
32
32
|
method: "POST",
|
33
33
|
dataType: "json",
|
@@ -37,17 +37,17 @@ $(document).ready(function () {
|
|
37
37
|
selectizeCallback({value: response.id, text: response.name});
|
38
38
|
selectizeCallback = null;
|
39
39
|
|
40
|
-
$("." + $(item).data('
|
40
|
+
$("." + $(item).data('name') + "-modal").modal('toggle');
|
41
41
|
},
|
42
42
|
error: function(response) {
|
43
43
|
$.each(response.responseJSON, function(key, value) {
|
44
|
-
$("
|
45
|
-
if (!($("
|
46
|
-
$("
|
44
|
+
$("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).addClass('has-error');
|
45
|
+
if (!($("." + $(item).data('name') + "-modal form" + " ." + $(item).data('model') + '_' + key).find('.help-block').length)) {
|
46
|
+
$("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).append("<p class='help-block'></p>");
|
47
47
|
}
|
48
|
-
$("
|
48
|
+
$("." + $(item).data('name') + "-modal form").find("." + $(item).data('model') + '_' + key).find('.help-block').text(value);
|
49
49
|
});
|
50
|
-
$.rails.enableFormElements($("
|
50
|
+
$.rails.enableFormElements($("." + $(item).data('name') + "-modal form" + ""));
|
51
51
|
}
|
52
52
|
});
|
53
53
|
});
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<% partial ||= 'shared/fields' %>
|
2
|
+
<% name ||= object.model_name.singular %>
|
2
3
|
|
3
|
-
<div class="modal fade in <%=
|
4
|
+
<div class="modal fade in <%= name %>-modal" id="modal-default">
|
4
5
|
<div class="modal-dialog">
|
5
6
|
<div class="modal-content">
|
6
7
|
<div class="modal-header">
|
File without changes
|
data/bin/console
CHANGED
File without changes
|
data/bin/setup
CHANGED
File without changes
|
data/lib/zutils/engine.rb
CHANGED
File without changes
|
data/lib/zutils/version.rb
CHANGED
data/lib/zutils.rb
CHANGED
File without changes
|
data/zutils.gemspec
CHANGED
File without changes
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zutils
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ricardo Viana
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-02-
|
11
|
+
date: 2019-02-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|