fipamo/themes/dash/posts-index.pug

47 lines
2.3 KiB
Text
Raw Normal View History

2018-10-31 17:00:31 +01:00
extends frame
block main-content
2019-03-01 23:48:05 +01:00
#post-index
#post-index-wrapper
2019-02-22 02:19:13 +01:00
#post-index-menu
2019-03-01 23:48:05 +01:00
- if(postFilter=='all')
a.current-filter(href="/@/dashboard/posts/all")= "All Posts ("+page_info.all+")"
- else
a(href="/@/dashboard/posts/all")= "All Posts ("+page_info.all+")"
2019-02-22 02:19:13 +01:00
| .
2019-03-01 23:48:05 +01:00
- if(postFilter=='published')
a.current-filter(href="/@/dashboard/posts/published")= "Published ("+page_info.published+")"
- else
a(href="/@/dashboard/posts/published")= "Published ("+page_info.published+")"
2019-02-22 02:19:13 +01:00
| .
2019-03-01 23:48:05 +01:00
- if(postFilter=='deleted')
a.current-filter(href="/@/dashboard/posts/deleted")= "Deleted ("+page_info.deleted+")"
- else
a(href="/@/dashboard/posts/deleted")= "Deleted ("+page_info.deleted+")"
2019-02-22 02:19:13 +01:00
a.add-new-post(href="/@/dashboard/posts/add/new") + Create New Post
#posts-list
2018-10-31 17:00:31 +01:00
- var index = 0;
- for ( index; index < items.length; index++)
2019-02-22 02:19:13 +01:00
a.post-link(href="/@/dashboard/posts/edit/"+items[index].post.uuid id=items[index].post.uuid)
label= items[index].post.title
span= items[index].post.created
div.post-bg(style="background: #fc6399 url("+items[index].post.feature.substr(8)+") no-repeat center center / cover")
p= items[index].post.plaintext.substr(0, 200)+"..."
2019-03-01 23:48:05 +01:00
2018-10-31 17:00:31 +01:00
- var next = parseInt(page_index, 10) + 1
- var prev = parseInt(page_index, 10) - 1
- if(next > page_count) next = 1
- if(prev <= 0) prev = page_count
br
2019-03-01 23:48:05 +01:00
a.page-btns(href="/@/dashboard/posts/"+postFilter+"/"+prev)
2018-10-31 17:00:31 +01:00
svg(viewBox="0 0 20 20" class="icons")
use(xlink:href='/dash/assets/images/sprite.svg#entypo-chevron-left')
span.paginate= "PAGE "+page_index+" OF "+page_count
2019-03-01 23:48:05 +01:00
a.page-btns(href="/@/dashboard/posts/"+postFilter+"/"+next)
2018-10-31 17:00:31 +01:00
svg(viewBox="0 0 20 20" class="icons")
use(xlink:href='/dash/assets/images/sprite.svg#entypo-chevron-right')
2019-03-01 23:48:05 +01:00