From a1e8cc512885082724268a82fe1cba4e1a5a9c26 Mon Sep 17 00:00:00 2001 From: Jocelyn Fiat Date: Wed, 8 Feb 2017 18:41:17 +0100 Subject: [PATCH] Make sure to use the user profile name whenever it is possible. --- modules/blog/handler/blog_handler.e | 10 +++++----- modules/blog/handler/blog_user_handler.e | 4 ++-- modules/node/handler/node_handler.e | 2 +- modules/node/handler/nodes_handler.e | 2 +- modules/node/handler/trash_handler.e | 8 ++++++-- modules/recent_changes/cms_recent_changes_module.e | 2 +- 6 files changed, 16 insertions(+), 12 deletions(-) diff --git a/modules/blog/handler/blog_handler.e b/modules/blog/handler/blog_handler.e index 2f731d6..768b869 100644 --- a/modules/blog/handler/blog_handler.e +++ b/modules/blog/handler/blog_handler.e @@ -158,7 +158,7 @@ feature -- HTML Output lnk: CMS_LOCAL_LINK do -- Output the title. If more than one page, also output the current page number - append_page_title_html_to (a_output) + append_page_title_html_to (page, a_output) -- Get the posts from the current page (given by page number and entries per page) -- Start list of posts @@ -174,7 +174,7 @@ feature -- HTML Output append_creation_date_html_to (n, a_output) -- Output the author of the post - append_author_html_to (n, a_output) + append_author_html_to (n, page, a_output) -- Output the title of the post as a link (to the detail page) append_title_html_to (n, page, a_output) @@ -192,7 +192,7 @@ feature -- HTML Output append_pagination_html_to (a_output) end - append_page_title_html_to (a_output: STRING) + append_page_title_html_to (a_page: CMS_RESPONSE; a_output: STRING) -- Append the title of the page as a html string to `a_output'. -- It shows the current page number. do @@ -215,12 +215,12 @@ feature -- HTML Output end end - append_author_html_to (n: CMS_NODE; a_output: STRING) + append_author_html_to (n: CMS_NODE; a_page: CMS_RESPONSE; a_output: STRING) -- Append to `a_output', the author of node `n' as html link to author's posts. do if attached n.author as l_author then a_output.append ("by ") - a_output.append ("" + html_encoded (l_author.name) + "") + a_output.append ("" + html_encoded (a_page.user_profile_name (l_author)) + "") end end diff --git a/modules/blog/handler/blog_user_handler.e b/modules/blog/handler/blog_user_handler.e index def1f19..7a2b396 100644 --- a/modules/blog/handler/blog_user_handler.e +++ b/modules/blog/handler/blog_user_handler.e @@ -114,12 +114,12 @@ feature -- Query feature -- HTML Output - append_page_title_html_to (a_output: STRING) + append_page_title_html_to (a_page: CMS_RESPONSE; a_output: STRING) -- Returns the title of the page as a html string. It shows the current page number and the name of the current user do a_output.append ("

Posts from ") if attached user as l_user then - a_output.append (html_encoded (l_user.name)) + a_output.append (html_encoded (a_page.user_profile_name (l_user))) else a_output.append ("unknown user") end diff --git a/modules/node/handler/node_handler.e b/modules/node/handler/node_handler.e index 4d79a1a..52d52eb 100644 --- a/modules/node/handler/node_handler.e +++ b/modules/node/handler/node_handler.e @@ -335,7 +335,7 @@ feature {NONE} -- Trash:Restore b.append ("") if attached n.author as l_author then b.append (" by ") - b.append (r.link (l_author.name, "user/" + l_author.id.out, Void)) + b.append (r.link (r.user_profile_name (l_author), "user/" + l_author.id.out, Void)) end if node_api.has_permission_for_action_on_node ("edit revisions", l_node, api.user) then b.append (" (>)) @@ -59,7 +63,7 @@ feature -- HTTP Methods then -- NOTE: for development purposes we have the following hardcode output. if l_trash_owner /= Void then - create s.make_from_string ("

Trash for user " + l_page.html_encoded (l_trash_owner.name) + "

") + create s.make_from_string ("

Trash for user " + l_page.html_encoded (l_page.user_profile_name (l_trash_owner)) + "

") else create s.make_from_string ("

Trash

") end diff --git a/modules/recent_changes/cms_recent_changes_module.e b/modules/recent_changes/cms_recent_changes_module.e index 99420d1..8c958fd 100644 --- a/modules/recent_changes/cms_recent_changes_module.e +++ b/modules/recent_changes/cms_recent_changes_module.e @@ -346,7 +346,7 @@ feature -- Handler l_content.append ("") l_content.append ("") if attached ch.author as u then - l_content.append (r.link (u.name, "user/" + u.id.out, Void)) + l_content.append (r.link (r.user_profile_name (u), "user/" + u.id.out, Void)) elseif attached ch.author_name as un then l_content.append (r.html_encoded (un)) end