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 from django.core.paginator import Paginator, InvalidPage, EmptyPage
RESULTS_PER_PAGE = 3 RESULTS_PER_PAGE = 6
def home(request): def home(request):
all_issues = Issue.objects.all().order_by('-date') all_issues = Issue.objects.all().order_by('-date')

View File

@ -1,6 +1,9 @@
/*
body { body {
background: rgb(220,220,220);
background: rgba(210,210,210,0.7);
} }
*/
#leftMenu { #leftMenu {
float: left; float: left;
@ -51,11 +54,18 @@
.newsletterList a { .newsletterList a {
text-decoration: none; text-decoration: none;
color: #666;
} }
.newsletterList a:hover {
color: #000;
}
.newsletterList li { .newsletterList li {
margin-bottom: 4px; margin-bottom: 6px;
list-style-type: none; list-style-type: none;
border-bottom: 1px solid #FECD07;
} }
.response { .response {
@ -91,3 +101,31 @@
font-style: italic; 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(); e.preventDefault();
var searchInput = $('#issueSearch'); var searchInput = $('#issueSearch');
var search_terms = searchInput.val(); var search_terms = searchInput.val();
if (search_terms == '' || search_terms == searchInput.data("placeholder")) { if (search_terms == searchInput.data("placeholder")) {
return false; return false;
} }
doIssuesLoading(); doIssuesLoading();

View File

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