client/tags: allow deleting used tags
This commit is contained in:
		
							parent
							
								
									f40e41ae8b
								
							
						
					
					
						commit
						7e6e59417e
					
				@ -1,20 +1,17 @@
 | 
			
		||||
<div class='tag-delete'>
 | 
			
		||||
    <form>
 | 
			
		||||
        <% if (ctx.tag.postCount) { %>
 | 
			
		||||
            <p>For extra <s>paranoia</s> safety, only tags that are unused can be deleted.</p>
 | 
			
		||||
            <p>Check <a href='/posts/query=<%- encodeURIComponent(ctx.tag.names[0]) %>'>which posts</a> are tagged with <%- ctx.tag.names[0] %>.</p>
 | 
			
		||||
        <% } else { %>
 | 
			
		||||
            <ul>
 | 
			
		||||
                <li>
 | 
			
		||||
                    <%= ctx.makeCheckbox({id: 'confirm-deletion', name: 'confirm-deletion', required: true, text: 'I confirm that I want to delete this tag.'}) %>
 | 
			
		||||
                </li>
 | 
			
		||||
            </ul>
 | 
			
		||||
        <p>This tag has <a href='/posts/query=<%- encodeURIComponent(ctx.tag.names[0]) %>'><%- ctx.tag.postCount %> usage(s)</a>.</p>
 | 
			
		||||
 | 
			
		||||
            <div class='messages'></div>
 | 
			
		||||
        <ul>
 | 
			
		||||
            <li>
 | 
			
		||||
                <%= ctx.makeCheckbox({id: 'confirm-deletion', name: 'confirm-deletion', required: true, text: 'I confirm that I want to delete this tag.'}) %>
 | 
			
		||||
            </li>
 | 
			
		||||
        </ul>
 | 
			
		||||
 | 
			
		||||
            <div class='buttons'>
 | 
			
		||||
                <input type='submit' value='Delete tag'/>
 | 
			
		||||
            </div>
 | 
			
		||||
        <% } %>
 | 
			
		||||
        <div class='messages'></div>
 | 
			
		||||
 | 
			
		||||
        <div class='buttons'>
 | 
			
		||||
            <input type='submit' value='Delete tag'/>
 | 
			
		||||
        </div>
 | 
			
		||||
    </form>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
@ -36,6 +36,6 @@
 | 
			
		||||
    <section class='description'>
 | 
			
		||||
        <hr/>
 | 
			
		||||
        <%= ctx.makeMarkdown(ctx.tag.description || 'This tag has no description yet.') %>
 | 
			
		||||
        <p>This tag has <a href='/posts/query=<%- encodeURIComponent(ctx.tag.names[0]) %>'><%- ctx.tag.postCount %> usages</a>.</p>
 | 
			
		||||
        <p>This tag has <a href='/posts/query=<%- encodeURIComponent(ctx.tag.names[0]) %>'><%- ctx.tag.postCount %> usage(s)</a>.</p>
 | 
			
		||||
    </section>
 | 
			
		||||
</div>
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user