diff --git a/RIGS/rigboard.py b/RIGS/rigboard.py index 42a79b3b..a6ccde09 100644 --- a/RIGS/rigboard.py +++ b/RIGS/rigboard.py @@ -37,6 +37,12 @@ class RigboardIndex(generic.TemplateView): class WebCalendar(generic.TemplateView): template_name = 'RIGS/calendar.html' + def get_context_data(self, **kwargs): + context = super(WebCalendar, self).get_context_data(**kwargs) + context['view'] = kwargs.get('view','') + context['date'] = kwargs.get('date','') + return context + class EventDetail(generic.DetailView): model = models.Event diff --git a/RIGS/templates/RIGS/calendar.html b/RIGS/templates/RIGS/calendar.html index 23a0b1b8..f6891d84 100644 --- a/RIGS/templates/RIGS/calendar.html +++ b/RIGS/templates/RIGS/calendar.html @@ -14,8 +14,28 @@ diff --git a/RIGS/templates/RIGS/event_detail.html b/RIGS/templates/RIGS/event_detail.html index b5fd1b7a..e68e73bf 100644 --- a/RIGS/templates/RIGS/event_detail.html +++ b/RIGS/templates/RIGS/event_detail.html @@ -151,7 +151,7 @@ {% if object.based_on.is_rig %}N{{ object.based_on.pk|stringformat:"05d" }}{% else %} {{ object.based_on.pk }}{% endif %} - {{ object.base_on.name }} by {{ object.based_on.mic.name }} + {{ object.base_on.name }} {% if object.based_on.mic %}by {{ object.based_on.mic.name }}{% endif %} {% endif %} diff --git a/RIGS/test_functional.py b/RIGS/test_functional.py index 7fad8fc0..f37bf0bc 100644 --- a/RIGS/test_functional.py +++ b/RIGS/test_functional.py @@ -420,8 +420,9 @@ class EventTest(LiveServerTestCase): e.send_keys(Keys.ENTER) # See redirected to success page + successTitle = self.browser.find_element_by_xpath('//h1').text event = models.Event.objects.get(name='Test Event Name') - self.assertIn("N0000%d | Test Event Name"%event.pk, self.browser.find_element_by_xpath('//h1').text) + self.assertIn("N0000%d | Test Event Name"%event.pk, successTitle) def testEventDuplicate(self): testEvent = models.Event.objects.create(name="TE E1", status=models.Event.PROVISIONAL, start_date=date.today() + timedelta(days=6), description="start future no end") @@ -608,9 +609,10 @@ class EventTest(LiveServerTestCase): save.click() # See redirected to success page + successTitle = self.browser.find_element_by_xpath('//h1').text event = models.Event.objects.get(name='Test Event Name') - self.assertIn("N0000%d | Test Event Name"%event.pk, self.browser.find_element_by_xpath('//h1').text) - + self.assertIn("N0000%d | Test Event Name"%event.pk, successTitle) + def testRigNonRig(self): self.browser.get(self.live_server_url + '/event/create/') # Gets redirected to login and back diff --git a/RIGS/urls.py b/RIGS/urls.py index 93028bb2..4338df08 100644 --- a/RIGS/urls.py +++ b/RIGS/urls.py @@ -69,6 +69,8 @@ urlpatterns = patterns('', # Rigboard url(r'^rigboard/$', login_required(rigboard.RigboardIndex.as_view()), name='rigboard'), url(r'^rigboard/calendar/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'), + url(r'^rigboard/calendar/(?P(month|week|day))/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'), + url(r'^rigboard/calendar/(?P(month|week|day))/(?P(\d{4}-\d{2}-\d{2}))/$', login_required()(rigboard.WebCalendar.as_view()), name='web_calendar'), url(r'^rigboard/archive/$', RedirectView.as_view(permanent=True,pattern_name='event_archive')), url(r'^rigboard/activity/$', permission_required_with_403('RIGS.view_event')(versioning.ActivityTable.as_view()), diff --git a/templates/base.html b/templates/base.html index 8bf8b62c..23476432 100644 --- a/templates/base.html +++ b/templates/base.html @@ -144,10 +144,6 @@ {% endif %} {% endblock %} -
- Reminder: Please consider carefully before booking rigs at this moment -
- {% block content %}{% endblock %}