Skip to content

Commit

Permalink
convert alternatives to uswds accordian
Browse files Browse the repository at this point in the history
  • Loading branch information
Laura Gerhardt committed Feb 7, 2020
1 parent e77c1b3 commit d840e1d
Show file tree
Hide file tree
Showing 6 changed files with 66 additions and 20 deletions.
Binary file added _assets/images/remove-organization.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _assets/images/remove-space-user.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _assets/images/space-user-role-management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added _assets/images/user-role-management.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
70 changes: 50 additions & 20 deletions _docs/apps/managing-teammates.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,30 +26,44 @@ After a teammate gets a cloud.gov account, an Org Manager or Space Manager will
Org Managers can assign roles using the [dashboard](https://dashboard.fr.cloud.gov/) or command line. Space Managers can assign roles using the command line.


{{% alternatives dashboard="dashboard-org-give-role" cli="cli-org-give-role" %}}
{{% dashboard %}}

<div class="usa-accordion usa-accordion--bordered">
<!-- Use the accurate heading level to maintain the document outline -->
<h2 class="usa-accordion__heading">
<button class="usa-accordion__button"
aria-expanded="true"
aria-controls="b-a1">
Dashboard
</button>
</h2>
<div id="b-a1" class="usa-accordion__content usa-prose" markdown="1">
### Organization users

If you're an Org Manager, go to your [dashboard](https://dashboard.fr.cloud.gov/) and click on the name of your org.

![User roles](/img/user-role-management.png)
{% asset user-role-management.png alt="User Roles" %}

On the org page, scroll down to "Organization users". This lists the org users and their org roles. Change the roles by clicking the checkboxes beside their names. (If you're the only person in the org, you'll just see "You are the only user in this organization".)

### Space users

If you're a Space Manager, go to your [dashboard](https://dashboard.fr.cloud.gov/) and click on the name of your org, then click on the name of your space.

![Space roles](/img/space-user-role-management.png)
{% asset space-user-role-management.png alt="Adding users to the space" %}

On the space page, scroll down to "Space users". This lists the space users and their space roles. Change the roles by clicking the checkboxes beside their names. (If you're the only person in the space, you'll just see "You are the only user in this space".)

To give an existing organization user access to a space, go to your space page, click a space name, and scroll down to "Space users". You can add a person, and then you can give them roles with the checkboxes.

{{% /dashboard %}}
{{% commandline %}}

</div>

<!-- Use the accurate heading level to maintain the document outline -->
<h2 class="usa-accordion__heading">
<button class="usa-accordion__button"
aria-expanded="false"
aria-controls="b-a2">
Commandline
</button>
</h2>
<div id="b-a2" class="usa-accordion__content usa-prose" markdown="1">
If you're an Org Manager or Space Manager, here's how to give your teammates roles for your orgs and spaces. You can check whether you're an Org Manager using `cf org-users <org>` and whether you're a Space Manager using `cf space-users <org> <space>`.

Check what version of the CLI you're running: `cf -v`. If that's older than the [latest version listed here](https://github.com/cloudfoundry/cli/releases), you should [upgrade it](https://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html) to avoid unexpected errors.
Expand All @@ -76,16 +90,25 @@ Decide which roles to give them. For a complete list of roles, see [the Cloud Fo
```sh
cf set-org-role <email> <org> OrgAuditor
```
{{% /commandline %}}
{{% /alternatives %}}
</div>

<div markdown="1">
## Removing a teammate

If you are an Org Manager or Space Manager, you can remove teammates from orgs and spaces respectively.

{{% alternatives dashboard="dashboard-org-remove-role" cli="cli-org-remove-role" %}}
{{% dashboard %}}

<div >

<div class="usa-accordion usa-accordion--bordered">
<!-- Use the accurate heading level to maintain the document outline -->
<h2 class="usa-accordion__heading">
<button class="usa-accordion__button"
aria-expanded="true"
aria-controls="b-a1">
Dashboard
</button>
</h2>
<div id="b-a1" class="usa-accordion__content usa-prose" markdown="1">
### Organization Users

If you're an Org Manager, go to the org with the teammate you want to remove.
Expand All @@ -95,6 +118,7 @@ On the Organization page, scroll down to the “Organization users” section. T
To remove a teammate from an organization, you must first remove them from any of the organization's spaces first.

![App Overview dashboard](/img/remove-organization.png)
{% asset remove-organization.png alt="Removing users" %}

### Space users

Expand All @@ -103,10 +127,17 @@ If you're an Org Manager or Space Manager, go to the space with the teammate you
On the Space page, scroll down to the “Space users” section. This has a list of all the space users. Click the "Remove All Space Roles" button.
You can also remove a user from a Space by unchecking all of their space roles.
{{% /dashboard %}}
{{% commandline %}}
</div>
<!-- Use the accurate heading level to maintain the document outline -->
<h2 class="usa-accordion__heading">
<button class="usa-accordion__button"
aria-expanded="false"
aria-controls="b-a2">
Commandline
</button>
</h2>
<div id="b-a2" class="usa-accordion__content usa-prose" markdown="1">
If you're an Org Manager or Space Manager, here's how to remove teammates from your orgs and spaces. You can check whether you're an Org Manager using `cf org-users <org>` and whether you're a Space Manager using `cf space-users <org> <space>`.
Check what version of the CLI you're running: `cf -v`. If that's older than the [latest version listed here](https://github.com/cloudfoundry/cli/releases), you should [upgrade it](https://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html) to avoid unexpected errors.
Expand Down Expand Up @@ -171,5 +202,4 @@ To remove teammates from your space, run the following:
cf unset-space-role <email> <org> <space> <role>
```
{{% /commandline %}}
{{% /alternatives %}}
</div>
16 changes: 16 additions & 0 deletions _plugins/usa-accordian.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# _plugins/render_note.rb
module Jekyll
class RenderAccordianTag < Liquid::Tag

def initialize(tag_name, text, tokens)
super
@text = text
end

def render(context)
"<div class=\"alert alert-info\" role=\"alert\">#{@text}</div>"
end
end
end

Liquid::Template.register_tag('render_note', Jekyll::RenderAccordianTag)

0 comments on commit d840e1d

Please sign in to comment.