Commit be78d56f9e93d3f3e2b6507de2cefa65368d35c3
Exists in
master
and in
11 other branches
Merge branch 'master' of gitlab.com:participa/proposal-app
Showing
3 changed files
with
13 additions
and
7 deletions
Show diff stats
index.html
| ... | ... | @@ -32,7 +32,7 @@ |
| 32 | 32 | <ul id="proposal-categories"> |
| 33 | 33 | <div id="proposal-categories-container"> |
| 34 | 34 | {{#each article.categories}} |
| 35 | - <li id='proposal-category-{{slug}}' class="proposal-category"> | |
| 35 | + <li id='proposal-category-{{slug}}' class="proposal-category" data-category="{{slug}}"> | |
| 36 | 36 | {{#link name id}}{{/link}} |
| 37 | 37 | <div class="arrow-box" style="display: none"></div> |
| 38 | 38 | </li> |
| ... | ... | @@ -64,8 +64,8 @@ |
| 64 | 64 | <div class='categories {{#each categories}}{{slug}} {{/each}}'> |
| 65 | 65 | <ul> |
| 66 | 66 | {{#each categories}} |
| 67 | - <li class='category'> | |
| 68 | - <a href="#"><span>{{name}}</span></a> | |
| 67 | + <li class='category proposal-category' data-category="{{slug}}"> | |
| 68 | + {{#link name id}}{{/link}} | |
| 69 | 69 | </li> |
| 70 | 70 | {{/each}} |
| 71 | 71 | </ul> | ... | ... |
js/main.js
| ... | ... | @@ -70,11 +70,14 @@ $.getJSON(noosferoAPI) |
| 70 | 70 | var item = this.href.split('#').pop(); |
| 71 | 71 | if($('#' + item).hasClass('proposal-category-items')){ |
| 72 | 72 | //Display Topics or Discussion by category |
| 73 | + $('#proposal-categories').show(); | |
| 73 | 74 | $('.proposal-category-items').hide(); |
| 75 | + $('.proposal-detail').hide(); | |
| 74 | 76 | $('#' + item).show(); |
| 75 | 77 | $(".proposal-item").dotdotdot(); |
| 76 | 78 | $('.proposal-category .arrow-box').hide(); |
| 77 | - $(this).siblings('.arrow-box').show(); | |
| 79 | + $(this).parent('.proposal-category').data('category') | |
| 80 | + $('#proposal-category-'+$(this).parent('.proposal-category').data('category')).find('.arrow-box').show(); | |
| 78 | 81 | } |
| 79 | 82 | event.preventDefault(); |
| 80 | 83 | }); |
| ... | ... | @@ -104,7 +107,8 @@ $.getJSON(noosferoAPI) |
| 104 | 107 | function loadRandomProposal(topic_id, private_token) { |
| 105 | 108 | var url = host + '/api/v1/articles/' + topic_id + '/children' + '?private_token=' + private_token + '&limit=1&order=random()&_='+new Date().getTime()+'&fields=id,name,created_by'; |
| 106 | 109 | $.getJSON(url).done(function( data ) { |
| 107 | - var article = data.articles.length > 0 ? data.articles[0] : null; | |
| 110 | + if(data.articles.length == 0) return; | |
| 111 | + var article = data.articles[0]; | |
| 108 | 112 | $('.support-proposal-container').html(supportProposalTemplate(article)); |
| 109 | 113 | $(document.body).off('click', '.vote-actions .like'); |
| 110 | 114 | $(document.body).on('click', '.vote-actions .like', function(e) { | ... | ... |
sass/_proposal_categories.scss
| ... | ... | @@ -56,7 +56,6 @@ |
| 56 | 56 | color: #172938; |
| 57 | 57 | margin: 0; |
| 58 | 58 | padding-top: 5px; |
| 59 | - background: #fff; | |
| 60 | 59 | margin-bottom: 10px; |
| 61 | 60 | text-align: left; |
| 62 | 61 | } |
| ... | ... | @@ -71,7 +70,6 @@ |
| 71 | 70 | font-family: asap_bold; |
| 72 | 71 | font-size: 16px; |
| 73 | 72 | text-decoration: none; |
| 74 | - background: #fff; | |
| 75 | 73 | } |
| 76 | 74 | |
| 77 | 75 | .proposal-item { |
| ... | ... | @@ -84,6 +82,10 @@ |
| 84 | 82 | vertical-align: top; |
| 85 | 83 | } |
| 86 | 84 | |
| 85 | + .proposal-item:hover { | |
| 86 | + background: #eeeff1; | |
| 87 | + } | |
| 88 | + | |
| 87 | 89 | .proposal-category-items { |
| 88 | 90 | text-align: left; |
| 89 | 91 | border-radius: 6px; | ... | ... |