Skip to content

Commit 86a0da8

Browse files
committed
Add logo and enable buttons on feedback cards
1 parent 5a863f1 commit 86a0da8

File tree

3 files changed

+59
-23
lines changed

3 files changed

+59
-23
lines changed

assets/logo_white.png

35.4 KB
Loading

css/db.css

Lines changed: 17 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ html, body {
1818
left: 0;
1919
right: 0;
2020
height: 75px;
21-
background-color: #8395a7;
21+
background-color: #566879;
2222
display: flex;
2323
flex-direction: row;
2424
justify-content: space-between;
@@ -27,17 +27,21 @@ html, body {
2727
}
2828

2929
#header #logo {
30+
width: 150px;
3031
margin: auto 20px;
3132
}
3233

34+
#header #logo img {
35+
height: 45px;
36+
}
37+
3338
#header #logo #logo-text {
3439
width: 75px;
3540
font-weight: bold;
3641
text-align: center;
37-
color: #feca57;
42+
color: whitesmoke;
3843
font-size: 22px;
39-
padding: 5px 0;
40-
border-bottom: 5px solid white;
44+
margin: auto 0;
4145
}
4246

4347
#header #cur-user {
@@ -59,7 +63,7 @@ html, body {
5963
margin: auto 0;
6064
font-weight: bold;
6165
cursor: pointer;
62-
color: lightgreen;
66+
color: white;
6367
}
6468

6569
#header #cur-user #cur-username {
@@ -79,8 +83,8 @@ html, body {
7983
background-color: white;
8084
display: flex;
8185
flex-direction: row;
82-
justify-content: flex-start;
83-
overflow-y: scroll;
86+
justify-content: left;
87+
flex-wrap: wrap;
8488
}
8589

8690
.fb-card {
@@ -96,9 +100,9 @@ html, body {
96100
}
97101

98102
.fb-card:hover {
99-
transform: scale(1.01);
103+
box-shadow: 2px 2px 10px rgba(0, 0, 0, 0.1);
100104
cursor: pointer;
101-
transition: 0.5s;
105+
transition: 0.75s;
102106
}
103107

104108
.fb-card .fb-details {
@@ -141,13 +145,13 @@ html, body {
141145
color: #1dd1a1;
142146
}
143147

144-
.fb-card .fb-options .fb-delete {
148+
.fb-card .fb-options .fb-archive {
145149
border: 2px solid #ee5253;
146150
color: #ee5253;
147151
}
148152

149153
.fb-card .fb-options button:hover {
150-
opacity: 0.5;
154+
opacity: 0.4;
151155
transition: 0.3s;
152156
}
153157

@@ -232,7 +236,7 @@ html, body {
232236
margin-bottom: 5px;
233237
}
234238

235-
/* ---------------------------------------------------------------------------------------- */
239+
/* ----------------------------------------------------------------------------------------
236240
237241
#sidebar {
238242
position: absolute;
@@ -242,4 +246,4 @@ html, body {
242246
width: 300px;
243247
background-color: antiquewhite;
244248
z-index: 1000;
245-
}
249+
} */

dashboard.html

Lines changed: 42 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
<body>
1717
<div id="header">
1818
<div id="logo">
19-
<p id="logo-text">mcf.db</p>
19+
<img src="assets/logo_white.png">
20+
<!-- <p id="logo-text">mcf.db</p> -->
2021
</div>
2122

2223
<div id="cur-user">
@@ -147,15 +148,44 @@
147148
var cardOptions = document.createElement('div')
148149
cardOptions.classList += 'fb-options'
149150

150-
var doneBtn = document.createElement('button')
151-
doneBtn.classList += 'fb-done'
152-
doneBtn.innerHTML = "Mark as done"
151+
var assignBtn = document.createElement('button')
152+
assignBtn.classList += 'fb-done'
153+
assignBtn.innerHTML = "Assign"
154+
155+
assignBtn.addEventListener('click', () => {
156+
console.log("Assign to ...")
157+
var body = "Hey!\n\nWe recently received this message via our feedback channel:\n\n"
158+
+ `\"${this.logs['msg']}\"` + "\n\nWe believe you're the best person to handle this.\n\nBest regards!"
159+
160+
var title = "Re: Assignment of ComClub Feedback"
161+
162+
let email = window.prompt('Enter a destination email within NUS Computing Club: ')
163+
164+
if (email.length > 0 && email.includes("@")) {
165+
window.open(`mailto:${email}?subject=${title}&body=${encodeURIComponent(body)}`)
166+
} else {
167+
window.alert("You have provided an invalid email. Please try again!")
168+
}
169+
})
153170

154171
var archiveBtn = document.createElement('button')
155-
archiveBtn.classList += 'fb-delete'
172+
archiveBtn.classList += 'fb-archive'
156173
archiveBtn.innerHTML = "Archive"
157174

158-
cardOptions.appendChild(doneBtn)
175+
archiveBtn.addEventListener('click', () => {
176+
console.log("Archiving " + this.logs['msg'])
177+
178+
const feedbackRef = ref(database, `/24MC/feedback/${this.logs['fid']}/`)
179+
var updatedLogs = this.logs
180+
updatedLogs['status'] = 'archived'
181+
182+
console.log(updatedLogs)
183+
set(feedbackRef, updatedLogs).then(() => {
184+
window.alert(`Feedback ${updatedLogs['fid']} has been archived!!`)
185+
})
186+
})
187+
188+
cardOptions.appendChild(assignBtn)
159189
cardOptions.appendChild(archiveBtn)
160190

161191
/**
@@ -167,8 +197,8 @@
167197
* div.fb-topic
168198
* span.fb-topic-cat
169199
* div.fb-options
170-
* btn.fb-done
171-
* btn.fb-archive
200+
* btn.fb-archive
201+
* btn.fb-assign
172202
*/
173203

174204

@@ -191,8 +221,10 @@
191221
const logs = Object.values(data)
192222

193223
logs.forEach(child => {
194-
var card = new Card(child)
195-
card.addCard()
224+
if (child['status'] === 'active') {
225+
var card = new Card(child)
226+
card.addCard()
227+
}
196228
})
197229
})
198230
}

0 commit comments

Comments
 (0)