diff --git a/README.md b/README.md index 1ebdbdcb35812fa89ac24d46b31d27a810349794..78fda0caa5688af37508f86f7da0d7855cca746d 100644 --- a/README.md +++ b/README.md @@ -44,6 +44,7 @@ In this project, host-specific settings are defined in the `scipost-host-setting "CERTFILE": "none", "DEBUG": true, "ADMINS": "", + "MANAGERS": "", "ALLOWED_HOSTS": ["localhost", "127.0.0.1"], "SESSION_COOKIE_SECURE": false, "CSRF_COOKIE_SECURE": false, diff --git a/SciPost_v1/settings.py b/SciPost_v1/settings.py index d5c8742e915ba35c005135c0efaf6ca97799e06a..851298a82580842a4014e594ca367ed8d683f171 100644 --- a/SciPost_v1/settings.py +++ b/SciPost_v1/settings.py @@ -35,6 +35,7 @@ DEBUG = host_settings["DEBUG"] # Emails for server error reporting ADMINS = host_settings["ADMINS"] +MANAGERS = host_settings["MANAGERS"] ALLOWED_HOSTS = host_settings["ALLOWED_HOSTS"] diff --git a/SciPost_v1/urls.py b/SciPost_v1/urls.py index e1c8742b3efdde36aeb2adb9bf7a037939ef5cea..8bb1cbd455cf3f734dcc129e7f8c02ba31d6cf1f 100644 --- a/SciPost_v1/urls.py +++ b/SciPost_v1/urls.py @@ -15,7 +15,6 @@ Including another URLconf """ from django.conf import settings from django.conf.urls import include, url -from django.conf.urls.static import static from django.contrib import admin urlpatterns = [ @@ -33,7 +32,5 @@ urlpatterns = [ url(r'^theses/', include('theses.urls', namespace="theses")), url(r'^thesis/', include('theses.urls', namespace="theses")), url(r'^captcha/', include('captcha.urls')), -] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) +] - -# urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT) diff --git a/submissions/templates/submissions/submission_detail.html b/submissions/templates/submissions/submission_detail.html index 9a55f03955cb0cc037025847f93ac4a9fb780420..68750602f0e9eddaf708bac9af84bef5b2d2d317 100644 --- a/submissions/templates/submissions/submission_detail.html +++ b/submissions/templates/submissions/submission_detail.html @@ -6,6 +6,8 @@ {% load scipost_extras %} {% load submissions_extras %} +{% load filename %} +{% load file_extentions %} <script> $(document).ready(function(){ @@ -198,6 +200,18 @@ </div> <div class="col-12"> <p>{{ reply.comment_text|linebreaks }}</p> + {% if reply.file_attachment %} + <h3>Attachment:</h3> + <p> + <a target="_blank" href="{{ reply.file_attachment.url }}"> + {% if reply.file_attachment|is_image %} + <img class="attachment attachment-comment" src="{{ reply.file_attachment.url }}"> + {% else %} + {{ reply.file_attachment|filename }}<br><small>{{ reply.file_attachment.size|filesizeformat }}</small> + {% endif %} + </a> + </p> + {% endif %} </div> </div> </div>