Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use NcListItem
Signed-off-by: Carl Schwan <[email protected]>
Signed-off-by: Louis Chemineau <[email protected]>
  • Loading branch information
CarlSchwan authored and artonge committed Nov 28, 2022
commit 348796892b0cff6dfe38ce4d6761309552cc8c05
90 changes: 46 additions & 44 deletions apps/files_versions/src/views/VersionTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,50 +17,52 @@
-->
<template>
<div>
<NcListItem v-for="version in versions"
class="version"
key="version.url"
:title="version.title"
:href="version.url">
<template #icon>
<img lazy="true"
:src="version.preview"
alt=""
height="256"
width="256"
class="version-image">
</template>
<template #subtitle>
<div class="version-info">
<a v-tooltip="version.dateTime" :href="version.url">{{ version.relativeTime }}</a>
<span class="version-info-size">•</span>
<span class="version-info-size">
{{ version.size }}
</span>
</div>
</template>
<template #actions>
<NcActionLink :href="version.url">
<template #icon>
<Download :size="22" />
</template>
{{ t('files_versions', `Download file ${fileInfo.name} with version ${version.displayVersionName}`) }}
</NcActionLink>
<NcActionButton @click="restoreVersion(version)" v-if="!version.isCurrent">
<template #icon>
<BackupRestore :size="22" />
</template>
{{ t('files_versions', `Restore file ${fileInfo.name} with version ${version.displayVersionName}`) }}
</NcActionButton>
</template>
</NcListItem>
<NcEmptyContent v-if="!loading && versions.length === 1"
:title="t('files_version', 'No versions yet')">
<!-- length === 1, since we don't want to show versions if there is only the current file -->
<template #icon>
<BackupRestore />
</template>
</NcEmptyContent>
<ul>
<NcListItem v-for="version in versions"
class="version"
key="version.url"
:title="version.title"
:href="version.url">
<template #icon>
<img lazy="true"
:src="version.preview"
alt=""
height="256"
width="256"
class="version-image">
</template>
<template #subtitle>
<div class="version-info">
<a v-tooltip="version.dateTime" :href="version.url">{{ version.relativeTime }}</a>
<span class="version-info-size">•</span>
<span class="version-info-size">
{{ version.size }}
</span>
</div>
</template>
<template #actions>
<NcActionLink :href="version.url">
<template #icon>
<Download :size="22" />
</template>
{{ t('files_versions', 'Download version') }}
</NcActionLink>
<NcActionButton @click="restoreVersion(version)" v-if="!version.isCurrent">
<template #icon>
<BackupRestore :size="22" />
</template>
{{ t('files_versions', 'Restore version') }}
</NcActionButton>
</template>
</NcListItem>
<NcEmptyContent v-if="!loading && versions.length === 1"
:title="t('files_version', 'No versions yet')">
<!-- length === 1, since we don't want to show versions if there is only the current file -->
<template #icon>
<BackupRestore />
</template>
</NcEmptyContent>
</ul>
</div>
</template>

Expand Down