added template tag to fix relative links
This commit is contained in:
parent
819020259d
commit
d2b7424588
0
itf/erang_organised/templatetags/__init__.py
Normal file
0
itf/erang_organised/templatetags/__init__.py
Normal file
8
itf/erang_organised/templatetags/erangtags.py
Normal file
8
itf/erang_organised/templatetags/erangtags.py
Normal 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)
|
|
@ -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')
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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">< Previous</span><% } %>
|
||||
<% if (hasNext) { %><span class="nextBtn">Next ></span><% } %>
|
||||
</div>
|
||||
|
||||
</script>
|
||||
|
@ -28,12 +28,14 @@
|
|||
<div class="homeLink">
|
||||
<h3><img src="/static/images/favicon.ico" title="India Theatre Forum" alt="" /> <a href="/" title="India Theatre Forum Home"> Home</a> </h3>
|
||||
</div>
|
||||
<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"></>
|
||||
<h3>Subscribe:</h3>
|
||||
|
@ -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>
|
||||
|
|
Loading…
Reference in New Issue
Block a user