Fixed CMS_USER.creation_date retrieval.
Improved the admin users listing.
This commit is contained in:
@@ -5,13 +5,26 @@ ul.cms-users {
|
||||
}
|
||||
ul.cms-users li {
|
||||
border-top: dotted 1px #ccc;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
ul.cms-users li:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
ul.cms-users li.cms_user a::before {
|
||||
ul.cms-users li span {
|
||||
flex-grow: 1;
|
||||
flex-basis: 20px;
|
||||
padding-left: 2px;
|
||||
text-align: left;
|
||||
}
|
||||
ul.cms-users li span.identifier a::before {
|
||||
content: "[user] ";
|
||||
}
|
||||
ul.cms-users li span.roles {
|
||||
color: #090;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.cms-roles {
|
||||
list-style-type: none;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
ul.cms-users {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc;
|
||||
@@ -9,10 +8,22 @@ ul.cms-users {
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.cms_user a::before {
|
||||
content: "[user] ";
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
span {
|
||||
flex-grow: 1;
|
||||
flex-basis: 20px;
|
||||
padding-left: 2px;
|
||||
text-align: left;
|
||||
&.identifier a::before {
|
||||
content: "[user] ";
|
||||
}
|
||||
&.roles {
|
||||
color: #090;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -196,6 +196,11 @@ feature -- Change element
|
||||
email_set: email = a_email
|
||||
end
|
||||
|
||||
set_creation_date (dt: like creation_date)
|
||||
do
|
||||
creation_date := dt
|
||||
end
|
||||
|
||||
set_last_login_date (dt: like last_login_date)
|
||||
do
|
||||
last_login_date := dt
|
||||
|
||||
@@ -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")
|
||||
|
||||
@@ -5,13 +5,26 @@ ul.cms-users {
|
||||
}
|
||||
ul.cms-users li {
|
||||
border-top: dotted 1px #ccc;
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
}
|
||||
ul.cms-users li:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
ul.cms-users li.cms_user a::before {
|
||||
ul.cms-users li span {
|
||||
flex-grow: 1;
|
||||
flex-basis: 20px;
|
||||
padding-left: 2px;
|
||||
text-align: left;
|
||||
}
|
||||
ul.cms-users li span.identifier a::before {
|
||||
content: "[user] ";
|
||||
}
|
||||
ul.cms-users li span.roles {
|
||||
color: #090;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
ul.cms-roles {
|
||||
list-style-type: none;
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
ul.cms-users {
|
||||
|
||||
list-style-type: none;
|
||||
padding: 3px 3px 3px 3px;
|
||||
border: solid 1px #ccc;
|
||||
@@ -9,10 +8,22 @@ ul.cms-users {
|
||||
&:first-child {
|
||||
border-top: none;
|
||||
}
|
||||
}
|
||||
|
||||
li.cms_user a::before {
|
||||
content: "[user] ";
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
align-items: flex-start;
|
||||
span {
|
||||
flex-grow: 1;
|
||||
flex-basis: 20px;
|
||||
padding-left: 2px;
|
||||
text-align: left;
|
||||
&.identifier a::before {
|
||||
content: "[user] ";
|
||||
}
|
||||
&.roles {
|
||||
color: #090;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -899,6 +899,9 @@ feature {NONE} -- Implementation: User
|
||||
if attached sql_read_integer_32 (6) as l_status then
|
||||
Result.set_status (l_status)
|
||||
end
|
||||
if attached sql_read_date_time (7) as l_creation_date then
|
||||
Result.set_creation_date (l_creation_date)
|
||||
end
|
||||
if attached sql_read_date_time (8) as l_signed_date then
|
||||
Result.set_last_login_date (l_signed_date)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user