diff --git a/RIGS/finance.py b/RIGS/finance.py index 2ae0fc47..73552f2e 100644 --- a/RIGS/finance.py +++ b/RIGS/finance.py @@ -55,6 +55,7 @@ class InvoicePrint(generic.View): } }, 'invoice':invoice, + 'current_user':request.user, }) rml = template.render(context) diff --git a/RIGS/forms.py b/RIGS/forms.py index 617eb1bc..7c18d0d2 100644 --- a/RIGS/forms.py +++ b/RIGS/forms.py @@ -12,16 +12,11 @@ from RIGS import models #Registration class ProfileRegistrationFormUniqueEmail(RegistrationFormUniqueEmail): - username = forms.CharField(required=True, max_length=30) - first_name = forms.CharField(required=False, max_length=50) - last_name = forms.CharField(required=False, max_length=50) - initials = forms.CharField(required=True, max_length=5) - phone = forms.CharField(required=False, max_length=13) captcha = ReCaptchaField() class Meta: model = models.Profile - fields = ('username','first_name','last_name','initials','phone') + fields = ('username','email','first_name','last_name','initials','phone') def clean_initials(self): """ diff --git a/RIGS/ical.py b/RIGS/ical.py index 8ae94342..47ee669e 100644 --- a/RIGS/ical.py +++ b/RIGS/ical.py @@ -97,6 +97,9 @@ class CalendarICS(ICalFeed): return item.earliest_time def item_end_datetime(self, item): + if type(item.latest_time) is datetime.date: # Ical end_datetime is non-inclusive, so add a day + return item.latest_time + datetime.timedelta(days=1) + return item.latest_time def item_location(self,item): diff --git a/RIGS/models.py b/RIGS/models.py index 49963a6f..636c7dca 100644 --- a/RIGS/models.py +++ b/RIGS/models.py @@ -71,6 +71,15 @@ class RevisionMixin(object): else: return None + @property + def current_version_id(self): + versions = reversion.get_for_object(self) + if versions: + version = reversion.get_for_object(self)[0] + return "V{0} | R{1}".format(version.pk,version.revision.pk) + else: + return None + @reversion.register @python_2_unicode_compatible class Person(models.Model, RevisionMixin): diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index f62ed2da..42a79b3b 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -122,7 +122,8 @@ class EventPrint(generic.View): 'bold': 'RIGS/static/fonts/OPENSANS-BOLD.TTF', } }, - 'copy':copy + 'copy':copy, + 'current_user':request.user, }) # context['copy'] = copy # this is the way to do it once we upgrade to Django 1.8.3 diff --git a/RIGS/templates/RIGS/calendar.html b/RIGS/templates/RIGS/calendar.html index 0ac85749..23a0b1b8 100644 --- a/RIGS/templates/RIGS/calendar.html +++ b/RIGS/templates/RIGS/calendar.html @@ -56,11 +56,14 @@ 'non-rig': '#5bc0de' }; $(doc).each(function() { - + end = $(this).attr('latest') + if(end.indexOf("T") < 0){ //If latest does not contain a time + end = moment(end).add(1, 'days') //End date is non-inclusive, so add a day + } thisEvent = { 'start': $(this).attr('earliest'), - 'end': $(this).attr('latest'), + 'end': end, 'className': 'modal-href', 'title': $(this).attr('title'), 'url': $(this).attr('url') diff --git a/RIGS/templates/RIGS/event_form.html b/RIGS/templates/RIGS/event_form.html index 7da39132..b0b94e14 100644 --- a/RIGS/templates/RIGS/event_form.html +++ b/RIGS/templates/RIGS/event_form.html @@ -19,6 +19,7 @@ + @@ -110,6 +111,9 @@ $(document).ready(function () { setupItemTable($("#{{ form.items_json.id_for_label }}").val()); }); + $(function () { + $('[data-toggle="tooltip"]').tooltip(); + }) {% endblock %} @@ -162,7 +166,7 @@