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
|
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')
|
||||||
|
|
|
@ -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;
|
||||||
|
}
|
||||||
|
|
|
@ -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();
|
||||||
|
|
|
@ -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">< Previous</span><% } %>
|
||||||
<% if (hasNext) { %><span class="nextBtn">Next</span><% } %>
|
<% if (hasNext) { %><span class="nextBtn">Next ></span><% } %>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
@ -28,11 +28,13 @@
|
||||||
<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"> Home</a> </h3>
|
<h3><img src="/static/images/favicon.ico" title="India Theatre Forum" alt="" /> <a href="/" title="India Theatre Forum Home"> Home</a> </h3>
|
||||||
</div>
|
</div>
|
||||||
<h3>Past Issues:</h3>
|
<div id="issueListWrapper">
|
||||||
<form id="searchForm" action="" method="get" />
|
<h3>Past Issues:</h3>
|
||||||
<input id="issueSearch" data-placeholder="Search" /><input id="searchSubmit" type="submit" value="Go" />
|
<form id="searchForm" action="" method="get" />
|
||||||
</form>
|
<input id="issueSearch" data-placeholder="Search" /><input id="searchSubmit" type="submit" value="Go" />
|
||||||
<div class="issueListContainer">
|
</form>
|
||||||
|
<div class="issueListContainer">
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="subscribe">
|
<div id="subscribe">
|
||||||
<a name="subscribe"></>
|
<a name="subscribe"></>
|
||||||
|
@ -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>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user