Generate client id menu dynamically instead of hard coding the mapping from

role to client id.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=218913784
This commit is contained in:
shicong 2018-10-26 14:25:08 -07:00 committed by jianglai
parent b48061b792
commit 21f706bf24
3 changed files with 7 additions and 29 deletions

View file

@ -23,8 +23,7 @@
{template .main}
{@param xsrfToken: string} /** Security token. */
{@param clientId: string} /** Registrar client identifier. */
{@param ownerClientIds: list<string>}
{@param adminClientIds: list<string>}
{@param allClientIds: list<string>} /** All registrar client identifiers for the user. */
{@param username: string} /** Arbitrary username to display. */
{@param logoutUrl: string} /** Generated URL for logging out of Google. */
{@param productName: string} /** Name to display for this software product. */
@ -78,8 +77,7 @@
/** Sidebar nav. Ids on each elt for testing only. */
{template .navbar_ visibility="private"}
{@param clientId: string} /** Registrar client identifier. */
{@param ownerClientIds: list<string>}
{@param adminClientIds: list<string>}
{@param allClientIds: list<string>}
<div id="reg-nav" class="{css('kd-content-sidebar')}">
<form>
@ -88,20 +86,9 @@
class="{css('kd-button')} {css('kd-button-submit')}"
onchange='this.form.submit()'>
<option value="">[auto select]</option>
{if length($ownerClientIds) > 0}
<optgroup label="OWNER">
{for $id in $ownerClientIds}
<option value="{$id}" {if $id == $clientId}selected{/if}>{$id}</option>
{/for}
</optgroup>
{/if}
{if length($adminClientIds) > 0}
<optgroup label="ADMIN">
{for $id in $adminClientIds}
<option value="{$id}" {if $id == $clientId}selected{/if}>{$id}</option>
{/for}
</optgroup>
{/if}
{for $id in $allClientIds}
<option value="{$id}" {if $id == $clientId}selected{/if}>{$id}</option>
{/for}
</select>
</form>
<ul id="reg-navlist">