fnp
/
wolnelektury.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
b8e94e0
)
Fixes #3393: sponsor logo on picture viewer page.
author
Radek Czajka
<radekczajka@nowoczesnapolska.org.pl>
Wed, 22 Oct 2014 09:53:30 +0000
(11:53 +0200)
committer
Radek Czajka
<radekczajka@nowoczesnapolska.org.pl>
Wed, 22 Oct 2014 09:53:30 +0000
(11:53 +0200)
apps/picture/templates/picture/picture_list_thumb.html
patch
|
blob
|
history
apps/picture/templates/picture/picture_viewer.html
patch
|
blob
|
history
apps/picture/views.py
patch
|
blob
|
history
apps/wolnelektury_core/static/css/new.book.css
patch
|
blob
|
history
diff --git
a/apps/picture/templates/picture/picture_list_thumb.html
b/apps/picture/templates/picture/picture_list_thumb.html
index
4c2933c
..
adfc25e
100644
(file)
--- a/
apps/picture/templates/picture/picture_list_thumb.html
+++ b/
apps/picture/templates/picture/picture_list_thumb.html
@@
-17,12
+17,6
@@
{% ssi_include 'chunk' key='picture-list' %}
{% endblock %}
</div></div>
{% ssi_include 'chunk' key='picture-list' %}
{% endblock %}
</div></div>
- <div class="right-column" id="logo-space">
- {% block book_list_logos %}
- <a href="http://www.nck.pl">
- <img style="float:right; width:200px; margin:1em" src="{% static "img/logo_nck_200horiz_trans.png" %}" alt="Narodowe Centrum Kultury" ></img></a>
- {% endblock %}
- </div>
<div class='clearboth'></div>
<div class='clearboth'></div>
diff --git
a/apps/picture/templates/picture/picture_viewer.html
b/apps/picture/templates/picture/picture_viewer.html
index
65b689d
..
a1fb991
100644
(file)
--- a/
apps/picture/templates/picture/picture_viewer.html
+++ b/
apps/picture/templates/picture/picture_viewer.html
@@
-42,7
+42,11
@@
</a></li>
<li id="sponsors">
</a></li>
<li id="sponsors">
- <a href="http://www.nck.pl"><img src="{% static "img/logo_nck.jpg" %}" alt="Narodowe Centrum Kultury" ></img></a>
+ {% for sponsor in sponsors %}
+ {% thumbnail sponsor.logo "80x200" as logo %}
+ <a href="{{ sponsor.url }}" target="_blank"><img src="{{ logo.url }}" alt="{{ sponsor.name }}" /></a>
+ {% endthumbnail %}
+ {% endfor %}
</li>
{% endblock %}
</li>
{% endblock %}
@@
-67,7
+71,11
@@
<div class="sponsors">
<a href="/"><img src="{% static "img/logo-220.png" %}" alt="Wolne Lektury" ></img>
</a>
<div class="sponsors">
<a href="/"><img src="{% static "img/logo-220.png" %}" alt="Wolne Lektury" ></img>
</a>
- <a href="http://www.nck.pl"><img src="{% static "img/logo_nck_200horiz_trans.png" %}" alt="Narodowe Centrum Kultury" ></img></a>
+ {% for sponsor in sponsors %}
+ {% thumbnail sponsor.logo "220x220" as logo %}
+ <a href="{{ sponsor.url }}" target="_blank"><img src="{{ logo.url }}" alt="{{ sponsor.name }}" /></a>
+ {% endthumbnail %}
+ {% endfor %}
</div>
{% book_info picture %}
</div>
{% book_info picture %}
diff --git
a/apps/picture/views.py
b/apps/picture/views.py
index
78700d1
..
1f87386
100644
(file)
--- a/
apps/picture/views.py
+++ b/
apps/picture/views.py
@@
-9,6
+9,7
@@
from django.template import RequestContext
from picture.models import Picture, PictureArea
from catalogue.utils import split_tags
from ssify import ssi_included
from picture.models import Picture, PictureArea
from catalogue.utils import split_tags
from ssify import ssi_included
+from sponsors.models import Sponsor
# was picture/picture_list.html list (without thumbs)
def picture_list(request, filter=None, get_filter=None, template_name='catalogue/picture_list.html', cache_key=None, context=None):
# was picture/picture_list.html list (without thumbs)
def picture_list(request, filter=None, get_filter=None, template_name='catalogue/picture_list.html', cache_key=None, context=None):
@@
-57,6
+58,11
@@
def picture_detail(request, slug):
def picture_viewer(request, slug):
picture = get_object_or_404(Picture, slug=slug)
def picture_viewer(request, slug):
picture = get_object_or_404(Picture, slug=slug)
+ sponsors = []
+ for sponsor in picture.extra_info.get('sponsors', []):
+ have_sponsors = Sponsor.objects.filter(name=sponsor)
+ if have_sponsors.exists():
+ sponsors.append(have_sponsors[0])
return render_to_response("picture/picture_viewer.html", locals(),
context_instance=RequestContext(request))
return render_to_response("picture/picture_viewer.html", locals(),
context_instance=RequestContext(request))
diff --git
a/apps/wolnelektury_core/static/css/new.book.css
b/apps/wolnelektury_core/static/css/new.book.css
index
45f8e5d
..
a5f4c06
100644
(file)
--- a/
apps/wolnelektury_core/static/css/new.book.css
+++ b/
apps/wolnelektury_core/static/css/new.book.css
@@
-48,6
+48,11
@@
a {
margin: 1em 0 0;
}
margin: 1em 0 0;
}
+#info .sponsors img {
+ margin-bottom: 1em;
+}
+
+
/* =================================================== */
/* = Common elements: headings, paragraphs and lines = */
/* =================================================== */
/* =================================================== */
/* = Common elements: headings, paragraphs and lines = */
/* =================================================== */