Skip to content

Commit

Permalink
feat: site symbol support
Browse files Browse the repository at this point in the history
  • Loading branch information
lukasvinclav committed Apr 16, 2023
1 parent 62996d0 commit 116a179
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ UNFOLD = {
"SITE_HEADER": None,
"SITE_URL": "/",
"SITE_ICON": lambda request: static("logo.svg"),
"SITE_SYMBOL": "speed", # symbol from icon set
"DASHBOARD_CALLBACK": "sample_app.dashboard_callback",
"LOGIN": {
"image": lambda r: static("sample/login-bg.jpg"),
Expand Down
1 change: 1 addition & 0 deletions src/unfold/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"SITE_HEADER": None,
"SITE_URL": "/",
"SITE_ICON": None,
"SITE_SYMBOL": None,
"COLORS": {
"primary": {
"50": "250 245 255",
Expand Down
3 changes: 3 additions & 0 deletions src/unfold/sites.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,9 @@ def each_context(self, request):
"icon": self._get_value(
get_config(self.settings_name)["SITE_ICON"], request
),
"symbol": self._get_value(
get_config(self.settings_name)["SITE_SYMBOL"], request
),
"tab_list": get_config(self.settings_name)["TABS"],
"styles": [
self._get_value(style, request)
Expand Down
2 changes: 1 addition & 1 deletion src/unfold/templates/unfold/helpers/site_icon.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@
</a>
{% else %}
<a href="{% url "admin:index" %}" class="bg-primary-600 flex h-8 items-center justify-center rounded-md mr-4 text-white text-xs w-8">
<span class="material-symbols-outlined md-18">settings</span>
<span class="material-symbols-outlined md-18">{% if symbol %}{{ symbol }}{% else %}settings{% endif %}</span>
</a>
{% endif %}

0 comments on commit 116a179

Please sign in to comment.