Commit db13bb3bef4a7cf98c38d0ed5f97bf7824885bb1
Exists in
master
and in
2 other branches
Merge branch 'master' of softwarepublico.gov.br:noosfero-apps/proposal-app
Showing
5 changed files
with
31 additions
and
28 deletions
Show diff stats
index.html
@@ -83,7 +83,7 @@ | @@ -83,7 +83,7 @@ | ||
83 | var script_element = document.createElement('script'); | 83 | var script_element = document.createElement('script'); |
84 | script_element.type = 'text/javascript'; | 84 | script_element.type = 'text/javascript'; |
85 | script_element.src = makeJSURL('js/require.js'); | 85 | script_element.src = makeJSURL('js/require.js'); |
86 | - script_element.setAttribute('data-main', makeJSURL('js/requirejs-config.js')); | 86 | + script_element.setAttribute('data-main', makeJSURL('js/requirejs-config.js?v=2')); |
87 | head.appendChild(script_element); | 87 | head.appendChild(script_element); |
88 | } | 88 | } |
89 | 89 | ||
@@ -403,7 +403,7 @@ | @@ -403,7 +403,7 @@ | ||
403 | {{#each proposals}} | 403 | {{#each proposals}} |
404 | <tr> | 404 | <tr> |
405 | <td class="">{{calcPosition @index ../pagination.per_page ../pagination.page}}°</td> | 405 | <td class="">{{calcPosition @index ../pagination.per_page ../pagination.page}}°</td> |
406 | - <td class="abstract-text"><div class="truncate"><p class="truncated"><a href="{{proposal_url ../topic_id id}}">{{stripTags abstract}}</a></p></div></td> | 406 | + <td class="abstract-text"><div class="truncate"><p class="truncated"><a href="{{proposal_url ../topic_id proposal_id}}">{{stripTags abstract}}</a></p></div></td> |
407 | <td class="views value">{{hits}}</td> | 407 | <td class="views value">{{hits}}</td> |
408 | <td class="votes-for value">{{votes_for}}</td> | 408 | <td class="votes-for value">{{votes_for}}</td> |
409 | <td class="votes-against value">{{votes_against}}</td> | 409 | <td class="votes-against value">{{votes_against}}</td> |
js/main.js
1 | /* global define */ | 1 | /* global define */ |
2 | -define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers', 'piwik'], function($, Handlebars, FastClick, ProposalApp){ | 2 | +define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers', 'piwik_config'], function($, Handlebars, FastClick, ProposalApp){ |
3 | // 'use strict'; | 3 | // 'use strict'; |
4 | 4 | ||
5 | // The template code | 5 | // The template code |
@@ -930,8 +930,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -930,8 +930,8 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
930 | return msg; | 930 | return msg; |
931 | }, | 931 | }, |
932 | display_events: function(cat_id, active_category) { | 932 | display_events: function(cat_id, active_category) { |
933 | - //var url = host + '/api/v1/communities/' + dialoga_community + '/articles?categories_ids[]=' + cat_id + '&content_type=Event&private_token=' + '375bee7e17d0021af7160ce664874618'; | ||
934 | - var url = host + '/api/v1/communities/' + dialoga_community + '/articles?categories_ids[]=' + cat_id + '&content_type=Event'; | 933 | + //var url = host + '/api/v1/communities/' + dialoga_community + '/articles?category_ids[]=' + cat_id + '&content_type=Event&private_token=' + '375bee7e17d0021af7160ce664874618'; |
934 | + var url = host + '/api/v1/communities/' + dialoga_community + '/articles?category_ids[]=' + cat_id + '&content_type=Event'; | ||
935 | $.getJSON(url).done(function (data) { | 935 | $.getJSON(url).done(function (data) { |
936 | 936 | ||
937 | if(data.articles.length === 0){ | 937 | if(data.articles.length === 0){ |
@@ -1109,7 +1109,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1109,7 +1109,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
1109 | .addClass('alert-success') | 1109 | .addClass('alert-success') |
1110 | .show(); | 1110 | .show(); |
1111 | 1111 | ||
1112 | - $(document).trigger('login:success', response); | 1112 | + $(document).trigger('login:success', response['user']); |
1113 | } | 1113 | } |
1114 | 1114 | ||
1115 | }, | 1115 | }, |
@@ -1494,7 +1494,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1494,7 +1494,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
1494 | $loginPanel.hide(); | 1494 | $loginPanel.hide(); |
1495 | } | 1495 | } |
1496 | 1496 | ||
1497 | - $(document).trigger('login:success', data); | 1497 | + $(document).trigger('login:success', data['user']); |
1498 | }).fail(function(data) { | 1498 | }).fail(function(data) { |
1499 | 1499 | ||
1500 | $message.show(); | 1500 | $message.show(); |
@@ -1768,7 +1768,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | @@ -1768,7 +1768,7 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers | ||
1768 | if($sectionContent && $sectionContent.length > 0){ | 1768 | if($sectionContent && $sectionContent.length > 0){ |
1769 | Main.displaySuccess($sectionContent, 'Cadastro efetuado com sucesso', 1000, 'icon-user-created'); | 1769 | Main.displaySuccess($sectionContent, 'Cadastro efetuado com sucesso', 1000, 'icon-user-created'); |
1770 | } | 1770 | } |
1771 | - $(document).trigger('login:success', data); | 1771 | + $(document).trigger('login:success', data['user']); |
1772 | } else { | 1772 | } else { |
1773 | $signupForm.find('.cancel-signup').click(); | 1773 | $signupForm.find('.cancel-signup').click(); |
1774 | $signupForm.hide(); | 1774 | $signupForm.hide(); |
@@ -0,0 +1,21 @@ | @@ -0,0 +1,21 @@ | ||
1 | +define(['piwik_config'], function(){ | ||
2 | + | ||
3 | + var _paq = _paq || []; | ||
4 | + _paq.push(["trackPageView"]); | ||
5 | + _paq.push(["enableLinkTracking"]); | ||
6 | + | ||
7 | + var isProduction = /^http:\/\/dialoga\.gov\.br\//.test(window.location.href); | ||
8 | + var siteId = isProduction ? "65" : "1"; | ||
9 | + | ||
10 | + (function() { | ||
11 | + var u="http://estatisticas.dialoga.gov.br/"; | ||
12 | + _paq.push(["setTrackerUrl", u+"piwik.php"]); | ||
13 | + _paq.push(["setSiteId", siteId]); | ||
14 | + var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; | ||
15 | + g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); | ||
16 | + })(); | ||
17 | + | ||
18 | + window._paq = _paq; | ||
19 | + return _paq; | ||
20 | + | ||
21 | +}); |
js/piwik.js
@@ -1,18 +0,0 @@ | @@ -1,18 +0,0 @@ | ||
1 | -define(['piwik'], function(){ | ||
2 | - | ||
3 | - var _paq = _paq || []; | ||
4 | - _paq.push(["trackPageView"]); | ||
5 | - _paq.push(["enableLinkTracking"]); | ||
6 | - | ||
7 | - (function() { | ||
8 | - var u="http://estatisticas.presidencia.gov.br/"; | ||
9 | - _paq.push(["setTrackerUrl", u+"piwik.php"]); | ||
10 | - _paq.push(["setSiteId", "65"]); | ||
11 | - var d=document, g=d.createElement("script"), s=d.getElementsByTagName("script")[0]; g.type="text/javascript"; | ||
12 | - g.defer=true; g.async=true; g.src=u+"piwik.js"; s.parentNode.insertBefore(g,s); | ||
13 | - })(); | ||
14 | - | ||
15 | - window._paq = _paq; | ||
16 | - return _paq; | ||
17 | - | ||
18 | -}); |
js/requirejs-config.js
@@ -8,7 +8,7 @@ requirejs.config({ | @@ -8,7 +8,7 @@ requirejs.config({ | ||
8 | baseUrl: base, | 8 | baseUrl: base, |
9 | waitSeconds: 0, | 9 | waitSeconds: 0, |
10 | paths: { | 10 | paths: { |
11 | - piwik: 'piwik', | 11 | + piwik_config: 'piwik-config', |
12 | jquery: 'jquery-2.1.3.min', | 12 | jquery: 'jquery-2.1.3.min', |
13 | jquery_xdomainrequest: 'jquery.xdomainrequest.min', | 13 | jquery_xdomainrequest: 'jquery.xdomainrequest.min', |
14 | jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min', | 14 | jquery_ui: 'jquery-ui-1.11.4.custom/jquery-ui.min', |
@@ -78,6 +78,6 @@ requirejs.config({ | @@ -78,6 +78,6 @@ requirejs.config({ | ||
78 | } | 78 | } |
79 | }); | 79 | }); |
80 | 80 | ||
81 | -requirejs(['piwik']); | 81 | +requirejs(['piwik_config']); |
82 | requirejs(['jquery', 'proposal_app', 'jquery_ui', 'jquery_xdomainrequest', 'jquery_timeago_pt', 'jquery_simplePagination', 'jquery_equalHeights', 'footable', 'handlebars_helpers']); | 82 | requirejs(['jquery', 'proposal_app', 'jquery_ui', 'jquery_xdomainrequest', 'jquery_timeago_pt', 'jquery_simplePagination', 'jquery_equalHeights', 'footable', 'handlebars_helpers']); |
83 | requirejs(['slick', 'fastclick', 'jquery_maxlength', 'layout','main']); | 83 | requirejs(['slick', 'fastclick', 'jquery_maxlength', 'layout','main']); |