mirror of
https://github.com/sissbruecker/linkding.git
synced 2026-02-28 06:53:12 +08:00
Extract inline icons to SVG iconset (#1262)
This commit is contained in:
@@ -13,6 +13,7 @@ from bookmarks.middlewares import LinkdingMiddleware
|
||||
from bookmarks.models import Bookmark, BookmarkSearch, UserProfile, User
|
||||
from bookmarks.tests.helpers import BookmarkFactoryMixin, HtmlTestMixin
|
||||
from bookmarks.views import contexts
|
||||
from bookmarks.utils import app_version
|
||||
|
||||
|
||||
class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
||||
@@ -214,10 +215,10 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
||||
|
||||
def assertNotesToggle(self, html: str, count=1):
|
||||
self.assertInHTML(
|
||||
"""
|
||||
f"""
|
||||
<button type="button" class="btn btn-link btn-sm btn-icon toggle-notes">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||
<use xlink:href="#ld-icon-note"></use>
|
||||
<svg width="16" height="16">
|
||||
<use href="/static/icons.svg?v={app_version}#note"></use>
|
||||
</svg>
|
||||
Notes
|
||||
</button>
|
||||
@@ -232,8 +233,8 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
||||
<button type="submit" name="unshare" value="{bookmark.id}"
|
||||
class="btn btn-link btn-sm btn-icon"
|
||||
data-confirm data-confirm-question="Unshare?">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||
<use xlink:href="#ld-icon-share"></use>
|
||||
<svg width="16" height="16">
|
||||
<use href="/static/icons.svg?v={app_version}#share"></use>
|
||||
</svg>
|
||||
Shared
|
||||
</button>
|
||||
@@ -248,8 +249,8 @@ class BookmarkListTemplateTest(TestCase, BookmarkFactoryMixin, HtmlTestMixin):
|
||||
<button type="submit" name="mark_as_read" value="{bookmark.id}"
|
||||
class="btn btn-link btn-sm btn-icon"
|
||||
data-confirm data-confirm-question="Mark as read?">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16">
|
||||
<use xlink:href="#ld-icon-unread"></use>
|
||||
<svg width="16" height="16">
|
||||
<use href="/static/icons.svg?v={app_version}#unread"></use>
|
||||
</svg>
|
||||
Unread
|
||||
</button>
|
||||
|
||||
@@ -3,6 +3,7 @@ from django.urls import reverse
|
||||
|
||||
from bookmarks.models import BookmarkBundle
|
||||
from bookmarks.tests.helpers import BookmarkFactoryMixin
|
||||
from bookmarks.utils import app_version
|
||||
|
||||
|
||||
class BundleIndexViewTestCase(TestCase, BookmarkFactoryMixin):
|
||||
@@ -28,15 +29,8 @@ class BundleIndexViewTestCase(TestCase, BookmarkFactoryMixin):
|
||||
<tr data-bundle-id="{bundle.id}" draggable="true">
|
||||
<td>
|
||||
<div class="d-flex align-center">
|
||||
<svg xmlns="http://www.w3.org/2000/svg" class="text-secondary mr-1" width="16" height="16" viewBox="0 0 24 24" fill="none"
|
||||
stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
|
||||
<path stroke="none" d="M0 0h24v24H0z" fill="none"/>
|
||||
<path d="M9 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<path d="M9 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<path d="M9 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<path d="M15 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<path d="M15 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<path d="M15 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0"/>
|
||||
<svg class="text-secondary mr-1" width="16" height="16">
|
||||
<use href="/static/icons.svg?v={app_version}#drag"></use>
|
||||
</svg>
|
||||
<span>{ bundle.name }</span>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user