added template tag to fix relative links

This commit is contained in:
sanj 2010-11-13 02:42:47 +05:30
parent 819020259d
commit d2b7424588
6 changed files with 62 additions and 12 deletions

View File

@ -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)

View File

@ -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')

View File

@ -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;
}

View File

@ -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();

View File

@ -19,8 +19,8 @@
<% } %>
</ul>
<div class="navBtns" data-terms="<%= search_terms %>" data-page="<%= page_no %>">
<% if (hasPrev) { %><span class="prevBtn">Prev</span><% } %>
<% if (hasNext) { %><span class="nextBtn">Next</span><% } %>
<% if (hasPrev) { %><span class="prevBtn">&lt; Previous</span><% } %>
<% if (hasNext) { %><span class="nextBtn">Next &gt;</span><% } %>
</div>
</script>
@ -28,11 +28,13 @@
<div class="homeLink">
<h3><img src="/static/images/favicon.ico" title="India Theatre Forum" alt="" /> <a href="/" title="India Theatre Forum Home">&nbsp;Home</a> </h3>
</div>
<h3>Past Issues:</h3>
<form id="searchForm" action="" method="get" />
<input id="issueSearch" data-placeholder="Search" /><input id="searchSubmit" type="submit" value="Go" />
</form>
<div class="issueListContainer">
<div id="issueListWrapper">
<h3>Past Issues:</h3>
<form id="searchForm" action="" method="get" />
<input id="issueSearch" data-placeholder="Search" /><input id="searchSubmit" type="submit" value="Go" />
</form>
<div class="issueListContainer">
</div>
</div>
<div id="subscribe">
<a name="subscribe"></>
@ -43,9 +45,11 @@
</form>
</div>
</div>
{% load erangtags %}
<div id="newsletterContent">
{% autoescape off %}
{{ current_issue.html }}
{{ current_issue.html|absolutify_links }}
{% endautoescape %}
<div id="commentWrapper">
<h3>Comments and Feedback</h3>