Commit 5dbe4a115e5cf990f573f8e73aa248f5f5ab52de
Exists in
master
and in
6 other branches
Merge branch 'fix-issues'
Showing
4 changed files
with
56 additions
and
10 deletions
Show diff stats
src/app/layout.scss
... | ... | @@ -342,6 +342,14 @@ blockquote { |
342 | 342 | border-left: none; |
343 | 343 | |
344 | 344 | .content-highlight-icon { |
345 | + // &:before { | |
346 | + // content: ""; | |
347 | + width: 110px; | |
348 | + height: 112px; | |
349 | + position: absolute; | |
350 | + display: inline-block; | |
351 | + opacity: .5; | |
352 | + | |
345 | 353 | @each $category, |
346 | 354 | $color in $categories { |
347 | 355 | .#{$category} & { |
... | ... | @@ -349,14 +357,9 @@ blockquote { |
349 | 357 | border-top: 33px solid $color; |
350 | 358 | } |
351 | 359 | } |
352 | - width: 110px; | |
353 | - height: 112px; | |
354 | - position: absolute; | |
355 | - display: inline-block; | |
356 | - opacity: .5; | |
357 | 360 | } |
358 | 361 | |
359 | - p.content-highlight-text { | |
362 | + p { | |
360 | 363 | margin-left: 60px; |
361 | 364 | padding-top: 50px; |
362 | 365 | } | ... | ... |
src/app/pages/duvidas/duvidas.controller.js
... | ... | @@ -6,16 +6,19 @@ |
6 | 6 | .controller('DuvidasPageController', DuvidasPageController); |
7 | 7 | |
8 | 8 | /** @ngInject */ |
9 | - function DuvidasPageController(DialogaService, $log) { | |
9 | + function DuvidasPageController(DialogaService, $interval, $window, $log) { | |
10 | 10 | $log.debug('DuvidasPageController'); |
11 | 11 | |
12 | 12 | var vm = this; |
13 | 13 | |
14 | 14 | vm.DialogaService = DialogaService; |
15 | + vm.$interval = $interval; | |
16 | + vm.$window = $window; | |
15 | 17 | vm.$log = $log; |
16 | 18 | |
17 | 19 | vm.init(); |
18 | 20 | vm.loadData(); |
21 | + vm.attachListeners(); | |
19 | 22 | } |
20 | 23 | |
21 | 24 | DuvidasPageController.prototype.init = function () { |
... | ... | @@ -29,14 +32,39 @@ |
29 | 32 | answer: 'Anim pariatur cliche reprehenderit, enim eiusmod high life accusamus terry richardson ad squid. 3 wolf moon officia aute, non cupidatat skateboard dolor brunch. Food truck quinoa nesciunt laborum eiusmod. Brunch 3 wolf moon tempor, sunt aliqua put a bird on it squid single-origin coffee nulla assumenda shoreditch et. Nihil anim keffiyeh helvetica, craft beer labore wes anderson cred nesciunt sapiente ea proident. Ad vegan excepteur butcher vice lomo. Leggings occaecat craft beer farm-to-table, raw denim aesthetic synth nesciunt you probably haven`t heard of them accusamus labore sustainable VHS.' |
30 | 33 | } |
31 | 34 | ]; |
35 | + | |
32 | 36 | vm.loading = true; |
33 | 37 | vm.error = false; |
38 | + vm.sendingContactForm = false; | |
39 | + | |
34 | 40 | }; |
35 | 41 | |
36 | 42 | DuvidasPageController.prototype.loadData = function () { |
37 | 43 | // var vm = this; |
38 | 44 | }; |
39 | 45 | |
46 | + DuvidasPageController.prototype.attachListeners = function () { | |
47 | + var vm = this; | |
48 | + | |
49 | + vm._attachCaptcha(); | |
50 | + }; | |
51 | + | |
52 | + DuvidasPageController.prototype._attachCaptcha = function() { | |
53 | + var vm = this; | |
54 | + | |
55 | + var stop = null; | |
56 | + stop = vm.$interval(function(){ | |
57 | + var $el = angular.element('#serpro_captcha'); | |
58 | + | |
59 | + if ($el && $el.length > 0 ){ | |
60 | + vm.$window.initCaptcha($el[0]); | |
61 | + vm.$interval.cancel(stop); | |
62 | + stop = undefined; | |
63 | + } | |
64 | + | |
65 | + }, 200); | |
66 | + }; | |
67 | + | |
40 | 68 | DuvidasPageController.prototype.submitContactForm = function ($event, contactForm) { |
41 | 69 | var vm = this; |
42 | 70 | |
... | ... | @@ -49,6 +77,11 @@ |
49 | 77 | subject: contactForm.inputSubject.$modelValue, |
50 | 78 | message: contactForm.inputMessage.$modelValue |
51 | 79 | }; |
80 | + | |
81 | + var target = $event.target; | |
82 | + var $target = angular.element(target); | |
83 | + var $captcha = $target.find('[name="txtToken_captcha_serpro_gov_br"]'); | |
84 | + data.txtToken_captcha_serpro_gov_br = $captcha.val(); | |
52 | 85 | |
53 | 86 | vm.DialogaService.sendContactForm(data) |
54 | 87 | .then(function(response){ | ... | ... |
src/app/pages/duvidas/duvidas.html
... | ... | @@ -39,7 +39,7 @@ |
39 | 39 | |
40 | 40 | <div class="row"> |
41 | 41 | <div class="col-sm-12"> |
42 | - <form role="form" name="contactForm" ng-submit="pageDuvidas.submitContactForm($event, contactForm)" novalidate> | |
42 | + <form role="form" name="contactForm" ng-submit="pageDuvidas.submitContactForm($event, contactForm)"> | |
43 | 43 | <div class="row"> |
44 | 44 | <div class="col-sm-6"> |
45 | 45 | <div class="form-group"> |
... | ... | @@ -75,9 +75,20 @@ |
75 | 75 | <textarea id="inputMessage" name="inputMessage" class="mensagem-text-area form-control light-input" ng-class="{ 'has-error' : contactForm.inputMessage.$invalid && contactForm.inputMessage.$touched }" ng-model="inputMessage" required ></textarea> |
76 | 76 | <validation-messages field="contactForm.inputMessage"></validation-messages> |
77 | 77 | </div> |
78 | + | |
78 | 79 | <span class="pull-left">*Dados obrigatórios</span> |
79 | 80 | <div class="row"> |
80 | 81 | <div class="col-sm-4 form-group pull-right"> |
82 | + | |
83 | + <div class="form-group"> | |
84 | + <div id="serpro_captcha" class="captcha"></div> | |
85 | + <div class="captcha">Digite os caracteres acima:</div> | |
86 | + <div class="captcha"> | |
87 | + <input type="text" name="captcha_text" id="captcha_text" aria-label="Escreva os caracteres do captcha aqui" ng-model="pageSignin.signup.captcha_text" ng-minlength="" ng-maxlength="" required> | |
88 | + <validation-messages field="contactForm.captcha_text"></validation-messages> | |
89 | + </div> | |
90 | + </div> | |
91 | + | |
81 | 92 | <div class="row" ng-show="pageDuvidas.sendingContactForm"> |
82 | 93 | <div class="col-sm-12"> |
83 | 94 | <div class="alert alert-info" role="alert">Enviando formulário...</div> |
... | ... | @@ -93,7 +104,7 @@ |
93 | 104 | <div class="alert alert-danger" role="alert">{{pageDuvidas.errorMessage}}</div> |
94 | 105 | </div> |
95 | 106 | </div> |
96 | - <button class="btn btn-lg btn-block btn-submit" type="submit">Enviar Mensagem</button> | |
107 | + <button class="btn btn-lg btn-block btn-submit" type="submit" ng-class=" {'disabled' : (contactForm.$invalid && !contactForm.$touched) }">Enviar Mensagem</button> | |
97 | 108 | </div> |
98 | 109 | </div> |
99 | 110 | </form> | ... | ... |
src/index.html