Commit ab220a5b6682ca7a995d3ebda5265b65f4d25925
1 parent
5b4c9b48
Exists in
master
and in
8 other branches
Add modal terms into signin page
Showing
4 changed files
with
41 additions
and
97 deletions
Show diff stats
src/app/pages/article/article.controller.js
src/app/pages/auth/auth.controller.js
... | ... | @@ -6,7 +6,7 @@ |
6 | 6 | .controller('AuthPageController', AuthPageController); |
7 | 7 | |
8 | 8 | /** @ngInject */ |
9 | - function AuthPageController($scope, $rootScope, AUTH_EVENTS, AuthService, Session, $log) { | |
9 | + function AuthPageController($scope, $rootScope, AUTH_EVENTS, AuthService, DialogaService, Session, $log) { | |
10 | 10 | $log.debug('AuthPageController'); |
11 | 11 | |
12 | 12 | var vm = this; |
... | ... | @@ -15,10 +15,12 @@ |
15 | 15 | vm.$scope = $scope; |
16 | 16 | vm.AUTH_EVENTS = AUTH_EVENTS; |
17 | 17 | vm.AuthService = AuthService; |
18 | + vm.DialogaService = DialogaService; | |
18 | 19 | vm.Session = Session; |
19 | 20 | vm.$log = $log; |
20 | 21 | |
21 | 22 | vm.init(); |
23 | + vm.loadData(); | |
22 | 24 | } |
23 | 25 | |
24 | 26 | AuthPageController.prototype.init = function() { |
... | ... | @@ -26,6 +28,8 @@ |
26 | 28 | |
27 | 29 | // init variables |
28 | 30 | vm.credentials = {}; |
31 | + vm.terms = null; | |
32 | + vm.loadingTerms = null; | |
29 | 33 | |
30 | 34 | // attach events |
31 | 35 | vm.currentUser = vm.Session.getCurrentUser(); |
... | ... | @@ -42,6 +46,21 @@ |
42 | 46 | // ... |
43 | 47 | }; |
44 | 48 | |
49 | + AuthPageController.prototype.loadData = function() { | |
50 | + var vm = this; | |
51 | + | |
52 | + // load terms | |
53 | + vm.loadingTerms = true; | |
54 | + vm.DialogaService.getTerms(function(data){ | |
55 | + vm.loadingTerms = false; | |
56 | + vm.terms = data.article; | |
57 | + }, function(error){ | |
58 | + // vm.$log.debug('handleSuccess.error', error); | |
59 | + vm.loadingTerms = false; | |
60 | + vm.error = error; | |
61 | + }); | |
62 | + }; | |
63 | + | |
45 | 64 | |
46 | 65 | AuthPageController.prototype.onClickLogout = function (){ |
47 | 66 | var vm = this; | ... | ... |
src/app/pages/auth/signin.html
... | ... | @@ -157,7 +157,7 @@ |
157 | 157 | <div class="form-group"> |
158 | 158 | <input type="checkbox" id="termosDeUso" name="termosDeUso" value="aceito" ng-model="termosDeUso" required> |
159 | 159 | Já li os |
160 | - <a href="">Termos de Uso</a> | |
160 | + <button type="button" class="btn btn-link" data-toggle="modal" data-target="#modalTermosDeUso">Termos de Uso</button> | |
161 | 161 | e concordo com os mesmos* |
162 | 162 | </input> |
163 | 163 | <validation-messages field="cadastroForm.termosDeUso"/> |
... | ... | @@ -176,3 +176,22 @@ |
176 | 176 | </div> |
177 | 177 | </div> |
178 | 178 | </section> |
179 | + | |
180 | + | |
181 | +<div class="modal fade" id="modalTermosDeUso" tabindex="-1" role="dialog" aria-labelledby="termosDeUsoLabel"> | |
182 | + <div class="modal-dialog" role="document"> | |
183 | + <div class="modal-content"> | |
184 | + <div class="modal-header modal-termos-uso-header"> | |
185 | + <button type="button" class="close" data-dismiss="modal" aria-label="Close"> | |
186 | + <span aria-hidden="true" class="modal-fechar-pequeno">FECHAR</span> | |
187 | + <span aria-hidden="true" class="modal-fechar-grande">X</span> | |
188 | + </button> | |
189 | + </div> | |
190 | + <div class="modal-body modal-termos-uso-body"> | |
191 | + <div class="modal-termos-uso-body-inner" ng-if="pageSignin.terms"> | |
192 | + <div ng-bind-html="pageSignin.terms.body"></div> | |
193 | + </div> | |
194 | + </div> | |
195 | + </div> | |
196 | + </div> | |
197 | +</div> | ... | ... |
src/app/pages/auth/signup.html
... | ... | @@ -1,94 +0,0 @@ |
1 | -<!-- Facebook --> | |
2 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> --> | |
3 | -<!-- Twitter --> | |
4 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M32 6.1c-1.2 0.5-2.4 0.9-3.8 1 1.4-0.8 2.4-2.1 2.9-3.6 -1.3 0.8-2.7 1.3-4.2 1.6 -1.2-1.3-2.9-2.1-4.8-2.1 -3.6 0-6.6 2.9-6.6 6.6 0 0.5 0.1 1 0.2 1.5 -5.5-0.3-10.3-2.9-13.5-6.9 -0.6 1-0.9 2.1-0.9 3.3 0 2.3 1.2 4.3 2.9 5.5 -1.1 0-2.1-0.3-3-0.8 0 0 0 0.1 0 0.1 0 3.2 2.3 5.8 5.3 6.4 -0.6 0.2-1.1 0.2-1.7 0.2 -0.4 0-0.8 0-1.2-0.1 0.8 2.6 3.3 4.5 6.1 4.6 -2.2 1.8-5.1 2.8-8.2 2.8 -0.5 0-1.1 0-1.6-0.1 2.9 1.9 6.4 3 10.1 3 12.1 0 18.7-10 18.7-18.7 0-0.3 0-0.6 0-0.8C30 8.5 31.1 7.4 32 6.1z"/></svg> --> | |
5 | -<!-- Google Plus --> | |
6 | -<!-- <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> --> | |
7 | - | |
8 | -<section> | |
9 | - <div class="container"> | |
10 | - <div class="row"> | |
11 | - <div class="col-sm-12"> | |
12 | - <!-- <h1>Ou cadastre-se</h1> --> | |
13 | - <!-- <p>Para fazer parte do Dialoga Brasil, interagir com as propostas e enviar as suas!</p> --> | |
14 | - </div> | |
15 | - </div> | |
16 | - </div> | |
17 | -</section> | |
18 | -<section role="main" class="section-gray auth-content"> | |
19 | -<div class="row"> | |
20 | - <div class="col-sm-12"> | |
21 | - <h1>Ou cadastre-se</h1> | |
22 | - <p>Para fazer parte do Dialoga Brasil, interagir com as propostas e enviar as suas!</p> | |
23 | - </div> | |
24 | - </div> | |
25 | - <div class="container"> | |
26 | - <div class="row"> | |
27 | - <div class="col-md-6"> | |
28 | - <button type="button" class="btn btn-lg btn-block btn-social btn-facebook"> | |
29 | - <span class="glyphicon icon-facebook icon-white" aria-hidden="true"> | |
30 | - <!-- Facebook --> | |
31 | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M18 32L12 32 12 16l-4 0 0-5.5 4 0 0-3.2C12 2.7 13.2 0 18.5 0l4.4 0 0 5.5 -2.8 0c-2.1 0-2.2 0.8-2.2 2.2l0 2.8 5 0 -0.6 5.5L18 16 18 32z"/></svg> | |
32 | - </span> | |
33 | - <span class="text"> | |
34 | - Conectar pelo Facebook | |
35 | - </span> | |
36 | - </button> | |
37 | - </div> | |
38 | - <div class="col-md-6"> | |
39 | - <button type="button" class="btn btn-lg btn-block btn-social btn-google-plus"> | |
40 | - <span class="glyphicon icon-google-plus icon-white" aria-hidden="true"> | |
41 | - <!-- Google Plus --> | |
42 | - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 33 33" width="25" height="25"><path d="M17.5 2c0 0-6.3 0-8.4 0C5.3 2 1.8 4.8 1.8 8.1c0 3.4 2.6 6.1 6.4 6.1 0.3 0 0.5 0 0.8 0 -0.2 0.5-0.4 1-0.4 1.6 0 0.9 0.5 1.7 1.1 2.3 -0.5 0-0.9 0-1.5 0C3.6 18.1 0 21.1 0 24.1c0 3 3.9 4.9 8.6 4.9 5.3 0 8.2-3 8.2-6 0-2.4-0.7-3.9-2.9-5.4 -0.8-0.5-2.2-1.8-2.2-2.6 0-0.9 0.3-1.3 1.6-2.4 1.4-1.1 2.4-2.6 2.4-4.4 0-2.1-0.9-4.2-2.7-4.8l2.7 0L17.5 2zM14.5 22.5c0.1 0.3 0.1 0.6 0.1 0.9 0 2.4-1.6 4.4-6.1 4.4 -3.2 0-5.5-2-5.5-4.5 0-2.4 2.9-4.4 6.1-4.4 0.8 0 1.4 0.1 2.1 0.3C12.9 20.4 14.2 21.1 14.5 22.5zM9.4 13.4c-2.2-0.1-4.2-2.4-4.6-5.2 -0.4-2.8 1.1-5 3.2-4.9 2.2 0.1 4.2 2.3 4.6 5.2C13 11.2 11.6 13.4 9.4 13.4zM26 8L26 2 24 2 24 8 18 8 18 10 24 10 24 16 26 16 26 10 32 10 32 8z"/></svg> | |
43 | - </span> | |
44 | - <span class="text"> | |
45 | - Conectar pelo Google+ | |
46 | - </span> | |
47 | - </button> | |
48 | - </div> | |
49 | - </div> | |
50 | - <div class="row"> | |
51 | - <div class="col-sm-12"> | |
52 | - <hr class="separator separator-cadastro"></hr> | |
53 | - </div> | |
54 | - </div> | |
55 | - <div class="row"> | |
56 | - <div class="col-sm-12"> | |
57 | - <form name="loginForm" ng-submit="pageSignin.login(pageSignin.credentials)"> | |
58 | - <div class="form-group"> | |
59 | - <label for="inputNome">Nome:</label> | |
60 | - <input type="text" id="inputNome" class="form-control input-lg" required="true" autofocus="" ng-model=""> | |
61 | - </div> | |
62 | - <div class="form-group"> | |
63 | - <label for="inputEmail">E-mail*</label> | |
64 | - <input type="text" id="inputEmail" class="form-control input-lg" required="true" autofocus="" ng-model=""> | |
65 | - </div> | |
66 | - <div class="form-group"> | |
67 | - <div class="input-group"> | |
68 | - <label for="inputPassword">Senha:</label> | |
69 | - <input type="password" id="inputPassword" class="form-control input-lg" required="true" ng-model=""> | |
70 | - </div> | |
71 | - </div> | |
72 | - <div class="form-group"> | |
73 | - | |
74 | - <div class="input-group"> | |
75 | - <label for="inputRepeatPassword">Confirmar Senha:</label> | |
76 | - <input type="password" id="inputRepeatPassword" class="form-control input-lg" required="true" ng-model=""> | |
77 | - </div> | |
78 | - </div> | |
79 | - <span>A senha deve ter 6 ou mais caracteres e conter números e letras.</span> | |
80 | - <div class="form-group"> | |
81 | - <input type="checkbox" name="termosDeUso" value="aceito">Já li os <a href="">Termos de Uso</a> e concordo com os mesmos*</input> | |
82 | - </div> | |
83 | - <div class="form-group"> | |
84 | - <span>Digite o texto da imagem</span> | |
85 | - <p>O Captcha vai aqui</p> | |
86 | - </div> | |
87 | - <div class="form-group"> | |
88 | - <button class="btn btn-lg btn-block btn-submit" type="submit">Cadastrar</button> | |
89 | - </div> | |
90 | - </form> | |
91 | - </div> | |
92 | - </div> | |
93 | - </div> | |
94 | -</section> |