Commit 4e4fc2b71d4c03165772850b3f1aaa0342aa1095
1 parent
f8b468b8
Exists in
master
and in
10 other branches
Fix issue #22
Showing
2 changed files
with
11 additions
and
9 deletions
Show diff stats
js/handlebars-helpers.js
@@ -13,20 +13,22 @@ Handlebars.registerHelper('list_proposal', function(proposals, options) { | @@ -13,20 +13,22 @@ Handlebars.registerHelper('list_proposal', function(proposals, options) { | ||
13 | for(var i=0, j=proposals.length; i<j; i++) { | 13 | for(var i=0, j=proposals.length; i<j; i++) { |
14 | element = "<li class='proposal-item'><div class='item'>"; | 14 | element = "<li class='proposal-item'><div class='item'>"; |
15 | category = "<ul class='category'>"; | 15 | category = "<ul class='category'>"; |
16 | - | ||
17 | - for(var x=0, y=proposals[i].categories.length; x<y; x++) { | ||
18 | - if((options.hash['category'] != null) && (options.hash['category'] != proposals[i].categories[x].slug)){ | 16 | + |
17 | + var proposal = proposals[i]; | ||
18 | + | ||
19 | + for(var x=0, y=proposal.categories.length; x<y; x++) { | ||
20 | + if((options.hash['category'] != null) && (options.hash['category'] != proposal.categories[x].slug)){ | ||
19 | element = ''; | 21 | element = ''; |
20 | continue; | 22 | continue; |
21 | } | 23 | } |
22 | - category = category + '<li class="category-'+proposals[i].categories[x].slug+'">' + proposals[i].categories[x].name + '</li>'; | 24 | + category = category + '<li class="category-'+proposal.categories[x].slug+'">' + proposal.categories[x].name + '</li>'; |
23 | } | 25 | } |
24 | if(element == ''){ | 26 | if(element == ''){ |
25 | continue; | 27 | continue; |
26 | } | 28 | } |
27 | category = category + '</ul>'; | 29 | category = category + '</ul>'; |
28 | - element = element + options.fn(proposals[i]); | ||
29 | - element = element + (proposals[i].abstract ? proposals[i].abstract : ''); | 30 | + element = element + options.fn(proposal); |
31 | + element = element + (proposal.abstract ? proposal.abstract : ''); | ||
30 | 32 | ||
31 | element = element + category; | 33 | element = element + category; |
32 | ret = ret + element + '</div></li>'; | 34 | ret = ret + element + '</div></li>'; |
js/main.js
@@ -61,7 +61,7 @@ $.getJSON(noosferoAPI) | @@ -61,7 +61,7 @@ $.getJSON(noosferoAPI) | ||
61 | $('#proposal-group').show(); | 61 | $('#proposal-group').show(); |
62 | $('#nav-proposal-group a').addClass('active'); | 62 | $('#nav-proposal-group a').addClass('active'); |
63 | $('#nav-proposal-categories a').removeClass('active'); | 63 | $('#nav-proposal-categories a').removeClass('active'); |
64 | - $(".proposal-item").dotdotdot(); | 64 | + $(".proposal-item p").dotdotdot(); |
65 | event.preventDefault(); | 65 | event.preventDefault(); |
66 | }); | 66 | }); |
67 | $( '.proposal-item a' ).click(function(event){ | 67 | $( '.proposal-item a' ).click(function(event){ |
@@ -78,9 +78,9 @@ $.getJSON(noosferoAPI) | @@ -78,9 +78,9 @@ $.getJSON(noosferoAPI) | ||
78 | $('.proposal-category-items').hide(); | 78 | $('.proposal-category-items').hide(); |
79 | $('.proposal-detail').hide(); | 79 | $('.proposal-detail').hide(); |
80 | $('#' + item).show(); | 80 | $('#' + item).show(); |
81 | - $(".proposal-item").dotdotdot(); | 81 | + $(".proposal-item p").dotdotdot(); |
82 | $('.proposal-category .arrow-box').hide(); | 82 | $('.proposal-category .arrow-box').hide(); |
83 | - $(this).parent('.proposal-category').data('category') | 83 | + $(this).parent('.proposal-category').data('category'); |
84 | $('#proposal-category-'+$(this).parent('.proposal-category').data('category')).find('.arrow-box').show(); | 84 | $('#proposal-category-'+$(this).parent('.proposal-category').data('category')).find('.arrow-box').show(); |
85 | } | 85 | } |
86 | event.preventDefault(); | 86 | event.preventDefault(); |