Skip to content

Commit 24a2540

Browse files
author
NooBxGockeL
committed
Labels! On the pattern list for better overview over all the different patterns
1 parent f647cca commit 24a2540

2 files changed

Lines changed: 21 additions & 10 deletions

File tree

pages/patterns.html

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
page-index: 3
88
---
99
<div id="index" class="row">
10+
<!-- MAIN -->
1011
<div class="col-sm-9">
1112
<div class="content-area">
1213
<!-- small button -->
@@ -24,28 +25,39 @@
2425
{% assign allPatterns = site.pages | where:"layout","pattern" | sort: 'title' %}
2526
<div>
2627
{% for page in allPatterns %}
27-
<a class="list-item" href="{{ page.url | prepend: site.baseurl }}"
28+
<div class="list-item" href="{{ page.url | prepend: site.baseurl }}"
2829
cats='All;{{ page.categories | join: ';' }}'
2930
tags='All;{{ page.tags | join: ';' }}'>
30-
<h2>{{ page.title }}</h2>
31-
</a>
31+
<a href="{{ page.url | prepend: site.baseurl }}"><h2>{{ page.title }}</h2></a>
32+
<span class="cats">
33+
{% for cat in page.categories %}
34+
<a href="javascript:;" class="cat-button" category="{{ cat }}">{{ cat }}</a>
35+
{% endfor %}
36+
</span>
37+
<span class="tags">
38+
{% for tag in page.tags %}
39+
<a href="javascript:;" class="tag-button" tag="{{ tag }}">{{ tag }}</a>
40+
{% endfor %}
41+
</span>
42+
</div>
3243

3344
{% endfor %}
3445
</div>
3546
</div>
3647
</div>
3748
</div>
49+
<!-- SIDEBAR -->
3850
<div class="col-sm-3">
3951
<div class="shadow-corner-curl hidden-xs">
4052
<div class="sidebar-list-header">
4153
Categories
4254
</div>
4355

44-
<a href="javascript:;" class="sidebar-list-item category" category="All">
56+
<a href="javascript:;" class="sidebar-list-item cat-button" category="All">
4557
All<span class="my-badge"> {{ allPatterns | size }}</span>
4658
</a>
4759
{% for category in site.data.categories %}
48-
<a href="javascript:;" class="sidebar-list-item category" category="{{ category.name }}">
60+
<a href="javascript:;" class="sidebar-list-item cat-button" category="{{ category.name }}">
4961
{{ category.name }} <span class="my-badge">
5062
{% assign counter=0 %}
5163
{% for page in allPatterns %}
@@ -64,11 +76,11 @@ <h2>{{ page.title }}</h2>
6476
Tags
6577
</div>
6678

67-
<a href="javascript:;" class="sidebar-list-item tag" tag="All">
79+
<a href="javascript:;" class="sidebar-list-item tag-button" tag="All">
6880
All<span class="my-badge"> {{ allPatterns | size }}</span>
6981
</a>
7082
{% for tag in site.data.tags %}
71-
<a href="javascript:;" class="sidebar-list-item tag" tag="{{ tag.name }}">
83+
<a href="javascript:;" class="sidebar-list-item tag-button" tag="{{ tag.name }}">
7284
{{ tag.name }} <span class="my-badge">
7385
{% assign counter=0 %}
7486
{% for page in allPatterns %}

static/js/index.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,15 +42,14 @@ function categoryAndTagDisplay() {
4242
$('.post-list-body>div[post-tag!=All]').hide();
4343
*/
4444
/*show category when click categories list*/
45-
$('.sidebar-list-item.category').click(function() {
45+
$('a.cat-button').click(function() {
4646
var category = $(this).attr('category'); //get category's name
4747
$('.list-item').not('[cats*=\'' + category + '\']').slideUp(200)
4848
$('.list-item[cats*=\'' + category + '\']').slideDown()
4949
});
5050
/*show category when click tags list*/
51-
$('.sidebar-list-item.tag').click(function() {
51+
$('a.tag-button').click(function() {
5252
var tag = $(this).attr('tag'); //get tag's name
53-
5453
$('.list-item').not('[tags*=\'' + tag + '\']').slideUp(200)
5554
$('.list-item[tags*=\'' + tag + '\']').slideDown()
5655
});

0 commit comments

Comments
 (0)