Skip to content

Commit e71a744

Browse files
committed
display account.last_seen_on for admin and moderators
A column has been added with last_seen_on on admin's page "latest users". On each user profile, administrators and moderators can view this new piece of information. User can view it also for itself (that's less interesting for it, because it should be always "today").
1 parent f7a3212 commit e71a744

File tree

2 files changed

+3
-0
lines changed

2 files changed

+3
-0
lines changed

app/views/admin/accounts/index.html.haml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
%th Adresse IP courante / précédente
1717
%th Commentaires / contenus / étiquettes
1818
%th Date de création
19+
%th Dernière visite
1920
%th Actions
2021
%th Changer de rôle
2122
- @accounts.each do |account|
@@ -69,6 +70,7 @@
6970
#{ image_tag "/images/icones/denied.png", alt: "masqués", title: "masqués", width: "16px" }
7071
%br
7172
%td= account.created_at.to_s(:posted)
73+
%td= account.last_seen_on ? account.last_seen_on.to_s(:date) : "-"
7274
%td
7375
- if account.inactive? && account.user_id != 1
7476
= button_to "Activer", [:admin, account], method: :put, class: "ok_button"

app/views/users/_recent.html.haml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
%li Rôle : #{a.display_role(@user.nodes.where(public: true).count>0)}
1111
%li Dernière connexion : #{a.current_sign_in_at ? l(@user.account.current_sign_in_at) : "-"}
1212
%li Dernière action : #{a.updated_at ? l(@user.account.updated_at) : "-"}
13+
%li Dernière visite : #{a.last_seen_on ? l(@user.account.last_seen_on, format: :long) : "-"}
1314
%li Karma : #{a.karma} (minimum : #{a.min_karma}, maximum : #{a.max_karma})
1415
- if @user.homesite.present?
1516
%li Site perso : #{@user.homesite}

0 commit comments

Comments
 (0)