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 {
|
ul.cms-users li {
|
||||||
border-top: dotted 1px #ccc;
|
border-top: dotted 1px #ccc;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
ul.cms-users li:first-child {
|
ul.cms-users li:first-child {
|
||||||
border-top: none;
|
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] ";
|
content: "[user] ";
|
||||||
}
|
}
|
||||||
|
ul.cms-users li span.roles {
|
||||||
|
color: #090;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
ul.cms-roles {
|
ul.cms-roles {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
ul.cms-users {
|
ul.cms-users {
|
||||||
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 3px 3px 3px 3px;
|
padding: 3px 3px 3px 3px;
|
||||||
border: solid 1px #ccc;
|
border: solid 1px #ccc;
|
||||||
@@ -9,10 +8,22 @@ ul.cms-users {
|
|||||||
&:first-child {
|
&:first-child {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
}
|
}
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
li.cms_user a::before {
|
align-items: flex-start;
|
||||||
content: "[user] ";
|
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
|
email_set: email = a_email
|
||||||
end
|
end
|
||||||
|
|
||||||
|
set_creation_date (dt: like creation_date)
|
||||||
|
do
|
||||||
|
creation_date := dt
|
||||||
|
end
|
||||||
|
|
||||||
set_last_login_date (dt: like last_login_date)
|
set_last_login_date (dt: like last_login_date)
|
||||||
do
|
do
|
||||||
last_login_date := dt
|
last_login_date := dt
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ feature -- HTTP Methods
|
|||||||
l_count: INTEGER
|
l_count: INTEGER
|
||||||
user_api: CMS_USER_API
|
user_api: CMS_USER_API
|
||||||
l_display_name: READABLE_STRING_32
|
l_display_name: READABLE_STRING_32
|
||||||
|
ago: DATE_TIME_AGO_CONVERTER
|
||||||
do
|
do
|
||||||
-- At the moment the template are hardcoded, but we can
|
-- At the moment the template are hardcoded, but we can
|
||||||
-- get them from the configuration file and load them into
|
-- 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
|
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")
|
s.append ("<ul class=%"cms-users%">%N")
|
||||||
|
create ago.make
|
||||||
across
|
across
|
||||||
lst as ic
|
lst as ic
|
||||||
loop
|
loop
|
||||||
u := ic.item
|
u := ic.item
|
||||||
s.append ("<li class=%"cms_user%">")
|
s.append ("<li class=%"user%">")
|
||||||
s.append ("<a href=%"")
|
s.append ("<span class=%"identifier%"><a href=%"")
|
||||||
s.append (req.absolute_script_url ("/admin/user/"+u.id.out))
|
s.append (req.absolute_script_url ("/admin/user/"+u.id.out))
|
||||||
s.append ("%">")
|
s.append ("%">")
|
||||||
l_display_name := user_api.user_display_name (u)
|
l_display_name := user_api.user_display_name (u)
|
||||||
@@ -114,17 +116,33 @@ feature -- HTTP Methods
|
|||||||
s.append (html_encoded (u.name))
|
s.append (html_encoded (u.name))
|
||||||
s.append ("]")
|
s.append ("]")
|
||||||
end
|
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
|
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
|
across
|
||||||
l_roles as ic_roles
|
l_roles as ic_roles
|
||||||
loop
|
loop
|
||||||
s.append (html_encoded (ic_roles.item.name))
|
s.append (html_encoded (ic_roles.item.name))
|
||||||
s.append (" ")
|
s.append (" ")
|
||||||
end
|
end
|
||||||
s.append (")</span>")
|
|
||||||
end
|
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")
|
s.append ("</li>%N")
|
||||||
end
|
end
|
||||||
s.append ("</ul>%N")
|
s.append ("</ul>%N")
|
||||||
|
|||||||
@@ -5,13 +5,26 @@ ul.cms-users {
|
|||||||
}
|
}
|
||||||
ul.cms-users li {
|
ul.cms-users li {
|
||||||
border-top: dotted 1px #ccc;
|
border-top: dotted 1px #ccc;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
align-items: flex-start;
|
||||||
}
|
}
|
||||||
ul.cms-users li:first-child {
|
ul.cms-users li:first-child {
|
||||||
border-top: none;
|
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] ";
|
content: "[user] ";
|
||||||
}
|
}
|
||||||
|
ul.cms-users li span.roles {
|
||||||
|
color: #090;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
|
||||||
ul.cms-roles {
|
ul.cms-roles {
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
ul.cms-users {
|
ul.cms-users {
|
||||||
|
|
||||||
list-style-type: none;
|
list-style-type: none;
|
||||||
padding: 3px 3px 3px 3px;
|
padding: 3px 3px 3px 3px;
|
||||||
border: solid 1px #ccc;
|
border: solid 1px #ccc;
|
||||||
@@ -9,10 +8,22 @@ ul.cms-users {
|
|||||||
&:first-child {
|
&:first-child {
|
||||||
border-top: none;
|
border-top: none;
|
||||||
}
|
}
|
||||||
}
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
li.cms_user a::before {
|
align-items: flex-start;
|
||||||
content: "[user] ";
|
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
|
if attached sql_read_integer_32 (6) as l_status then
|
||||||
Result.set_status (l_status)
|
Result.set_status (l_status)
|
||||||
end
|
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
|
if attached sql_read_date_time (8) as l_signed_date then
|
||||||
Result.set_last_login_date (l_signed_date)
|
Result.set_last_login_date (l_signed_date)
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user