annotate MoinMoin/apps/admin/views.py @ 2687:daf1dbbf507c

Fixed traceback which comes on accessing +admin/itemsize due to tickets- shown fqname instead of name
author Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
date Fri, 01 Aug 2014 18:00:52 +0530
parents fded75e578be
children 63267bfa9099
rev   line source
92
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
1 # Copyright: 2007-2011 MoinMoin:ThomasWaldmann
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
2 # Copyright: 2001-2003 Juergen Hermann <jh@web.de>
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
3 # Copyright: 2008 MoinMoin:JohannesBerg
91
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
4 # Copyright: 2009 MoinMoin:EugeneSyromyatnikov
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
5 # Copyright: 2010 MoinMoin:DiogenesAugusto
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
6 # Copyright: 2010 MoinMoin:ReimarBauer
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
7 # License: GNU GPL v2 (or any later version), see LICENSE.txt for details.
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
8
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
9 """
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
10 MoinMoin - admin views
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
11
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
12 This shows the user interface for wiki admins.
26
4cd8edde9e94 automatically transform module docstrings, moving legal stuff to comments
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 24
diff changeset
13 """
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
14 from collections import namedtuple
186
5dd1db45ed55 implement require_permission decorator
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 185
diff changeset
15 from flask import request, url_for, flash, redirect
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
16 from flask import current_app as app
109
e4c332436733 remove flask monkeypatch, use 'from flask import g as flaskg'
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 107
diff changeset
17 from flask import g as flaskg
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
18 from whoosh.query import Term, And
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
19 from MoinMoin.i18n import _, L_, N_
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
20 from MoinMoin.themes import render_template, get_editor_info
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
21 from MoinMoin.apps.admin import admin
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
22 from MoinMoin import user
2671
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
23 from MoinMoin.constants.keys import NAME, ITEMID, SIZE, EMAIL, DISABLED, NAME_EXACT, WIKINAME, TRASH, NAMESPACE, NAME_OLD, REVID, MTIME, COMMENT, LATEST_REVS, EMAIL_UNVALIDATED, ACL
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
24 from MoinMoin.constants.namespaces import NAMESPACE_USERPROFILES, NAMESPACE_DEFAULT, NAMESPACE_ALL
2672
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
25 from MoinMoin.constants.rights import SUPERUSER, ACL_RIGHTS_CONTENTS
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
26 from MoinMoin.security import require_permission, ACLStringIterator
2273
a8e67947f130 Updated admin views to support fqnames.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2102
diff changeset
27 from MoinMoin.util.interwiki import CompositeName
2670
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
28 from MoinMoin.datastruct.backends.wiki_groups import WikiGroup
2672
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
29 from MoinMoin.datastruct.backends import GroupDoesNotExistError
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
30
1975
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1974
diff changeset
31
1520
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
32 @admin.route('/superuser')
1720
ea19b98d4f94 Admin menu lock for non-admin users
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1717
diff changeset
33 @require_permission(SUPERUSER)
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
34 def index():
1006
b65a998fab8e fixes #61 using title_name instead of item_name for pages without an item
Bruno Gola <brunogola@gmail.com>
parents: 997
diff changeset
35 return render_template('admin/index.html', title_name=_(u"Admin"))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
36
1975
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1974
diff changeset
37
1606
e64047b16c4c Fix view.py error
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1527
diff changeset
38 @admin.route('/user')
1520
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
39 def index_user():
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
40 return render_template('user/index_user.html', title_name=_(u"User"))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
41
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
42
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
43 @admin.route('/userbrowser')
1717
7b7ec9dccf34 reverted changeset 6cd9347f7cc5
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1705
diff changeset
44 @require_permission(SUPERUSER)
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
45 def userbrowser():
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
46 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
47 User Account Browser
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
48 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
49 groups = flaskg.groups
1975
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1974
diff changeset
50 revs = user.search_users() # all users
2666
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
51 user_accounts = []
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
52 for rev in revs:
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
53 user_groups = []
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
54 user_names = rev.meta[NAME]
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
55 for groupname in groups:
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
56 group = groups[groupname]
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
57 for name in user_names:
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
58 if name in group:
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
59 user_groups.append(groupname)
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
60 user_accounts.append(dict(uid=rev.meta[ITEMID],
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
61 name=user_names,
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
62 fqname=CompositeName(NAMESPACE_USERPROFILES, NAME_EXACT, rev.name),
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
63 email=rev.meta[EMAIL] if EMAIL in rev.meta else rev.meta[EMAIL_UNVALIDATED],
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
64 disabled=rev.meta[DISABLED],
c04690fb2305 Fixed issue #447
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2664
diff changeset
65 groups=user_groups))
1907
7324a1d71443 simplify and standardize headings and page titles on user and admin pages
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1720
diff changeset
66 return render_template('admin/userbrowser.html', user_accounts=user_accounts, title_name=_(u"Users"))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
67
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
68
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
69 @admin.route('/userprofile/<user_name>', methods=['GET', 'POST', ])
1717
7b7ec9dccf34 reverted changeset 6cd9347f7cc5
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1705
diff changeset
70 @require_permission(SUPERUSER)
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
71 def userprofile(user_name):
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
72 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
73 Set values in user profile
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
74 """
839
cc23787a37d0 use search_users() or User() instead of specialized lookup functions
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 838
diff changeset
75 u = user.User(auth_username=user_name)
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
76 if request.method == 'GET':
2102
ca5e39389265 use %s(name) instead of %r(name)
Ashutosh Singla <ashu1461@gmail.com>
parents: 2024
diff changeset
77 return _(u"User profile of %(username)s: %(email)s %(disabled)s", username=user_name,
ca5e39389265 use %s(name) instead of %r(name)
Ashutosh Singla <ashu1461@gmail.com>
parents: 2024
diff changeset
78 email=u.email, disabled=u.disabled)
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
79
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
80 if request.method == 'POST':
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
81 key = request.form.get('key', '')
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
82 val = request.form.get('val', '')
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
83 ok = False
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
84 if hasattr(u, key):
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
85 ok = True
2024
2d11470eb41b fix userbrowser, enable/disable user
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2016
diff changeset
86 oldval = u.profile[key]
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
87 if isinstance(oldval, bool):
2024
2d11470eb41b fix userbrowser, enable/disable user
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2016
diff changeset
88 val = bool(int(val))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
89 elif isinstance(oldval, int):
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
90 val = int(val)
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
91 elif isinstance(oldval, unicode):
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
92 val = unicode(val)
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
93 else:
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
94 ok = False
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
95 if ok:
2024
2d11470eb41b fix userbrowser, enable/disable user
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 2016
diff changeset
96 u.profile[key] = val
839
cc23787a37d0 use search_users() or User() instead of specialized lookup functions
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 838
diff changeset
97 u.save()
1414
614005b5edb3 fixed some .format() unicode issues, partially fixing bug #124
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1397
diff changeset
98 flash(u'{0}.{1}: {2} -> {3}'.format(user_name, key, unicode(oldval), unicode(val), ), "info")
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
99 else:
1414
614005b5edb3 fixed some .format() unicode issues, partially fixing bug #124
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1397
diff changeset
100 flash(u'modifying {0}.{1} failed'.format(user_name, key, ), "error")
266
7a6b116afa20 upgrade to flask 0.7.1 (not compatible to older flasks)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 186
diff changeset
101 return redirect(url_for('.userbrowser'))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
102
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
103
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
104 @admin.route('/mail_recovery_token', methods=['GET', 'POST', ])
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
105 def mail_recovery_token():
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
106 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
107 Send user an email so he can reset his password.
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
108 """
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
109 flash("mail recovery token not implemented yet")
266
7a6b116afa20 upgrade to flask 0.7.1 (not compatible to older flasks)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 186
diff changeset
110 return redirect(url_for('.userbrowser'))
0
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
111
5568cf133caf create moin/2.0 repo, drop all history (see notes below)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents:
diff changeset
112
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
113 from MoinMoin.config import default as defaultconfig
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
114
1975
384555088cab lots of pep8 fixes
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1974
diff changeset
115
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
116 @admin.route('/wikiconfig', methods=['GET', ])
1717
7b7ec9dccf34 reverted changeset 6cd9347f7cc5
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1705
diff changeset
117 @require_permission(SUPERUSER)
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
118 def wikiconfig():
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
119 settings = {}
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
120 for groupname in defaultconfig.options:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
121 heading, desc, opts = defaultconfig.options[groupname]
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
122 for name, default, description in opts:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
123 name = groupname + '_' + name
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
124 if isinstance(default, defaultconfig.DefaultExpression):
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
125 default = default.value
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
126 settings[name] = default
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
127 for groupname in defaultconfig.options_no_group_name:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
128 heading, desc, opts = defaultconfig.options_no_group_name[groupname]
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
129 for name, default, description in opts:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
130 if isinstance(default, defaultconfig.DefaultExpression):
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
131 default = default.value
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
132 settings[name] = default
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
133
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
134 def iter_vnames(cfg):
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
135 dedup = {}
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
136 for name in cfg.__dict__:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
137 dedup[name] = True
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
138 yield name, cfg.__dict__[name]
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
139 for cls in cfg.__class__.mro():
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
140 if cls == defaultconfig.ConfigFunctionality:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
141 break
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
142 for name in cls.__dict__:
2589
ee404f81afe9 fix new pep8 errors generated after pep8 is upgraded to 1.5.1
RogerHaase <haaserd@gmail.com>
parents: 2279
diff changeset
143 if name not in dedup:
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
144 dedup[name] = True
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
145 yield name, cls.__dict__[name]
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
146
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
147 found = []
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
148 for vname, value in iter_vnames(app.cfg):
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
149 if hasattr(defaultconfig.ConfigFunctionality, vname):
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
150 continue
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
151 if vname in settings and settings[vname] == value:
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
152 continue
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
153 found.append((vname, value))
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
154
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
155 found.sort()
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
156 return render_template('admin/wikiconfig.html',
1907
7324a1d71443 simplify and standardize headings and page titles on user and admin pages
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1720
diff changeset
157 title_name=_(u"Show Wiki Configuration"),
54
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
158 found=found, settings=settings)
2d6a32f75c2d WikiConfig: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 26
diff changeset
159
55
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
160
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
161 @admin.route('/wikiconfighelp', methods=['GET', ])
1717
7b7ec9dccf34 reverted changeset 6cd9347f7cc5
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1705
diff changeset
162 @require_permission(SUPERUSER)
55
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
163 def wikiconfighelp():
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
164 def format_default(default):
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
165 if isinstance(default, defaultconfig.DefaultExpression):
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
166 default_txt = default.text
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
167 else:
969
5bf6d7a2ffcf Convert all %r, %s, %x, %d, %i, %o to new Format String Syntax
Vedran Mileti? <rivanvx@gmail.com>
parents: 953
diff changeset
168 default_txt = repr(default)
55
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
169 if len(default_txt) > 30:
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
170 default_txt = '...'
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
171 return default_txt
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
172
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
173 groups = []
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
174 for groupname in defaultconfig.options:
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
175 heading, desc, opts = defaultconfig.options[groupname]
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
176 opts = sorted([(groupname + '_' + name, format_default(default), description)
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
177 for name, default, description in opts])
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
178 groups.append((heading, desc, opts))
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
179 for groupname in defaultconfig.options_no_group_name:
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
180 heading, desc, opts = defaultconfig.options_no_group_name[groupname]
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
181 opts = sorted([(name, format_default(default), description)
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
182 for name, default, description in opts])
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
183 groups.append((heading, desc, opts))
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
184 groups.sort()
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
185 return render_template('admin/wikiconfighelp.html',
1006
b65a998fab8e fixes #61 using title_name instead of item_name for pages without an item
Bruno Gola <brunogola@gmail.com>
parents: 997
diff changeset
186 title_name=_(u"Wiki Configuration Help"),
55
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
187 groups=groups)
32b88d45d63c WikiConfigHelp: remove macro, create admin view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 54
diff changeset
188
91
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
189
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
190 @admin.route('/highlighterhelp', methods=['GET', ])
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
191 def highlighterhelp():
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
192 """display a table with list of available Pygments lexers"""
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
193 import pygments.lexers
2011
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
194 headings = [
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
195 _('Lexer description'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
196 _('Lexer names'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
197 _('File patterns'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
198 _('Mimetypes'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
199 ]
91
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
200 lexers = pygments.lexers.get_all_lexers()
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
201 rows = sorted([[desc, ' '.join(names), ' '.join(patterns), ' '.join(mimetypes), ]
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
202 for desc, names, patterns, mimetypes in lexers])
1520
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
203 return render_template('user/highlighterhelp.html',
1907
7324a1d71443 simplify and standardize headings and page titles on user and admin pages
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1720
diff changeset
204 title_name=_(u"Highlighters"),
91
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
205 headings=headings,
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
206 rows=rows)
2e0766600e8f admin/highlighterhelp view (replaces HighlighterList macro), added table macro to utils.html template
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 55
diff changeset
207
94
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
208
92
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
209 @admin.route('/interwikihelp', methods=['GET', ])
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
210 def interwikihelp():
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
211 """display a table with list of known interwiki names / urls"""
2011
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
212 headings = [
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
213 _('InterWiki name'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
214 _('URL'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
215 ]
92
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
216 rows = sorted(app.cfg.interwiki_map.items())
1520
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
217 return render_template('user/interwikihelp.html',
1907
7324a1d71443 simplify and standardize headings and page titles on user and admin pages
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1720
diff changeset
218 title_name=_(u"Interwiki Names"),
92
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
219 headings=headings,
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
220 rows=rows)
5ff01f07c67c admin/interwikihelp view (replaces InterWiki macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 91
diff changeset
221
94
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
222
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
223 @admin.route('/itemsize', methods=['GET', ])
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
224 def itemsize():
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
225 """display a table with item sizes"""
2011
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
226 headings = [
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
227 _('Size'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
228 _('Item name'),
791bdedb0c20 fix lots of pep8 issues, mainly E12x
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 1983
diff changeset
229 ]
2687
daf1dbbf507c Fixed traceback which comes on accessing +admin/itemsize due to tickets- shown fqname instead of name
Saurabh Kathpalia <saurabh.kathpalia95@gmail.com>
parents: 2677
diff changeset
230 rows = [(rev.meta[SIZE], rev.fqname)
997
3e912ed37167 fix item sizes view
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 969
diff changeset
231 for rev in flaskg.storage.documents(wikiname=app.cfg.interwikiname)]
94
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
232 rows = sorted(rows, reverse=True)
1520
a9f837dee2d7 More splitted to Admin and User
Jaiditya Mathur <jaiditya.mathur@gmail.com>
parents: 1505
diff changeset
233 return render_template('user/itemsize.html',
1907
7324a1d71443 simplify and standardize headings and page titles on user and admin pages
Roger Haase <crosseyedpenguin@yahoo.com>
parents: 1720
diff changeset
234 title_name=_(u"Item Sizes"),
94
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
235 headings=headings,
990fdbe2d52c admin/itemsize view (replaces PageSize macro)
Thomas Waldmann <tw AT waldmann-edv DOT de>
parents: 92
diff changeset
236 rows=rows)
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
237
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
238
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
239 @admin.route('/trash', defaults=dict(namespace=NAMESPACE_DEFAULT), methods=['GET'])
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
240 @admin.route('/<namespace>/trash')
2677
fded75e578be Fixes #415, any logged in user can access trash by typing localhost:8080/+admin/all/trash; thanks kumar risabh
RogerHaase <haaserd@gmail.com>
parents: 2672
diff changeset
241 @require_permission(SUPERUSER)
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
242 def trash(namespace):
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
243 """
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
244 Returns the trashed items.
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
245 """
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
246 trash = _trashed(namespace)
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
247 return render_template('admin/trash.html',
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
248 headline=_(u'Trashed Items'),
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
249 title_name=_(u'Trashed Items'),
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
250 results=trash)
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
251
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
252
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
253 def _trashed(namespace):
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
254 q = And([Term(WIKINAME, app.cfg.interwikiname), Term(TRASH, True)])
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
255 if not namespace == NAMESPACE_ALL:
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
256 q = And([q, Term(NAMESPACE, namespace), ])
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
257 trashedEntry = namedtuple('trashedEntry', 'fqname oldname revid mtime comment editor')
2279
49bc6f85f918 Fixed pep8 errors.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2274
diff changeset
258 results = []
2274
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
259 for rev in flaskg.storage.search(q, limit=None):
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
260 meta = rev.meta
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
261 results.append(trashedEntry(rev.fqname, meta[NAME_OLD], meta[REVID], meta[MTIME], meta[COMMENT], get_editor_info(meta)))
980b4f225f13 Moved trash view under admin.
Ashutosh Singla <ashu1461@gmail.com>
parents: 2273
diff changeset
262 return results
2668
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
263
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
264
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
265 @admin.route('/user_acl_report/<uid>', methods=['GET'])
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
266 @require_permission(SUPERUSER)
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
267 def user_acl_report(uid):
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
268 all_items = flaskg.storage.documents(wikiname=app.cfg.interwikiname)
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
269 groups = flaskg.groups
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
270 theuser = user.User(uid=uid)
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
271 itemwise_acl = []
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
272 for item in all_items:
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
273 fqname = CompositeName(item.meta.get(NAMESPACE), u'itemid', item.meta.get(ITEMID))
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
274 itemwise_acl.append({'name': item.meta.get(NAME),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
275 'itemid': item.meta.get(ITEMID),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
276 'fqname': fqname,
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
277 'read': theuser.may.read(fqname),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
278 'write': theuser.may.write(fqname),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
279 'create': theuser.may.create(fqname),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
280 'admin': theuser.may.admin(fqname),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
281 'destroy': theuser.may.destroy(fqname)})
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
282 return render_template('admin/user_acl_report.html',
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
283 title_name=_(u'User ACL Report'),
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
284 user_names=theuser.name,
f649d7a3b3cd Added Userwise ACL Report view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2666
diff changeset
285 itemwise_acl=itemwise_acl)
2670
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
286
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
287
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
288 @admin.route('/groupbrowser', methods=['GET'])
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
289 @require_permission(SUPERUSER)
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
290 def groupbrowser():
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
291 """
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
292 Display list of all groups and their members
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
293 """
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
294 all_groups = flaskg.groups
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
295 groups = []
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
296 for group in all_groups:
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
297 group_type = ''
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
298 if isinstance(all_groups[group], WikiGroup):
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
299 group_type = 'WikiGroup'
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
300 else:
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
301 group_type = 'ConfigGroup'
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
302 groups.append(dict(name=all_groups[group].name,
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
303 member_users=all_groups[group].members,
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
304 member_groups=all_groups[group].member_groups,
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
305 grouptype=group_type))
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
306 return render_template('admin/groupbrowser.html',
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
307 title_name=_(u'Groups'),
54aaba93f5de Added Groups view to for admin to view information regarding all groups and provide links to their ACL Report
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2668
diff changeset
308 groups=groups)
2671
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
309
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
310
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
311 @admin.route('/item_acl_report', methods=['GET'])
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
312 @require_permission(SUPERUSER)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
313 def item_acl_report():
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
314 """
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
315 Return a list of all items in the wiki along with the ACL Meta-data
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
316 """
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
317 all_items = flaskg.storage.documents(wikiname=app.cfg.interwikiname)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
318 items_acls = []
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
319 for item in all_items:
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
320 item_namespace = item.meta.get(NAMESPACE)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
321 item_id = item.meta.get(ITEMID)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
322 item_name = item.meta.get(NAME)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
323 item_acl = item.meta.get(ACL)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
324 fqname = CompositeName(item_namespace, u'itemid', item_id)
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
325 if item_acl is None:
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
326 for namespace, acl_config in app.cfg.acl_mapping:
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
327 if item_namespace == namespace or item_namespace == 'userprofiles' and namespace == 'userprofiles/':
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
328 item_acl = 'Default ({0})'.format(acl_config['default'])
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
329 items_acls.append({'name': item_name,
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
330 'itemid': item_id,
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
331 'fqname': fqname,
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
332 'acl': item_acl})
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
333 return render_template('admin/item_acl_report.html',
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
334 title_name=_('Item ACL Report'),
5e518c71b581 Added item acl report view for admin to view ACLs for all the items in the wiki and provided links to their modify view
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2670
diff changeset
335 items_acls=items_acls)
2672
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
336
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
337
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
338 def search_group(group_name):
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
339 groups = flaskg.groups
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
340 if groups[group_name]:
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
341 return groups[group_name]
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
342 else:
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
343 raise GroupDoesNotExistError(group_name)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
344
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
345
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
346 @admin.route('/group_acl_report/<group_name>')
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
347 @require_permission(SUPERUSER)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
348 def group_acl_report(group_name):
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
349 """
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
350 Display a 2-column table of items and ACLs, where the ACL rule specifies any
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
351 WikiGroup or ConfigGroup name.
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
352 """
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
353 group = search_group(group_name)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
354 all_items = flaskg.storage.documents(wikiname=app.cfg.interwikiname)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
355 group_items = []
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
356 for item in all_items:
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
357 acl_iterator = ACLStringIterator(ACL_RIGHTS_CONTENTS, item.meta.get(ACL, ''))
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
358 for modifier, entries, rights in acl_iterator:
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
359 if group_name in entries:
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
360 item_id = item.meta.get(ITEMID)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
361 fqname = CompositeName(item.meta.get(NAMESPACE), u'itemid', item_id)
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
362 group_items.append(dict(name=item.meta.get(NAME),
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
363 itemid=item_id,
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
364 fqname=fqname,
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
365 rights=rights))
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
366 return render_template('admin/group_acl_report.html',
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
367 title_name=_(u'Group ACL Report'),
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
368 group_items=group_items,
3f729c4a241c Added group acl report view for admin to help see ACL capabilities of each group with respect to all items in the wiki
Ajitesh Gupta <ajgupta93@gmail.com>
parents: 2671
diff changeset
369 group_name=group_name)