43529c488a
no issue - the index route/controller/template was initially used for a separate loading state within the posts screen layout, this isn't necessary however as the same effect can be achieved with the `posts-loading.hbs` template - this change also lays the groundwork for more complex dropdown-based filters as it enables the filters and query params to live in the same controller+template
68 lines
2.8 KiB
Handlebars
68 lines
2.8 KiB
Handlebars
<section class="gh-canvas">
|
|
<header class="gh-canvas-header">
|
|
<h2 class="gh-canvas-title">Your stories</h2>
|
|
<section class="view-actions">
|
|
{{#link-to "editor.new" class="gh-btn gh-btn-green" data-test-new-post-button=true}}<span>New story</span>{{/link-to}}
|
|
</section>
|
|
</header>
|
|
|
|
<div class="gh-contentfilter">
|
|
{{#active-link}}
|
|
{{link-to "All" "posts.index" (query-params type=null) data-test-all-filter-link=true}}
|
|
{{/active-link}}
|
|
{{#active-link}}
|
|
{{link-to "Drafts" "posts.index" (query-params type="draft") data-test-drafts-filter-link=true}}
|
|
{{/active-link}}
|
|
{{#active-link}}
|
|
{{link-to "Published" "posts.index" (query-params type="published") data-test-published-filter-link=true}}
|
|
{{/active-link}}
|
|
{{#active-link}}
|
|
{{link-to "Scheduled" "posts.index" (query-params type="scheduled") data-test-scheduled-filter-link=true}}
|
|
{{/active-link}}
|
|
{{#active-link}}
|
|
{{link-to "Pages" "posts.index" (query-params type="page") data-test-pages-filter-link=true}}
|
|
{{/active-link}}
|
|
</div>
|
|
|
|
<section class="content-list">
|
|
<ol class="posts-list">
|
|
{{#each model as |post|}}
|
|
{{gh-posts-list-item
|
|
post=post
|
|
active=(eq post selectedPost)
|
|
onDoubleClick="openEditor"
|
|
data-test-posts-list-item-id=post.id}}
|
|
{{else}}
|
|
<li class="no-posts-box">
|
|
<div class="no-posts">
|
|
{{#if showingAll}}
|
|
<h3>You Haven't Written Any Posts Yet!</h3>
|
|
{{#link-to "editor.new"}}<button type="button" class="gh-btn gh-btn-green gh-btn-lg"><span>Write a new Post</span></button>{{/link-to}}
|
|
{{else}}
|
|
<h3>No posts that match the current filter</h3>
|
|
{{#link-to "posts.index" (query-params type=null)}}<button type="button" class="gh-btn gh-btn-lg"><span>Show all posts</span></button>{{/link-to}}
|
|
{{/if}}
|
|
</div>
|
|
</li>
|
|
{{/each}}
|
|
</ol>
|
|
|
|
{{infinity-loader
|
|
infinityModel=model
|
|
scrollable=".gh-main"
|
|
triggerOffset=1000}}
|
|
</section>
|
|
|
|
{{#if showDeletePostModal}}
|
|
{{gh-fullscreen-modal "delete-post"
|
|
model=(hash
|
|
post=selectedPost
|
|
onSuccess=(route-action 'onPostDeletion')
|
|
)
|
|
close=(action "toggleDeletePostModal")
|
|
modifier="action wide"}}
|
|
{{/if}}
|
|
|
|
{{outlet}}
|
|
</section>
|