allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From brond...@apache.org
Subject [23/26] git commit: [#7656] ticket:654 Split additional_fields options into additional_search_fields and additional_display_fields
Date Fri, 19 Sep 2014 20:04:37 GMT
[#7656] ticket:654 Split additional_fields options into additional_search_fields and additional_display_fields


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/74965ec2
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/74965ec2
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/74965ec2

Branch: refs/heads/master
Commit: 74965ec2c811a6731bf6bb052b84ad7c5a228c42
Parents: ab4961f
Author: Aleksey 'LXj' Alekseyev <gotletter@gmail.com>
Authored: Tue Sep 16 16:42:51 2014 +0300
Committer: Dave Brondsema <dbrondsema@slashdotmedia.com>
Committed: Fri Sep 19 19:35:42 2014 +0000

----------------------------------------------------------------------
 Allura/allura/controllers/site_admin.py                     | 8 ++++++--
 .../templates/site_admin_search_projects_results.html       | 4 ++--
 .../allura/templates/site_admin_search_users_results.html   | 4 ++--
 Allura/development.ini                                      | 9 +++++++--
 4 files changed, 17 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/74965ec2/Allura/allura/controllers/site_admin.py
----------------------------------------------------------------------
diff --git a/Allura/allura/controllers/site_admin.py b/Allura/allura/controllers/site_admin.py
index b6fecd7..755c405 100644
--- a/Allura/allura/controllers/site_admin.py
+++ b/Allura/allura/controllers/site_admin.py
@@ -346,9 +346,11 @@ class SiteAdminController(object):
                               page=validators.Int(if_empty=0, if_invalid=0)))
     def search_projects(self, q=None, f=None, page=0, limit=None, **kw):
         fields = [('shortname', 'shortname'), ('name', 'full name')]
-        add_fields = aslist(tg.config.get('search.project.additional_fields'), ',')
+        add_fields = aslist(tg.config.get('search.project.additional_search_fields'), ',')
         r = self._search(M.Project, fields, add_fields, q, f, page, limit, **kw)
         r['search_results_template'] = 'allura:templates/site_admin_search_projects_results.html'
+        r['additional_display_fields'] = \
+            aslist(tg.config.get('search.project.additional_display_fields'), ',')
         r['provider'] = ProjectRegistrationProvider.get()
         return r
 
@@ -359,9 +361,11 @@ class SiteAdminController(object):
                               page=validators.Int(if_empty=0, if_invalid=0)))
     def search_users(self, q=None, f=None, page=0, limit=None, **kw):
         fields = [('username', 'username'), ('display_name', 'display name')]
-        add_fields = aslist(tg.config.get('search.user.additional_fields'), ',')
+        add_fields = aslist(tg.config.get('search.user.additional_search_fields'), ',')
         r = self._search(M.User, fields, add_fields, q, f, page, limit, **kw)
         r['search_results_template'] = 'allura:templates/site_admin_search_users_results.html'
+        r['additional_display_fields'] = \
+            aslist(tg.config.get('search.user.additional_display_fields'), ',')
         r['provider'] = AuthenticationProvider.get(request)
         return r
 

http://git-wip-us.apache.org/repos/asf/allura/blob/74965ec2/Allura/allura/templates/site_admin_search_projects_results.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_search_projects_results.html b/Allura/allura/templates/site_admin_search_projects_results.html
index 5bde5f0..3fedf82 100644
--- a/Allura/allura/templates/site_admin_search_projects_results.html
+++ b/Allura/allura/templates/site_admin_search_projects_results.html
@@ -21,7 +21,7 @@
   <th>Full name</th>
   <th>Registered</th>
   <th>Deleted?</th>
-  {% for field in additional_fields %}
+  {% for field in additional_display_fields %}
   <th>{{ field }}</th>
   {% endfor %}
   <th>Details</th>
@@ -33,7 +33,7 @@
   <td>{{ p['name'] }}</td>
   <td>{{ h.ago_string(p['registration']) }}</td>
   <td>{{ p['deleted'] }}</td>
-  {% for field in additional_fields %}
+  {% for field in additional_display_fields %}
   <td>{{ p[field] }}</td>
   {% endfor %}
   <td>

http://git-wip-us.apache.org/repos/asf/allura/blob/74965ec2/Allura/allura/templates/site_admin_search_users_results.html
----------------------------------------------------------------------
diff --git a/Allura/allura/templates/site_admin_search_users_results.html b/Allura/allura/templates/site_admin_search_users_results.html
index dc83184..c718b02 100644
--- a/Allura/allura/templates/site_admin_search_users_results.html
+++ b/Allura/allura/templates/site_admin_search_users_results.html
@@ -22,7 +22,7 @@
   <th>Email</th>
   <th>Registered</th>
   <th>Disabled?</th>
-  {% for field in additional_fields %}
+  {% for field in additional_display_fields %}
   <th>{{ field }}</th>
   {% endfor %}
   <th>Details</th>
@@ -35,7 +35,7 @@
   <td>{{ u['object'].get_pref('email_address') }}</td>
   <td>{{ h.ago(provider.user_registration_date(u['object']).replace(tzinfo=None)) }}</td>
   <td>{{ u['disabled'] }}</td>
-  {% for field in additional_fields %}
+  {% for field in additional_display_fields %}
   <td>{{ u[field] }}</td>
   {% endfor %}
   <td>

http://git-wip-us.apache.org/repos/asf/allura/blob/74965ec2/Allura/development.ini
----------------------------------------------------------------------
diff --git a/Allura/development.ini b/Allura/development.ini
index ab0c114..841714d 100644
--- a/Allura/development.ini
+++ b/Allura/development.ini
@@ -122,8 +122,13 @@ user_prefs_storage.ldap.fields.display_name = cn
 
 # Additional fields for admin project/user search
 # Note: whitespace after comma is important!
-# search.project.additional_fields = private, url, title
-# search.user.additional_fields = email_addresses
+# search.project.additional_search_fields = private, url, title
+# search.user.additional_search_fields = email_addresses
+
+# Additional fields to show in the result of admin project/user search
+# Note: whitespace after comma is important!
+# search.project.additional_display_fields = private, url, title
+# search.user.additional_display_fields = email_addresses
 
 # Set the locations of some static resources
 #  script_name is the path that is handled by the application


Mime
View raw message