refactor: 💡 Add template conditionals for dates and duration (#257)
Add template conditionals within session-recordings for start_date, end_date and duration fields.
This commit is contained in:
1 parent
1afe8af15a
commit
6802f4a4da
3 files changed
+62
-46
No files matched your search
@@ -24,11 +24,13 @@
|
||||
<B.Tr>
|
||||
{{! Time }}
|
||||
<B.Td>
|
||||
<span class='hds-foreground-faint'>
|
||||
<time datetime={{format-date-iso B.data.start_time}}>
|
||||
{{format-date-iso-human B.data.start_time}}
|
||||
</time>
|
||||
</span>
|
||||
{{#if B.data.start_time}}
|
||||
<span class='hds-foreground-faint'>
|
||||
<time datetime={{format-date-iso B.data.start_time}}>
|
||||
{{format-date-iso-human B.data.start_time}}
|
||||
</time>
|
||||
</span>
|
||||
{{/if}}
|
||||
</B.Td>
|
||||
{{! User }}
|
||||
<B.Td>
|
||||
@@ -58,14 +60,16 @@
|
||||
</B.Td>
|
||||
{{! Duration }}
|
||||
<B.Td>
|
||||
<div
|
||||
class='session-recording-list-cell-item hds-foreground-faint'
|
||||
>
|
||||
<span><FlightIcon @name='clock' /></span>
|
||||
<span>
|
||||
{{format-time-duration B.data.duration}}
|
||||
</span>
|
||||
</div>
|
||||
{{#if B.data.duration}}
|
||||
<div
|
||||
class='session-recording-list-cell-item hds-foreground-faint'
|
||||
>
|
||||
<span><FlightIcon @name='clock' /></span>
|
||||
<span>
|
||||
{{format-time-duration B.data.duration}}
|
||||
</span>
|
||||
</div>
|
||||
{{/if}}
|
||||
</B.Td>
|
||||
<B.Td align='right'>
|
||||
{{#if (can 'read session-recording' B.data)}}
|
||||
|
||||
+20
-14
@@ -73,21 +73,27 @@
|
||||
<h2>{{t 'resources.session-recording.channel.details'}}</h2>
|
||||
<MetadataList @orientation='vertical' as |list|>
|
||||
{{! Start time }}
|
||||
<list.Item @icon='calendar' @color='faint'>
|
||||
{{t 'form.started.label'}}
|
||||
<time
|
||||
datetime={{format-date-iso @model.channelRecording.start_time}}
|
||||
>
|
||||
{{format-date-iso-human @model.channelRecording.start_time}}
|
||||
</time>
|
||||
</list.Item>
|
||||
{{#if @model.channelRecording.start_time}}
|
||||
<list.Item @icon='calendar' @color='faint'>
|
||||
{{t 'form.started.label'}}
|
||||
<time
|
||||
datetime={{format-date-iso
|
||||
@model.channelRecording.start_time
|
||||
}}
|
||||
>
|
||||
{{format-date-iso-human @model.channelRecording.start_time}}
|
||||
</time>
|
||||
</list.Item>
|
||||
{{/if}}
|
||||
{{! Duration }}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{t
|
||||
'resources.session-recording.duration'
|
||||
time=(format-time-duration @model.channelRecording.duration)
|
||||
}}
|
||||
</list.Item>
|
||||
{{#if @model.channelRecording.duration}}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{t
|
||||
'resources.session-recording.duration'
|
||||
time=(format-time-duration @model.channelRecording.duration)
|
||||
}}
|
||||
</list.Item>
|
||||
{{/if}}
|
||||
{{! Bytes up }}
|
||||
<list.Item @icon='arrow-up' @color='success'>
|
||||
{{t
|
||||
|
||||
+25
-19
@@ -77,9 +77,11 @@
|
||||
}}
|
||||
</list.Item>
|
||||
{{! Duration }}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{format-time-duration B.data.duration}}
|
||||
</list.Item>
|
||||
{{#if B.data.duration}}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{format-time-duration B.data.duration}}
|
||||
</list.Item>
|
||||
{{/if}}
|
||||
</MetadataList>
|
||||
</B.Td>
|
||||
<B.Td>
|
||||
@@ -111,23 +113,27 @@
|
||||
|
||||
<MetadataList @orientation='vertical' as |list|>
|
||||
{{! Start time }}
|
||||
<list.Item @icon='calendar' @color='faint'>
|
||||
{{t 'form.started.label'}}
|
||||
<time
|
||||
datetime={{format-date-iso
|
||||
@model.sessionRecording.start_time
|
||||
}}
|
||||
>
|
||||
{{format-date-iso-human @model.sessionRecording.start_time}}
|
||||
</time>
|
||||
</list.Item>
|
||||
{{#if @model.sessionRecording.start_time}}
|
||||
<list.Item @icon='calendar' @color='faint'>
|
||||
{{t 'form.started.label'}}
|
||||
<time
|
||||
datetime={{format-date-iso
|
||||
@model.sessionRecording.start_time
|
||||
}}
|
||||
>
|
||||
{{format-date-iso-human @model.sessionRecording.start_time}}
|
||||
</time>
|
||||
</list.Item>
|
||||
{{/if}}
|
||||
{{! Duration }}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{t
|
||||
'resources.session-recording.duration'
|
||||
time=(format-time-duration @model.sessionRecording.duration)
|
||||
}}
|
||||
</list.Item>
|
||||
{{#if @model.sessionRecording.duration}}
|
||||
<list.Item @icon='clock' @color='faint'>
|
||||
{{t
|
||||
'resources.session-recording.duration'
|
||||
time=(format-time-duration @model.sessionRecording.duration)
|
||||
}}
|
||||
</list.Item>
|
||||
{{/if}}
|
||||
{{! Bytes up }}
|
||||
<list.Item @icon='arrow-up' @color='success'>
|
||||
{{t
|
||||
|
||||
Reference in new issue
Block a user