diff options
| author | bitweaver.org <bitweaver@users.sourceforge.net> | 2007-07-15 17:04:03 +0000 |
|---|---|---|
| committer | bitweaver.org <bitweaver@users.sourceforge.net> | 2007-07-15 17:04:03 +0000 |
| commit | c224408f07ebc9ca31f8c76cdf5ead73b13b4c0d (patch) | |
| tree | 72817134138a4a3710bc5b49f4065a2057f52a2a /templates/content_permissions.tpl | |
| parent | 83785ff1a4bbcde7ab2338ab00e03dce3c2a1b83 (diff) | |
| download | liberty-c224408f07ebc9ca31f8c76cdf5ead73b13b4c0d.tar.gz liberty-c224408f07ebc9ca31f8c76cdf5ead73b13b4c0d.tar.bz2 liberty-c224408f07ebc9ca31f8c76cdf5ead73b13b4c0d.zip | |
improve UI when there's few groups by increasing icon size and display large matrix when there's many groups. might look daunting to start off with but it's easier to deal with in the long run.
Diffstat (limited to 'templates/content_permissions.tpl')
| -rw-r--r-- | templates/content_permissions.tpl | 149 |
1 files changed, 40 insertions, 109 deletions
diff --git a/templates/content_permissions.tpl b/templates/content_permissions.tpl index c4ae116..bdb9b35 100644 --- a/templates/content_permissions.tpl +++ b/templates/content_permissions.tpl @@ -15,121 +15,52 @@ {/if} {if count($contentPerms.groups) lt 10} - <table class="data"> - <caption>{tr}Permissions set for this content item{/tr}</caption> - <tr> - <th>{tr}Permission{/tr}</th> - {foreach from=$contentPerms.groups item=group} - <th>{$group.group_name}</th> - {/foreach} - </tr> + {assign var=size value="large/"} + {/if} - {foreach from=$contentPerms.assignable key=perm item=permInfo} - <tr class="{cycle values="odd,even"}"> - <td>{$permInfo.perm_desc}<br /><em>({$permInfo.perm_name})</em></td> - {foreach from=$contentPerms.groups key=groupId item=groupInfo} - {assign var=icon value="icons/media-playback-stop"} {* default icon *} - {assign var=action value="assign"} {* default action *} - {if $groupInfo.perms.$perm} {* global active permissions *} - {assign var=icon value="icons/dialog-ok"} {* default active permission icon *} - {if $contentPerms.assigned.$groupId.$perm} - {assign var=icon value="icons/list-add"} {* custon permission icon *} - {assign var=action value="remove"} {* remove permission if we have a custom one *} - {/if} - {if $contentPerms.assigned.$groupId.$perm.is_revoked} - {assign var=icon value="icons/list-remove"} {* is_revoked icon *} - {/if} - {/if} - <td style="text-align:center">{smartlink itra=false ititle=$perm ibiticon=$icon action=$action content_id=$gContent->mContentId perm=$perm group_id=$groupId}</td> - {/foreach} - </tr> + <table class="data"> + <caption>{tr}Permissions set for this content item{/tr}</caption> + <tr> + <th>{tr}Permission{/tr}</th> + {foreach from=$contentPerms.groups item=group} + {if count($contentPerms.groups) lt 10} + <th>{$group.group_name}</th> + {else} + <th>{$group.group_id}</th> + {/if} {/foreach} - </table> - - {else} + </tr> - {form} - <input type="hidden" name="content_id" value="{$gContent->mContentId}" /> - <input type="hidden" name="action" value="assign" /> - - <div class="row"> - {formlabel label="Assign this Permission" for="perm"} - {forminput} - <select name="perm" id="perm"> - {foreach from=$contentPerms.assignable item=perm} - <option value="{$perm.perm_name}">{$perm.perm_desc}</option> - {/foreach} - </select> - {formhelp note=""} - {/forminput} - </div> - - <div class="row"> - {formlabel label="To this Group" for="group_id"} - {forminput} - <select name="group_id" id="group_id"> - {foreach from=$contentPerms.groups item=group} - <option value="{$group.group_id}">{$group.group_name}</option> - {/foreach} - </select> - {formhelp note=""} - {/forminput} - </div> - - <div class="row submit"> - <input type="submit" name="back" value="{tr}Go back to content{/tr}" /> - <input type="submit" name="assign" value="{tr}Assign Permission{/tr}" /> - </div> - {/form} - - {if $contentPerms.assigned} - <table class="data"> - <caption>{tr}Custom permissions assigned to this content{/tr}</caption> - <tr> - <th>{tr}Group{/tr}</th> - <th>{tr}Permission{/tr}</th> - <th>{tr}Action{/tr}</th> - </tr> - {foreach from=$contentPerms.assigned key=groupId item=groupInfo} - {foreach from=$groupInfo key=perm item=permInfo name=fgroup} - <tr class="{cycle values="even,odd"}"> - {if $smarty.foreach.fgroup.first} - <td rowspan="{$smarty.foreach.fgroup.total}">{$permInfo.group_name}</td> - {/if} - <td> - {if $contentPerms.assigned.$groupId.$perm.is_revoked} - {biticon iname=list-remove iexplain="Removed Permission"} - {else} - {biticon iname=list-add iexplain="Added Permission"} - {/if} {$permInfo.perm_desc} <em>({$permInfo.perm_name})</em> - </td> - <td align="right"> - {smartlink ititle="Remove Permission" ibiticon="icons/edit-delete" action=remove content_id=$gContent->mContentId perm=$perm group_id=$groupId} - </td> - </tr> - {/foreach} - {foreachelse} - <tr class="norecords"> - <td colspan="3">{tr}No individual permissions, global permissions apply{/tr}</td> - </tr> + {foreach from=$contentPerms.assignable key=perm item=permInfo} + <tr class="{cycle values="odd,even"}"> + <td>{$permInfo.perm_desc}<br /><em>({$permInfo.perm_name})</em></td> + {foreach from=$contentPerms.groups key=groupId item=groupInfo} + {assign var=icon value="media-playback-stop"} {* default icon *} + {assign var=action value="assign"} {* default action *} + {if $groupInfo.perms.$perm} {* global active permissions *} + {assign var=icon value="dialog-ok"} {* default active permission icon *} + {if $contentPerms.assigned.$groupId.$perm} + {assign var=icon value="list-add"} {* custon permission icon *} + {assign var=action value="remove"} {* remove permission if we have a custom one *} + {/if} + {if $contentPerms.assigned.$groupId.$perm.is_revoked} + {assign var=icon value="list-remove"} {* is_revoked icon *} + {/if} + {/if} + <td style="text-align:center">{smartlink itra=false ititle="`$contentPerms.groups.$groupId.group_name`: $perm" ibiticon=icons/$size$icon action=$action content_id=$gContent->mContentId perm=$perm group_id=$groupId}</td> {/foreach} - </table> - {/if} + </tr> + {/foreach} + </table> - <h2 >{tr}Default Permissions{/tr}</h2> - <ul> - {foreach from=$contentPerms.groups key=groupId item=groupInfo} - <li>{$groupInfo.group_name} - <ul> - {foreach from=$groupInfo.perms key=perm item=permInfo} - {if $contentPerms.assignable.$perm} - <li>{$permInfo.perm_desc} <em>({$permInfo.perm_name})</em></li> - {/if} - {/foreach} - </ul> - </li> + {if count($contentPerms.groups) gt 10} + <h2>{tr}Legend{/tr}</h2> + <dl> + {foreach from=$contentPerms.groups item=group} + <dt>{$group.group_id}</dt> + <dd>{$group.group_name}: {$group.group_desc}</dd> {/foreach} - </ul> + </dl> {/if} </div><!-- end .body --> </div><!-- end .liberty --> |
