Fixed CMS_USER.creation_date retrieval.
Improved the admin users listing.
This commit is contained in:
@@ -67,6 +67,7 @@ feature -- HTTP Methods
|
||||
l_count: INTEGER
|
||||
user_api: CMS_USER_API
|
||||
l_display_name: READABLE_STRING_32
|
||||
ago: DATE_TIME_AGO_CONVERTER
|
||||
do
|
||||
-- At the moment the template are hardcoded, but we can
|
||||
-- get them from the configuration file and load them into
|
||||
@@ -99,12 +100,13 @@ feature -- HTTP Methods
|
||||
|
||||
if attached user_api.recent_users (create {CMS_DATA_QUERY_PARAMETERS}.make (l_page_helper.current_page_offset, l_page_helper.page_size)) as lst then
|
||||
s.append ("<ul class=%"cms-users%">%N")
|
||||
create ago.make
|
||||
across
|
||||
lst as ic
|
||||
loop
|
||||
u := ic.item
|
||||
s.append ("<li class=%"cms_user%">")
|
||||
s.append ("<a href=%"")
|
||||
s.append ("<li class=%"user%">")
|
||||
s.append ("<span class=%"identifier%"><a href=%"")
|
||||
s.append (req.absolute_script_url ("/admin/user/"+u.id.out))
|
||||
s.append ("%">")
|
||||
l_display_name := user_api.user_display_name (u)
|
||||
@@ -114,17 +116,33 @@ feature -- HTTP Methods
|
||||
s.append (html_encoded (u.name))
|
||||
s.append ("]")
|
||||
end
|
||||
s.append ("</a>")
|
||||
s.append ("</a></span>")
|
||||
if attached u.email as l_email then
|
||||
s.append (" <span class=%"email%">")
|
||||
s.append (api.html_encoded (l_email))
|
||||
s.append ("</span>")
|
||||
end
|
||||
s.append (" <span class=%"roles%">")
|
||||
if attached user_api.user_roles (u) as l_roles and then not l_roles.is_empty then
|
||||
s.append (" <span class=%"cms_roles%">(")
|
||||
across
|
||||
l_roles as ic_roles
|
||||
loop
|
||||
s.append (html_encoded (ic_roles.item.name))
|
||||
s.append (" ")
|
||||
end
|
||||
s.append (")</span>")
|
||||
end
|
||||
s.append ("</span>")
|
||||
s.append (" <span>Last signed in: ")
|
||||
if attached u.last_login_date as dt then
|
||||
s.append (api.html_encoded (ago.smart_date_duration (dt)))
|
||||
else
|
||||
s.append ("Never")
|
||||
end
|
||||
s.append ("</span>")
|
||||
s.append (" <span>Created: ")
|
||||
s.append (api.html_encoded (ago.short_date (u.creation_date)))
|
||||
s.append ("</span>")
|
||||
|
||||
s.append ("</li>%N")
|
||||
end
|
||||
s.append ("</ul>%N")
|
||||
|
||||
Reference in New Issue
Block a user