Skip to content

Commit

Permalink
PackageDetail: improve download link behaviour, icon, email-link label
Browse files Browse the repository at this point in the history
  • Loading branch information
dmstern committed Nov 19, 2018
1 parent eb45ff9 commit aa4acbd
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 7 deletions.
3 changes: 2 additions & 1 deletion src/components/ExternalLink.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<a
:href="href"
target="_blank"
:target="newTab === false ? '' : '_blank'"
:title="title"
>
<img :src="img" v-if="img">
Expand All @@ -21,6 +21,7 @@ export default class ExternalLink extends Vue {
@Prop() private text?: string;
@Prop() private icon?: string;
@Prop() private img?: string;
@Prop() private newTab?: boolean;
}
</script>

Expand Down
17 changes: 11 additions & 6 deletions src/views/PackageDetail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,16 @@
</span>
<span v-if="!isHighlightableType(data.activeTreeItem)">This filetype ({{`${data.activeTreeItem.type}`}}) is not supported.</span>
</h3>
But you can download it here: <ExternalLink :href="`${baseUrl}/packageDetail/${
data.currentPackage ? data.currentPackage.scope : undefined
}/${$router.currentRoute.params.packageName}/${
data.currentPackage ? data.currentPackage.version : undefined
}/files/${encodeURIComponent(`${data.activeTreeItem.path}/${data.activeTreeItem.name}`)}?format=file`"></ExternalLink>
But you can download it here:
<ExternalLink
:href="`${baseUrl}/packageDetail/${
data.currentPackage ? data.currentPackage.scope : undefined
}/${$router.currentRoute.params.packageName}/${
data.currentPackage ? data.currentPackage.version : undefined
}/files/${encodeURIComponent(`${data.activeTreeItem.path}/${data.activeTreeItem.name}`)}?format=file`"
:newTab="false"
:icon="$vuetify.icons.download"
></ExternalLink>
</v-alert>
<LoadingSpinner
class="transition"
Expand Down Expand Up @@ -300,7 +305,7 @@
<v-list-tile-action>
<v-icon>{{$vuetify.icons.email}}</v-icon>
</v-list-tile-action>
<v-list-tile-title>mailto:{{crafter.email}}</v-list-tile-title>
<v-list-tile-title>{{crafter.email}}</v-list-tile-title>
</v-list-tile>
</a>
</v-list>
Expand Down

0 comments on commit aa4acbd

Please sign in to comment.