diff options
author | 2010-08-25 15:20:57 -0500 | |
---|---|---|
committer | 2010-08-25 15:20:57 -0500 | |
commit | 3f81c893810dd1934e2b1ee785091b7e6a7fbac5 (patch) | |
tree | 309e3062d36967edc9bab845afa9fdc02397b30f | |
parent | New plain text ad type is available (diff) | |
download | gentoo-ads-3f81c893810dd1934e2b1ee785091b7e6a7fbac5.tar.gz gentoo-ads-3f81c893810dd1934e2b1ee785091b7e6a7fbac5.tar.bz2 gentoo-ads-3f81c893810dd1934e2b1ee785091b7e6a7fbac5.zip |
Added feature: ad type arbitrary html
Some styles and template work to accomodate
Example usage in example_ads.py
-rw-r--r-- | example_ads.py | 4 | ||||
-rw-r--r-- | 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': '<h2>Heading</h2><p>This <a href="http://www.example.com">here</a> is a link.</p>', '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; + } </style> </head> <body> @@ -51,7 +69,13 @@ </p> </a> {% else %} - <a href="{{ad.url}}" target="_parent"><img src="{{ MEDIA_URL }}{{ ad.img }}" alt="{{ ad.title|slice:":50" }}" title="{{ ad.title|slice:":50" }}" height="{{ ad.height }}" width="{{ ad.width }}" /></a> + {% ifequal ad.type 'html' %} + <div class="arbit"> + {{ ad.html|safe }} + </div> + {% else %} + <a href="{{ad.url}}" target="_parent"><img src="{{ MEDIA_URL }}{{ ad.img }}" alt="{{ ad.title|slice:":50" }}" title="{{ ad.title|slice:":50" }}" height="{{ ad.height }}" width="{{ ad.width }}" /></a> + {% endifequal %} {% endifequal %} {% endfor %} <hr /> |