Skip to content

Commit a059a8d

Browse files
committed
added number badges and download dialog
1 parent 36e7bec commit a059a8d

File tree

1 file changed

+33
-6
lines changed

1 file changed

+33
-6
lines changed

hackcafe-vue/src/components/MainPage.vue

Lines changed: 33 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,28 @@
4949
</v-card>
5050
</v-dialog>
5151

52+
<v-dialog
53+
v-model="downloadDialog"
54+
persistent
55+
width="400px">
56+
<v-card
57+
color="primary"
58+
dark>
59+
<v-card-text class="title font-weight-light pa-3">Your download is ready!</v-card-text>
60+
<v-divider></v-divider>
61+
<v-card-text class="subheading font-weight-bold">Download your package <a class="blue--text lighten-1" href="https://www.google.com/" target="_blank">here</a>.</v-card-text>
62+
63+
<v-card-actions>
64+
<v-spacer></v-spacer>
65+
<v-btn
66+
color="blue"
67+
@click="downloadDialog = false">
68+
OK
69+
</v-btn>
70+
</v-card-actions>
71+
</v-card>
72+
</v-dialog>
73+
5274
<v-dialog
5375
v-model="receiptDialog"
5476
width="500px">
@@ -76,8 +98,8 @@
7698
</v-card-actions>
7799
</v-list>
78100
<v-card v-else>
79-
<v-card-title class="headline" primary-title>Alert</v-card-title>
80-
<v-card-text>You need to select some hacks first!</v-card-text>
101+
<v-card-title class="headline" primary-title>Heads up!</v-card-title>
102+
<v-card-text class="title font-weight-light">You need to select some hacks first!</v-card-text>
81103

82104
<v-divider></v-divider>
83105

@@ -106,7 +128,12 @@
106128
:key="category.id"
107129
:value="category.id">
108130
<span class="font-weight-light">{{ category.name }}</span>
109-
<history-icon>history</history-icon>
131+
<v-badge color="indigo">
132+
<template v-slot:badge>
133+
<span>{{ hacks.filter(hack => hack.category == category.id && hack.enabled).length }}</span>
134+
</template>
135+
<history-icon>history</history-icon>
136+
</v-badge>
110137
</v-btn>
111138

112139
</v-bottom-nav>
@@ -147,11 +174,11 @@ export default {
147174
hacks: [],
148175
loadingDialog: false,
149176
receiptDialog: false,
177+
downloadDialog: false,
150178
}),
151179
methods: {
152180
showReceipt: function(event) {
153-
// if (this.selectedHacks.length > 0)
154-
this.receiptDialog = true;
181+
this.receiptDialog = true;
155182
},
156183
sendTicket: function(event) {
157184
this.loadingDialog = true;
@@ -160,9 +187,9 @@ export default {
160187
HTTP
161188
.post('request-package', this.selectedHacks)
162189
.then(res => {
163-
console.log(res.data);
164190
setTimeout(() => {
165191
this.loadingDialog = false;
192+
this.downloadDialog = true;
166193
}, 4000);
167194
});
168195
},

0 commit comments

Comments
 (0)