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
- Email benachrichtigung bei Foreneintrag!
Bugfixes: - Gallery
- Countdown Field when event is on same day but over -> shows no countdown
- what events to display?

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

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

View File

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

View File

@ -8,9 +8,9 @@ urlpatterns = patterns('',
url(r'^$', eventplanning ), url(r'^$', eventplanning ),
url(r'^grid$', events_grid ), url(r'^grid$', events_grid ),
url(r'^planning$', eventplanning ), url(r'^planning$', eventplanning ),
url(r'^(?P<pk>\d+)$', permission_required('eventmanager.events.edit')( EventUpdate.as_view() ) ), url(r'^(?P<pk>\d+)$', permission_required('eventplanner.change_event')( EventUpdate.as_view() ) ),
url(r'^add$', permission_required('eventmanager.events.edit')( EventCreate.as_view() ) ), url(r'^add$', permission_required('eventplanner.add_event')( EventCreate.as_view() ) ),
url(r'^(?P<pk>\d+)/delete$', permission_required('eventmanager.events.edit')( deleteEvent ) ), url(r'^(?P<pk>\d+)/delete$', permission_required('eventplanner.delete_event')( deleteEvent ) ),
url(r'^api/', event_api, name="event_api" ), url(r'^api/', event_api, name="event_api" ),
url(r'^api/(\w+)/$', event_api, name="event_api_per_user" ), url(r'^api/(\w+)/$', event_api, name="event_api_per_user" ),
url(r'^api/(\w+)/(\d+)$', event_api, name="event_api_per_user_event"), 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 ) serializer = ParticipationSerializer ( participationQs, data = request.DATA, many=True )
if serializer.is_valid(): if serializer.is_valid():
for serializedObject in serializer.object: 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 ) return Response( status = status.HTTP_403_FORBIDDEN )
if serializedObject.user != request.user: if serializedObject.user != request.user:
if not EventParticipation.isAdmin( request.user ): if not EventParticipation.isAdmin( request.user ):
return Response( status = status.HTTP_403_FORBIDDEN ) return Response( status = status.HTTP_403_FORBIDDEN )
print serializer.data
serializer.save() serializer.save()
return Response( serializer.data ) return Response( serializer.data )
else: else:
print "In Bad request" + str(serializer.errors)
return Response( status = status.HTTP_400_BAD_REQUEST ) return Response( status = status.HTTP_400_BAD_REQUEST )
@ -67,7 +65,6 @@ def eventplanning( request ):
""" """
# non-members see the grid - but cannot edit anything # non-members see the grid - but cannot edit anything
if not EventParticipation.isMember( request.user ): if not EventParticipation.isMember( request.user ):
print "Not a member"
return events_grid(request) return events_grid(request)
# All events in the future sorted by date # 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 navbar_options %} navbar navbar-inverse navbar-static-top {% endblock %}
{% block content %} {% block content %}
{% include "imagestore/pphoto.html" %} {% include "imagestore/pphoto.html" %}

View File

@ -12,7 +12,8 @@ class LocationWidget(widgets.TextInput):
super(LocationWidget, self).__init__(attrs) super(LocationWidget, self).__init__(attrs)
def render(self, name, value, attrs=None): 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(',') lat, lng, zoom = value.split(',')
value = '%s,%s,%d' % ( 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 ): def addressbook( request ):
context = dict() context = dict()
context['musicians'] = Musician.objects.all() context['musicians'] = Musician.objects.all().order_by('user__first_name')
return render( request, 'musicians/addressbook.html', context ) return render( request, 'musicians/addressbook.html', context )

View File

@ -14,6 +14,8 @@ class Message ( models.Model ):
author = models.ForeignKey( User, verbose_name=_("Author") ) 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="row">
<div class="span1"> <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>
<div class="span7"> <div class="span7">
<div class="name"> <div class="name">

View File

@ -7,7 +7,7 @@ from django.utils.safestring import mark_safe
register = django.template.Library() 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' ) @register.filter( name='youtube' )
@stringfilter @stringfilter

View File

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

View File

@ -84,12 +84,27 @@
controlText.innerHTML = 'Konzertort anzeigen'; controlText.innerHTML = 'Konzertort anzeigen';
controlUI.appendChild(controlText); controlUI.appendChild(controlText);
var target = new google.maps.LatLng( {{ nextConcert.map_location }} ); 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 );
google.maps.event.addDomListener(controlUI, 'click', function() { map.setCenter( results[0].geometry.location );
map.setMapTypeId( google.maps.MapTypeId.HYBRID ); }
map.setZoom( 19 ); });
map.setCenter( target ); {% 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, mapTypeId: google.maps.MapTypeId.ROAD,
zoomControl: false, zoomControl: false,
panControl: false, panControl: false,
streetViewControl: false streetViewControl: false,
scrollwheel: false
} }
var directionsService = new google.maps.DirectionsService(); var directionsService = new google.maps.DirectionsService();
var directionsDisplay = new google.maps.DirectionsRenderer(); var directionsDisplay = new google.maps.DirectionsRenderer();
@ -137,11 +153,13 @@
var showTargetControl = new ShowTargetControl(showTargetControlDiv, map); var showTargetControl = new ShowTargetControl(showTargetControlDiv, map);
showTargetControlDiv.index = 2; 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 a").click( function() {
$("#map_box").hide(); $("#map_box").hide();
map.setOptions( { scrollwheel: true } );
}); });
} }
); );