Merge pull request #1542 from bookwyrm-social/cancel-button
A cancel button that leads nowhere
This commit is contained in:
		@@ -108,7 +108,13 @@
 | 
				
			|||||||
    {% if not confirm_mode %}
 | 
					    {% if not confirm_mode %}
 | 
				
			||||||
    <div class="block">
 | 
					    <div class="block">
 | 
				
			||||||
        <button class="button is-primary" type="submit">{% trans "Save" %}</button>
 | 
					        <button class="button is-primary" type="submit">{% trans "Save" %}</button>
 | 
				
			||||||
 | 
					        {% if book %}
 | 
				
			||||||
        <a class="button" href="{{ book.local_path }}">{% trans "Cancel" %}</a>
 | 
					        <a class="button" href="{{ book.local_path }}">{% trans "Cancel" %}</a>
 | 
				
			||||||
 | 
					        {% else %}
 | 
				
			||||||
 | 
					        <a href="/" class="button" data-back>
 | 
				
			||||||
 | 
					            <span>{% trans "Cancel" %}</span>
 | 
				
			||||||
 | 
					        </a>
 | 
				
			||||||
 | 
					        {% endif %}
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
    {% endif %}
 | 
					    {% endif %}
 | 
				
			||||||
</form>
 | 
					</form>
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -58,6 +58,17 @@ class EditBookViews(TestCase):
 | 
				
			|||||||
        validate_html(result.render())
 | 
					        validate_html(result.render())
 | 
				
			||||||
        self.assertEqual(result.status_code, 200)
 | 
					        self.assertEqual(result.status_code, 200)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    def test_edit_book_create_page(self):
 | 
				
			||||||
 | 
					        """there are so many views, this just makes sure it LOADS"""
 | 
				
			||||||
 | 
					        view = views.EditBook.as_view()
 | 
				
			||||||
 | 
					        request = self.factory.get("")
 | 
				
			||||||
 | 
					        request.user = self.local_user
 | 
				
			||||||
 | 
					        request.user.is_superuser = True
 | 
				
			||||||
 | 
					        result = view(request)
 | 
				
			||||||
 | 
					        self.assertIsInstance(result, TemplateResponse)
 | 
				
			||||||
 | 
					        validate_html(result.render())
 | 
				
			||||||
 | 
					        self.assertEqual(result.status_code, 200)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def test_edit_book(self):
 | 
					    def test_edit_book(self):
 | 
				
			||||||
        """lets a user edit a book"""
 | 
					        """lets a user edit a book"""
 | 
				
			||||||
        view = views.EditBook.as_view()
 | 
					        view = views.EditBook.as_view()
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user