Sponsor (vertical) area on basic page layout working with graphics.

This commit is contained in:
Nick Seidenman (N6) 2017-02-21 10:51:45 +11:00
parent 901c636a6b
commit a07dbe58c1
8 changed files with 46 additions and 11 deletions

View file

@ -34,6 +34,8 @@ WSGIPythonPath /srv/http/uat.2017.pycon-au.org/symposion/website:/srv/http/uat.2
Alias /robots.txt /srv/http/uat.2017.pycon-au.org/symposion/website/robots.txt
Alias /site_media/static/pyconau2017/ /srv/http/uat.2017.pycon-au.org/symposion/website/static/dist/pyconau2017/
Alias /fonts/ /srv/http/uat.2017.pycon-au.org/symposion/website/static/dist/pyconau2017/css/fonts/
Alias /site_media/static/admin/ /srv/http/uat.2017.pycon-au.org/symposion/lib/python2.7/site-packages/django/contrib/admin/static/admin/
@ -45,6 +47,14 @@ WSGIPythonPath /srv/http/uat.2017.pycon-au.org/symposion/website:/srv/http/uat.2
# Require all granted
</Directory>
Alias /site_media/media/ /srv/http/uat.2017.pycon-au.org/symposion/website/pinaxcon/site_media/media/
<Directory /srv/http/uat.2017.pycon-au.org/symposion/website/pinaxcon/site_media/media/>
Order allow,deny
Allow from all
# Require all granted
</Directory>
WSGIDaemonProcess uat2017.pycon-au.org python-path="/srv/http/uat.2017.pycon-au.org/symposion/website:/srv/http/uat.2017.pycon-au.org/symposion/lib/python2.7/site-packages:/srv/http/uat.2017.pycon-au.org/symposion/lib/python2.7" home=/srv/http/uat.2017.pycon-au.org/symposion/website user=nicks group=www-data
WSGIProcessGroup uat2017.pycon-au.org

View file

@ -243,6 +243,10 @@ DEBUG_TOOLBAR_PANELS = [
'debug_toolbar.panels.redirects.RedirectsPanel',
]
# To use the debug toolbar on a "remote" site (i.e., not on localhost) change
# SHOW_TOOLBAR_CALLBACK's definition, below, to return True, rather than False.
# If you're using this on a local(host) for development, there's no need to
# change it so long as DEBUG (above) is defined as True.
DEBUG_TOOLBAR_CONFIG = {
'INTERCEPT_REDIRECTS': False,
'SHOW_TOOLBAR_CALLBACK': lambda x: False,

View file

@ -32,9 +32,9 @@
<div class="col-md-1">
<div id="sponsors" class="wrapper jumbotron-white">
<h4>Sponsors</h4>
{% include "symposion/sponsorship/_wall.html" %}
{% include "symposion/sponsorship/_vertical_by_level.html" %}
</div>
</div>
</div>
</div>
</div>
{% endblock %}

View file

@ -1,11 +1,7 @@
{% load thumbnail %}
{% load pyconau2017_tags %}
{% spaceless %}
<a href="{{ sponsor.external_url }}">
{% if dimensions %}
<img id="sponsor_{{ sponsor.pk }}" src="{% thumbnail sponsor.logo dimensions %}" alt="{{ sponsor.name }}" />
{% else %}
<img id="sponsor_{{ sponsor.pk }}" src="{% thumbnail sponsor.logo '150x150' %}" alt="{{ sponsor.name }}" />
{% endif %}
<img id="sponsor_{{ sponsor.pk }}" src="{% sponsor_thumbnail sponsor.sponsor_logo %}" class="thumbnail" alt="{{ sponsor.name }}" />
</a>
{% endspaceless %}

View file

@ -6,7 +6,7 @@
{% for level in levels %}
<h3>{{ level.name }}</h3>
{% for sponsor in level.sponsors %}
<div>
<div class="sponsor-list">
{% include "symposion/sponsorship/_sponsor_link.html" with sponsor=sponsor %}
</div>
{% endfor %}

View file

@ -2,6 +2,8 @@ import cms_pages
import hashlib
import urllib
import os
from decimal import Decimal
from django import template
from django.conf import settings
@ -101,3 +103,12 @@ def trackname(room, day):
except Track.DoesNotExist:
track_name = None
return track_name
@register.simple_tag()
def sponsor_thumbnail(sponsor_logo):
if sponsor_logo is not None:
if sponsor_logo.upload:
logo_file = os.path.join(settings.MEDIA_URL, str(sponsor_logo.upload))
return logo_file
return ""

View file

@ -23,7 +23,6 @@ urlpatterns = [
url(r"^admin/", include(admin.site.urls)),
# Debug toolbar
url(r'^__debug__/', include(debug_toolbar.urls)),
url(r"^account/", include("account.urls")),
@ -63,7 +62,7 @@ urlpatterns = [
if settings.DEBUG:
import debug_toolbar
#urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), ]
urlpatterns += [ url(r'^__debug__/', include(debug_toolbar.urls)), ]
urlpatterns += static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

View file

@ -90,3 +90,18 @@ nav {
width: 150px; /* this is a hack. need to figure out exactly where (else) it's being set. */
}
.thumbnail {
width: auto;
height: auto;
max-width: 100px;
max-height: 100px;
border: 0;
}
div.sponsor-list {
min-width: 100px;
display: block;
margin: 0 auto;
}