Add conditional on template

This commit is contained in:
Carlos Alcaide Corvo committed 2021-12-14 08:35:13 -08:00
1 parent f4cdbfc99c
commit bc0af27afa
1 file changed
+31 -29
@@ -5,35 +5,37 @@
<Rose::Table as |table|>
<table.body as |body|>
{{#each @model.hosts as |host|}}
<body.row as |row|>
<row.cell>
{{host.displayName}}
<p>{{host.description}}</p>
</row.cell>
<row.cell>
<Copyable
@text={{host.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{host.id}}</code>
</Copyable>
</row.cell>
<row.cell>{{host.attributes.address}}</row.cell>
<row.cell>
<Rose::Badge>{{t
(concat 'resources.host.types.' host.type)
}}</Rose::Badge>
</row.cell>
<row.cell>
<Rose::Button
@style='secondary'
{{on 'click' (route-action 'connect' @model.target host)}}
>
{{t 'resources.session.actions.connect'}}
</Rose::Button>
</row.cell>
</body.row>
{{#if host.isStatic}}
<body.row as |row|>
<row.cell>
{{host.displayName}}
<p>{{host.description}}</p>
</row.cell>
<row.cell>
<Copyable
@text={{host.id}}
@buttonText={{t 'actions.copy-to-clipboard'}}
@acknowledgeText={{t 'states.copied'}}
>
<code>{{host.id}}</code>
</Copyable>
</row.cell>
<row.cell>{{host.attributes.address}}</row.cell>
<row.cell>
<Rose::Badge>{{t
(concat 'resources.host.types.' host.type)
}}</Rose::Badge>
</row.cell>
<row.cell>
<Rose::Button
@style='secondary'
{{on 'click' (route-action 'connect' @model.target host)}}
>
{{t 'resources.session.actions.connect'}}
</Rose::Button>
</row.cell>
</body.row>
{{/if}}
{{/each}}
</table.body>
</Rose::Table>