Commit 6e0ed037 authored by Joost Rijneveld's avatar Joost Rijneveld
Browse files

Merge branch '242-er-moet-een-stukje-django-voor-media-styleguide-dat-ok-zegt' into 'master'

Zet een stukje voor media styleguide dat ok zegt

Closes #242 

Fixt ook meteen een vertalingsfout

See merge request !281
parents ccbb5f2a dda7af51
...@@ -77,8 +77,9 @@ ...@@ -77,8 +77,9 @@
<h2>Basis</h2> <h2>Basis</h2>
<p> <p>
{% url 'styleguide-file' 'font.zip' as font_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
Thalia's logo consists of a 'T' formed by the pieces of a <a href="https://en.wikipedia.org/wiki/Tangram" target="_blank">tangram</a> and the text 'Study Association Thalia'. The font that was used for this text is '<a href="{{ MEDIA_URL }}styleguide/font.zip">Gill Sans MT Condensed</a>'. Thalia's logo consists of a 'T' formed by the pieces of a <a href="https://en.wikipedia.org/wiki/Tangram" target="_blank">tangram</a> and the text 'Study Association Thalia'. The font that was used for this text is '<a href="{{ font_url }}">Gill Sans MT Condensed</a>'.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
...@@ -99,8 +100,9 @@ ...@@ -99,8 +100,9 @@
</p> </p>
<p> <p>
{% url 'styleguide-file' 'logo.zip' as logo_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
You can download the archive with all versions of the logo in PNG, SVG and Illustrator <a href="{{ MEDIA_URL }}styleguide/logo.zip">here</a>. You can download the archive with all versions of the logo in PNG, SVG and Illustrator <a href="{{ logo_url }}">here</a>.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
...@@ -124,8 +126,9 @@ ...@@ -124,8 +126,9 @@
</p> </p>
<p> <p>
{% url 'styleguide-file' 'variant-logo.zip' as variant_logo_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
You can download the archive with the Illustrator and EPS files to create a variant <a href="{{ MEDIA_URL }}styleguide/variant-logo.zip">here</a>. You can download the archive with the Illustrator and EPS files to create a variant <a href="{{ variant_logo_url }}">here</a>.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
...@@ -144,15 +147,18 @@ ...@@ -144,15 +147,18 @@
<li>{% trans "Registration forms" %}</li> <li>{% trans "Registration forms" %}</li>
<li>{% trans "Declarations" %}</li> <li>{% trans "Declarations" %}</li>
</ul> </ul>
{% url 'styleguide-file' 'documents.zip' as documents_url %}
{% url 'styleguide-file' 'latex.zip' as latex_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
You can download these template as <a href="{{ MEDIA_URL }}styleguide/documents.zip">here</a> as archive. We've also included PDF examples. You can download these template as <a href="{{ documents_url }}">here</a> as archive. We've also included PDF examples.
In case you prefer LateX then you can download the <a href="{{ MEDIA_URL }}styleguide/latex.zip">template</a>. In case you prefer LaTeX then you can download the <a href="{{ latex_url }}">template</a>.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<p> <p>
{% url 'styleguide-file' 'presentations.zip' as presentations_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
Templates for PowerPoint, Keynote and LibreOffice are available <a href="{{ MEDIA_URL }}styleguide/presentations.zip">here</a>. Templates for PowerPoint, Keynote and LibreOffice are available <a href="{{ presentations_url }}">here</a>.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
...@@ -174,10 +180,11 @@ ...@@ -174,10 +180,11 @@
</p> </p>
<p> <p>
{% url 'styleguide-file' 'posters-banners.zip' as posters_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
The templates are available for download <a href="{{ MEDIA_URL }}styleguide/posters-banners.zip">here</a>. The templates are available for download <a href="{{ posters_url }}">here</a>.
Although, it's the task of the media committee to create the posters and banners. Although, it's the task of the media committee to create the posters and banners.
So you're always welcome to send an email to media@thalia.nu to get yourself a sleek poster for your event. So you're always welcome to send an email to <a href="mailto:media@thalia.nu">media@thalia.nu</a> to get yourself a sleek poster for your event.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
...@@ -201,23 +208,24 @@ ...@@ -201,23 +208,24 @@
<h1>{% trans "Introshirts" %}</h1> <h1>{% trans "Introshirts" %}</h1>
<p> <p>
{% url 'styleguide-file' 'introshirt.zip' as introshirt_url %}
{% blocktrans trimmed %} {% blocktrans trimmed %}
The introshirts too are an exception. These shirts are in different colours every year. The introshirts too are an exception. These shirts are in different colours every year.
The templates for the shirts can be found <a href="{{ MEDIA_URL }}styleguide/introshirt.zip">here</a>. The sponsorlogos and texts can be changed to those you prefer. The templates for the shirts can be found <a href="{{ introshirt_url }}">here</a>. The sponsorlogos and texts can be changed to those you prefer.
{% endblocktrans %} {% endblocktrans %}
</p> </p>
<h1>{% trans "Downloads" %}</h1> <h1>{% trans "Downloads" %}</h1>
<ul> <ul>
<li><a href="{{ MEDIA_URL }}styleguide/font.zip">{% trans "Font" %}</a></li> <li><a href="{{ font_url }}">{% trans "Font" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/logo.zip">{% trans "Logos" %}</a></li> <li><a href="{{ logo_url }}">{% trans "Logos" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/variant-logo.zip">{% trans "Logo variant template" %}</a></li> <li><a href="{{ variant_logo_url }}">{% trans "Logo variant template" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/documents.zip">{% trans "Word documents" %}</a></li> <li><a href="{{ documents_url }}">{% trans "Word documents" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/latex.zip">{% trans "LateX template" %}</a></li> <li><a href="{{ latex_url }}">{% trans "LaTeX template" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/presentations.zip">{% trans "Presentation templates" %}</a></li> <li><a href="{{ presentations_url }}">{% trans "Presentation templates" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/posters-banners.zip">{% trans "Poster templates" %}</a></li> <li><a href="{{ posters_url }}">{% trans "Poster templates" %}</a></li>
<li><a href="{{ MEDIA_URL }}styleguide/introshirt.zip">{% trans "Introshirts" %}</a></li> <li><a href="{{ introshirt_url }}">{% trans "Introshirts" %}</a></li>
</ul> </ul>
{% endblock %} {% endblock %}
\ No newline at end of file
...@@ -76,8 +76,9 @@ urlpatterns = [ ...@@ -76,8 +76,9 @@ urlpatterns = [
url(r'^', include([ # 'for members' menu url(r'^', include([ # 'for members' menu
url(r'^become-active/', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'), url(r'^become-active/', TemplateView.as_view(template_name='singlepages/become_active.html'), name='become-active'),
url(r'^photos/', include('photos.urls')), url(r'^photos/', include('photos.urls')),
url(r'^statistics/', members.views.statistics, name='statistics'), url(r'^statistics/$', members.views.statistics, name='statistics'),
url(r'^styleguide/', views.styleguide, name='styleguide'), url(r'^styleguide/$', views.styleguide, name='styleguide'),
url(r'^styleguide/file/(?P<filename>[\w\-_\.]+)$', views.styleguide_file, name='styleguide-file'),
])), ])),
url(r'^career/', include('partners.urls')), url(r'^career/', include('partners.urls')),
url(r'^contact$', TemplateView.as_view(template_name='singlepages/contact.html'), name='contact'), url(r'^contact$', TemplateView.as_view(template_name='singlepages/contact.html'), name='contact'),
......
import os.path
from django.conf import settings from django.conf import settings
from django.contrib.auth import authenticate from django.contrib.auth import authenticate
from django.contrib.admin.views.decorators import staff_member_required from django.contrib.admin.views.decorators import staff_member_required
from django.contrib.auth.decorators import login_required from django.contrib.auth.decorators import login_required
from django.http import (HttpResponseBadRequest, from django.http import (HttpResponseBadRequest, Http404,
HttpResponseForbidden, JsonResponse) HttpResponseForbidden, JsonResponse)
from django.shortcuts import render from django.shortcuts import render
from django.utils import timezone from django.utils import timezone
from django.views.decorators.csrf import csrf_exempt from django.views.decorators.csrf import csrf_exempt
from django.views.decorators.http import require_POST from django.views.decorators.http import require_POST
from sendfile import sendfile
from members.models import Member from members.models import Member
...@@ -53,6 +57,16 @@ def wiki_login(request): ...@@ -53,6 +57,16 @@ def wiki_login(request):
status_code=403) status_code=403)
@login_required
def styleguide_file(request, filename):
path = os.path.join(settings.MEDIA_ROOT, 'styleguide')
filepath = os.path.join(path, filename)
if not (os.path.commonprefix([path, filepath]).startswith(path) and
os.path.isfile(filepath)):
raise Http404("File not found.")
return sendfile(request, filepath, attachment=True)
@staff_member_required @staff_member_required
def crash(request): def crash(request):
raise Exception("Test exception") raise Exception("Test exception")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment