Commit 370d0a5376f31907b9b7056a1dbffd20b56bcaca
Exists in
master
and in
6 other branches
Merge branch 'master' of https://gitlab.com/participa/proposal-app
Conflicts: sass/style.scss
Showing
23 changed files
with
374 additions
and
134 deletions
Show diff stats
.gitignore
Gemfile
Gemfile.lock
... | ... | @@ -0,0 +1,6 @@ |
1 | +/*! | |
2 | + * Bootstrap v3.3.4 (http://getbootstrap.com) | |
3 | + * Copyright 2011-2015 Twitter, Inc. | |
4 | + * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) | |
5 | + */ | |
6 | + .alert{padding:15px;margin-bottom:20px;border:1px solid transparent;border-radius:4px}.alert h4{margin-top:0;color:inherit}.alert .alert-link{font-weight:700}.alert>p,.alert>ul{margin-bottom:0}.alert>p+p{margin-top:5px}.alert-dismissable,.alert-dismissible{padding-right:35px}.alert-dismissable .close,.alert-dismissible .close{position:relative;top:-2px;right:-21px;color:inherit}.alert-success{color:#3c763d;background-color:#dff0d8;border-color:#d6e9c6}.alert-success hr{border-top-color:#c9e2b3}.alert-success .alert-link{color:#2b542c}.alert-info{color:#31708f;background-color:#d9edf7;border-color:#bce8f1}.alert-info hr{border-top-color:#a6e1ec}.alert-info .alert-link{color:#245269}.alert-warning{color:#8a6d3b;background-color:#fcf8e3;border-color:#faebcc}.alert-warning hr{border-top-color:#f7e1b5}.alert-warning .alert-link{color:#66512c}.alert-danger{color:#a94442;background-color:#f2dede;border-color:#ebccd1}.alert-danger hr{border-top-color:#e4b9c0}.alert-danger .alert-link{color:#843534} | ... | ... |
1.48 KB
15.2 KB
1.52 KB
1.73 KB
15.5 KB
1.93 KB
1.79 KB
15.4 KB
1.72 KB
2.04 KB
15.7 KB
2.17 KB
index.html
... | ... | @@ -25,7 +25,10 @@ |
25 | 25 | if(base.match(/file:/) || filename.match(/http:/)){ |
26 | 26 | base = ''; |
27 | 27 | }else{ |
28 | - base = this.initBase() + '/'; | |
28 | + base = this.initBase(); | |
29 | + if(base.indexOf('/', base.length - 1) === -1) { | |
30 | + base = base + '/'; | |
31 | + } | |
29 | 32 | } |
30 | 33 | return base + filename; |
31 | 34 | } |
... | ... | @@ -43,6 +46,7 @@ |
43 | 46 | function loadCSSFiles(){ |
44 | 47 | var css_files = [ |
45 | 48 | 'css/bootstrap.min.css', |
49 | + 'css/bootstrap-alert.min.css', | |
46 | 50 | 'css/hover.custom.css', |
47 | 51 | 'http://maxcdn.bootstrapcdn.com/font-awesome/4.3.0/css/font-awesome.min.css', |
48 | 52 | 'http://fonts.googleapis.com/css?family=Open+Sans:400,300,700', |
... | ... | @@ -95,8 +99,8 @@ |
95 | 99 | <header> |
96 | 100 | <h1><a href="#">{{article.title}}</a></h1> |
97 | 101 | <a id="display-contrast" href="#">Alto Contraste</a> |
98 | - <div class="social"> | |
99 | - <a href="#" class="fb-share" data-description="Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo">Compartilhar</a> | |
102 | + <div class="social top"> | |
103 | + {{#social_share "Dialoga Brasil" "Aqui suas ideias viram propostas e você ajuda a melhorar as ações do governo" "#"}}{{/social_share}} | |
100 | 104 | </div> |
101 | 105 | </header> |
102 | 106 | |
... | ... | @@ -158,27 +162,27 @@ |
158 | 162 | <ul class="select"> |
159 | 163 | {{#each categories}} |
160 | 164 | <li class="category proposal-category" data-category="{{slug}}"> |
161 | - <a href="#/temas/{{slug}}/{{id}}" class="proposal-link" data-target="proposal-item-{{id}}">{{name}}</a> | |
162 | - <button class="go-back btn btn-default pull-right"> | |
163 | - VOLTAR | |
165 | + <button class="go-back btn btn-default"> | |
164 | 166 | <span class="fa fa-reply"></span> |
167 | + Voltar | |
165 | 168 | </button> |
169 | + <a href="#/temas/{{slug}}/{{id}}" class="proposal-link" data-target="proposal-item-{{id}}">{{name}}</a> | |
166 | 170 | {{#select_proposal ../../article.children slug ../id}}{{/select_proposal}} |
167 | 171 | </li> |
168 | 172 | {{/each}} |
169 | 173 | </ul> |
170 | 174 | |
171 | - <div class="social"> | |
172 | - <a href="#" class="fb-share" data-caption="{{title}}" data-description="{{stripTags abstract}}">Compartilhar</a> | |
173 | - </div> | |
174 | - <div class="proposal-header"> | |
175 | - <div class="abstract"> | |
175 | + | |
176 | + <div class="proposal-header "> | |
177 | + <div class="abstract "> | |
176 | 178 | <img src="{{../host}}{{image.url}}" alt="Imagem de apresentação do programa."/> |
177 | 179 | </div> |
178 | - <div class="title">{{title}}</div> | |
179 | - <div class="abstract">{{{abstract}}}</div> | |
180 | - <div class="show_body"> | |
181 | - <a href="#/programas/{{id}}/sobre-o-programa"><span>Conheça o Programa</span></a> | |
180 | + <a href="#/programas/{{id}}/sobre-o-programa"> | |
181 | + <div class="title ">{{title}}</div> | |
182 | + <div class="abstract ">{{{abstract}}}</div> | |
183 | + </a> | |
184 | + <div class="show_body row"> | |
185 | + <a class="col-sm-6 col-sm-offset-3" href="#/programas/{{id}}/sobre-o-programa"><span>Conheça o programa</span></a> | |
182 | 186 | </div> |
183 | 187 | </div> |
184 | 188 | |
... | ... | @@ -188,12 +192,20 @@ |
188 | 192 | </div> |
189 | 193 | |
190 | 194 | <div class="container"> |
191 | - <div class="col-sm-4 col-sm-offset-4"> | |
192 | - <div class="go-to-proposal-button"> | |
193 | - <a href="#/programas/{{id}}" data-target="proposal-item-{{id}}"> | |
194 | - <span class="fa fa-reply"></span> | |
195 | - Participe | |
196 | - </a> | |
195 | + <div class="row"> | |
196 | + <div class="col-sm-4"> | |
197 | + <div class="go-to-proposal-button"> | |
198 | + <a href="#/programas/{{id}}" data-target="proposal-item-{{id}}"> | |
199 | + <span class="fa fa-reply"></span> | |
200 | + Participe | |
201 | + </a> | |
202 | + </div> | |
203 | + </div> | |
204 | + <div class="col-sm-4 col-sm-offset-4"> | |
205 | + <div class="social right"> | |
206 | + <span>COMPARTILHE<br>ESTE PROGRAMA</span> | |
207 | + {{{social_share title abstract (program_detail_url id)}}} | |
208 | + </div> | |
197 | 209 | </div> |
198 | 210 | </div> |
199 | 211 | </div> |
... | ... | @@ -204,9 +216,9 @@ |
204 | 216 | <div class="container-title">Faça Uma Proposta</div> |
205 | 217 | <div class="subtitle">Qual a sua sugestão para melhorar este programa?</div> |
206 | 218 | <div class="info">Esta consulta termina em julho de 2015. Até lá, todas as propostas serão lidas e as cinco mais pontuadas em cada programa receberão resposta oficial do governo.</div> |
207 | - <div class="send-proposal-button send-button"><a href="#"><span>Envie Sua Proposta</span></a></div> | |
219 | + <div class="send-proposal-button send-button"><a href="#"><span>Envie sua proposta</span></a></div> | |
208 | 220 | <div class="login-container hide">Login</div> |
209 | - <form class="make-proposal-form save-article-form hide" id="make-proposal-form-{{id}}" action="{{proposal_action ../article . }}" method="post"> | |
221 | + <form class="make-proposal-form save-article-form require-login hide" id="make-proposal-form-{{id}}" action="{{proposal_action ../article . }}" method="post"> | |
210 | 222 | <div class="message hide"></div> |
211 | 223 | <div> |
212 | 224 | <div><label for="article_abstract">Descrição</label></div> |
... | ... | @@ -227,9 +239,16 @@ |
227 | 239 | <div class="support-proposal-container"> |
228 | 240 | <div class="support-proposal"> |
229 | 241 | <div class="container-title"> Apoie outras propostas</div> |
230 | - <div class="random-proposal"></div> | |
231 | - <div class="loading">Carregando...</div> | |
232 | - <div class="no-proposals">Ainda não existe nenhuma proposta para este programa.</div> | |
242 | + <div class="alert alert-warning hide" role="alert"> | |
243 | + <i class="fa fa-warning"></i><strong>Proposta não encontrada</strong> | |
244 | + </div> | |
245 | + <div class="support-proposal-content require-login"> | |
246 | + <div class="random-proposal"></div> | |
247 | + <div class="loading">Carregando...</div> | |
248 | + <div class="no-proposals">Ainda não existe nenhuma proposta para este programa.</div> | |
249 | + </div> | |
250 | + <div class="login-container hide">Login</div> | |
251 | + <div class="send-button"><a href="#"><span>Login</span></a></div> | |
233 | 252 | </div> |
234 | 253 | </div> |
235 | 254 | |
... | ... | @@ -282,7 +301,8 @@ |
282 | 301 | <a href="#" class="vote-result">Resultados</a> |
283 | 302 | </div> |
284 | 303 | <div class="social"> |
285 | - <a href="#/programas/{{parent.id}}/propostas/{{id}}" class="fb-share" data-caption="{{parent.title}}" data-description="{{stripTags abstract}}">Compartilhar</a> | |
304 | + <span>Compartilhe esta proposta</span> | |
305 | + {{{social_share parent.title abstract (proposal_url parent.id id)}}} | |
286 | 306 | </div> |
287 | 307 | </script> |
288 | 308 | |
... | ... | @@ -364,13 +384,21 @@ |
364 | 384 | <a href="#" class="confirm-signup">Confirmar</a> |
365 | 385 | <a href="#" class="cancel-signup">Cancelar</a> |
366 | 386 | </div> |
367 | - <div id="captcha"> | |
387 | + <div class="captcha"> | |
368 | 388 | <div class="g-recaptcha" data-sitekey="6LcLPAcTAAAAAKsd0bxY_TArhD_A7OL19SRCW7_i"></div> |
369 | 389 | <script src='https://www.google.com/recaptcha/api.js?hl=pt-BR' async defer></script> |
370 | 390 | </div> |
371 | 391 | </form> |
372 | 392 | </script> |
373 | 393 | |
394 | + <script id="social-share" type="text/x-handlebars-template"> | |
395 | + <ul> | |
396 | + <li><a href="{{url}}" class="fb-share icon icon-facebook" data-caption="{{title}}" data-description="{{stripTags description}}">Compartilhar no Facebook</a></li> | |
397 | + <li><a href="https://twitter.com/intent/tweet?url={{encodeURI url}}&text={{stripTags description}}" class="tw-share icon icon-twitter popup">Compartilhar no Twitter</a></li> | |
398 | + <li><a href="https://plus.google.com/share?url={{encodeURI url}}" class="gp-share icon icon-gplus popup">Compartilhar no Google Plus</a></li> | |
399 | + <li><a href="whatsapp://send?text={{stripTags description}} {{encodeURI url}}" class="ws-share icon icon-whatsapp">Compartilhar no WhatsApp</a></li> | |
400 | + </ul> | |
401 | + </script> | |
374 | 402 | |
375 | 403 | <script type='text/javascript' > |
376 | 404 | loadRequireJS(); | ... | ... |
js/handlebars-helpers.js
... | ... | @@ -94,6 +94,27 @@ define(['handlebars'], function(Handlebars){ |
94 | 94 | return +(Math.round(num + "e+2") + "e-2"); |
95 | 95 | }); |
96 | 96 | |
97 | + Handlebars.registerHelper('social_share', function(title, description, url) { | |
98 | + var template = Handlebars.compile($('#social-share').html()); | |
99 | + if(url==='#') { | |
100 | + url = ''; | |
101 | + } | |
102 | + url = 'http:'+Url.addBaseUrl(url); | |
103 | + return template({title: title, description: description, url: url}); | |
104 | + }); | |
105 | + | |
106 | + Handlebars.registerHelper('proposal_url', function(parent_id, id) { | |
107 | + return "#/programas/"+parent_id+"/propostas/"+id; | |
108 | + }); | |
109 | + | |
110 | + Handlebars.registerHelper('program_detail_url', function(id) { | |
111 | + return "#/programas/"+id+"/sobre-o-programa"; | |
112 | + }); | |
113 | + | |
114 | + Handlebars.registerHelper('encodeURI', function(uri) { | |
115 | + return encodeURIComponent(uri); | |
116 | + }); | |
117 | + | |
97 | 118 | function proposal_has_category(proposal, category_slug) { |
98 | 119 | for(var i=0; i<proposal.categories.length; i++) { |
99 | 120 | if(proposal.categories[i].slug == category_slug) | ... | ... |
js/main.js
... | ... | @@ -20,14 +20,10 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
20 | 20 | var participa = true; |
21 | 21 | if(participa){ |
22 | 22 | var host = 'http://www.participa.br'; |
23 | - var private_token = '375bee7e17d0021af7160ce664874618'; //participa | |
24 | - var proposal_discussion = '92856'; //participa | |
23 | + var proposal_discussion = '103358'; //participa | |
25 | 24 | }else{ |
26 | 25 | var host = 'http://noosfero.com:3000'; |
27 | - //var private_token = 'bd8996155f5ea4354e42fee50b4b6891'; //casa | |
28 | - var private_token = 'aae32bf5031e895b00a20a529d763b31'; //local serpro | |
29 | 26 | var proposal_discussion = '632'; //local serpro |
30 | - //var proposal_discussion = '401'; //casa | |
31 | 27 | } |
32 | 28 | |
33 | 29 | var BARRA_ADDED = false; |
... | ... | @@ -36,7 +32,22 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
36 | 32 | Main = (function(){ |
37 | 33 | |
38 | 34 | return { |
39 | - loadRandomProposal: function (topic_id, private_token) { | |
35 | + private_token: '375bee7e17d0021af7160ce664874618', | |
36 | + getProposalId: function() { | |
37 | + var regexProposals = /\d.*\/propostas\/*.*/; | |
38 | + var proposalId = 0; | |
39 | + | |
40 | + var hasProposal = regexProposals.test(location.hash); | |
41 | + if( hasProposal ){ | |
42 | + var regexExtractProposal = /propostas\/*.*/; | |
43 | + proposalId = regexExtractProposal.exec(location.hash)[0].split('/')[1]; | |
44 | + | |
45 | + } | |
46 | + | |
47 | + return proposalId; | |
48 | + }, | |
49 | + loadRandomProposal: function (topic_id) { | |
50 | + var private_token = Main.private_token; | |
40 | 51 | var $noProposals = $('.no-proposals'); |
41 | 52 | var $loading = $('.loading'); |
42 | 53 | var $randomProposal = $('.random-proposal'); |
... | ... | @@ -48,10 +59,19 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
48 | 59 | $loading.show(); |
49 | 60 | $randomProposal.html(''); |
50 | 61 | |
51 | - var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; | |
62 | + var url = host + '/api/v1/articles/' + topic_id + '/children'; | |
63 | + var childId = this.getProposalId(); | |
64 | + | |
65 | + if(childId != 0){ | |
66 | + url += '/'+childId; | |
67 | + } | |
68 | + url += '?private_token=' + Main.private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,abstract,created_by&content_type=ProposalsDiscussionPlugin::Proposal'; | |
69 | + | |
52 | 70 | $.getJSON(url).done(function( data ) { |
53 | 71 | $loading.hide(); |
72 | + $('.support-proposal .alert').hide(); | |
54 | 73 | |
74 | + data.articles = data.articles || [data.article]; | |
55 | 75 | if(data.articles.length === 0) { |
56 | 76 | $noProposals.show(); |
57 | 77 | return; |
... | ... | @@ -63,7 +83,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
63 | 83 | $randomProposal.html(supportProposalTemplate(article)); |
64 | 84 | $body.off('click', '.vote-actions .skip'); |
65 | 85 | $body.on('click', '.vote-actions .skip', function(e) { |
66 | - contextMain.loadRandomProposal(topic_id, private_token); | |
86 | + contextMain.loadRandomProposal(topic_id); | |
67 | 87 | e.preventDefault(); |
68 | 88 | }); |
69 | 89 | $body.off('click', '.vote-actions .like'); |
... | ... | @@ -71,20 +91,27 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
71 | 91 | //Helps to prevent more than one vote per proposal |
72 | 92 | if(ProposalApp.hasProposalbeenVoted(article.id)){ |
73 | 93 | console.log("Proposta " + article.id + " já havia sido votada"); |
74 | - contextMain.loadRandomProposal(topic_id, private_token); | |
94 | + contextMain.loadRandomProposal(topic_id); | |
75 | 95 | e.preventDefault(); |
76 | 96 | return; |
77 | 97 | } |
98 | + | |
99 | + if(!logged_in) { | |
100 | + $(this).closest('.support-proposal').find('.send-button a').click(); | |
101 | + e.preventDefault(); | |
102 | + return; | |
103 | + } | |
104 | + | |
78 | 105 | $.ajax({ |
79 | 106 | type: 'post', |
80 | 107 | url: host + '/api/v1/articles/' + article.id + '/vote', |
81 | 108 | data: { |
82 | 109 | value: $(this).data('vote-value'), |
83 | - private_token: private_token | |
110 | + private_token: Main.private_token | |
84 | 111 | } |
85 | 112 | }).done(function( /*data*/ ) { |
86 | 113 | ProposalApp.addVotedProposal(article.id); |
87 | - contextMain.loadRandomProposal(topic_id, private_token); | |
114 | + contextMain.loadRandomProposal(topic_id); | |
88 | 115 | }); |
89 | 116 | e.preventDefault(); |
90 | 117 | }); |
... | ... | @@ -104,6 +131,9 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
104 | 131 | } |
105 | 132 | e.preventDefault(); |
106 | 133 | }); |
134 | + }).fail(function(){ | |
135 | + $loading.hide(); | |
136 | + $('.support-proposal .alert').show(); | |
107 | 137 | }); |
108 | 138 | }, |
109 | 139 | |
... | ... | @@ -112,7 +142,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
112 | 142 | $resultsContainer.find('.results-content').hide(); |
113 | 143 | |
114 | 144 | var per_page = 10; |
115 | - var url = host + '/api/v1/proposals_discussion_plugin/' + topic_id + '/ranking' + '?private_token=' + private_token + '&per_page='+per_page+'&page='+page; | |
145 | + var url = host + '/api/v1/proposals_discussion_plugin/' + topic_id + '/ranking' + '?private_token=' + Main.private_token + '&per_page='+per_page+'&page='+page; | |
116 | 146 | $.getJSON(url).done(function( data, stats, xhr ) { |
117 | 147 | data.pagination = { |
118 | 148 | total: parseInt(xhr.getResponseHeader('Total')), |
... | ... | @@ -156,14 +186,14 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
156 | 186 | |
157 | 187 | if(logged_in) { |
158 | 188 | if(token){ |
159 | - private_token = token; | |
189 | + Main.private_token = token; | |
160 | 190 | } |
161 | - loginButton.siblings('.save-article-form').show(); | |
162 | - loginButton.siblings('.save-article-form .message').show(); | |
191 | + loginButton.siblings('.require-login').show(); | |
192 | + loginButton.siblings('.require-login .message').show(); | |
163 | 193 | loginButton.siblings('.login-container').hide(); |
164 | - $.cookie('_dialoga_session', private_token); | |
194 | + $.cookie('_dialoga_session', Main.private_token); | |
165 | 195 | } else { |
166 | - loginButton.siblings('.save-article-form').hide(); | |
196 | + loginButton.siblings('.require-login').hide(); | |
167 | 197 | loginButton.siblings('.login-container').show(); |
168 | 198 | } |
169 | 199 | }, |
... | ... | @@ -218,7 +248,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
218 | 248 | $proposal.find('.calendar').slick(); |
219 | 249 | |
220 | 250 | var topic_id = proposal_id.split('-').pop(); |
221 | - this.loadRandomProposal(topic_id, private_token); | |
251 | + this.loadRandomProposal(topic_id); | |
222 | 252 | }, |
223 | 253 | display_proposal_detail: function(proposal_id){ |
224 | 254 | $('#proposal-categories').hide(); |
... | ... | @@ -236,7 +266,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
236 | 266 | $proposal.find('.body').show(); |
237 | 267 | $proposal.show(); |
238 | 268 | |
239 | - var url = host + '/api/v1/articles/' + proposal_id + '?private_token=' + private_token + '&fields=id,body&content_type=ProposalsDiscussionPlugin::Topic'; | |
269 | + var url = host + '/api/v1/articles/' + proposal_id + '?private_token=' + Main.private_token + '&fields=id,body&content_type=ProposalsDiscussionPlugin::Topic'; | |
240 | 270 | $.getJSON(url).done(function( data ) { |
241 | 271 | $('#proposal-item-' + proposal_id + ' .body-content').replaceWith(data.article.body); |
242 | 272 | }) |
... | ... | @@ -389,7 +419,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
389 | 419 | // show the 'index' -> category tab |
390 | 420 | this.display_category_tab(); |
391 | 421 | |
392 | - | |
422 | + | |
393 | 423 | // if(navOffset){ |
394 | 424 | // scrollTop = navOffset.top; |
395 | 425 | // } |
... | ... | @@ -435,12 +465,12 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
435 | 465 | })(); |
436 | 466 | |
437 | 467 | // Load data from localhost when it is dev env. |
438 | - var noosferoAPI = host + '/api/v1/articles/' + proposal_discussion + '?private_token=' + private_token + '&fields=id,children,categories,abstract,title,image,url,setting,position'; | |
468 | + var noosferoAPI = host + '/api/v1/articles/' + proposal_discussion + '?private_token=' + Main.private_token + '&fields=id,children,categories,abstract,title,image,url,setting,position'; | |
439 | 469 | |
440 | 470 | $.getJSON(noosferoAPI) |
441 | 471 | .done(function( data ) { |
442 | 472 | data.host = host; |
443 | - data.private_token = private_token; | |
473 | + data.private_token = Main.private_token; | |
444 | 474 | resultsPlaceholder.innerHTML = template(data); |
445 | 475 | $('.login-container').html(loginTemplate()); |
446 | 476 | $('.countdown').maxlength({text: '%left caracteres restantes'}); |
... | ... | @@ -583,7 +613,7 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
583 | 613 | $.ajax({ |
584 | 614 | type: 'post', |
585 | 615 | url: host + $form.attr('action'), |
586 | - data: $('#'+this.id).serialize() + '&private_token=' + private_token + '&fields=id&article[name]=article_' + Main.guid() | |
616 | + data: $('#'+this.id).serialize() + '&private_token=' + Main.private_token + '&fields=id&article[name]=article_' + Main.guid() | |
587 | 617 | }) |
588 | 618 | .done(function( /*data*/ ) { |
589 | 619 | form.reset(); |
... | ... | @@ -612,14 +642,14 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
612 | 642 | |
613 | 643 | |
614 | 644 | $(document).ready(function($) { |
615 | - | |
645 | + | |
616 | 646 | FastClick.attach(document.body); |
617 | 647 | |
618 | 648 | if($.cookie('_dialoga_session')) { |
619 | 649 | var url = host + '/api/v1/users/me?private_token=' + $.cookie('_dialoga_session'); |
620 | 650 | $.getJSON(url).done(function( /*data*/ ) { |
621 | 651 | logged_in = true; |
622 | - private_token = $.cookie('_dialoga_session'); | |
652 | + Main.private_token = $.cookie('_dialoga_session'); | |
623 | 653 | }); |
624 | 654 | } |
625 | 655 | |
... | ... | @@ -645,11 +675,6 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
645 | 675 | |
646 | 676 | $(document).on('click', '.social .fb-share', function(e) { |
647 | 677 | var link = $(this).attr('href'); |
648 | - if(link==='#' || link ==='') { | |
649 | - link = window.location.href; | |
650 | - } else { | |
651 | - link = 'http:'+Url.addBaseUrl(link); | |
652 | - } | |
653 | 678 | FB.ui({ |
654 | 679 | method: 'feed', |
655 | 680 | link: link, |
... | ... | @@ -700,6 +725,30 @@ define(['handlebars', 'fastclick', 'handlebars_helpers'], function(Handlebars, F |
700 | 725 | }); |
701 | 726 | e.preventDefault(); |
702 | 727 | }); |
728 | + | |
729 | + var popupCenter = function(url, title, w, h) { | |
730 | + var dualScreenLeft = window.screenLeft !== undefined ? window.screenLeft : screen.left; | |
731 | + var dualScreenTop = window.screenTop !== undefined ? window.screenTop : screen.top; | |
732 | + | |
733 | + var width = window.innerWidth ? window.innerWidth : document.documentElement.clientWidth ? document.documentElement.clientWidth : screen.width; | |
734 | + var height = window.innerHeight ? window.innerHeight : document.documentElement.clientHeight ? document.documentElement.clientHeight : screen.height; | |
735 | + | |
736 | + var left = ((width / 2) - (w / 2)) + dualScreenLeft; | |
737 | + var top = ((height / 3) - (h / 3)) + dualScreenTop; | |
738 | + | |
739 | + var newWindow = window.open(url, title, 'scrollbars=yes, width=' + w + ', height=' + h + ', top=' + top + ', left=' + left); | |
740 | + | |
741 | + // Puts focus on the newWindow | |
742 | + if (window.focus) { | |
743 | + newWindow.focus(); | |
744 | + } | |
745 | + }; | |
746 | + | |
747 | + $(document).on('click', '.social a.popup', {}, function popUp(e) { | |
748 | + var self = $(this); | |
749 | + popupCenter(self.attr('href'), self.find('.rrssb-text').html(), 580, 470); | |
750 | + e.preventDefault(); | |
751 | + }); | |
703 | 752 | }); |
704 | 753 | |
705 | 754 | window.addEventListener("message", function(ev) { | ... | ... |
sass/_proposal_detail.scss
... | ... | @@ -7,17 +7,18 @@ |
7 | 7 | li { |
8 | 8 | a { |
9 | 9 | text-decoration: none; |
10 | - text-transform: uppercase; | |
11 | - padding: 15px 15px 15px 50px; | |
10 | + // text-transform: uppercase; | |
11 | + padding: 0 0 0 45px; | |
12 | 12 | margin: 0; |
13 | 13 | width: 30%; |
14 | 14 | min-width: 210px; |
15 | 15 | display: inline-block; |
16 | + vertical-align: middle; | |
16 | 17 | span { |
17 | 18 | padding-left: 40px; |
18 | 19 | } |
19 | 20 | font: { |
20 | - size: larger; | |
21 | + size: 24px; | |
21 | 22 | weight: bold; |
22 | 23 | } |
23 | 24 | background-size: 32px; |
... | ... | @@ -27,13 +28,16 @@ |
27 | 28 | |
28 | 29 | .categories { |
29 | 30 | select { |
30 | - height: 57px; | |
31 | + // height: 57px; | |
31 | 32 | width: 60%; |
32 | 33 | margin: 0; |
33 | 34 | text-transform: uppercase; |
34 | 35 | border: 0; |
35 | - background: #EEEFF1; | |
36 | + background: #fff; | |
36 | 37 | float: right; |
38 | + vertical-align: middle; | |
39 | + margin: 4px; | |
40 | + border-radius: 3px; | |
37 | 41 | } |
38 | 42 | |
39 | 43 | .proposal-header { |
... | ... | @@ -65,30 +69,27 @@ |
65 | 69 | } |
66 | 70 | |
67 | 71 | .show_body { |
68 | - width: 100%; | |
69 | - padding: 30px 0; | |
72 | + // width: 100%; | |
73 | + // padding: 30px 0; | |
70 | 74 | margin: 10px auto; |
71 | 75 | text-align: center; |
72 | 76 | cursor: pointer; |
73 | - -webkit-border-radius: 6px; | |
74 | - -moz-border-radius: 6px; | |
75 | - border-radius: 6px; | |
76 | 77 | |
77 | 78 | |
78 | 79 | a { |
79 | - display: inline-block; | |
80 | - width: 70%; | |
80 | + // display: inline-block; | |
81 | + // width: 70%; | |
81 | 82 | text-decoration: none; |
82 | 83 | color: #fff; |
83 | 84 | font-size: 38px; |
84 | - font-weight: bold; | |
85 | - text-transform: uppercase; | |
86 | - margin: 0 auto; | |
85 | + font-weight: 500; | |
86 | + // text-transform: uppercase; | |
87 | + // margin: 0 auto; | |
87 | 88 | text-align: center; |
88 | 89 | } |
89 | 90 | |
90 | 91 | span { |
91 | - padding: 5px 15px; | |
92 | + // padding: 5px 15px; | |
92 | 93 | } |
93 | 94 | } |
94 | 95 | } |
... | ... | @@ -103,7 +104,7 @@ |
103 | 104 | li { |
104 | 105 | background: $color; |
105 | 106 | list-style: none; |
106 | - padding: 0; | |
107 | + padding: 5px; | |
107 | 108 | a { |
108 | 109 | min-width: 0; |
109 | 110 | width: auto; |
... | ... | @@ -249,31 +250,17 @@ |
249 | 250 | background: darken($color, 15%); |
250 | 251 | } |
251 | 252 | .show_body { |
252 | - background: $color; | |
253 | - // background: $color url(images/black-alpha.png); | |
254 | - // border-top: 5px solid $color; | |
255 | - transition: background-color .2s; | |
256 | - | |
257 | - &:hover, | |
258 | - &:focus { | |
259 | - background-color: saturate( lighten($color, 5%), 10% ); | |
260 | - // -webkit-box-shadow: 0 2px 5px rgba(0,0,0,.5); | |
261 | - // -moz-box-shadow: 0 2px 5px rgba(0,0,0,.5); | |
262 | - // box-shadow: 0 2px 5px rgba(0,0,0,.5); | |
263 | - | |
264 | - span { | |
265 | - background-color: saturate( lighten($color, 5%), 10% ); | |
266 | - } | |
267 | - } | |
268 | - | |
269 | 253 | a { |
270 | - background: transparent url(images/white-line.png) left center repeat-x; | |
271 | - } | |
272 | - | |
273 | - span { | |
274 | 254 | background: $color; |
275 | - // background: $color url(images/black-alpha.png); | |
276 | 255 | transition: background-color .2s; |
256 | + -webkit-border-radius: 6px; | |
257 | + -moz-border-radius: 6px; | |
258 | + border-radius: 6px; | |
259 | + border-bottom: 5px solid darken($color, 15%); | |
260 | + padding: 15px 0; | |
261 | + &:hover,&:focus { | |
262 | + background-color: darken($color, 15%); | |
263 | + } | |
277 | 264 | } |
278 | 265 | } |
279 | 266 | } |
... | ... | @@ -333,13 +320,13 @@ |
333 | 320 | .container-button a, |
334 | 321 | input[type=submit], |
335 | 322 | .success-proposal-sent a { |
336 | - font-weight: bolder; | |
337 | - font-size: 14px; | |
338 | - text-transform: uppercase; | |
323 | + font-weight: 500; | |
324 | + font-size: 16px; | |
325 | + // text-transform: uppercase; | |
339 | 326 | background-color: $color; |
327 | + border-bottom: 3px solid darken($color, 15%); | |
340 | 328 | color: white; |
341 | - width: 60%; | |
342 | - border: none; | |
329 | + width: 50%; | |
343 | 330 | margin: 10px auto; |
344 | 331 | -webkit-border-radius: 6px; |
345 | 332 | -moz-border-radius: 6px; |
... | ... | @@ -353,7 +340,7 @@ |
353 | 340 | |
354 | 341 | &:hover, |
355 | 342 | &:focus { |
356 | - background-color: saturate( lighten($color, 5%), 10% ); | |
343 | + background-color: darken($color, 15%); | |
357 | 344 | } |
358 | 345 | span { |
359 | 346 | padding-left: 20px; |
... | ... | @@ -401,9 +388,9 @@ |
401 | 388 | @extend .container-button; |
402 | 389 | a { |
403 | 390 | position: absolute; |
404 | - left: 50%; | |
391 | + left: 40%; | |
405 | 392 | margin: 0; |
406 | - margin-left: -30%; | |
393 | + margin-left: -20%; | |
407 | 394 | bottom: 40px; |
408 | 395 | padding: 20px 0; |
409 | 396 | } |
... | ... | @@ -433,6 +420,14 @@ |
433 | 420 | min-height: $container-height; |
434 | 421 | position: relative; |
435 | 422 | margin: 0 0 20px 10px; |
423 | + overflow: auto; | |
424 | + .alert{ | |
425 | + width: 95%; | |
426 | + margin: 0 auto; | |
427 | + strong{ | |
428 | + margin-left: 5px; | |
429 | + } | |
430 | + } | |
436 | 431 | } |
437 | 432 | .subtitle { |
438 | 433 | color: #000; |
... | ... | @@ -450,14 +445,14 @@ |
450 | 445 | background-image: url(./images/dislike.png); |
451 | 446 | } |
452 | 447 | .skip { |
453 | - font-weight: bolder; | |
454 | - font-size: 14px; | |
455 | - text-transform: uppercase; | |
448 | + font-weight: 500; | |
449 | + font-size: 16px; | |
450 | + // text-transform: uppercase; | |
456 | 451 | background-color: $color; |
457 | 452 | color: white; |
458 | - width: 60%; | |
459 | - border: none; | |
460 | - margin: 0; | |
453 | + width: 40%; | |
454 | + border-bottom: 3px solid darken($color, 15%); | |
455 | + margin: 20px auto 0; | |
461 | 456 | -webkit-border-radius: 6px; |
462 | 457 | -moz-border-radius: 6px; |
463 | 458 | border-radius: 6px; |
... | ... | @@ -465,16 +460,16 @@ |
465 | 460 | text-decoration: none; |
466 | 461 | padding: 20px 0; |
467 | 462 | display: block; |
468 | - position: absolute; | |
469 | - bottom: 40px; | |
470 | - left: 50%; | |
471 | - margin-left: -30%; | |
463 | + // position: absolute; | |
464 | + // bottom: 40px; | |
465 | + // left: 50%; | |
466 | + // margin-left: -30%; | |
472 | 467 | |
473 | 468 | transition: background-color .2s; |
474 | 469 | |
475 | 470 | &:hover, |
476 | 471 | &:focus { |
477 | - background-color: saturate( lighten($color, 5%), 10% ); | |
472 | + background-color: darken($color, 15%); | |
478 | 473 | } |
479 | 474 | } |
480 | 475 | .vote-result { |
... | ... | @@ -483,14 +478,14 @@ |
483 | 478 | color: #000; |
484 | 479 | font-weight: bold; |
485 | 480 | text-decoration: none; |
486 | - margin: 0; | |
481 | + margin: 15px 0; | |
487 | 482 | display: block; |
488 | 483 | width: 100%; |
489 | 484 | text-align: center; |
490 | - position: absolute; | |
491 | - bottom: 10px; | |
485 | + // position: absolute; | |
486 | + // bottom: 10px; | |
492 | 487 | left: 0; |
493 | - text-decoration: none; | |
488 | + text-decoration: underline; | |
494 | 489 | color: $color; |
495 | 490 | |
496 | 491 | &:hover, |
... | ... | @@ -499,6 +494,12 @@ |
499 | 494 | } |
500 | 495 | } |
501 | 496 | } |
497 | + .social { | |
498 | + span { | |
499 | + color: $color; | |
500 | + font-weight: 700; | |
501 | + } | |
502 | + } | |
502 | 503 | } |
503 | 504 | .experience-proposal-container{ |
504 | 505 | float: left; |
... | ... | @@ -590,9 +591,10 @@ |
590 | 591 | background-image: url(./images/icons/#{$category}.png); |
591 | 592 | background: { |
592 | 593 | color: $color; |
593 | - position: 10px 50%; | |
594 | + position: 5px 50%; | |
594 | 595 | repeat: no-repeat; |
595 | 596 | } |
597 | + border-left: 1px solid lighten($color, 10%) | |
596 | 598 | } |
597 | 599 | } |
598 | 600 | /*------------------ formulario ---------------- */ |
... | ... | @@ -710,6 +712,9 @@ |
710 | 712 | font-size: 20px; |
711 | 713 | } |
712 | 714 | } |
715 | + .support-proposal .send-button { | |
716 | + display: none !important; | |
717 | + } | |
713 | 718 | } |
714 | 719 | |
715 | 720 | @media only screen and (max-width: 992px) { |
... | ... | @@ -759,7 +764,6 @@ |
759 | 764 | } |
760 | 765 | } |
761 | 766 | .show_body { |
762 | - padding: 20px 0 !important; | |
763 | 767 | span { |
764 | 768 | text-align: center !important; |
765 | 769 | margin: 0 10px !important; | ... | ... |
... | ... | @@ -0,0 +1,71 @@ |
1 | +.social { | |
2 | + position: relative; | |
3 | + z-index: 1; | |
4 | + &.top { | |
5 | + margin-top: 45px; | |
6 | + } | |
7 | + &.right { | |
8 | + padding-top: 10px; | |
9 | + span { | |
10 | + display: inline-block; | |
11 | + font-size: 12px; | |
12 | + font-weight: 300; | |
13 | + padding-right: 10px; | |
14 | + text-align: right; | |
15 | + vertical-align: middle; | |
16 | + } | |
17 | + ul { | |
18 | + display: inline-block; | |
19 | + vertical-align: middle | |
20 | + } | |
21 | + } | |
22 | + span { | |
23 | + display: block; | |
24 | + margin-bottom: 10px; | |
25 | + } | |
26 | + ul { | |
27 | + list-style: none; | |
28 | + padding-left: 0; | |
29 | + } | |
30 | + li { | |
31 | + display: inline-block; | |
32 | + padding: 0 2px !important; | |
33 | + } | |
34 | + .icon { | |
35 | + background-color: transparent !important; | |
36 | + background-repeat: no-repeat; | |
37 | + background-position: 50% !important; | |
38 | + background-size: auto !important; | |
39 | + border: 0 !important; | |
40 | + display: inline-block; | |
41 | + height: 36px; | |
42 | + min-width: 0 !important; | |
43 | + padding: 0 !important; | |
44 | + text-indent: -999999px; | |
45 | + width: 36px; | |
46 | + &-facebook { | |
47 | + background-image: url(images/icons/icon-facebook.png) !important; | |
48 | + &.disabled { | |
49 | + background-image: url(images/icons/icon-facebook-disabled.png) !important; | |
50 | + } | |
51 | + } | |
52 | + &-twitter { | |
53 | + background-image: url(images/icons/icon-twitter.png) !important; | |
54 | + &.disabled { | |
55 | + background-image: url(images/icons/icon-twitter-disabled.png) !important; | |
56 | + } | |
57 | + } | |
58 | + &-gplus { | |
59 | + background-image: url(images/icons/icon-gplus.png) !important; | |
60 | + &.disabled { | |
61 | + background-image: url(images/icons/icon-gplus-disabled.png) !important; | |
62 | + } | |
63 | + } | |
64 | + &-whatsapp { | |
65 | + background-image: url(images/icons/icon-whatsapp.png) !important; | |
66 | + &.disabled { | |
67 | + background-image: url(images/icons/icon-whatsapp-disabled.png) !important; | |
68 | + } | |
69 | + } | |
70 | + } | |
71 | +} | |
0 | 72 | \ No newline at end of file | ... | ... |
sass/proposal_detail/_proposal-detail-base.scss
... | ... | @@ -107,12 +107,14 @@ |
107 | 107 | -webkit-border-radius: 6px; |
108 | 108 | -moz-border-radius: 6px; |
109 | 109 | border-radius: 6px; |
110 | + border-bottom: 3px solid darken($color, 18%); | |
110 | 111 | color: #fff; |
111 | 112 | display: block; |
112 | 113 | padding: 1em; |
113 | 114 | text-align: center; |
115 | + font-weight: 500; | |
114 | 116 | text-decoration: none; |
115 | - text-transform: uppercase; | |
117 | + // text-transform: uppercase; | |
116 | 118 | .fa-reply { |
117 | 119 | margin-right: .7em; |
118 | 120 | } |
... | ... | @@ -120,7 +122,7 @@ |
120 | 122 | transition: background-color .2s; |
121 | 123 | &:hover, |
122 | 124 | &:focus { |
123 | - background-color: saturate( lighten($color, 5%), 10% ); | |
125 | + background-color: darken($color, 18%); | |
124 | 126 | } |
125 | 127 | } |
126 | 128 | .row { | ... | ... |
sass/style.scss
... | ... | @@ -10,6 +10,7 @@ |
10 | 10 | @import 'accessibility'; |
11 | 11 | @import 'slick'; |
12 | 12 | @import 'slick-theme'; |
13 | +@import 'share'; | |
13 | 14 | |
14 | 15 | @import 'proposal_detail/proposal-detail-base'; |
15 | 16 | @import 'proposal_detail/urgencia-e-emergencia'; |
... | ... | @@ -114,11 +115,11 @@ form { |
114 | 115 | // TO_REFACT: |
115 | 116 | .btn { |
116 | 117 | display: inline-block; |
117 | - padding: 6px 12px; | |
118 | + padding: 0 12px; | |
118 | 119 | margin-bottom: 0; |
119 | 120 | font-size: 14px; |
120 | 121 | font-weight: 400; |
121 | - line-height: 3.1; | |
122 | + // line-height: 3.1; | |
122 | 123 | text-align: center; |
123 | 124 | white-space: nowrap; |
124 | 125 | vertical-align: middle; |
... | ... | @@ -130,13 +131,14 @@ form { |
130 | 131 | -ms-user-select: none; |
131 | 132 | user-select: none; |
132 | 133 | background-image: none; |
133 | - border: 1px solid transparent; | |
134 | + border: 0; | |
135 | + vertical-align: middle; | |
134 | 136 | /* border-radius: 4px; */ |
135 | 137 | } |
136 | 138 | |
137 | 139 | .btn-default { |
138 | - color: #000; | |
139 | - background-color: #fff; | |
140 | + color: #fff; | |
141 | + background-color: transparent; | |
140 | 142 | border-color: #ccc; |
141 | 143 | } |
142 | 144 | |
... | ... | @@ -151,7 +153,61 @@ form { |
151 | 153 | } |
152 | 154 | } |
153 | 155 | |
154 | -#captcha{ | |
156 | +@captcha{ | |
155 | 157 | padding-left: 25px; |
156 | 158 | padding-top: 20px; |
157 | 159 | } |
160 | + | |
161 | +@media (max-width: 480px) { | |
162 | + header { | |
163 | + height: auto; | |
164 | + h1 { | |
165 | + border-bottom: 0; | |
166 | + padding-bottom: 15px; | |
167 | + padding-top: 50px; | |
168 | + position: relative; | |
169 | + margin-bottom: 0; | |
170 | + } | |
171 | + #display-contrast { | |
172 | + position: absolute; | |
173 | + top: 10px; | |
174 | + } | |
175 | + } | |
176 | + .social { | |
177 | + &.top { | |
178 | + float: none; | |
179 | + margin-top: 0; | |
180 | + margin-bottom: 20px; | |
181 | + } | |
182 | + } | |
183 | + .select { | |
184 | + .proposal-category { | |
185 | + &:after { | |
186 | + content: ""; | |
187 | + display: block; | |
188 | + clear: both; | |
189 | + } | |
190 | + } | |
191 | + .proposal-selection { | |
192 | + float: none; | |
193 | + margin: 4px 0 0 !important; | |
194 | + width: auto; | |
195 | + } | |
196 | + } | |
197 | + .proposal-header { | |
198 | + .show_body { | |
199 | + a { | |
200 | + display: block !important; | |
201 | + line-height: 1; | |
202 | + } | |
203 | + span { | |
204 | + display: inline !important; | |
205 | + } | |
206 | + } | |
207 | + .abstract { | |
208 | + p { | |
209 | + padding-bottom: 5px !important; | |
210 | + } | |
211 | + } | |
212 | + } | |
213 | +} | ... | ... |