Commit a020f8b278637add03de20366c007fff88122f25
1 parent
c39bc484
Exists in
master
and in
2 other branches
Fix proposal box theming
Showing
4 changed files
with
20 additions
and
18 deletions
Show diff stats
index.html
| ... | ... | @@ -201,12 +201,6 @@ |
| 201 | 201 | |
| 202 | 202 | <div class="col-sm-9"> |
| 203 | 203 | <article id="proposal-group" class=""> |
| 204 | - <!-- | |
| 205 | - <label for="search-input">Selecione um programa para fazer propostas e contar sua experiência.</label> | |
| 206 | - <div id="search-input-container"> | |
| 207 | - <input placeholder="palavra chave" id="search-input" type="text" name="search" /> | |
| 208 | - </div> | |
| 209 | - --> | |
| 210 | 204 | <a class="ver-todos" href="#/programas" role="tab" aria-controls="proposal-group"><span class="fa fa-angle-right"></span>Ver todos os programas</a> |
| 211 | 205 | <h2 class="name">Programas</h2> |
| 212 | 206 | ... | ... |
js/handlebars-helpers.js
| ... | ... | @@ -31,7 +31,7 @@ define(['handlebars'], function(Handlebars){ |
| 31 | 31 | element = ''; |
| 32 | 32 | continue; |
| 33 | 33 | } |
| 34 | - category = category + '<div class="category-' + proposal.categories[x].slug + '">' + proposal.categories[x].name + '</div>'; | |
| 34 | + category = category + '<div class="category-title">' + proposal.categories[x].name + '</div>'; | |
| 35 | 35 | } |
| 36 | 36 | if (element == '') { |
| 37 | 37 | continue; | ... | ... |
js/main.js
| ... | ... | @@ -370,17 +370,23 @@ define(['jquery', 'handlebars', 'fastclick', 'proposal_app', 'handlebars_helpers |
| 370 | 370 | }, |
| 371 | 371 | // inicio Eduardo |
| 372 | 372 | randomProposalByTheme: function(themeClasses) { |
| 373 | - $('#proposal-group .proposal-list .proposal-item').hide(); | |
| 373 | + var $proposalGroup = $('#proposal-group'); | |
| 374 | + var $proposalList = $proposalGroup.find('.proposal-list'); | |
| 375 | + var $proposalItem = $proposalList.find('.proposal-item'); | |
| 376 | + | |
| 377 | + $proposalItem.hide(); | |
| 378 | + | |
| 374 | 379 | $.each(themeClasses, function(i, themeClass) { |
| 375 | - var proposalsByTheme = $('#proposal-group .proposal-list .proposal-item').find('.' + themeClass); | |
| 380 | + var proposalsByTheme = $proposalList.find('.' + themeClass); | |
| 376 | 381 | var randomizedIndex = Math.floor(Math.random() * proposalsByTheme.length); |
| 377 | - var proposalToShow = $(proposalsByTheme[randomizedIndex]).parents().filter('.proposal-item'); | |
| 378 | - $(proposalToShow).show(); | |
| 382 | + // var proposalToShow = $(proposalsByTheme[randomizedIndex]).parents().filter('.proposal-item'); | |
| 383 | + // $(proposalToShow).show(); | |
| 384 | + $(proposalsByTheme[randomizedIndex]).show(); | |
| 379 | 385 | }); |
| 380 | 386 | }, |
| 381 | 387 | display_category_tab: function(){ |
| 382 | 388 | // $('#proposal-group').hide(); |
| 383 | - this.randomProposalByTheme(['category-saude', 'category-seguranca-publica', 'category-educacao', 'category-reducao-da-pobreza']); | |
| 389 | + this.randomProposalByTheme(['saude', 'seguranca-publica', 'educacao', 'reducao-da-pobreza', 'cultura']); | |
| 384 | 390 | $('#proposal-group').show(); /* Show random proposals*/ |
| 385 | 391 | $('.content').addClass('background'); /* Add class background */ |
| 386 | 392 | $('#proposal-categories').show(); | ... | ... |
sass/style.sass
| ... | ... | @@ -1380,17 +1380,19 @@ h3.titulo-destaque |
| 1380 | 1380 | background-position: 5px 50% |
| 1381 | 1381 | background-repeat: no-repeat |
| 1382 | 1382 | background-size: 32px |
| 1383 | - .category-#{$category} | |
| 1384 | - background-color: $color | |
| 1385 | - background-position: 5px 50% | |
| 1386 | - background-repeat: no-repeat | |
| 1387 | - background-size: 40px | |
| 1388 | - border-color: darken($color, $darken) | |
| 1383 | + .category-title | |
| 1384 | + background-color: $color | |
| 1385 | + border-color: darken($color, $darken) | |
| 1389 | 1386 | .icon |
| 1390 | 1387 | &-#{$category} |
| 1391 | 1388 | background-color: $color |
| 1392 | 1389 | background-image: url(images/icons/#{$category}.png) |
| 1393 | 1390 | |
| 1391 | +.category-title | |
| 1392 | + background-position: 5px 50% | |
| 1393 | + background-repeat: no-repeat | |
| 1394 | + background-size: 40px | |
| 1395 | + | |
| 1394 | 1396 | |
| 1395 | 1397 | // ------------------------------------ |
| 1396 | 1398 | // 9 - Alto Contraste | ... | ... |