From cd24587bbe094197517512fb6c536d1cd109ecbe Mon Sep 17 00:00:00 2001 From: RogerHaase Date: Wed, 12 Jul 2023 14:07:21 -0700 Subject: [PATCH 1/3] update help/welcome/users-Home.data; fixes #1416 --- src/moin/help/welcome/users-Home.data | 13 ++++++++++++- src/moin/help/welcome/users-Home.meta | 13 +++++++------ 2 files changed, 19 insertions(+), 7 deletions(-) diff --git a/src/moin/help/welcome/users-Home.data b/src/moin/help/welcome/users-Home.data index c8acf12a4..be4a75708 100644 --- a/src/moin/help/welcome/users-Home.data +++ b/src/moin/help/welcome/users-Home.data @@ -1 +1,12 @@ -users/Home page \ No newline at end of file += users/Home = + +Use this namespace to create your user home page using the namespace and your +login name as the page name. Example: `users/JoeDoe` + +If you are logged in when you create/edit any page +there will be a link to your home page near the bottom in the item credits. + +You are encouraged to fill your home page with any information about yourself +that you are willing to share with other wiki users. If the wiki admin wants +to encourage some consistency among user home pages there will be a template +offered in the page creation dialog. diff --git a/src/moin/help/welcome/users-Home.meta b/src/moin/help/welcome/users-Home.meta index 6bf393c17..2687648af 100644 --- a/src/moin/help/welcome/users-Home.meta +++ b/src/moin/help/welcome/users-Home.meta @@ -3,23 +3,24 @@ "address": "127.0.0.1", "comment": "", "contenttype": "text/x.moin.wiki;charset=utf-8", - "dataid": "553bd9f91b034a7eaa25b04c31ea40d2", + "dataid": "9c043f2b971b4df4acd0b488df64bd76", "externallinks": [], "itemid": "39190076bdde4314a5f4d857f998a2f9", "itemlinks": [], "itemtransclusions": [], "itemtype": "default", - "mtime": 1679755014, + "mtime": 1689193990, "name": [ "Home" ], "name_old": [], "namespace": "users", + "parentid": "420f034d049543eaa74fe35441264a66", "rev_number": 1, - "revid": "67c2df0ce15c44b5903c0d9502ee7fe8", - "sha1": "ea505479709bda469782e7a75809223dcfde7e10", - "size": 15, + "revid": "5df874c84981428d9f58072011e97438", + "sha1": "7988eff17ca08ba85fbb8219911a3ad9a7523cd8", + "size": 558, "summary": "", "tags": [], "wikiname": "MyMoinMoin" -} \ No newline at end of file +} From 5bc9b6bc94d4ceb51cbb806aaf0a315b0c32459e Mon Sep 17 00:00:00 2001 From: RogerHaase Date: Mon, 17 Jul 2023 08:07:14 -0700 Subject: [PATCH 2/3] /apps/feed/views.py fails on namespaces; fixes #1476 --- src/moin/apps/feed/views.py | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/src/moin/apps/feed/views.py b/src/moin/apps/feed/views.py index 93a8515f8..b11af1872 100644 --- a/src/moin/apps/feed/views.py +++ b/src/moin/apps/feed/views.py @@ -21,11 +21,11 @@ from moin.i18n import _ from moin.apps.feed import feed -from moin.constants.keys import NAME, NAME_EXACT, WIKINAME, COMMENT, MTIME, REVID, ALL_REVS, PARENTID, LATEST_REVS +from moin.constants.keys import NAME, NAME_EXACT, NAMESPACE, WIKINAME, COMMENT, MTIME, REVID, ALL_REVS, PARENTID, LATEST_REVS from moin.themes import get_editor_info, render_template from moin.items import Item from moin.utils.crypto import cache_key -from moin.utils.interwiki import url_for_item +from moin.utils.interwiki import url_for_item, split_fqname from moin import log logging = log.getLogger(__name__) @@ -44,7 +44,8 @@ def atom(item_name): ''' query = Term(WIKINAME, app.cfg.interwikiname) if item_name: - query = And([query, Term(NAME_EXACT, item_name), ]) + fqname = split_fqname(item_name) + query = And([query, Term(NAME_EXACT, fqname.value), Term(NAMESPACE, fqname.namespace), ]) revs = list(flaskg.storage.search(query, idx_name=LATEST_REVS, sortedby=[MTIME], reverse=True, limit=1)) if revs: rev = revs[0] @@ -57,7 +58,7 @@ def atom(item_name): if not item_name: title = "{0}".format(app.cfg.sitename) else: - title = "{0} - {1}".format(app.cfg.sitename, item_name) + title = "{0} - {1}".format(app.cfg.sitename, fqname) feed = FeedGenerator() feed.id(request.url) feed.title(title) @@ -65,7 +66,7 @@ def atom(item_name): feed.link(href=request.url, rel='self') query = Term(WIKINAME, app.cfg.interwikiname) if item_name: - query = And([query, Term(NAME_EXACT, item_name), ]) + query = And([query, Term(NAME_EXACT, fqname.value), Term(NAMESPACE, fqname.namespace), ]) history = flaskg.storage.search(query, idx_name=ALL_REVS, sortedby=[MTIME], reverse=True, limit=100) for rev in history: name = rev.fqname.fullname @@ -86,7 +87,7 @@ def atom(item_name): content = render_template('atom.html', get='first_revision', rev=this_rev, content=Markup(hl_item.content._render_data()), revision=this_revid) except Exception: - logging.exception("content rendering crashed") + logging.exception("content rendering crashed on item {0}".format(name)) content = _('MoinMoin feels unhappy.') author = get_editor_info(rev.meta, external=True) rev_comment = rev.meta.get(COMMENT, '') From 6602f278232f5492415f624c66422f914c1fbdb5 Mon Sep 17 00:00:00 2001 From: RogerHaase Date: Mon, 17 Jul 2023 12:27:22 -0700 Subject: [PATCH 3/3] fix E501 error, line too long --- src/moin/apps/feed/views.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/moin/apps/feed/views.py b/src/moin/apps/feed/views.py index b11af1872..3c2fb7ebe 100644 --- a/src/moin/apps/feed/views.py +++ b/src/moin/apps/feed/views.py @@ -21,7 +21,8 @@ from moin.i18n import _ from moin.apps.feed import feed -from moin.constants.keys import NAME, NAME_EXACT, NAMESPACE, WIKINAME, COMMENT, MTIME, REVID, ALL_REVS, PARENTID, LATEST_REVS +from moin.constants.keys import (NAME, NAME_EXACT, NAMESPACE, WIKINAME, COMMENT, MTIME, REVID, + ALL_REVS, PARENTID, LATEST_REVS) from moin.themes import get_editor_info, render_template from moin.items import Item from moin.utils.crypto import cache_key