summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSashi202022-01-17 15:34:29 +0530
committerSashi202022-01-17 15:34:29 +0530
commit9a42f0c85394225155400c999be49c5cd563b5df (patch)
treeb9df72a267f3f803b054e58c7727405ee55d48f3
parent5d32758d9e229edc9d568bd2904068a296a42d28 (diff)
downloadMapathon-9a42f0c85394225155400c999be49c5cd563b5df.tar.gz
Mapathon-9a42f0c85394225155400c999be49c5cd563b5df.tar.bz2
Mapathon-9a42f0c85394225155400c999be49c5cd563b5df.zip
Allow uploading css, font files to static folder
-rwxr-xr-xcms/models.py6
-rwxr-xr-xcms/templates/cms_base.html7
2 files changed, 10 insertions, 3 deletions
diff --git a/cms/models.py b/cms/models.py
index 3b04752..452a81c 100755
--- a/cms/models.py
+++ b/cms/models.py
@@ -70,6 +70,12 @@ def get_filename(instance, _):
subdir = 'images'
elif extension == '.pdf':
subdir = 'pdf'
+ elif extension == '.css':
+ subdir = 'css'
+ elif extension == '.js':
+ subdir = 'js'
+ elif extension == '.ttf':
+ subdir = 'fonts'
# Add more
print(extension, subdir)
return os.path.join('static/cms/uploads', subdir, str(instance.filename))
diff --git a/cms/templates/cms_base.html b/cms/templates/cms_base.html
index cd38c3e..f6e0607 100755
--- a/cms/templates/cms_base.html
+++ b/cms/templates/cms_base.html
@@ -11,17 +11,18 @@
<meta name="author" content="FOSSEE web team">
<meta name="keywords" content="Mapathon, QGIS, competition">
<meta name="keywords"
- content="ISRO, IIT Bombay, Remote Sensing, Mapping, Open source, software">
+ content="IIT Bombay, Remote Sensing, Mapping, Open source, software">
<link rel="icon" href="{% static 'cms/uploads/images/favicon.png' %}">
- <title>IITB-ISRO-AICTE Mapathon</title>
+ <title>IITB-AICTE Mapathon</title>
<link href="{% static 'cms/bootstrap-4.5.0/css/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'cms/fontawesome/css/all.css' %}" rel="stylesheet">
<!-- <link href="css/custom.css?ver=1.4" rel="stylesheet"> -->
- <link href="{% static 'cms/css/custom.css' %}" rel="stylesheet">
+ <link href="{% static 'cms/uploads/css/custom.css' %}" rel="stylesheet">
<script src="{% static 'cms/js/jquery-3.2.1.min.js' %}"></script>
<script src="{% static 'cms/js/popper.min.js' %}"></script>
<script src="{% static 'cms/bootstrap-4.5.0/js/bootstrap.min.js' %}"></script>
<script src="{% static 'cms/js/holder.min.js' %}"></script>
+ <script src="{% static 'cms/uploads/js/custom.js' %}"></script>
<!-- Global site tag (gtag.js) - Google Analytics --> <script async src="https://www.googletagmanager.com/gtag/js?id=G-85GKJCKTG0"></script> <script> window.dataLayer = window.dataLayer || []; function gtag(){dataLayer.push(arguments);} gtag('js', new Date()); gtag('config', 'G-85GKJCKTG0'); </script>
</head>
<body>