Skip to content

Commit

Permalink
Add link to authoring a new guide when filter results in no guides
Browse files Browse the repository at this point in the history
  • Loading branch information
durden committed Jul 7, 2016
1 parent 7077871 commit 6ec72ce
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
5 changes: 5 additions & 0 deletions pskb_website/static/css/base.css
Expand Up @@ -1030,6 +1030,11 @@ td.login-name {
text-align: center;
}

#no-guides {
text-align: center;
font-size: 18px;
}

.login-button .btn-primary {
color: #fff;
}
Expand Down
7 changes: 7 additions & 0 deletions pskb_website/static/js/utils.js
Expand Up @@ -25,6 +25,7 @@ function populate_table_of_contents(article, div_to_fill) {

function filter() {
var stacks = document.getElementById("stacks");
var no_guides = $('#no-guides');
var selected_stacks = [];

for (var ii=0; ii < stacks.length; ii++) {
Expand All @@ -50,6 +51,12 @@ function filter() {
});

shuffle_items_in_grid(items_to_show);

if (!items_to_show.length) {
no_guides.css('display', 'block');
} else {
no_guides.css('display', 'none');
}
}


Expand Down
3 changes: 3 additions & 0 deletions pskb_website/templates/article_list.html
Expand Up @@ -87,6 +87,9 @@
</div> <!-- teaser col -->
{% if loop.last %}
</div> <!-- inner-row -->
<div id="no-guides" style="display: none;">
<p>No guides for that selection yet. Share your expertise and <a href="{{url_for('write')}}">write one</a>.</p>
</div>
</div> <!-- col-md-12 -->
</div> <!-- outer-row -->
{% endif %}
Expand Down

0 comments on commit 6ec72ce

Please sign in to comment.