ievkit_views 0.2.0 → 0.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: fea119828d0d0905ecb3949dd80945bbd46a0d57
4
- data.tar.gz: 8e834dcf39f1c06085c48885b66dbf57029c5caa
3
+ metadata.gz: 3f5ad02e375109205f936f59215ffae7d134d372
4
+ data.tar.gz: 31f9e63767da2923967b2bc458df2298330d1b47
5
5
  SHA512:
6
- metadata.gz: 8460180deba82dbff3f35d95793611579e075bb17f3e8835c3fb65d1ae0767d108cfcb5966677b42c954f00d468dd454f6f2a95479006c3b966f56470b914fe9
7
- data.tar.gz: 88c769e4b488d4aec1f551cbb15567d819bf19ecd2b183539660d57e9ba949e17f9c10b3dc905b5fe9426cdeffb4ac35cf6b6cbf57f3332682f2c5ac8530632f
6
+ metadata.gz: e86cf14806c96d490123e0e0bfd0a4e8d3dae6bc23d4bcd06f68ec770b8992e0e96e928254c419d315de4ac57281653a6e37b0b4d2ab486a47f19a527d38f442
7
+ data.tar.gz: bd4f083705d1f49508b541491b37dc9d15a2ed0cf451236f1fb3471c50fa95d18545782dfe3a1afa7058d13a27add03d930560228365f39ef0ff6e1935a1bbe9
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+
3
+ (function($){
4
+ var setProgressBar = function(val1, val2) {
5
+ var $pb1 = $('#progress-bar-steps');
6
+ $pb1.css('width', val1 + '%');
7
+ $pb1.find('.progress-bar-value').text(val1);
8
+ $pb1.attr('aria-valuenow', val1);
9
+ var $pb2 = $('#progress-bar-current-step');
10
+ $pb2.css('width', val2 + '%');
11
+ $pb2.find('.progress-bar-value').text(val2);
12
+ $pb2.attr('aria-valuenow', val2);
13
+ };
14
+
15
+ var progressJob = function() {
16
+ var $el = $('[data-progress-job]');
17
+ if($el.length == 1) {
18
+ var url = $el.data('progress-job');
19
+ $.ajax({
20
+ url: url
21
+ })
22
+ .done(function( datas ) {
23
+ if (datas.redirect) {
24
+ setProgressBar(100, 100);
25
+ window.location.href = datas.redirect;
26
+ } else if (datas.error_code) {
27
+ if ($('.cvd-JobListActionsBlock').length == 1)
28
+ $('.cvd-JobListActionsBlock').remove();
29
+ $('.progress').before('<p>Erreur impossible de traiter votre demande : ' + datas.error_code + '</p>');
30
+ $('.progress').remove();
31
+ } else {
32
+ setProgressBar(datas.steps_percent, datas.current_step_percent);
33
+ }
34
+ });
35
+ window.setTimeout(progressJob, <%= raw ENV["PROGRESS_BAR_TIMEOUT"] %>);
36
+ }
37
+ };
38
+
39
+ $(document).ready(function () {
40
+ $('.hide-js').hide();
41
+ $('.show-js').removeClass('hide');
42
+ progressJob();
43
+ $('.ievkit-AccordionBlock-details').click( function() {
44
+ var $gi = $(this).find('.glyphicon');
45
+ $gi.toggleClass('glyphicon-plus glyphicon-minus');
46
+ $(this).closest('li').find('div').slideToggle();
47
+ });
48
+ $('[data-toggle="collapse"]').click( function() {
49
+ var index = parseInt($(this).data('jump-to'));
50
+ if(index > 4) {
51
+ window.location.href = '#heading-' + (index - 4);
52
+ }
53
+ });
54
+ });
55
+ })(jQuery);
@@ -0,0 +1,10 @@
1
+ <div class="progress" data-progress-job="<%= path_to_progress_job %>">
2
+ <div class="progress-bar progress-bar-striped active" id="progress-bar-steps" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
3
+ <span><span class="progress-bar-value">0</span>% <%= t('complete') %></span>
4
+ </div>
5
+ </div>
6
+ <div class="progress">
7
+ <div class="progress-bar progress-bar-striped active progress-bar-success" id="progress-bar-current-step" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%">
8
+ <span><span class="progress-bar-value">0</span>% <%= t('complete') %></span>
9
+ </div>
10
+ </div>
@@ -1,3 +1,3 @@
1
1
  module IevkitViews
2
- VERSION = "0.2.0"
2
+ VERSION = "0.2.1"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ievkit_views
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Bruno Perles
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-10-27 00:00:00.000000000 Z
11
+ date: 2016-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -76,7 +76,7 @@ files:
76
76
  - MIT-LICENSE
77
77
  - README.md
78
78
  - Rakefile
79
- - app/assets/javascripts/ievkit_views/application.js
79
+ - app/assets/javascripts/ievkit_views/application.js.erb
80
80
  - app/assets/stylesheets/ievkit_views/application.css
81
81
  - app/assets/stylesheets/ievkit_views/report_results.scss
82
82
  - app/controllers/ievkit_views/application_controller.rb
@@ -88,6 +88,7 @@ files:
88
88
  - app/views/ievkit_views/_element_count.html.erb
89
89
  - app/views/ievkit_views/_file_details.html.erb
90
90
  - app/views/ievkit_views/_paginate.html.erb
91
+ - app/views/ievkit_views/_progress_bar.html.erb
91
92
  - app/views/ievkit_views/_report.html.erb
92
93
  - app/views/ievkit_views/_report_badges.html.erb
93
94
  - app/views/ievkit_views/_report_filters.html.erb
@@ -1,17 +0,0 @@
1
- "use strict";
2
-
3
- (function($){
4
- $(document).on('page:change', function () {
5
- $('.ievkit-AccordionBlock-details').click( function() {
6
- var $gi = $(this).find('.glyphicon');
7
- $gi.toggleClass('glyphicon-plus glyphicon-minus');
8
- $(this).closest('li').find('div').slideToggle();
9
- });
10
- $('[data-toggle="collapse"]').click( function() {
11
- var index = parseInt($(this).data('jump-to'));
12
- if(index > 4) {
13
- window.location.href = '#heading-' + (index - 4);
14
- }
15
- });
16
- });
17
- })(jQuery);