diff --git a/index.html b/index.html index 80f83c7..179d974 100644 --- a/index.html +++ b/index.html @@ -82,6 +82,10 @@ {{#each categories}}
  • {{name}} + {{#select_proposal ../../article.children slug ../id}}{{/select_proposal}}
  • {{/each}} diff --git a/js/main.js b/js/main.js index 708c0b0..e5698a9 100644 --- a/js/main.js +++ b/js/main.js @@ -79,6 +79,13 @@ $.getJSON(noosferoAPI) updateHash($link.attr('href')); }); + $( '.proposal-category .go-back' ).click(function(event){ + event.preventDefault(); + + // Update URL and Navigate + updateHash('#/temas'); + }); + $( '.send-button a' ).click(function(event){ //display form to send proposal (or login form for non-logged users) loginButton = $(this).parents('.send-button'); @@ -279,6 +286,9 @@ function display_category_tab(){ $('.proposal-category-items').hide(); $('.proposal-category .arrow-box').hide(); $('.proposal-detail').hide(); + + $('#content').show(); + $('nav').show(); } function display_proposals_tab(){ @@ -287,6 +297,9 @@ function display_proposals_tab(){ $('#nav-proposal-group a').addClass('active'); $('#nav-proposal-categories a').removeClass('active'); $(".proposal-item p").dotdotdot(); + + $('#content').show(); + $('nav').show(); } function display_proposal(proposal_id){ @@ -368,18 +381,33 @@ function locationHashChanged(){ function navigateTo(hash){ var regexProposals = /#\/programas/; var regexCategory = /#\/temas/; - var m; var parts = hash.split('/'); - if( (m = regexProposals.exec(hash)) !== null ){ + var isProposal = regexProposals.exec(hash) !== null; + var isCategory = regexCategory.exec(hash) !== null; + + if( isProposal ){ + + // go to proposal var proposalId = parts[2]; navigateToProposal(proposalId); - } else if( (m = regexCategory.exec(hash)) !== null ){ + + return; + } + + if( isCategory ){ + + // go to category var categoryId = parts[3]; navigateToCategory(categoryId); - } else { - console.log('route not handled', hash); + + return; } + + // default + // show the 'index' -> category tab + display_category_tab(); + console.log('route not handled', hash); } function navigateToProposal(proposalId){ diff --git a/sass/style.scss b/sass/style.scss index 1540c09..fb78645 100755 --- a/sass/style.scss +++ b/sass/style.scss @@ -99,3 +99,32 @@ form { margin-top: 10px; } } + +// @TO_ADD: Leonardo +.btn { + display: inline-block; + padding: 6px 12px; + margin-bottom: 0; + font-size: 14px; + font-weight: 400; + line-height: 3.1; + text-align: center; + white-space: nowrap; + vertical-align: middle; + -ms-touch-action: manipulation; + touch-action: manipulation; + cursor: pointer; + -webkit-user-select: none; + -moz-user-select: none; + -ms-user-select: none; + user-select: none; + background-image: none; + border: 1px solid transparent; + /* border-radius: 4px; */ +} + +.btn-default { + color: #333; + background-color: #fff; + border-color: #ccc; +} \ No newline at end of file -- libgit2 0.21.2