adherent 0.2.2 → 0.2.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/assets/javascripts/adherent/application.js +44 -0
- data/app/assets/javascripts/adherent/common.js +41 -0
- data/app/assets/stylesheets/adherent/print.css.scss +1 -3
- data/config/initializers/date_picker_input.rb +2 -1
- data/config/initializers/french_decimal_input.rb +1 -2
- data/lib/adherent/version.rb +2 -1
- metadata +2 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3ad48df83e2191b086f1877b810ed8df595814ce
|
4
|
+
data.tar.gz: 70a8642236d11c9c8268f600a0ed213d8bbf4393
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: bbb24410d145fa907604124e021f0ded8b6979c74441280025cea3f6081e007b018493b82e0f344761263dbe1939ab90b462a2fcbc3d88ddade245b7d9068eb1
|
7
|
+
data.tar.gz: 9f90d60b9499d6ddc02116b70865d251f4e384cc73d11538ea8e7524c9ddc0df1f6d5ac6d7e73afc8148094891d0e2b71975a3275e3195ca51516bad1858f74b
|
@@ -16,3 +16,47 @@
|
|
16
16
|
//= require bootstrap-sprockets
|
17
17
|
//= require_tree .
|
18
18
|
|
19
|
+
//
|
20
|
+
//
|
21
|
+
// fonction pour transformer une chaine avec virgule en float
|
22
|
+
// la fonction retire les espaces et remplace la virgule par le point décimal
|
23
|
+
// avant d'appeler Number, la fonction native de js.
|
24
|
+
function stringToFloat(jcdata) {
|
25
|
+
|
26
|
+
if (jcdata === undefined) {
|
27
|
+
return 0.0;
|
28
|
+
}
|
29
|
+
var d = String(jcdata).replace(/,/, '.');
|
30
|
+
d = d.replace(/\s/g, '');
|
31
|
+
if (isNaN(d)) {
|
32
|
+
return 0.0;
|
33
|
+
} else {
|
34
|
+
return Number(d);
|
35
|
+
}
|
36
|
+
}
|
37
|
+
// fonction permettant de mettre deux décimales à un nombre
|
38
|
+
// appelé lorsque l'utilisateur sort d'un champ pour remettre en forme sa saisir
|
39
|
+
// Par exemple 32 devient 32.00 ou 32.5 devient 32.50
|
40
|
+
function $f_two_decimals() {
|
41
|
+
var number = stringToFloat(this.value);
|
42
|
+
if (isNaN(number)) {
|
43
|
+
this.value = '0.00';
|
44
|
+
} else {
|
45
|
+
this.value = number.toFixed(2);
|
46
|
+
}
|
47
|
+
}
|
48
|
+
|
49
|
+
// série de fonction qui prépare les champs débit et crédit pour la saisie
|
50
|
+
// quand on entre dans un champ qui est à 0, on le vide
|
51
|
+
function $f_empty() {
|
52
|
+
if (this.value === '0.00') {
|
53
|
+
this.value = '';
|
54
|
+
}
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
jQuery(function () {
|
59
|
+
console.log('dans application js de Adherent');
|
60
|
+
$('#main-zone').on('focus', '.decimal', $f_empty); //vide le champ s'il est à zero (pour faciliter la saisie)
|
61
|
+
$('#main-zone').on('blur', '.decimal', $f_two_decimals);
|
62
|
+
});
|
@@ -0,0 +1,41 @@
|
|
1
|
+
// fonction pour transformer une chaine avec virgule en float
|
2
|
+
// la fonction retire les espaces et remplace la virgule par le point décimal
|
3
|
+
// avant d'appeler Number, la fonction native de js.
|
4
|
+
function stringToFloat(jcdata) {
|
5
|
+
|
6
|
+
if (jcdata === undefined) {
|
7
|
+
return 0.0;
|
8
|
+
}
|
9
|
+
var d = String(jcdata).replace(/,/, '.');
|
10
|
+
d = d.replace(/\s/g, '');
|
11
|
+
if (isNaN(d)) {
|
12
|
+
return 0.0;
|
13
|
+
} else {
|
14
|
+
return Number(d);
|
15
|
+
}
|
16
|
+
}
|
17
|
+
|
18
|
+
// fonction permettant de mettre deux décimales à un nombre
|
19
|
+
// appelé lorsque l'utilisateur sort d'un champ pour remettre en forme sa saisir
|
20
|
+
// Par exemple 32 devient 32.00 ou 32.5 devient 32.50
|
21
|
+
function $f_two_decimals() {
|
22
|
+
var number = stringToFloat(this.value);
|
23
|
+
if (isNaN(number)) {
|
24
|
+
this.value = '0.00';
|
25
|
+
} else {
|
26
|
+
this.value = number.toFixed(2);
|
27
|
+
}
|
28
|
+
}
|
29
|
+
|
30
|
+
// série de fonction qui prépare les champs débit et crédit pour la saisie
|
31
|
+
// quand on entre dans un champ qui est à 0, on le vide
|
32
|
+
function $f_empty() {
|
33
|
+
if (this.value === '0.00') {
|
34
|
+
this.value = '';
|
35
|
+
}
|
36
|
+
}
|
37
|
+
|
38
|
+
jQuery(function () {
|
39
|
+
$('#main-zone').on('focus', '.decimal', $f_empty); //vide le champ s'il est à zero (pour faciliter la saisie)
|
40
|
+
$('#main-zone').on('blur', '.decimal', $f_two_decimals);
|
41
|
+
});
|
@@ -41,9 +41,7 @@ adaptée.
|
|
41
41
|
blockquote, ul, ol {
|
42
42
|
page-break-inside: avoid; /* pas de coupure dans ces élements */
|
43
43
|
}
|
44
|
-
|
45
|
-
page-break-before: always; /* chaque titre commence sur une nouvelle page */
|
46
|
-
}
|
44
|
+
|
47
45
|
h1, h2, h3, caption {
|
48
46
|
page-break-after: avoid; /* pas de saut après ces éléments */
|
49
47
|
}
|
@@ -17,7 +17,8 @@ class DatePickerInput < SimpleForm::Inputs::Base
|
|
17
17
|
def input(wrapper_options)
|
18
18
|
input_html_options['data-jcmin'] = date_min(input_html_options[:date_min])
|
19
19
|
input_html_options['data-jcmax'] = date_max(input_html_options[:date_max])
|
20
|
-
input_html_classes.unshift('input_date_picker form-control')
|
20
|
+
input_html_classes.unshift('input_date_picker string form-control')
|
21
|
+
input_html_options['type'] = 'text' # probablement inutile
|
21
22
|
|
22
23
|
input_html_options.delete :date_min
|
23
24
|
input_html_options.delete :date_max
|
@@ -8,8 +8,7 @@ class FrenchDecimalInput < SimpleForm::Inputs::Base
|
|
8
8
|
def input(wrapper_options)
|
9
9
|
input_html_options['type'] = 'text' # probablement inutile
|
10
10
|
input_html_options['pattern'] = '\-?\d+(\.\d{0,2})?'
|
11
|
-
|
12
|
-
|
11
|
+
input_html_options['class'] = 'numeric decimal form-control'
|
13
12
|
@builder.text_field(attribute_name, input_html_options)
|
14
13
|
end
|
15
14
|
end
|
data/lib/adherent/version.rb
CHANGED
@@ -8,6 +8,7 @@ module Adherent
|
|
8
8
|
# VERSION = "0.2.0" # passage à rails 4.0 et bootstrap 3
|
9
9
|
# VERSION = "0.2.1" # reconstruction du gemfile.lock
|
10
10
|
# VERSION = "0.2.1.1" # correction coquille dans demo_table.scss
|
11
|
-
VERSION = "0.2.2" # refonte des formulaires suites bootstrap 3
|
11
|
+
# VERSION = "0.2.2" # refonte des formulaires suites bootstrap 3
|
12
|
+
VERSION = "0.2.2.1" # ajustements suite premiers essais staging
|
12
13
|
|
13
14
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: adherent
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.2
|
4
|
+
version: 0.2.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jean-Claude Lepage
|
@@ -298,6 +298,7 @@ files:
|
|
298
298
|
- app/assets/javascripts/adherent/adhesion.js
|
299
299
|
- app/assets/javascripts/adherent/allpayments.js
|
300
300
|
- app/assets/javascripts/adherent/application.js
|
301
|
+
- app/assets/javascripts/adherent/common.js
|
301
302
|
- app/assets/javascripts/adherent/coords.js
|
302
303
|
- app/assets/javascripts/adherent/date_picker.js
|
303
304
|
- app/assets/javascripts/adherent/jquery.dataTables.min.js
|