Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use right static path instead of hardcoding it #126

Open
wants to merge 13 commits into
base: master
Choose a base branch
from
4 changes: 2 additions & 2 deletions djedi/admin/mixins.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import simplejson as json
from django.conf import settings as django_settings
from django.http import HttpResponse
from django.templatetags.static import static

import djedi
from cio.conf import settings
Expand Down Expand Up @@ -34,7 +34,7 @@ def get_context_data(self, **context):
theme = settings.THEME

if "/" not in theme:
theme = f"{django_settings.STATIC_URL}djedi/themes/{theme}/theme.css"
theme = static(f"djedi/themes/{theme}/theme.css")

context["THEME"] = theme
context["VERSION"] = djedi.__version__
Expand Down
14 changes: 7 additions & 7 deletions djedi/templates/djedi/cms/cms.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<link href="{{ THEME }}?v={{ VERSION }}" rel="stylesheet" media="screen">
<link href="{{ THEME }}" rel="stylesheet" media="screen">

<!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
<!--[if lt IE 9]>
<script src="{% static 'djedi/vendor/html5/html5shiv.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/vendor/html5/respond.min.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/vendor/html5/html5shiv.js' %}"></script>
<script src="{% static 'djedi/vendor/html5/respond.min.js' %}"></script>
<![endif]-->
</head>
<body>
Expand Down Expand Up @@ -40,9 +40,9 @@
<section id="settings-panel" class="tab-pane hide"></section>
</div>
{% djedi_xss_domain %}
<script src="{% static 'djedi/vendor/jquery/jquery.min.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/vendor/bootstrap/js/bootstrap.min.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/cms/js/uri.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/cms/js/cms.js' %}?v={{ VERSION }}"></script>
<script src="{% static 'djedi/vendor/jquery/jquery.min.js' %}"></script>
<script src="{% static 'djedi/vendor/bootstrap/js/bootstrap.min.js' %}"></script>
<script src="{% static 'djedi/cms/js/uri.js' %}"></script>
<script src="{% static 'djedi/cms/js/cms.js' %}"></script>
</body>
</html>
1 change: 1 addition & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ deps = six
markdown<=3.3
django-discover-runner
coverage
setuptools<=71.1.0
django32: Django>=3.2,<3.3
django40: Django>=4.0,<4.1
django41: Django>=4.1,<4.2
Expand Down
Loading