Bugfixes, Daten umgezogen

This commit is contained in:
Martin Bauer 2013-10-15 21:51:05 +02:00
parent 175df72a21
commit cd635aff9b
31 changed files with 71 additions and 54 deletions

View File

@ -1,10 +1,8 @@
- bootstrap customize: everything red
- Termin Typ: Konzertvorschlag -> ohne Ort -> nicht auf routenplanung
Bugfixes:
- Countdown Field when event is on same day but over -> shows no countdown
- what events to display?
- Email benachrichtigung bei Foreneintrag!
- Gallery

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 99 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 40 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 41 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 36 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 35 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 95 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 92 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 37 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 38 KiB

View File

@ -100,8 +100,10 @@ class EventParticipation( models.Model ):
@staticmethod
def members():
perm = Permission.objects.get( codename='member' )
return User.objects.filter(Q(groups__permissions=perm) | Q(user_permissions=perm) ).distinct()
perm = Permission.objects.get( codename='member' )
f = User.objects.filter(Q(groups__permissions=perm) | Q(user_permissions=perm) ).distinct()
return f.order_by('musician__position')
@staticmethod
def get_or_create( user , event ):

View File

@ -17,17 +17,25 @@
{% addtoblock "css" %}
<style>
button.eventButton {
width: 55px;
width: 42px;
}
span.eventButton {
height: 16px;
width: 45px;
width: 32px;
text-align: center;
}
.eventButton i {
margin-right:2px;
}
.with_comment {
font-style: italic;
}
.usernameHeader {
font-size:11px;
text-align: center;
}
</style>
{% endaddtoblock %}
@ -125,7 +133,7 @@
<th> Termin </th>
<th> Datum </th>
{% for name in usernames %}
<th> {{ name|capfirst }} </th>
<th class='usernameHeader'> {{ name|capfirst }} </th>
{% endfor %}
<th> </th>
@ -146,18 +154,15 @@
<td class="center userEventTableData" data-username="{{p.user.username}}" data-event="{{event.pk}}">
{% if p.status == "Yes" %}
<button class="btn btn-mini btn-success eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">Ja</span>
<span class="text {% if p.comment %}with_comment{% endif %}">Ja</span>
</button>
{% elif p.status == "No" %}
<button class="btn btn-mini btn-danger eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment%} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">Nein</span>
<span class="text {% if p.comment %}with_comment{% endif %}">Nein</span>
</button>
{% else %}
<button class="btn btn-mini btn-warning eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">?</span>
<span class="text {% if p.comment %}with_comment{% endif %}">?</span>
</button>
{% endif %}
</td>
@ -165,18 +170,15 @@
<td class="center userEventTableData" data-username="{{p.user.username}}" data-event="{{event.pk}}">
{% if p.status == "Yes" %}
<span class="badge badge-success eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">Ja</span>
<span class="text {% if p.comment %}with_comment{% endif %}">Ja</span>
</span>
{% elif p.status == "No" %}
<span class="badge badge-important eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment%} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">Nein</span>
<span class="text {% if p.comment %}with_comment{% endif %}">Nein</span>
</span>
{% else %}
<span class="badge badge-warning eventButton" title="{{p.comment}}" data-status="{{p.status}}">
{% if p.comment %} <i class="icon-comment icon-white"></i> {% endif %}
<span class="text">?</span>
<span class="text {% if p.comment %}with_comment{% endif %}">?</span>
</span>
{% endif %}
</td>
@ -185,17 +187,18 @@
{% endfor %}
<td>
<a class="btn btn-mini btn-inverse deleteButton" data-pk="{{event.pk}}"><i class="icon-trash icon-white"></i> Löschen </a>
<a class="btn btn-mini btn-inverse deleteButton" data-pk="{{event.pk}}"><i class="icon-trash icon-white"></i> </a>
</td>
</tr>
{% endfor %}
{% if perms.eventplanner.admin %}
<tr>
<td class="center"> <a href="add">Termin hinzufügen...</a> </td>
<td class="center" colspan="80"> <a href="add">Termin hinzufügen...</a> </td>
<tr>
{% endif %}</form>
{% endif %}
</form>
</tbody>
</table>

View File

@ -8,9 +8,9 @@ urlpatterns = patterns('',
url(r'^$', eventplanning ),
url(r'^grid$', events_grid ),
url(r'^planning$', eventplanning ),
url(r'^(?P<pk>\d+)$', permission_required('eventmanager.events.edit')( EventUpdate.as_view() ) ),
url(r'^add$', permission_required('eventmanager.events.edit')( EventCreate.as_view() ) ),
url(r'^(?P<pk>\d+)/delete$', permission_required('eventmanager.events.edit')( deleteEvent ) ),
url(r'^(?P<pk>\d+)$', permission_required('eventplanner.change_event')( EventUpdate.as_view() ) ),
url(r'^add$', permission_required('eventplanner.add_event')( EventCreate.as_view() ) ),
url(r'^(?P<pk>\d+)/delete$', permission_required('eventplanner.delete_event')( deleteEvent ) ),
url(r'^api/', event_api, name="event_api" ),
url(r'^api/(\w+)/$', event_api, name="event_api_per_user" ),
url(r'^api/(\w+)/(\d+)$', event_api, name="event_api_per_user_event"),

View File

@ -44,17 +44,15 @@ def event_api( request, username = None, eventId = None ):
serializer = ParticipationSerializer ( participationQs, data = request.DATA, many=True )
if serializer.is_valid():
for serializedObject in serializer.object:
if not EventParticipation.isMember( request.user ):
if not ( EventParticipation.isMember( request.user ) or EventParticipation.isAdmin( request.user ) ):
return Response( status = status.HTTP_403_FORBIDDEN )
if serializedObject.user != request.user:
if not EventParticipation.isAdmin( request.user ):
return Response( status = status.HTTP_403_FORBIDDEN )
print serializer.data
serializer.save()
return Response( serializer.data )
else:
print "In Bad request" + str(serializer.errors)
return Response( status = status.HTTP_400_BAD_REQUEST )
@ -67,7 +65,6 @@ def eventplanning( request ):
"""
# non-members see the grid - but cannot edit anything
if not EventParticipation.isMember( request.user ):
print "Not a member"
return events_grid(request)
# All events in the future sorted by date

View File

@ -7,10 +7,6 @@
{% block navbar_options %} navbar navbar-inverse navbar-static-top {% endblock %}
{% block content %}
{% include "imagestore/pphoto.html" %}

View File

@ -12,7 +12,8 @@ class LocationWidget(widgets.TextInput):
super(LocationWidget, self).__init__(attrs)
def render(self, name, value, attrs=None):
if value is not None:
if value is not None and len(value)>0:
lat, lng, zoom = value.split(',')
value = '%s,%s,%d' % (

0
manage.py Normal file → Executable file
View File

View File

@ -74,7 +74,7 @@ class MusicianUpdate( UpdateView ):
def addressbook( request ):
context = dict()
context['musicians'] = Musician.objects.all()
context['musicians'] = Musician.objects.all().order_by('user__first_name')
return render( request, 'musicians/addressbook.html', context )

View File

@ -14,6 +14,8 @@ class Message ( models.Model ):
author = models.ForeignKey( User, verbose_name=_("Author") )
def __unicode__( self ):
return self.author.username + " : " + self.titel

View File

@ -77,7 +77,7 @@ $(document).ready(function(){
<div class="row">
<div class="span1">
<img src="{{MEDIA_URL}}/user_images/{{message.author}}_circle.png" class="img-circle author_pic">
<img src="{{MEDIA_URL}}/user_images/{{message.author}}_thumb.png" class="img-circle author_pic">
</div>
<div class="span7">
<div class="name">

View File

@ -7,7 +7,7 @@ from django.utils.safestring import mark_safe
register = django.template.Library()
youtubeRegex = re.compile( u'(?:http://)?www.youtube.(?:com|de)/watch\?v=(?P<videoID>[-\w]*)' )
youtubeRegex = re.compile( u'(?:https://)?(?:http://)?www.youtube.(?:com|de)/watch\?v=(?P<videoID>[-\w]*)' )
@register.filter( name='youtube' )
@stringfilter

View File

@ -145,7 +145,7 @@ $.ajaxSetup({
<div class="span12">
<div class="row copyright">
<div class="span12">
© 2013 Blechreiz
© 2013 Blechreiz, Martin Bauer
</div>
</div>
</div>

View File

@ -83,13 +83,28 @@
controlText.style.paddingRight = '4px';
controlText.innerHTML = 'Konzertort anzeigen';
controlUI.appendChild(controlText);
var target = new google.maps.LatLng( {{ nextConcert.map_location }} );
google.maps.event.addDomListener(controlUI, 'click', function() {
map.setMapTypeId( google.maps.MapTypeId.HYBRID );
map.setZoom( 19 );
map.setCenter( target );
google.maps.event.addDomListener(controlUI, 'click', function()
{
{% if not nextConcert.map_location %}
geocoder = new google.maps.Geocoder();
geocoder.region = "de";
geocoder.geocode( {"address": "{{ nextConcert.location }}" }, function(results, status) {
if (status == google.maps.GeocoderStatus.OK) {
map.setMapTypeId( google.maps.MapTypeId.HYBRID );
map.setZoom( 15 );
map.setCenter( results[0].geometry.location );
}
});
{% else %}
var loc = new google.maps.LatLng( {{ nextConcert.map_location }} );
map.setMapTypeId( google.maps.MapTypeId.HYBRID );
map.setZoom( 20 );
map.setCenter( loc );
{% endif %}
});
}
@ -102,7 +117,8 @@
mapTypeId: google.maps.MapTypeId.ROAD,
zoomControl: false,
panControl: false,
streetViewControl: false
streetViewControl: false,
scrollwheel: false
}
var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer();
@ -137,11 +153,13 @@
var showTargetControl = new ShowTargetControl(showTargetControlDiv, map);
showTargetControlDiv.index = 2;
map.controls[google.maps.ControlPosition.TOP_RIGHT].push(showTargetControlDiv);
map.controls[ google.maps.ControlPosition.TOP_RIGHT ].push(showTargetControlDiv);
$("#map_box a").click( function() {
$("#map_box").hide();
$("#map_box").hide();
map.setOptions( { scrollwheel: true } );
});
}
);