Commits

Luke Plant committed 36c097f

Improved usability and clarity of booking bar

Comments (0)

Files changed (2)

cciw/bookings/templatetags/bookings.py

 
     request = context['request']
     ensure_booking_acount_attr(request)
-    logged_in = request.booking_account is not None
+    booking_account = request.booking_account
+    logged_in = booking_account is not None
     current_stage = context['stage']
-    has_account_details = request.booking_account.has_account_details()
+    has_account_details = logged_in and request.booking_account.has_account_details()
 
-    # Tuple of (name, caption, if this a link, url):
+    # Tuple of (name, caption, if this a link, url, message if inaccessible):
+    msg_need_login = 'Must be logged in to access this'
+    msg_need_account_details = 'Need account details to access this' if logged_in else 'Must be logged in to access this'
     stages = [
         ('email',  'Log in', False,
-         ''),
+         '',
+         'Use the "log out" link if you need to log in as someone else'),
+
         ('account', 'Account details', logged_in,
-         reverse('cciw.bookings.views.account_details')),
+         reverse('cciw.bookings.views.account_details'),
+         msg_need_login),
+
         ('place', 'Place details', logged_in and has_account_details,
-         reverse('cciw.bookings.views.add_place')),
+         reverse('cciw.bookings.views.add_place'),
+         msg_need_account_details),
+
         ('list', 'Checkout', logged_in and has_account_details,
-         reverse('cciw.bookings.views.list_bookings')),
+         reverse('cciw.bookings.views.list_bookings'),
+         msg_need_account_details),
+
         ('pay', 'Pay', logged_in and has_account_details,
-         reverse('cciw.bookings.views.pay')),
+         reverse('cciw.bookings.views.pay'),
+         msg_need_account_details),
+
         ]
 
     out = []
     out.append("</div>")
 
     out.append("<ul>")
-    for name, caption, is_link, url in stages:
+    for name, caption, is_link, url, msg in stages:
         if is_link and name != current_stage:
             out.append('<li><a href="%s">%s</a></li>' % (escape(url), escape(caption)))
         elif name == current_stage:
             out.append('<li><span class="active">%s</span></li>' % escape(caption))
         else:
-            out.append('<li><span>%s</span></li>' % escape(caption))
+            out.append('<li><span title="%s">%s</span></li>' % (escape(msg), escape(caption)))
 
     out.append("</ul></div>")
     return ''.join(out)

cciw/cciwmain/static/css/style.css

     font-weight: bold;
 }
 
-#bookingbar ul li a:hover {
-    background-color:	#668099;
+#bookingbar ul li a:hover,
+#bookingbar ul li span:hover {
+    background-color: #668099;
 }
 
 #bookingbar ul li a.active,