Browse Source

Improve flat view

Gautier P 9 months ago
parent
commit
6862648d50
1 changed files with 31 additions and 27 deletions
  1. 31
    27
      flatisfy/web/js_src/components/flat.vue

+ 31
- 27
flatisfy/web/js_src/components/flat.vue View File

@@ -15,7 +15,7 @@
15 15
             </h2>
16 16
             <div class="grid">
17 17
                 <div class="left-panel">
18
-                    <p>
18
+                    <span>
19 19
                         {{ flat.cost | cost(flat.currency) }}
20 20
                         <template v-if="flat.utilities === 'included'">
21 21
                             {{ $t("flatsDetails.utilities_included") }}
@@ -23,13 +23,14 @@
23 23
                         <template v-else-if="flat.utilities === 'excluded'">
24 24
                             {{ $t("flatsDetails.utilities_excluded") }}
25 25
                         </template>
26
-                    </p>
26
+                    </span>
27
+                    <span v-if="flat.flatisfy_postal_code.postal_code">
28
+                        à {{ flat.flatisfy_postal_code.name }} ({{ flat.flatisfy_postal_code.postal_code }})
29
+                    </span>
27 30
                 </div>
28
-                <p class="right-panel right">
29
-                    {{ flat.area ? flat.area : '?' }} m<sup>2</sup>,
30
-                    {{ flat.rooms ? flat.rooms : '?' }} {{ $tc("flatsDetails.rooms", flat.rooms) }} /
31
-                    {{ flat.bedrooms ? flat.bedrooms : '?' }} {{ $tc("flatsDetails.bedrooms", flat.bedrooms) }}
32
-                </p>
31
+                <span class="right-panel right">
32
+                    <template v-if="flat.area"><span>{{flat.area}} m<sup>2</sup></span></template><template v-if="flat.rooms"><span>, {{flat.rooms}} {{ $tc("flatsDetails.rooms", flat.rooms) }}</span></template><template v-if="flat.bedrooms"><span>/ {{flat.bedrooms}} {{ $tc("flatsDetails.bedrooms", flat.bedrooms) }}</span></template>
33
+                </span>
33 34
             </div>
34 35
             <div>
35 36
                 <template v-if="flat.photos && flat.photos.length > 0">
@@ -116,26 +117,29 @@
116 117
         <div class="right-panel">
117 118
             <h3>{{ $t("flatsDetails.Contact") }}</h3>
118 119
             <div class="contact">
119
-                <p>
120
-                    <template v-if="flat.phone">
121
-                        <template v-for="phoneNumber in flat.phone.split(',')">
122
-                            <a :href="'tel:+33' + normalizePhoneNumber(phoneNumber)">{{ phoneNumber }}</a><br/>
123
-                        </template>
124
-                    </template>
125
-                    <template v-else>
126
-                        {{ $t("flatsDetails.no_phone_found") }}
127
-                    </template>
128
-                </p>
129
-                <p>{{ $tc("common.Original_post", flat.urls.length) }}
130
-                    <ul>
131
-                        <li v-for="(url, index) in flat.urls">
132
-                            <a :href="url" target="_blank">
133
-                                {{ $tc("common.Original_post", 1) }} {{ index + 1 }}
134
-                                <i class="fa fa-external-link" aria-hidden="true"></i>
135
-                            </a>
136
-                        </li>
137
-                    </ul>
138
-                </p>
120
+                <template v-if="flat.phone">
121
+                    <p v-for="phoneNumber in flat.phone.split(',')">
122
+                        <a :href="'tel:+33' + normalizePhoneNumber(phoneNumber)">{{ phoneNumber }}</a>
123
+                    </p>
124
+                </template>
125
+                <template v-if="flat.urls.length == 1">
126
+                    <a :href="flat.urls[0]" target="_blank">
127
+                        {{ $tc("common.Original_post", 1) }}
128
+                        <i class="fa fa-external-link" aria-hidden="true"></i>
129
+                    </a>
130
+                </template>
131
+                <template v-else-if="flat.urls.length > 1">
132
+                    <p>{{ $tc("common.Original_post", flat.urls.length) }}
133
+                        <ul>
134
+                            <li v-for="(url, index) in flat.urls">
135
+                                <a :href="url" target="_blank">
136
+                                    {{ $tc("common.Original_post", 1) }} {{ index + 1 }}
137
+                                    <i class="fa fa-external-link" aria-hidden="true"></i>
138
+                                </a>
139
+                            </li>
140
+                        </ul>
141
+                    </p>
142
+                </template>
139 143
             </div>
140 144
 
141 145
             <h3>{{ $t("flatsDetails.Visit") }}</h3>