Skip to content

Commit

Permalink
added colours to table
Browse files Browse the repository at this point in the history
  • Loading branch information
Karolis Rusenas committed Aug 6, 2015
1 parent c584a5d commit 62d2b36
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion templates/salesforce.html
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ <h3 class="box-title"> {{ title }}</h3>
{{ name }}
</td>
{% for code, value in sorted(values.items()) %}
<td>{{ value }}</td>
<td {% if value < 50 %} bgcolor="#E60000"
{% elif value < 80 %} bgcolor="#FF9900" {% end %} >{{ value }}%</td>
{% end %}

</tr>
Expand Down
8 changes: 5 additions & 3 deletions utilities/sfclient.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,10 +151,12 @@ def create_final_report(raw_report, time_dict, employee_dict):
# get full name from value {'group_key': '1', 'group_name': 'Employee', 'name': 'Karolis Rusenas'}
employee_full_name = employee_dict[empl_key]['name']
# getting utilisation
utilisation = value['aggregates'][0]['label']
utilisation = value['aggregates'][0]['value']
# check for Nones
if utilisation == "-":
utilisation = '0.00%'
if utilisation == "None" or utilisation is None:
utilisation = '0.00'

utilisation = float("{0:.2f}".format(float(utilisation)))

# check if employee is not in dictionary
if employee_full_name not in body_employee_records.keys():
Expand Down

0 comments on commit 62d2b36

Please sign in to comment.