|
|
@@ -2,7 +2,10 @@ |
|
|
|
<div class="panel"> |
|
|
|
|
|
|
|
<template v-if="user"> |
|
|
|
<side-bar v-if="user" :role="user && user.status" :active="active"> |
|
|
|
<side-bar v-if="user" |
|
|
|
:role="user && user.status" |
|
|
|
:avatar="user.avatar" |
|
|
|
:active="active"> |
|
|
|
</side-bar> |
|
|
|
|
|
|
|
<div v-if="loading" class="page loading"> |
|
|
@@ -24,6 +27,7 @@ v-else-if="active == 3" |
|
|
|
:token="token" |
|
|
|
@addFeeTemp="(f) => fees.push(f)" |
|
|
|
@removeFeeTemp="(fee) => fees = fees.filter(f => f.id != fee.id)" |
|
|
|
@preview="previewEstimate" |
|
|
|
/> |
|
|
|
|
|
|
|
<settings |
|
|
@@ -32,13 +36,21 @@ v-else-if="active == 3" |
|
|
|
@updateAvatar="updateAvatar" |
|
|
|
@updateLetterhead="updateLetterhead" |
|
|
|
v-else-if="active == 4" /> |
|
|
|
|
|
|
|
<sign-out :user="user" v-else-if="active == 5" /> |
|
|
|
|
|
|
|
</template> |
|
|
|
|
|
|
|
<template v-if="!user && active == 6"> |
|
|
|
<login @login="start" /> |
|
|
|
</template> |
|
|
|
|
|
|
|
<estimate-test |
|
|
|
v-else-if="active == 7" |
|
|
|
:token="token" |
|
|
|
:estimate="preview" |
|
|
|
/> |
|
|
|
|
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@@ -48,6 +60,7 @@ import Spinner from "./spinner.vue" |
|
|
|
import Home from "./home.vue" |
|
|
|
import NewEstimate from "./new/new.vue" |
|
|
|
import Estimates from "./estimates.vue" |
|
|
|
import EstimateTest from "./estimate-test.vue" |
|
|
|
import Settings from "./settings.vue" |
|
|
|
import SignOut from "./sign-out.vue" |
|
|
|
import Login from "./login.vue" |
|
|
@@ -191,6 +204,8 @@ function active() { |
|
|
|
return 5 |
|
|
|
} else if (/^#login\/?/.exec(this.hash)) { |
|
|
|
return 6 |
|
|
|
} else if (/^#estimate\/?/.exec(this.hash)) { |
|
|
|
return 7 |
|
|
|
} else { |
|
|
|
return 0 |
|
|
|
} |
|
|
@@ -218,12 +233,18 @@ function start() { |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
function previewEstimate(estimate) { |
|
|
|
this.preview = estimate |
|
|
|
window.location.hash = 'estimate' |
|
|
|
} |
|
|
|
|
|
|
|
export default { |
|
|
|
components: { |
|
|
|
SideBar, |
|
|
|
Spinner, |
|
|
|
Home, |
|
|
|
NewEstimate, |
|
|
|
EstimateTest, |
|
|
|
Estimates, |
|
|
|
Settings, |
|
|
|
SignOut, |
|
|
@@ -240,6 +261,7 @@ export default { |
|
|
|
getAvatar, |
|
|
|
updateLetterhead, |
|
|
|
getLetterhead, |
|
|
|
previewEstimate, |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
@@ -249,6 +271,7 @@ export default { |
|
|
|
fees: [], |
|
|
|
loadingError: "", |
|
|
|
token: '', |
|
|
|
preview: null, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|