changeset 2273:a8e67947f130

Updated admin views to support fqnames.
author Ashutosh Singla <ashu1461@gmail.com>
date Sat, 14 Sep 2013 04:24:03 +0530
parents b1c0a532235d
children 980b4f225f13
files MoinMoin/apps/admin/templates/admin/userbrowser.html MoinMoin/apps/admin/views.py MoinMoin/themes/__init__.py
diffstat 3 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/apps/admin/templates/admin/userbrowser.html	Sat Sep 14 02:00:50 2013 +0530
+++ b/MoinMoin/apps/admin/templates/admin/userbrowser.html	Sat Sep 14 04:24:03 2013 +0530
@@ -10,7 +10,7 @@
     </tr>
     {% for u in user_accounts %}
     <tr>
-        <td><a href="{{ url_for('frontend.show_item', item_name=u.name[0]) }}">{{ u.name|join(',') }}</a>{{ u.disabled and " (%s)" % _("disabled") or ""}}</td>
+        <td><a href="{{ url_for('frontend.show_item', item_name=u.fqname) }}">{{ u.name|join(',') }}</a>{{ u.disabled and " (%s)" % _("disabled") or ""}}</td>
         <td>{{ u.groups|join(',') }}</td>
         <td>
             {% if u.email %}
--- a/MoinMoin/apps/admin/views.py	Sat Sep 14 02:00:50 2013 +0530
+++ b/MoinMoin/apps/admin/views.py	Sat Sep 14 04:24:03 2013 +0530
@@ -20,9 +20,11 @@
 from MoinMoin.themes import render_template
 from MoinMoin.apps.admin import admin
 from MoinMoin import user
-from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED
+from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT
+from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES
 from MoinMoin.constants.rights import SUPERUSER
 from MoinMoin.security import require_permission
+from MoinMoin.util.interwiki import CompositeName
 
 
 @admin.route('/superuser')
@@ -46,6 +48,7 @@
     revs = user.search_users()  # all users
     user_accounts = [dict(uid=rev.meta[ITEMID],
                           name=rev.meta[NAME],
+                          fqname=CompositeName(NAMESPACE_USERPROFILES, NAME_EXACT, rev.name),
                           email=rev.meta[EMAIL],
                           disabled=rev.meta[DISABLED],
                           groups=[groupname for groupname in groups if rev.meta[NAME] in groups[groupname]],
--- a/MoinMoin/themes/__init__.py	Sat Sep 14 02:00:50 2013 +0530
+++ b/MoinMoin/themes/__init__.py	Sat Sep 14 04:24:03 2013 +0530
@@ -23,7 +23,7 @@
 from MoinMoin.i18n import _, L_, N_
 from MoinMoin import wikiutil, user
 from MoinMoin.constants.keys import USERID, ADDRESS, HOSTNAME, REVID, ITEMID, NAME_EXACT
-from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT
+from MoinMoin.constants.namespaces import NAMESPACE_DEFAULT, NAMESPACE_USERPROFILES
 from MoinMoin.search import SearchForm
 from MoinMoin.util.interwiki import split_interwiki, getInterwikiHome, is_local_wiki, is_known_wiki, url_for_item, CompositeName, split_fqname
 from MoinMoin.util.crypto import cache_key
@@ -163,7 +163,7 @@
         else:
             # We cannot check if wiki pages exists in remote wikis
             exists = True
-        wiki_href = url_for_item(itemname, wiki_name=wikiname)
+        wiki_href = url_for_item(itemname, wiki_name=wikiname,namespace=NAMESPACE_USERPROFILES)
         return wiki_href, display_name, title, exists
 
     def split_navilink(self, text):