Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
feat: shorten track description
Browse files Browse the repository at this point in the history
  • Loading branch information
ocjojo committed Mar 22, 2020
1 parent b219f16 commit f9c9022
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 3 deletions.
11 changes: 9 additions & 2 deletions frontend/src/components/TrackCard.vue
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<div class="track-img"></div>
<div class="track-info">
<h5>{{ track.Name }}</h5>
<p>{{ track.Description }}</p>
<p>{{ description }}</p>
</div>
</div>
</template>
Expand All @@ -12,6 +12,14 @@
export default {
props: {
track: Object
},
computed: {
description() {
const shortened = this.track.Description.substring(0, 160);
return shortened.length === this.track.Description.length
? shortened
: shortened + "...";
}
}
};
</script>
Expand Down Expand Up @@ -42,7 +50,6 @@ export default {
margin-bottom: 5px;
overflow: hidden;
padding-top: 0;
text-overflow: ellipsis;
h5 {
font-weight: 900;
Expand Down
4 changes: 3 additions & 1 deletion frontend/src/views/Main.vue
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@
</div>
<img v-else src="@/assets/defaultAvatar.svg" alt="avatar" />
<div class="context-menu">
<div class="context-menu-item">Username: {{ user.Fullname }}</div>
<div class="context-menu-item">
Username: {{ user ? user.Fullname : "" }}
</div>
<div class="context-menu-item">Bild ändern</div>
<div class="context-menu-item" @click="logOut()">Ausloggen</div>
</div>
Expand Down

0 comments on commit f9c9022

Please sign in to comment.