Skip to content

Commit

Permalink
change icons
Browse files Browse the repository at this point in the history
  • Loading branch information
lloesche committed Dec 13, 2016
1 parent 62b7e3f commit c65b9da
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions report.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,10 +149,10 @@ def aws_credentials(credentials):


def report2html(name, report):
img = {'n/a': '❎',
img = {'n/a': '➖',
'never': '✖',
'true': '✅',
'false': '❎'
'true': '✔',
'false': '➖'
}

# Need to duplicate style elements for certain Email clients
Expand All @@ -167,7 +167,7 @@ def report2html(name, report):
<td style="border: 1px solid black;border-collapse: collapse;"><b>Last changed</b></td>
<td style="border: 1px solid black;border-collapse: collapse;"><b>Groups</b></td>
<td style="border: 1px solid black;border-collapse: collapse;"><b>Policies</b></td>
<td style="border: 1px solid black;border-collapse: collapse;"><b>Last Service</b></td>
<td style="border: 1px solid black;border-collapse: collapse;"><b>Last Service used by an Access Key</b></td>
</tr>
{%- for row in rows %}
<tr style="background-color: {{ row.color }}">
Expand Down Expand Up @@ -228,10 +228,15 @@ def report2html(name, report):
r['color'] = '#{:02x}{:02x}{:02x}'.format(*color_gradient[0])

if user['password_last_changed']:
r['password_changed'] = days_ago(user['password_last_changed'])
if user['user_creation_time'].date() == user['password_last_changed'].date():
r['password_changed_align'] = 'center'
r['password_changed'] = img['never']
else:
r['password_changed'] = days_ago(user['password_last_changed'])
else:
r['password_changed'] = img['never']
r['password_changed_align'] = 'center'
r['password_changed'] = img['never'] if user['password_enabled'] else img['n/a']

r['created'] = days_ago(user['user_creation_time'])

r['access_key'] = img['true'] if user['access_key_1_active'] or user['access_key_2_active'] else img['false']
Expand Down

0 comments on commit c65b9da

Please sign in to comment.