Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
$header(formurl,breadcrumbs,shortcuts)$

$if(error)$<div class="error">$error$</div>$endif$
$if(success)$<div class="success">$success$</div>$endif$

<h2>$g.name;format="html"$ roles</h2>

<div><form method="post" action='$formurl$/group.roles' id="person_update" class="person">
	<input type="hidden" name="uuid" value="$uuid$"/>
	<input type="hidden" name="a" value="$auth$" />
	<input type="hidden" name="admin_roles" value="" />

	<h3 class="admin_roles">Administrative Roles</h3>

$roles:{r|
	$if(!r.role.internal)$
	<label for='role_$r.role.role$' class='custom'>
		<span class='question'>$r.role.name;format="html"$</span>
		<span class='answer'><input type="checkbox" name="role_$r.role.role$" id="role_$r.role.role$" value="true" $if(r.selected)$ checked="checked"$endif$ /> $r.role.description;format="html"$</span>
	</label>
	$endif$
}$

$if(has_custom_role)$
	<br/><br/>
$endif$

$roles:{r|
	$if(r.role.internal)$
	<label for='role_$r.role.role$' class='internal'>
		<span class='question'>$r.role.name;format="html"$</span>
		<span class='answer'><input type="checkbox" name="role_$r.role.role$" id="role_$r.role.role$" value="true" $if(r.selected)$ checked="checked"$endif$ /> $r.role.description;format="html"$</span>
	</label>
	$endif$
}$

	<div class='submit'>
		<input type="submit" value="Save"/>
	</div>
</form>

<div><form method="post" action='$formurl$/group.roles' id="person_roles" class="person">
	<input type="hidden" name="uuid" value="$uuid$"/>
	<input type="hidden" name="a" value="$auth$" />

	<h3>Roles</h3>

	<p>The following roles are associated with this group:</p>

	<ul class="current_roles chevron">
	<li>
		$if(role_to_add)$
		<input name="add_role" type="hidden" value='$role_to_add;format="html"$' />
		<select name="role_resource">
			$possible_resource_based_roles:{r|
			<option value='$r.key;format="html"$'>$role_to_add_name$ &mdash; $r.value;format="html"$</option>}$
		</select>
		$else$
		<select name="add_role">
			$rr:{r|
			<option value='$r.role;format="html"$'>$r.name;format="html"$</option>}$
		</select>
		$endif$
		<input type="submit" value="Add"/>
	</li>
$current_resource_based_roles:{r|
	<li>
		<span>$r.name;format="html"$</span> &mdash; $r.resource;format="html"$ <a class="delete" href='$formurl$/group.roles?delete_role=$r.role;format="url"$&amp;resource=$r.uid;format="url"$&uuid=$uuid$&a=$auth$'>Delete</a>
	</li>
}$
	</ul>

</form></div>

$footer()$
New to GrepCode? Check out our FAQ X