Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/admin/configure.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1454,7 +1454,7 @@ To configure custom namespaces, find the section in wikiconfig.py that looks sim
hierarchic=False, ),
}
namespace_mapping, backend_mapping, acl_mapping = create_mapping(uri, namespaces, backends, acls, )
# define mapping of namespaces to unique item_roots (home pages within namespaces).
# define mapping of namespaces to unique root items (home pages within namespaces).
root_mapping = {'users': 'UserHome', }
# default root, use this value by default for all namespaces
default_root = 'Home'
Expand Down Expand Up @@ -1616,4 +1616,4 @@ Make sure to use an absolute path that points to a valid logging configuration f
**Important:**
The logging configuration must be stored in a **separate file** — do **not** place it inside your `wikiconfig.py`.

If no configuration is provided, or if the provided configuration file cannot be loaded, Moin will fall back to a built-in default configuration, which logs to `stderr` at the `INFO` level.
If no configuration is provided, or if the provided configuration file cannot be loaded, Moin will fall back to a built-in default configuration, which logs to `stderr` at the `INFO` level.
2 changes: 1 addition & 1 deletion src/moin/_tests/wikiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class Config(DefaultConfig):
data_dir = join(_here, "wiki", "data") # needed for plugins package TODO
index_storage = "FileStorage", (join(_here, "wiki", "index"),), {}
default_acl = None
item_root = "FrontPage"
default_root = "FrontPage"
interwikiname = "MoinTest"
interwiki_map = dict(Self="http://localhost:8080/", MoinMoin="http://moinmo.in/")
interwiki_map[interwikiname] = "http://localhost:8080/"
Expand Down
2 changes: 1 addition & 1 deletion src/moin/config/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ def __init__(self, exprstr):
"Home",
"Default root, use this value in case no match is found in root_mapping. [Unicode]",
),
("root_mapping", {}, "mapping of namespaces to item_roots."),
("root_mapping", {}, "mapping of namespaces to unique root items."),
# the following regexes should match the complete name when used in free text
# the group 'all' shall match all, while the group 'key' shall match the key only
# e.g. FooGroup -> group 'all' == FooGroup, group 'key' == Foo
Expand Down
2 changes: 1 addition & 1 deletion src/moin/config/wikiconfig.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class Config(DefaultConfig):
# TODO If there is a future change that requires wiki admins to merge this wikiconfig with the customized wikiconfig
# then remove the "uri" parameter in create mapping below and in storage/__init__.py.
namespace_mapping, backend_mapping, acl_mapping = create_mapping(uri, namespaces, backends, acls)
# define mapping of namespaces to unique item_roots (home pages within namespaces).
# define mapping of namespaces to unique root items (home pages within namespaces).
root_mapping = {"users": "UserHome"}
# default root, use this value by default for all namespaces
default_root = "Home"
Expand Down
2 changes: 1 addition & 1 deletion src/moin/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
{{ utils.user_login_logoff() }}
</ul>
{% if cfg.sitename %}
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.default_root) }}">
{{ cfg.sitename }}
</a>
{% endif %}
Expand Down
4 changes: 2 additions & 2 deletions src/moin/themes/basic/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@
<header class="moin-sidebar flex-grow-0" lang="{{ theme_supp.user_lang }}" dir="{{ theme_supp.user_dir }}">
<div class="moin-logo">
{% if logo %}
<a href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
<a href="{{ url_for('frontend.show_item', item_name=cfg.root_mapping.get('', cfg.default_root)) }}">
{{ logo }}
</a>
{% endif %}
Expand Down Expand Up @@ -131,7 +131,7 @@
</button>

{% if cfg.sitename %}
<a class="navbar-brand" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
<a class="navbar-brand" href="{{ url_for('frontend.show_item', item_name=cfg.default_root) }}">
{{ cfg.sitename }}
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/moin/themes/focus/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
</div>
{% endif %}
{% if cfg.sitename %}
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.default_root) }}">
{{ cfg.sitename }}
</a>
{% endif %}
Expand Down
2 changes: 1 addition & 1 deletion src/moin/themes/topside/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
</div>
{%- endif %}
{%- if cfg.sitename %}
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.item_root) }}">
<a class="moin-sitename" href="{{ url_for('frontend.show_item', item_name=cfg.default_root) }}">
{{ cfg.sitename }}
</a>
{%- endif %}
Expand Down
3 changes: 1 addition & 2 deletions src/moin/utils/interwiki.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@ def query(self):

def get_root_fqname(self):
"""
Set value to the item_root of that namespace, and return
the new CompositeName.
Determine the root item of the namespace of this composite name and return it as new CompositeName instance.
"""
return CompositeName(self.namespace, NAME_EXACT, app.cfg.root_mapping.get(self.namespace, app.cfg.default_root))

Expand Down