ups, forgot to add js
This commit is contained in:
parent
77d5717e12
commit
6f00c2fcbe
|
@ -87,7 +87,7 @@ class ItfModel(models.Model):
|
||||||
ret[p] = self._get_property(p)
|
ret[p] = self._get_property(p)
|
||||||
return ret
|
return ret
|
||||||
elif typ == str:
|
elif typ == str:
|
||||||
return _get_property(props)
|
return self._get_property(props)
|
||||||
else:
|
else:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ class ItfModel(models.Model):
|
||||||
def get_list(kls, data):
|
def get_list(kls, data):
|
||||||
options = {
|
options = {
|
||||||
'page_no': 1,
|
'page_no': 1,
|
||||||
'list_size': 8,
|
'list_size': 12,
|
||||||
'search': '',
|
'search': '',
|
||||||
'sort': [],
|
'sort': [],
|
||||||
'range': [0,50]
|
'range': [0,50]
|
||||||
|
@ -219,12 +219,22 @@ class ItfModel(models.Model):
|
||||||
operator = ''
|
operator = ''
|
||||||
sort = operator + s['key']
|
sort = operator + s['key']
|
||||||
qset = qset.order_by(sort)
|
qset = qset.order_by(sort)
|
||||||
|
'''
|
||||||
r0 = options['range'][0]
|
r0 = options['range'][0]
|
||||||
r1 = options['range'][1]
|
r1 = options['range'][1]
|
||||||
results = qset[r0:r1]
|
results = qset[r0:r1]
|
||||||
for r in results:
|
'''
|
||||||
|
paginator = Paginator(qset, list_size)
|
||||||
|
|
||||||
|
|
||||||
|
try:
|
||||||
|
results = paginator.page(page_no)
|
||||||
|
except (EmptyPage, InvalidPage):
|
||||||
|
results = paginator.page(paginator.num_pages)
|
||||||
|
|
||||||
|
for r in results.object_list:
|
||||||
ret.append(r.list_dict())
|
ret.append(r.list_dict())
|
||||||
|
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
|
@ -22,6 +22,9 @@ class ModuleTab(models.Model):
|
||||||
order = models.IntegerField(default=1)
|
order = models.IntegerField(default=1)
|
||||||
is_displayed = models.BooleanField(default=True)
|
is_displayed = models.BooleanField(default=True)
|
||||||
|
|
||||||
|
class Meta:
|
||||||
|
ordering = ['-is_default', 'order']
|
||||||
|
|
||||||
def __unicode__(self):
|
def __unicode__(self):
|
||||||
return self.title
|
return self.title
|
||||||
|
|
||||||
|
|
|
@ -3,6 +3,7 @@ from django.shortcuts import render_to_response, get_object_or_404
|
||||||
from django.template import RequestContext
|
from django.template import RequestContext
|
||||||
from ox.django.shortcuts import render_to_json_response
|
from ox.django.shortcuts import render_to_json_response
|
||||||
|
|
||||||
|
|
||||||
def main(request, module_slug):
|
def main(request, module_slug):
|
||||||
m = get_object_or_404(Module, slug=module_slug)
|
m = get_object_or_404(Module, slug=module_slug)
|
||||||
tabs = m.moduletab_set.all()
|
tabs = m.moduletab_set.all()
|
||||||
|
@ -19,7 +20,7 @@ def main(request, module_slug):
|
||||||
|
|
||||||
|
|
||||||
def get_list(request):
|
def get_list(request):
|
||||||
tab_id = request.GET.get("tab", 0)
|
tab_id = request.GET.get("tab_id", 0)
|
||||||
tab = get_object_or_404(ModuleTab, pk=tab_id)
|
tab = get_object_or_404(ModuleTab, pk=tab_id)
|
||||||
list_options = {
|
list_options = {
|
||||||
'search': request.GET.get("search", ""),
|
'search': request.GET.get("search", ""),
|
||||||
|
@ -38,3 +39,4 @@ def get_details(request):
|
||||||
obj = get_object_or_404(model_class, pk=object_id)
|
obj = get_object_or_404(model_class, pk=object_id)
|
||||||
return render_to_json_response(obj.insidepage_dict())
|
return render_to_json_response(obj.insidepage_dict())
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -99,6 +99,15 @@ color:#FFF;
|
||||||
box-shadow:-3px -0px 6px #e0dfdf;
|
box-shadow:-3px -0px 6px #e0dfdf;
|
||||||
cursor:pointer;}
|
cursor:pointer;}
|
||||||
|
|
||||||
|
.tabText
|
||||||
|
{ display:none; }
|
||||||
|
|
||||||
|
.displayedTab
|
||||||
|
{ display:block !important; }
|
||||||
|
|
||||||
|
#loadingList
|
||||||
|
{display:none;}
|
||||||
|
|
||||||
#contentTabsInner
|
#contentTabsInner
|
||||||
{font-family:Arial, Helvetica, 'DejaVu Sans', sans-serif;
|
{font-family:Arial, Helvetica, 'DejaVu Sans', sans-serif;
|
||||||
font-size:13px;
|
font-size:13px;
|
||||||
|
|
52
itf/static/js/insidepage.js
Normal file
52
itf/static/js/insidepage.js
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
$('#listLeft ul li a').live("click", function() {
|
||||||
|
// alert("foo");
|
||||||
|
// e.preventDefault();
|
||||||
|
var objId = $(this).attr("data-id");
|
||||||
|
var tabId = $('.innerSelected').attr("data-id");
|
||||||
|
$.getJSON("/m/get_details", {
|
||||||
|
'tab_id': tabId,
|
||||||
|
'object_id': objId
|
||||||
|
}, function(data) {
|
||||||
|
$('#textRight').text(data.title);
|
||||||
|
$('#bottomRight').html(data.html);
|
||||||
|
// console.log(data);
|
||||||
|
});
|
||||||
|
return false;
|
||||||
|
});
|
||||||
|
|
||||||
|
function getLi(item) {
|
||||||
|
var $li = $('<li />').addClass("tabListItem");
|
||||||
|
var $a = $('<a />').attr("href", '#').attr("data-id", item.id).appendTo($li);
|
||||||
|
var $span = $('<span />').text(item.title).appendTo($a);
|
||||||
|
return $li;
|
||||||
|
}
|
||||||
|
|
||||||
|
$(function() {
|
||||||
|
$('#listLeft ul li a').eq(0).click();
|
||||||
|
// alert("hi");
|
||||||
|
$('.tabCategory').click(function() {
|
||||||
|
var $this = $(this);
|
||||||
|
if ($this.hasClass('.innerSelected')) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$('.innerSelected').removeClass("innerSelected");
|
||||||
|
$this.addClass("innerSelected");
|
||||||
|
$('.displayedTab').removeClass("displayedTab");
|
||||||
|
var tabId = $this.attr("data-id");
|
||||||
|
$('#tabText_' + tabId).addClass("displayedTab");
|
||||||
|
$('#loadingList').show();
|
||||||
|
$('.tabListItem').remove();
|
||||||
|
$.getJSON("/m/get_list", {
|
||||||
|
'tab_id': tabId,
|
||||||
|
'page_no': 1
|
||||||
|
}, function(data) {
|
||||||
|
$('#loadingList').hide();
|
||||||
|
for (var i=0; i<data.length; i++) {
|
||||||
|
var $li = getLi(data[i]);
|
||||||
|
$('#listLeft ul').append($li);
|
||||||
|
}
|
||||||
|
$('#listLeft ul li a').eq(0).click();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
});
|
|
@ -4,7 +4,7 @@
|
||||||
|
|
||||||
{% block extra_head %}
|
{% block extra_head %}
|
||||||
<link rel="stylesheet" href="/static/css/noel/inner.css" type="text/css" />
|
<link rel="stylesheet" href="/static/css/noel/inner.css" type="text/css" />
|
||||||
<script type="text/javascript" href="/static/js/insidepage.js"></script>
|
<script type="text/javascript" src="/static/js/insidepage.js"></script>
|
||||||
{% endblock %}
|
{% endblock %}
|
||||||
|
|
||||||
|
|
||||||
|
@ -38,14 +38,22 @@
|
||||||
</ul>
|
</ul>
|
||||||
|
|
||||||
<div id="contentTabsInner">
|
<div id="contentTabsInner">
|
||||||
{{ default_tab.text }}
|
<div id="tabText_{{default_tab.id}}" class="tabText displayedTab">
|
||||||
|
{{ default_tab.text }}
|
||||||
|
</div>
|
||||||
|
{% for t in tabs %}
|
||||||
|
<div id="tabText_{{t.id}}" class="tabText">
|
||||||
|
{{ t.text }}
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="listLeft">
|
<div id="listLeft">
|
||||||
<ul>
|
<ul>
|
||||||
|
<li id="loadingList">Loading...</li>
|
||||||
{% for l in default_list %}
|
{% for l in default_list %}
|
||||||
<li><a href="{{ l.url }}" data-id="{{ l.id }}"><span>{{ l.title }}</span></a></li>
|
<li class="tabListItem"><a href="{{ l.url }}" data-id="{{ l.id }}"><span>{{ l.title }}</span></a></li>
|
||||||
{% endfor %}
|
{% endfor %}
|
||||||
<!-- <li><a href=""><span>The Mystery of vanishing rights<span></a></li> -->
|
<!-- <li><a href=""><span>The Mystery of vanishing rights<span></a></li> -->
|
||||||
</ul>
|
</ul>
|
||||||
|
@ -62,9 +70,9 @@
|
||||||
<div id="imageLeft">
|
<div id="imageLeft">
|
||||||
</div>
|
</div>
|
||||||
<p id="textRight">
|
<p id="textRight">
|
||||||
The Mystery of vanishing rights
|
|
||||||
</p>
|
</p>
|
||||||
|
<!--
|
||||||
<p id="twitter">
|
<p id="twitter">
|
||||||
<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="http://twitter.com/#!/indtheatreforum">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
|
<a href="http://twitter.com/share" class="twitter-share-button" data-count="none" data-via="http://twitter.com/#!/indtheatreforum">Tweet</a><script type="text/javascript" src="http://platform.twitter.com/widgets.js"></script>
|
||||||
</p>
|
</p>
|
||||||
|
@ -73,12 +81,13 @@
|
||||||
<iframe src="http://www.facebook.com/plugins/like.php?href=www.theatreforum.in&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font=arial&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
|
<iframe src="http://www.facebook.com/plugins/like.php?href=www.theatreforum.in&send=false&layout=button_count&width=450&show_faces=false&action=like&colorscheme=light&font=arial&height=21" scrolling="no" frameborder="0" style="border:none; overflow:hidden; width:450px; height:21px;" allowTransparency="true"></iframe>
|
||||||
|
|
||||||
</p>
|
</p>
|
||||||
|
-->
|
||||||
<img src="/static/images/noel/download.jpg" width="16" height="16" alt="download" id="download">
|
<img src="/static/images/noel/download.jpg" width="16" height="16" alt="download" id="download">
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="bottomRight">
|
<div id="bottomRight">
|
||||||
|
<!--
|
||||||
<p><span id="sectionTitle">Story 1:</span> A well known theatre group had auditions for casting lead characters in their play for which over 150 actors auditioned. A television film director happened to see the recording of the auditions and obtained a copy. Two months later, a few actors who had auditioned were horrified to see themselves in a television comedy show. Snippets of the recording had obviously been used!</p><br/>
|
<p><span id="sectionTitle">Story 1:</span> A well known theatre group had auditions for casting lead characters in their play for which over 150 actors auditioned. A television film director happened to see the recording of the auditions and obtained a copy. Two months later, a few actors who had auditioned were horrified to see themselves in a television comedy show. Snippets of the recording had obviously been used!</p><br/>
|
||||||
|
|
||||||
<p><span id="sectionTitle">Actors:</span> Not on! If you like our acting, you hire us! Not use our improvisations for another purpose and that too by someone else! We'll sue the television show producer and the theatre group.</p><br/>
|
<p><span id="sectionTitle">Actors:</span> Not on! If you like our acting, you hire us! Not use our improvisations for another purpose and that too by someone else! We'll sue the television show producer and the theatre group.</p><br/>
|
||||||
|
@ -96,7 +105,7 @@
|
||||||
<p><span id="sectionTitle">Neha Bhasin:</span> That's my voice…that's my name on the CD but I'm not the background vocalist!!! I'll sue the film producer! The music director: Hmmm not so! We didn't even want to use your voice. It was a recording mistake! The Court: A costly mistake. You've used her voice, now pay up royalty! And recall all the CDs with her voice.</p><br/>
|
<p><span id="sectionTitle">Neha Bhasin:</span> That's my voice…that's my name on the CD but I'm not the background vocalist!!! I'll sue the film producer! The music director: Hmmm not so! We didn't even want to use your voice. It was a recording mistake! The Court: A costly mistake. You've used her voice, now pay up royalty! And recall all the CDs with her voice.</p><br/>
|
||||||
|
|
||||||
<p><span id="sectionTitle">Law:</span> Do actors have special rights? Under the Indian Copyright law, actors, singers, musicians, dancers, et al are called performers</p><br/>
|
<p><span id="sectionTitle">Law:</span> Do actors have special rights? Under the Indian Copyright law, actors, singers, musicians, dancers, et al are called performers</p><br/>
|
||||||
|
-->
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div id="clearBoth"></div>
|
<div id="clearBoth"></div>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user