From 3f81c893810dd1934e2b1ee785091b7e6a7fbac5 Mon Sep 17 00:00:00 2001 From: Matthew Summers Date: Wed, 25 Aug 2010 15:20:57 -0500 Subject: Added feature: ad type arbitrary html Some styles and template work to accomodate Example usage in example_ads.py --- example_ads.py | 4 ++-- gentoo_ads/ads/templates/ads.html | 26 +++++++++++++++++++++++++- 2 files changed, 27 insertions(+), 3 deletions(-) diff --git a/example_ads.py b/example_ads.py index 9c52421..25aa3eb 100644 --- a/example_ads.py +++ b/example_ads.py @@ -12,13 +12,13 @@ ads = [ { - 'type':'txt', + 'type':'html', 'name': 'internal_name_1', 'title': 'human title 1', 'tier': 1, 'weight': 15, #bogomips 'url': 'http://www1.example.com', - 'text': 'On the other hand, we denounce with righteous indignation and dislike men who are so beguiled and demoralized by the charms of pleasure of the moment, so blinded by desire, that they cannot foresee the pain and trouble that are bound to ensue; and equal blame belongs to those who fail in their duty through weakness of will, which is the same as saying through shrinking from toil and pain.', + 'html': '

Heading

This here is a link.

', 'height': 120, 'width': 125, }, diff --git a/gentoo_ads/ads/templates/ads.html b/gentoo_ads/ads/templates/ads.html index 0af4e69..70dca67 100644 --- a/gentoo_ads/ads/templates/ads.html +++ b/gentoo_ads/ads/templates/ads.html @@ -37,6 +37,24 @@ text-align: justify; text-decoration: none; } + div.arbit { + width:100%; + height: 100% + } + div.arbit a { + text-decoration: underline; + color: #0000FF; + } + div.arbit h2 { + font-size: 100%; + text-align: center; + text-decoration: none; + } + div.arbit p { + font-size: 80%; + text-align: justify; + text-decoration: none; + } @@ -51,7 +69,13 @@

{% else %} - {{ ad.title|slice: + {% ifequal ad.type 'html' %} +
+ {{ ad.html|safe }} +
+ {% else %} + {{ ad.title|slice: + {% endifequal %} {% endifequal %} {% endfor %}
-- cgit v1.2.3-65-gdbad