Browse Source

Use simple anchors for flat details;

merge-requests/8/head
Benjamin Bouvier 5 years ago committed by Phyks (Lucas Verney)
parent
commit
aac6b63e0a
  1. 47
      flatisfy/web/js_src/components/flatstable.vue

47
flatisfy/web/js_src/components/flatstable.vue

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

Loading…
Cancel
Save