Files
threshold-ui/ui/admin/app/templates/scopes/scope/groups/index.hbs
T
Amy Lam aa5b813791 Ran a find and replace
New namespacing. `flight-icons/` replace with `flight-icons/svg/`
2021-09-16 14:24:38 -07:00

104 lines
3.2 KiB
Handlebars

<Rose::Layout::Page as |page|>
<page.breadcrumbs>
<BreadCrumbs />
</page.breadcrumbs>
<page.header>
<h2>
{{t 'resources.group.title_plural'}}
<DocLink @doc='group' @iconSize='large' />
</h2>
<p>{{t 'resources.group.description'}}</p>
</page.header>
<page.actions>
{{#if (can 'create collection' this.scope collection='groups')}}
{{#if @model}}
<Rose::LinkButton @route='scopes.scope.groups.new' @style='primary'>{{t
'titles.new'
}}</Rose::LinkButton>
{{/if}}
{{/if}}
</page.actions>
<page.body>
{{#if @model}}
<Rose::Table as |table|>
<table.header as |header|>
<header.row as |row|>
<row.headerCell>{{t 'form.name.label'}}</row.headerCell>
<row.headerCell>{{t 'form.id.label'}}</row.headerCell>
</header.row>
</table.header>
<table.body as |body|>
{{#each @model as |group|}}
<body.row as |row|>
<row.headerCell>
{{#if (can 'read model' group)}}
<LinkTo
@route='scopes.scope.groups.group'
@model={{group.id}}
>
{{group.displayName}}
</LinkTo>
{{else}}
{{group.displayName}}
{{/if}}
<p>{{group.description}}</p>
</row.headerCell>
<row.cell>
<Copyable
@text={{group.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{group.id}}</code>
</Copyable>
</row.cell>
</body.row>
{{/each}}
</table.body>
</Rose::Table>
{{else}}
<Rose::Layout::Centered>
<Rose::Message
@title={{t 'resources.group.messages.welcome.title'}}
as |message|
>
<message.description>
{{#if (can 'list collection' this.scope collection='groups')}}
{{! can list (at least): show default welcome message}}
{{t 'resources.group.description'}}
{{else if (can 'create collection' this.scope collection='groups')}}
{{! can create (only): show create-but-not-list welcome message}}
{{t
'descriptions.create-but-not-list'
resource=(t 'resources.group.title_plural')
}}
{{else}}
{{! can neither list nor create }}
{{t
'descriptions.neither-list-nor-create'
resource=(t 'resources.group.title_plural')
}}
{{/if}}
</message.description>
{{#if (can 'create collection' this.scope collection='groups')}}
<message.link @route='scopes.scope.groups.new'>
<Rose::Icon @name='flight-icons/svg/plus-circle-16' />
{{t 'titles.new'}}
</message.link>
{{/if}}
</Rose::Message>
</Rose::Layout::Centered>
{{/if}}
</page.body>
</Rose::Layout::Page>