Skip to content

Commit 7f927bb

Browse files
committed
feat(ec-home): add useful links on head free space
1 parent beaae40 commit 7f927bb

File tree

2 files changed

+72
-20
lines changed

2 files changed

+72
-20
lines changed

src/components/EcHome.vue

Lines changed: 56 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,23 @@
2626
</p>
2727

2828
<slide-y-up-transition>
29-
<img
30-
v-if="store.logo"
31-
:src="store.logo.url"
32-
alt="Logo"
33-
class="mt-4 mb-3 mb-xl-0 img-fluid"
34-
style="max-height: 60px"
35-
>
29+
<div class="d-flex align-items-center mt-4 mb-3 mb-xl-0">
30+
<img
31+
v-if="store.logo"
32+
:src="store.logo.url"
33+
alt="Logo"
34+
class="img-fluid"
35+
style="max-height: 60px"
36+
>
37+
<a
38+
class="text-secondary ml-3"
39+
href="#"
40+
@click.prevent="uploadLogo"
41+
:title="i19uploadLogo"
42+
>
43+
<i class="ti-pencil"></i>
44+
</a>
45+
</div>
3646
</slide-y-up-transition>
3747
</div>
3848

@@ -49,42 +59,45 @@
4959
{{ store.financial_email }}
5060
</a>
5161

52-
<template v-if="store.domain">
62+
<span
63+
v-if="store.domain"
64+
class="d-inline-block"
65+
>
5366
·
5467
<a
5568
:href="`https://${store.domain}`"
5669
target="_blank"
57-
class="d-inline-block fw-500"
70+
class="fw-500"
5871
>
5972
{{ store.domain }}
6073
</a>
6174
<a
62-
class="text-secondary ml-2"
75+
class="text-secondary ml-1"
6376
href="#"
6477
@click.prevent="isEditingDomain = !isEditingDomain"
6578
:title="i19setStoreDomain"
6679
>
6780
<i class="ti-pencil"></i>
6881
</a>
69-
</template>
82+
</span>
7083
</div>
7184

7285
<slide-y-up-transition>
7386
<div v-if="store.domain">
7487
<a
7588
target="_blank"
7689
:href="`https://${store.domain}/admin/`"
77-
class="btn btn-sm btn-primary mr-3 mt-2"
90+
class="btn btn-primary mr-3 mt-2"
7891
>
7992
<i class="ti-paint-roller"></i>
80-
<span class="ml-1 d-sm-none d-md-inline">
93+
<span class="ml-1 d-none d-md-inline">
8194
{{ i19editStorefront }}
8295
</span>
8396
</a>
8497
<a
8598
target="_blank"
8699
:href="shopLink"
87-
class="btn btn-sm btn-primary mt-2"
100+
class="btn btn-primary mt-2"
88101
>
89102
<i class="ti-shopping-cart"></i>
90103
<span class="ml-1 d-none d-md-inline">
@@ -129,9 +142,33 @@
129142
</slide-y-up-transition>
130143
</div>
131144
</div>
145+
146+
<div class="d-none d-lg-block mt-4">
147+
<a
148+
href="/#/settings"
149+
class="btn btn-sm btn-outline-secondary mr-3 mt-2"
150+
>
151+
<i class="fa fa-cogs mr-1"></i>
152+
{{ i19settings }}
153+
</a>
154+
<a
155+
href="/#/resources/products/new"
156+
class="d-none d-xl-inline-block btn btn-sm btn-outline-secondary mr-3 mt-2"
157+
>
158+
<i class="fa fa-tag mr-1"></i>
159+
{{ i19registerProduct }}
160+
</a>
161+
<a
162+
href="/#/apps"
163+
class="btn btn-sm btn-outline-secondary mt-2"
164+
>
165+
<i class="fa fa-puzzle-piece mr-1"></i>
166+
{{ i19apps }}
167+
</a>
168+
</div>
132169
</div>
133170

134-
<div class="col-sm mt-5 mt-sm-0 text-right">
171+
<div class="col-sm col-md-auto col-xl-5 mt-5 mt-sm-0 text-right">
135172
<div class="mb-3">
136173
<ec-dates-picker
137174
v-if="!isLoading"
@@ -162,7 +199,9 @@
162199
{{ ordersMetrics.countCreated }}
163200
</strong>
164201
<span class="ml-2 text-uppercase lh-1">
165-
{{ i19newOrders }}
202+
<a href="/#/resources/orders">
203+
{{ i19newOrders }}
204+
</a>
166205
<template v-if="countOrdersDiff !== null">
167206
<br>
168207
<span
@@ -206,7 +245,7 @@
206245
<div class="row justify-content-end">
207246
<div
208247
v-for="({ label, value, diffValue, diffPercent }) in amountMetrics"
209-
class="col-md-auto mt-3"
248+
class="col-lg-auto mt-3"
210249
>
211250
<template v-if="value">
212251
<em class="fw-200">

src/components/js/EcHome.js

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
i19apps,
23
i19attention,
34
i19comparedPreviousPeriodMsg,
45
i19domain,
@@ -10,9 +11,12 @@ import {
1011
i19paymentConfirmed,
1112
i19share,
1213
i19pressEnterToSave,
14+
// i19registerProduct,
1315
i19setDomainMsg,
1416
i19setStoreDomain
15-
// i19totalAmount
17+
// i19settings,
18+
// i19totalAmount,
19+
// i19uploadLogo
1620
} from '@ecomplus/i18n'
1721

1822
import { i18n, formatMoney } from '@ecomplus/utils'
@@ -82,6 +86,7 @@ export default {
8286
},
8387

8488
computed: {
89+
i19apps: () => i18n(i19apps),
8590
i19attention: () => i18n(i19attention),
8691
i19comparedPreviousPeriodMsg: () => i18n(i19comparedPreviousPeriodMsg),
8792
i19domain: () => i18n(i19domain),
@@ -91,9 +96,12 @@ export default {
9196
i19newOrders: () => i18n(i19newOrders),
9297
i19noNewOrdersMsg: () => i18n(i19noNewOrdersMsg),
9398
i19pressEnterToSave: () => i18n(i19pressEnterToSave),
99+
i19registerProduct: () => 'Cadastrar produto',
94100
i19setDomainMsg: () => i18n(i19setDomainMsg),
95101
i19setStoreDomain: () => i18n(i19setStoreDomain),
96102
i19share: () => i18n(i19share),
103+
i19settings: () => 'Configurações',
104+
i19uploadLogo: () => 'Carregar logo',
97105

98106
isMobile: () => {
99107
const { userAgent } = navigator
@@ -220,10 +228,15 @@ export default {
220228
}
221229
},
222230

223-
setLogo () {
231+
uploadLogo () {
224232
uploadPictures()
225233
.then(pictures => {
226-
234+
if (pictures.length) {
235+
const logo = pictures[0].zoom
236+
this.updateStore({ logo }).then(() => {
237+
this.store.logo = logo
238+
})
239+
}
227240
})
228241
.catch(console.error)
229242
},

0 commit comments

Comments
 (0)