New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Last Login Date block to dashboard.html #4735
Add Last Login Date block to dashboard.html #4735
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please don't keep your JIRA IDs in commit messages going upstream and use present tense :)
Add xxx block in dashboard template
for example
@@ -49,6 +49,7 @@ <h3>{{ user.full_name }}</h3> | |||
</div> | |||
{% endif %} | |||
{{ labels(user) }} | |||
{% block last_login_dt %} {% endblock %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The name is too specific. Please find a generic name. after_user_labels
maybe. Also, no need to put a space in the default content.
Showing the last login date may be useful in the core. Are you using the highest |
@ThiefMaster Yes, I'm using the |
Since you can only view your own dashboard unless you are an admin, I think showing it all the time would be fine. I don't have objections in showing it only to admins there, since we eventually want to add a nice sessions overview for users as well where we could show it to the user themself. |
Sessions overview will be good let me know the features you are thinking to add there. Also, I think we can show users last login location from the IP we are storing in identities. For the time being, I've committed the entire block, please have a review and let me know if any changes required. |
@@ -49,6 +49,14 @@ <h3>{{ user.full_name }}</h3> | |||
</div> | |||
{% endif %} | |||
{{ labels(user) }} | |||
{% block session_details %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless you still need to override it, let's get rid of the block around it.
{% set last_login_dt = user.local_identity.safe_last_login_dt %} | ||
<div class="detail">{{ last_login_dt | format_datetime }}</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fail if the user has no local_identity
.
Co-authored-by: Adrian <adrian@planetcoding.net>
…to IND2-1073/last_login_dt
Co-authored-by: Adrian <adrian@planetcoding.net>
f131a29
to
b8a6e66
Compare
c071cb6
to
10f8351
Compare
b94ba28
to
b8a6e66
Compare
ab92232
to
a7cb0bf
Compare
Need to add an empty block to the user dashboard template for displaying the last login date from the UN template override.