events template, contact

This commit is contained in:
Sanjay B 2013-04-15 15:45:31 +05:30
parent 6aaa192382
commit af7d07fcf7
4 changed files with 135 additions and 14 deletions

View File

@ -86,6 +86,7 @@ class Event(ItfModel):
'galleries': [obj for obj in self.galleries.all()],
'child_events': self.child_events.all(),
'parent':self.parent_event,
'has_people_tab': False
}
if self.groups.all():
groups= {
@ -93,8 +94,8 @@ class Event(ItfModel):
'performing': [ obj.group for obj in self.groupevent_set.filter(typ='performing')]
}
rdict['groups']= groups
rdict['has_people_tab'] = True
if self.people.all():
people= {
'attendees': [ obj.person for obj in self.personevent_set.filter(typ='attendee')],
@ -102,6 +103,7 @@ class Event(ItfModel):
'performers': [ obj.person for obj in self.personevent_set.filter(typ='performer')]
}
rdict['people']= people
rdict['has_people_tab'] = True
return rdict

View File

@ -1,4 +1,4 @@
{% load thumbnail %}
<div class="imgVideoBlock">
<h3 class="orange">Albums</h3>
{% for g in obj.galleries.all %}
@ -22,6 +22,7 @@
<img src="{{ v.thumbnail }}" class="youtubeLink thumbsDetails" data-iframe='{{ v.iframe }}' />
{% endfor %}
{% endif %}
</div>
{% endif %}
<!-- <a href="" class="moreLink">More&raquo;</a> -->
</div>

View File

@ -12,9 +12,15 @@ $(function() {
<ul class="tabsInnerRight">
<li><a href="#about">About</a></li>
<li><a href="#calendar">Calendar</a></li>
<li><a href="#people">People</a></li>
<li><a href="#gallery">Gallery</a></li>
{% if child_events %}
<li><a href="#calendar">Calendar</a></li>
{% endif %}
{% if has_people_tab %}
<li><a href="#people">People</a></li>
{% endif %}
{% if galleries %}
<li><a href="#gallery">Gallery</a></li>
{% endif %}
<li><a href="#buzz">Buzz</a></li>
<li><a href="#notes">Notes</a></li>
<li><a href="#contact">Contact</a></li>
@ -23,20 +29,99 @@ $(function() {
<div id="about" class="tab_content">
<h3>{{ title }}</h3>
<div><strong>Tag-line </strong>: {{ oneliner }}</div>
<div><strong>Description: </strong>: {{ description }} </div>
<div><strong>Event Type: </strong>: {{ event_type }}</div>
<div><strong>Address:</strong>: {{ address }}</div>
<div><strong>City:</strong>: {{ city }}</div>
<div><strong>Tag-line: </strong> {{ oneliner }}</div>
<div><strong>Description: </strong> {{ description }} </div>
<div><strong>Event Type: </strong> {{ event_type }}</div>
<div><strong>Address:</strong> {{ address }}</div>
<div><strong>City:</strong> {{ city }}</div>
<div><strong>Start date:</strong> {{ start_date|date:"jS M, Y" }}</div>
{% if start_time %}
<div><strong>Start time:</strong> {{ start_time|time:"P" }}</div>
{% endif %}
{% if end_date %}
<div><strong>End date:</strong> {{ end_date|date:"jS M, Y" }}</div>
{% endif %}
{% if end_time %}
<div><strong>End time:</strong> {{ end_time|time:"P" }}</div>
{% endif %}
{% if booking_link %}
<div><strong>Booking Link: </strong><a href="{{ booking_link }}" target="_blank">{{ booking_link }}</a></div>
{% endif %}
</div> <!-- end div about -->
<div id="calendar" class="tab_content">
{% for event in child_events %}
<div>
<a href="{{ event.get_absolute_url }}">{{ event.title }}</a>
</div>
{% endfor %}
</div> <!-- end calendar -->
<div id="people" class="tab_content">
{% if people.organisers %}
<h5>Organisers</h5>
{% for person in people.organisers %}
<div class="productionEach">
<div class="productionEachImg">
<img src="{{ person.get_image }}" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="{{ person.get_absolute_url }}">{{ person.first_name }} {{ person.last_name }}</a>
<div>{{ person.about|truncatewords:40 }}</div>
<div>{{ person.locations.0.city.name }}</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
{% endfor %}
{% endif %}
{% if people.performers %}
<h5>Performers</h5>
{% for person in people.performers %}
<div class="productionEach">
<div class="productionEachImg">
<img src="{{ person.get_image }}" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="{{ person.get_absolute_url }}">{{ person.first_name }} {{ person.last_name }}</a>
<div>{{ person.about|truncatewords:40 }}</div>
<div>{{ person.locations.0.city.name }}</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
{% endfor %}
{% endif %}
{% if people.attendees %}
<h5>Attendees</h5>
{% for person in people.attendees %}
<div class="productionEach">
<div class="productionEachImg">
<img src="{{ person.get_image }}" alt="/static/images/150x150.jpg" />
</div>
<div class="productionEachTextA">
<a href="{{ person.get_absolute_url }}">{{ person.first_name }} {{ person.last_name }}</a>
<div>{{ person.about|truncatewords:40 }}</div>
<div>{{ person.locations.0.city.name }}</div>
</div>
<div class="clear"></div>
</div> <!-- end production each -->
{% endfor %}
{% endif %}
</div>
@ -53,10 +138,42 @@ $(function() {
</div> <!-- end notes -->
<div id="contact" class="tab_content">
{% if tel_no %}
<div>
<strong>Telephone: {{ tel_no }}
</div>
{% endif %}
{% if request.user.is_authenticated %}
<form id="contactForm" action="/contact/event" method="POST">
<!-- <input type="hidden" id="contactFrom" value="{{ request.user.id }}" /> -->
<input type="hidden" id="contactTo" value="{{ obj.id }}" />
<textarea id="contactMessage" placeholder="Type your message here..."></textarea>
<input type="submit" value="Submit" />
</form>
{% else %}
You need to be signed in to contact people.
{% endif %}
</div>
<script type="text/javascript" src="/static/js/innertabs.js"></script>
<script type="text/javascript" src="/static/js/innertabs.js"></script>
<script>
$(function() {
$('#contactForm').submit(function(e) {
e.preventDefault();
var url = $(this).attr("action");
$.get(url, {
// 'from': $('#contactFrom').val(),
'to': $('#contactTo').val(),
'message': $('#contactMessage').val()
}, function(response) {
$('#contactDiv').text(response);
});
});
});
</script>
<br />
<a href="{{ edit_url }}">Edit</a>

View File

@ -65,6 +65,7 @@ urlpatterns = patterns('',
(r'^invitation/invite/$', 'itfprofiles.views.friend_invite'),
(r'^contact/person/$', 'itfprofiles.views.contact_person'),
(r'^contact/group/$', 'itfprofiles.views.contact_group'),
(r'^contact/event/$', 'events.views.contact_event'),
)
# (r'^ajax_filtered_fields/', include('ajax_filtered_fields.urls')),