Skip to content

Commit

Permalink
Fix styling of padination dummy tags
Browse files Browse the repository at this point in the history
  • Loading branch information
AtomicNibble authored and sio4 committed Sep 4, 2022
1 parent 86b68f9 commit 9f6a549
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion pagination.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func urlFor(path string, page int) (string, error) {

func pageLIDummy() *Tag {
li := New("li", Options{"class": "page-item disabled"})
a := New("a", Options{"body": "..."})
a := New("a", Options{"class": "page-link", "body": "..."})
li.Append(a)
return li
}
8 changes: 4 additions & 4 deletions pagination_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ func Test_Pagination_LongPageStart(t *testing.T) {
})
r.NoError(err)

r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item disabled"><span class="page-link">&laquo;</span></li><li class="page-item active"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">2</a></li><li class="page-item"><a class="page-link" href="/foo?page=3">3</a></li><li class="page-item"><a class="page-link" href="/foo?page=4">4</a></li><li class="page-item"><a class="page-link" href="/foo?page=5">5</a></li><li class="page-item"><a class="page-link" href="/foo?page=6">6</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">7</a></li><li class="page-item"><a class="page-link" href="/foo?page=8">8</a></li><li class="page-item"><a class="page-link" href="/foo?page=9">9</a></li><li class="page-item disabled"><a>...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">&raquo;</a></li></ul>`), tag.HTML())
r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item disabled"><span class="page-link">&laquo;</span></li><li class="page-item active"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">2</a></li><li class="page-item"><a class="page-link" href="/foo?page=3">3</a></li><li class="page-item"><a class="page-link" href="/foo?page=4">4</a></li><li class="page-item"><a class="page-link" href="/foo?page=5">5</a></li><li class="page-item"><a class="page-link" href="/foo?page=6">6</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">7</a></li><li class="page-item"><a class="page-link" href="/foo?page=8">8</a></li><li class="page-item"><a class="page-link" href="/foo?page=9">9</a></li><li class="page-item disabled"><a class="page-link">...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">&raquo;</a></li></ul>`), tag.HTML())
}

func Test_Pagination_LongPageStartPoint1(t *testing.T) {
Expand All @@ -74,7 +74,7 @@ func Test_Pagination_LongPageStartPoint1(t *testing.T) {
})
r.NoError(err)

r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=5">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">2</a></li><li class="page-item"><a class="page-link" href="/foo?page=3">3</a></li><li class="page-item"><a class="page-link" href="/foo?page=4">4</a></li><li class="page-item"><a class="page-link" href="/foo?page=5">5</a></li><li class="page-item active"><a class="page-link" href="/foo?page=6">6</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">7</a></li><li class="page-item"><a class="page-link" href="/foo?page=8">8</a></li><li class="page-item"><a class="page-link" href="/foo?page=9">9</a></li><li class="page-item disabled"><a>...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">&raquo;</a></li></ul>`), tag.HTML())
r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=5">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item"><a class="page-link" href="/foo?page=2">2</a></li><li class="page-item"><a class="page-link" href="/foo?page=3">3</a></li><li class="page-item"><a class="page-link" href="/foo?page=4">4</a></li><li class="page-item"><a class="page-link" href="/foo?page=5">5</a></li><li class="page-item active"><a class="page-link" href="/foo?page=6">6</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">7</a></li><li class="page-item"><a class="page-link" href="/foo?page=8">8</a></li><li class="page-item"><a class="page-link" href="/foo?page=9">9</a></li><li class="page-item disabled"><a class="page-link">...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=7">&raquo;</a></li></ul>`), tag.HTML())
}

func Test_Pagination_LongPagePoint2(t *testing.T) {
Expand All @@ -88,7 +88,7 @@ func Test_Pagination_LongPagePoint2(t *testing.T) {
})
r.NoError(err)

r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=22">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item disabled"><a>...</a></li><li class="page-item"><a class="page-link" href="/foo?page=20">20</a></li><li class="page-item"><a class="page-link" href="/foo?page=21">21</a></li><li class="page-item"><a class="page-link" href="/foo?page=22">22</a></li><li class="page-item active"><a class="page-link" href="/foo?page=23">23</a></li><li class="page-item"><a class="page-link" href="/foo?page=24">24</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">25</a></li><li class="page-item"><a class="page-link" href="/foo?page=26">26</a></li><li class="page-item disabled"><a>...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=24">&raquo;</a></li></ul>`), tag.HTML())
r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=22">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item disabled"><a class="page-link">...</a></li><li class="page-item"><a class="page-link" href="/foo?page=20">20</a></li><li class="page-item"><a class="page-link" href="/foo?page=21">21</a></li><li class="page-item"><a class="page-link" href="/foo?page=22">22</a></li><li class="page-item active"><a class="page-link" href="/foo?page=23">23</a></li><li class="page-item"><a class="page-link" href="/foo?page=24">24</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">25</a></li><li class="page-item"><a class="page-link" href="/foo?page=26">26</a></li><li class="page-item disabled"><a class="page-link">...</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=24">&raquo;</a></li></ul>`), tag.HTML())
}

func Test_Pagination_LongPageEnd(t *testing.T) {
Expand All @@ -102,7 +102,7 @@ func Test_Pagination_LongPageEnd(t *testing.T) {
})
r.NoError(err)

r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=23">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item disabled"><a>...</a></li><li class="page-item"><a class="page-link" href="/foo?page=21">21</a></li><li class="page-item"><a class="page-link" href="/foo?page=22">22</a></li><li class="page-item"><a class="page-link" href="/foo?page=23">23</a></li><li class="page-item active"><a class="page-link" href="/foo?page=24">24</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">25</a></li><li class="page-item"><a class="page-link" href="/foo?page=26">26</a></li><li class="page-item"><a class="page-link" href="/foo?page=27">27</a></li><li class="page-item"><a class="page-link" href="/foo?page=28">28</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">&raquo;</a></li></ul>`), tag.HTML())
r.Equal(template.HTML(`<ul class=" pagination"><li class="page-item"><a class="page-link" href="/foo?page=23">&laquo;</a></li><li class="page-item"><a class="page-link" href="/foo?page=1">1</a></li><li class="page-item disabled"><a class="page-link">...</a></li><li class="page-item"><a class="page-link" href="/foo?page=21">21</a></li><li class="page-item"><a class="page-link" href="/foo?page=22">22</a></li><li class="page-item"><a class="page-link" href="/foo?page=23">23</a></li><li class="page-item active"><a class="page-link" href="/foo?page=24">24</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">25</a></li><li class="page-item"><a class="page-link" href="/foo?page=26">26</a></li><li class="page-item"><a class="page-link" href="/foo?page=27">27</a></li><li class="page-item"><a class="page-link" href="/foo?page=28">28</a></li><li class="page-item"><a class="page-link" href="/foo?page=29">29</a></li><li class="page-item"><a class="page-link" href="/foo?page=25">&raquo;</a></li></ul>`), tag.HTML())
}

func Test_Pagination_NextPrevContent(t *testing.T) {
Expand Down

0 comments on commit 9f6a549

Please sign in to comment.