Use simple anchors for flat details;

This commit is contained in:
Benjamin Bouvier 2017-06-13 16:55:58 +02:00 committed by Phyks (Lucas Verney)
parent 6ed484bb8b
commit aac6b63e0a
1 changed files with 24 additions and 17 deletions

View File

@ -41,28 +41,30 @@
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<tr v-for="flat in sortedFlats" :key="flat.id" v-on:click="event => showMore(event, flat.id)" class="pointer"> <tr v-for="flat in sortedFlats" :key="flat.id">
<td v-if="showNotationColumn"> <td v-if="showNotationColumn">
<template v-for="n in range(flat.notation)"> <template v-for="n in range(flat.notation)">
<i class="fa fa-star" aria-hidden="true" :title="capitalize($t('status.followed'))"></i> <i class="fa fa-star" aria-hidden="true" :title="capitalize($t('status.followed'))"></i>
</template> </template>
</td> </td>
<td> <td>
<template v-if="!showNotationColumn" v-for="n in range(flat.notation)"> <a class="fill" :href="makeDetailsUrl(flat.id)">
<i class="fa fa-star" aria-hidden="true" :title="capitalize($t('status.followed'))"></i> <template v-if="!showNotationColumn" v-for="n in range(flat.notation)">
</template> <i class="fa fa-star" aria-hidden="true" :title="capitalize($t('status.followed'))"></i>
</template>
[{{ flat.id.split("@")[1] }}] {{ flat.title }} [{{ flat.id.split("@")[1] }}] {{ flat.title }}
<template v-if="flat.photos && flat.photos.length > 0"> <template v-if="flat.photos && flat.photos.length > 0">
<br/> <br/>
<img :src="flat.photos[0].url"/> <img :src="flat.photos[0].url"/>
</template> </template>
<template v-if="showNotes"> <template v-if="showNotes">
<br/> <br/>
<pre>{{ flat.notes }}</pre> <pre>{{ flat.notes }}</pre>
</template> </template>
</a>
</td> </td>
<td>{{ flat.area }} </td> <td>{{ flat.area }} </td>
<td> <td>
@ -169,10 +171,8 @@ export default {
this.sortBy = field this.sortBy = field
} }
}, },
showMore (event, flatId) { makeDetailsUrl(flatId) {
if (event.target.tagName === 'TD') { return `/#/flat/${flatId}`;
this.$router.push({ name: 'details', params: { id: flatId }})
}
}, },
capitalize: capitalize, capitalize: capitalize,
range: range range: range
@ -217,4 +217,11 @@ pre {
word-wrap: break-word; word-wrap: break-word;
word-break: break-all; word-break: break-all;
} }
.fill {
display: block;
width: 100%;
padding-left: 0;
padding-right: 0;
}
</style> </style>