Add "hours as decimal" hover text for some HH:MM timesheet values
hoping this helps with random troubleshooting...
This commit is contained in:
		
							parent
							
								
									9e065541b9
								
							
						
					
					
						commit
						fd0760ed07
					
				
					 3 changed files with 6 additions and 5 deletions
				
			
		| 
						 | 
				
			
			@ -34,7 +34,7 @@ from rattail.db import model
 | 
			
		|||
from rattail.time import localtime
 | 
			
		||||
from rattail.util import pretty_hours, hours_as_decimal
 | 
			
		||||
 | 
			
		||||
from webhelpers2.html import tags
 | 
			
		||||
from webhelpers2.html import tags, HTML
 | 
			
		||||
 | 
			
		||||
from tailbone.views import MasterView
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			@ -44,7 +44,8 @@ def render_shift_length(shift, field):
 | 
			
		|||
        return ""
 | 
			
		||||
    if shift.end_time < shift.start_time:
 | 
			
		||||
        return "??"
 | 
			
		||||
    return pretty_hours(shift.end_time - shift.start_time)
 | 
			
		||||
    length = shift.end_time - shift.start_time
 | 
			
		||||
    return HTML.tag('span', title="{} hrs".format(hours_as_decimal(length)), c=[pretty_hours(length)])
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
class ScheduledShiftsView(MasterView):
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue