This is an automated email from the ASF dual-hosted git repository. brondsem pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/allura.git
commit 90373b939aa8757f56897a02e7b29581fa047d91 Author: Dillon Walls <dillon.wa...@slashdotmedia.com> AuthorDate: Thu May 21 16:16:10 2020 +0000 wiki_username remove displayname from wiki history/browse If a user removes or edits their displayname after making wiki changes, their old displayname would remain forever in the history. This can pose an issue for users seeking privacy. Additionally, added links to the user's profile in these two places. And to the version of the wiki page. --- ForgeWiki/forgewiki/templates/wiki/browse.html | 4 ++-- ForgeWiki/forgewiki/templates/wiki/page_history.html | 2 +- ForgeWiki/forgewiki/tests/functional/test_root.py | 10 +++++----- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/ForgeWiki/forgewiki/templates/wiki/browse.html b/ForgeWiki/forgewiki/templates/wiki/browse.html index 98fbdd0..2a091c3 100644 --- a/ForgeWiki/forgewiki/templates/wiki/browse.html +++ b/ForgeWiki/forgewiki/templates/wiki/browse.html @@ -42,8 +42,8 @@ <tr class="{{'deleted ' if page.deleted else ''}}{{loop.cycle('', 'even')}}"> <td><a href="{{page.url|safe}}">{{page['title']}}</a></td> - {% if 'user_label' in page %} - <td>{{page['user_label']}} ({{page['user_name']}})</td> + {% if 'user_name' in page %} + <td><a href="/u/{{ page['user_name'] }}">{{page['user_name']}}</a></td> {% else %} <td></td> {% endif %} diff --git a/ForgeWiki/forgewiki/templates/wiki/page_history.html b/ForgeWiki/forgewiki/templates/wiki/page_history.html index 8b73362..8f4bb86 100644 --- a/ForgeWiki/forgewiki/templates/wiki/page_history.html +++ b/ForgeWiki/forgewiki/templates/wiki/page_history.html @@ -46,7 +46,7 @@ <tbody> {% for p in pages %} <tr> - <td>{{p.version}} by {{p.author.display_name}} ({{p.author.username}})</td> + <td><a href="./?version={{ p.version }}">{{p.version}}</a> by <a href="/u/{{ p.author.username }}">{{ p.author.username }}</a></td> <td>{{abbr_date(p.mod_date)}}</td> <td><input name="v1" type="radio" value="{{p.version}}"/></td> <td><input name="v2" type="radio" value="{{p.version}}"/></td> diff --git a/ForgeWiki/forgewiki/tests/functional/test_root.py b/ForgeWiki/forgewiki/tests/functional/test_root.py index 19e4bae..823f663 100644 --- a/ForgeWiki/forgewiki/tests/functional/test_root.py +++ b/ForgeWiki/forgewiki/tests/functional/test_root.py @@ -249,16 +249,16 @@ class TestRootController(TestController): response = self.app.get(h.urlquote('/wiki/tést/history')) assert 'tést' in response # two revisions are shown - assert '2 by Test Admin' in response - assert '1 by Test Admin' in response + assert '<td><a href="./?version=2">2</a> by <a href="/u/test-admin">test-admin</a></td>' in response + assert '1 by test-admin' in response.html.text # you can revert to an old revison, but not the current one assert response.html.find('a', {'data-dialog-id': '1'}), response.html assert not response.html.find('a', {'data-dialog-id': '2'}) response = self.app.get(h.urlquote('/wiki/tést/history'), extra_environ=dict(username=str('*anonymous'))) # two revisions are shown - assert '2 by Test Admin' in response - assert '1 by Test Admin' in response + assert '2 by test-admin' in response.html.text + assert '1 by test-admin' in response.html.text # you cannot revert to any revision assert not response.html.find('a', {'data-dialog-id': '1'}) assert not response.html.find('a', {'data-dialog-id': '2'}) @@ -838,7 +838,7 @@ class TestRootController(TestController): def test_user_browse_page(self): r = self.app.get('/wiki/browse_pages/') - assert '<td>Test Admin (test-admin)</td>' in r + assert '<td><a href="/u/test-admin">test-admin</a></td>' in r def test_subscribe(self): user = M.User.query.get(username='test-user')