You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@bloodhound.apache.org by rj...@apache.org on 2013/07/08 07:31:59 UTC
svn commit: r1500581 - in /bloodhound/trunk/bloodhound_theme/bhtheme:
templates/bh_admin_users.html templates/bh_user_table.html theme.py
Author: rjollos
Date: Mon Jul 8 05:31:59 2013
New Revision: 1500581
URL: http://svn.apache.org/r1500581
Log:
Added support for th:AccountManagerPlugin wiki macros. Refs #201.
Moved user table template code from `admin_users.html` to `user_table.html`. This change mirrors one made in !AccountManagerPlugin prior to release 0.4.0, and allows !WikiMacro support in !AccountManagerPlugin to be utilized.
Added:
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_user_table.html
Modified:
bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_users.html
bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
Modified: bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_users.html
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_users.html?rev=1500581&r1=1500580&r2=1500581&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_users.html (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_admin_users.html Mon Jul 8 05:31:59 2013
@@ -142,49 +142,21 @@
py:with="msglabel = 'Warning';
msgbody = _('This password store does not support listing users.')"/>
</div>
- <form py:otherwise="" method="post" py:strip="not delete_enabled">
- <div>
- <table id="accountlist"
- class="listing table table-striped table-condensed table-bordered" >
- <thead>
- <tr>
- <th py:if="delete_enabled" class="sel">
- <i class="icon-check"></i>
- </th>
- <th>Account</th><th>Name</th><th>Email</th><th>Last Login</th>
- </tr>
- </thead>
- <tbody>
- <tr py:for="acct in accounts">
- <td py:if="delete_enabled">
- <input type="checkbox" name="sel" value="${acct.username}" />
- </td>
- <td>
- <a href="${acct.review_url}">$acct.username</a>
- <!--! Additional account status icons -->
- <py:choose py:if="acct.locked">
- <img py:when="acct.release_hint" alt="Account locked"
- src="${href.chrome('/acct_mgr/time-locked.png')}"
- title="${acct.release_hint}" />
- <img py:otherwise="" alt="Permanently locked"
- src="${href.chrome('/acct_mgr/locked.png')}"
- title="${dgettext('acct_mgr', 'Permanently locked')}" />
- </py:choose>
- </td>
- <td>$acct.name</td>
- <td>$acct.email</td>
- <td>$acct.last_visit</td>
- </tr>
- </tbody>
- </table>
- </div>
- <div class="buttons">
- <input type="submit" name="reset" class="btn"
+ <form method="post" py:otherwise="" py:strip="not delete_enabled">
+ <div class="system-message"
+ py:if="deletion_error"><p>${deletion_error}</p></div>
+ <xi:include href="bh_user_table.html"/>
+ <div class="buttons control-group">
+ <input type="submit" class="btn" name="reset"
py:if="password_reset_enabled"
+ title="Send another random password"
value="${dgettext('acct_mgr', 'Reset passwords')}" />
- <input type="submit" name="remove" class="btn"
+ <input type="submit" class="btn" name="remove"
py:if="delete_enabled"
value="${dgettext('acct_mgr', 'Remove selected accounts')}" />
+ <input type="submit" class="btn" name="cleanup"
+ py:if="req.perm.has_permission('ACCTMGR_ADMIN')"
+ value="${dgettext('acct_mgr', 'Review account attributes')}" />
</div>
</form>
</py:choose>
Added: bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_user_table.html
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_user_table.html?rev=1500581&view=auto
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_user_table.html (added)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/templates/bh_user_table.html Mon Jul 8 05:31:59 2013
@@ -0,0 +1,62 @@
+<!--!
+Table style account/user list.
+
+Arguments:
+ - accounts:
+ - delete_enabled:
+ - cls:
+ - cols:
+-->
+<div xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:xi="http://www.w3.org/2001/XInclude"
+ xmlns:py="http://genshi.edgewall.org/"
+ xmlns:i18n="http://genshi.edgewall.org/i18n"
+ i18n:domain="acct_mgr"
+ id="accountlist">
+ <table class="$cls table table-striped table-condensed table-bordered" id="accountlist">
+ <thead>
+ <tr>
+ <th class="sel" py:if="delete_enabled"><i class="icon-check"></i></th>
+ <th>Account</th>
+ <th py:if="'name' in cols">Name</th>
+ <th py:if="'email' in cols">Email</th>
+ <th>Last Login</th>
+ </tr>
+ </thead>
+ <tbody>
+ <py:for each="idx, acct in enumerate(accounts)">
+ <py:with vars="odd_even = ('even', 'odd')[idx % 2]">
+ <tr class="$odd_even">
+ <td py:if="delete_enabled">
+ <input type="checkbox" name="sel"
+ value="${acct.username}" />
+ </td>
+ <td>
+ <a href="${acct.review_url}">${acct.username}</a>
+ <!--! Additional account status icons -->
+ <py:choose py:if="acct.locked">
+ <img src="${href.chrome('/acct_mgr/time-locked.png')}"
+ py:when="acct.release_hint" alt="Account locked"
+ title="${acct.release_hint}" />
+ <img src="${href.chrome('/acct_mgr/locked.png')}"
+ py:otherwise="" alt="Permanently locked"
+ title="${dgettext('acct_mgr', 'Permanently locked')}" />
+ </py:choose>
+ </td>
+ <td py:if="'name' in cols">${acct.name}</td>
+ <td py:if="'email' in cols">${acct.email}</td>
+ <!--! Trac >= 0.13: 'pretty_dateinfo' calls 'user_time' here -->
+ <py:if test="pretty_dateinfo">
+ <td>${acct.last_visit and pretty_date(acct.last_visit) or ''}</td>
+ </py:if>
+ <!--! pre-trac-0.13 fallback: always show absolute time here -->
+ <py:if test="not pretty_dateinfo">
+ <td>${acct.last_visit and \
+ pretty_date(acct.last_visit, format='absolute') or ''}</td>
+ </py:if>
+ </tr>
+ </py:with>
+ </py:for>
+ </tbody>
+ </table>
+</div>
Modified: bloodhound/trunk/bloodhound_theme/bhtheme/theme.py
URL: http://svn.apache.org/viewvc/bloodhound/trunk/bloodhound_theme/bhtheme/theme.py?rev=1500581&r1=1500580&r2=1500581&view=diff
==============================================================================
--- bloodhound/trunk/bloodhound_theme/bhtheme/theme.py (original)
+++ bloodhound/trunk/bloodhound_theme/bhtheme/theme.py Mon Jul 8 05:31:59 2013
@@ -143,6 +143,7 @@ class BloodhoundTheme(ThemeBase):
'login.html': ('bh_login.html', None),
'register.html': ('bh_register.html', None),
'reset_password.html': ('bh_reset_password.html', None),
+ 'user_table.html': ('bh_user_table.html', None),
'verify_email.html': ('bh_verify_email.html', None),
}
BOOTSTRAP_CSS_DEFAULTS = (