add: sample usage of subactions (groups are broken for now!)
authorRicardo Velhote <rvelhote@gmail.com>
Wed, 26 May 2010 23:30:52 +0000 (00:30 +0100)
committerRicardo Velhote <rvelhote@gmail.com>
Wed, 26 May 2010 23:30:52 +0000 (00:30 +0100)
swat/templates/default/derived/account.mako

index 63d5f4a529839a5c818730b9263711f139981d26..e263ded510e750a29ae0e5ecc025d2d99cbbe85f 100644 (file)
@@ -47,7 +47,7 @@ ${options(c.config.get_action())}
     % if c.list_groups == True:
         <h3>${_("User List")}</h3>
     % endif
-    
+
     <table id="${table_id}" class="list ${table_class}">
        <thead>
            <tr>
@@ -91,11 +91,11 @@ ${options(c.config.get_action())}
         
             <tr id="row-user-${i}" title="${_('Edit User')}" class="${tr_class}">
                 <td><input value="${user.username}" onchange="selectShareRow(this);" name="name" type="checkbox" id="check-row-user-${i}" /></td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${i}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.rid}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.username}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${user.description}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'edituser', id = user.rid)}');">${quick_tasks(user.rid, "User", False)}</td>
+                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', id=user.rid)}');">${i}</td>
+                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', id=user.rid)}');">${user.rid}</td>
+                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', id=user.rid)}');">${user.username}</td>
+                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', id=user.rid)}');">${user.description}</td>
+                <td onclick="clickableRow('${h.url_for('account_action', controller='account', action='user', subaction='edit', id=user.rid)}');">${quick_tasks(user.rid, "User", False)}</td>
             </tr>
             
             <% i = i + 1 %>
@@ -156,10 +156,10 @@ ${options(c.config.get_action())}
         
             <tr id="row-group-${i}" title="${_('Edit Group')}" class="${tr_class}">
                 <td><input value="${group.name}" onchange="selectShareRow(this);" name="name" type="checkbox" id="check-row-group-${i}" /></td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${i}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.rid}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.name}</td>
-                <td onclick="clickableRow('${h.url_for(controller = 'account', action = 'editgroup', id = group.rid)}');">${group.description}</td>
+                <td onclick="clickableRow('${h.url_for(action = 'editgroup', id = group.rid)}');">${i}</td>
+                <td onclick="clickableRow('${h.url_for(action = 'editgroup', id = group.rid)}');">${group.rid}</td>
+                <td onclick="clickableRow('${h.url_for(action = 'editgroup', id = group.rid)}');">${group.name}</td>
+                <td onclick="clickableRow('${h.url_for(action = 'editgroup', id = group.rid)}');">${group.description}</td>
                 <td>${quick_tasks(group.rid, "Group", False)}</td>
             </tr>
             
@@ -170,8 +170,8 @@ ${options(c.config.get_action())}
     
 <%def name="quick_tasks(id, type, is_disabled=False)">
     <ul class="quick-tasks">
-        <li><a href="${h.url_for(controller = 'account', action = 'edit' + type.lower(), id = id)}" title="${_('Edit %s' % (type))}"><img src="/default/images/icons/folder-pencil.png" alt="${_('Edit %s Icon' % (type))}"/></a></li>
-       <li><a href="${h.url_for(controller = 'account', action = 'remove' + type.lower(), id = id)}" title="${_('Remove %s' % (type))}"><img src="/default/images/icons/folder-minus.png" alt="${_('Remove %s Icon' % (type))}"/></a></li>
+        <li><a href="${h.url_for('account_action', action=type.lower(), subaction='edit', id=id)}" title="${_('Edit %s' % (type))}"><img src="/default/images/icons/folder-pencil.png" alt="${_('Edit %s Icon' % (type))}"/></a></li>
+       <li><a href="${h.url_for('account_action', action=type.lower(), subaction='remove', id=id)}" title="${_('Remove %s' % (type))}"><img src="/default/images/icons/folder-minus.png" alt="${_('Remove %s Icon' % (type))}"/></a></li>
     </ul>
 </%def>