From d2b742458863f575a60e326c1d3bb73c5baaac92 Mon Sep 17 00:00:00 2001 From: sanj Date: Sat, 13 Nov 2010 02:42:47 +0530 Subject: [PATCH] added template tag to fix relative links --- itf/erang_organised/templatetags/__init__.py | 0 itf/erang_organised/templatetags/erangtags.py | 8 ++++ itf/erang_organised/views.py | 2 +- itf/static/css/erang/erang.css | 42 ++++++++++++++++++- itf/static/js/erang/erang.js | 2 +- itf/templates/erang/home.html | 20 +++++---- 6 files changed, 62 insertions(+), 12 deletions(-) create mode 100644 itf/erang_organised/templatetags/__init__.py create mode 100644 itf/erang_organised/templatetags/erangtags.py diff --git a/itf/erang_organised/templatetags/__init__.py b/itf/erang_organised/templatetags/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/itf/erang_organised/templatetags/erangtags.py b/itf/erang_organised/templatetags/erangtags.py new file mode 100644 index 0000000..7084212 --- /dev/null +++ b/itf/erang_organised/templatetags/erangtags.py @@ -0,0 +1,8 @@ +from django import template + +register = template.Library() + +def absolutify_links(value): + return value.replace('src="img.x', 'src="http://a.organisedmail.com/img.x') + +register.filter("absolutify_links", absolutify_links) diff --git a/itf/erang_organised/views.py b/itf/erang_organised/views.py index 063e2cd..81e028c 100644 --- a/itf/erang_organised/views.py +++ b/itf/erang_organised/views.py @@ -10,7 +10,7 @@ from oxdjango.shortcuts import render_to_json_response from django.core.paginator import Paginator, InvalidPage, EmptyPage -RESULTS_PER_PAGE = 3 +RESULTS_PER_PAGE = 6 def home(request): all_issues = Issue.objects.all().order_by('-date') diff --git a/itf/static/css/erang/erang.css b/itf/static/css/erang/erang.css index f306622..d188140 100644 --- a/itf/static/css/erang/erang.css +++ b/itf/static/css/erang/erang.css @@ -1,6 +1,9 @@ +/* body { - + background: rgb(220,220,220); + background: rgba(210,210,210,0.7); } +*/ #leftMenu { float: left; @@ -51,11 +54,18 @@ .newsletterList a { text-decoration: none; + color: #666; } + .newsletterList a:hover { + color: #000; + } + + .newsletterList li { - margin-bottom: 4px; + margin-bottom: 6px; list-style-type: none; + border-bottom: 1px solid #FECD07; } .response { @@ -91,3 +101,31 @@ font-style: italic; } + +#issueListWrapper { + position: relative; + padding-bottom: 15px; +} + +.prevBtn { + position: absolute; + bottom: 2px; + left: 2px; +} + +.navBtns { + font-size: 10px; + cursor: pointer; + color: #EE9B11; + font-weight: bold; +} + +.navBtns span:hover { + color: #8A1E1C; +} + +.nextBtn { + position: absolute; + bottom: 2px; + right: 2px; +} diff --git a/itf/static/js/erang/erang.js b/itf/static/js/erang/erang.js index 2665731..d56a9ab 100644 --- a/itf/static/js/erang/erang.js +++ b/itf/static/js/erang/erang.js @@ -51,7 +51,7 @@ $(document).ready(function() { e.preventDefault(); var searchInput = $('#issueSearch'); var search_terms = searchInput.val(); - if (search_terms == '' || search_terms == searchInput.data("placeholder")) { + if (search_terms == searchInput.data("placeholder")) { return false; } doIssuesLoading(); diff --git a/itf/templates/erang/home.html b/itf/templates/erang/home.html index 6128e59..2020320 100644 --- a/itf/templates/erang/home.html +++ b/itf/templates/erang/home.html @@ -19,8 +19,8 @@ <% } %> @@ -28,11 +28,13 @@ -

Past Issues:

-
- -
-
+
+

Past Issues:

+
+ +
+
+
+ +{% load erangtags %}
{% autoescape off %} - {{ current_issue.html }} + {{ current_issue.html|absolutify_links }} {% endautoescape %}

Comments and Feedback