Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
django-iconify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AlekSIS®
Libraries
django-iconify
Commits
40c058f6
Verified
Commit
40c058f6
authored
3 years ago
by
Jonathan Weth
Browse files
Options
Downloads
Patches
Plain Diff
Fix config JS snippet to work with current Iconify and bump version
cf.
https://docs.iconify.design/api/config.html#using-iconifyproviders
parent
5c01e7bb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!5
Fix config JS snippet to work with current Iconify
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
dj_iconify/views.py
+5
-4
5 additions, 4 deletions
dj_iconify/views.py
pyproject.toml
+1
-1
1 addition, 1 deletion
pyproject.toml
with
6 additions
and
5 deletions
dj_iconify/views.py
+
5
−
4
View file @
40c058f6
...
...
@@ -68,15 +68,16 @@ class ConfigView(View):
def
get
(
self
,
request
:
HttpRequest
)
->
HttpResponse
:
# Guess the base URL by reverse-mapping the URL for a fake icon set
rev
=
reverse
(
"
iconify_json
"
,
kwargs
=
{
"
collection
"
:
"
prefix
"
,
"
format_
"
:
"
js
"
})
# Iconify SVG Framework expects placeholders {prefix} and {icons} in API URL
api_pattern
=
rev
[:
-
9
]
+
"
{prefix}.js?icons={icons}
"
# Iconify SVG Framework expects just the base path to the API
api_base
=
rev
[:
-
10
]
# Put together configuration as dict and output as JSON
config
=
{
"
defaultAPI
"
:
api_pattern
,
"
resources
"
:
api_base
,
}
config_json
=
json
.
dumps
(
config
)
return
HttpResponse
(
f
"
var Iconify
Config =
{
config_json
}
"
,
content_type
=
"
text/javascript
"
)
return
HttpResponse
(
"
var Iconify
Providers = {
''
:
"
+
config_json
+
"
}
"
,
content_type
=
"
text/javascript
"
)
class
CollectionView
(
BaseJSONView
):
...
...
This diff is collapsed.
Click to expand it.
pyproject.toml
+
1
−
1
View file @
40c058f6
[tool.poetry]
name
=
"django-iconify"
version
=
"0.
1.1
"
version
=
"0.
2
"
description
=
"Iconify API implementation and tools for Django projects"
authors
=
[
"Dominik George <dominik.george@teckids.org>"
]
license
=
"Apache-2.0"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment