Skip to content

Commit

Permalink
thead view- updated
Browse files Browse the repository at this point in the history
  • Loading branch information
Oshanath committed Mar 20, 2021
1 parent 884ebb9 commit 18871c3
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Controllers/threadController.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ module.exports.submitRequests_post = (req, res) => {
let user = await db.collections.users.findOne({_id: mongoose.Types.ObjectId(id)});
let message2;
if(bodyData.type == 'repeat' || bodyData.type == 'submission'){
message2 = (user.name + ' has a request regarding the module ' + bodyData.module);
message2 = ('Module: ' + bodyData.module);
}
else{
message2 = (user.name + ' requested the module ' + bodyData.module + ' to be changed to ' + bodyData.requiredModule);
message2 = ('Current Module: ' + bodyData.module + '\nRequired Module: ' + bodyData.requiredModule);
}
let messageId2 = database.addMessage({'from': id, 'text': message2});

Expand Down
16 changes: 16 additions & 0 deletions public/assets/css/styles_threadView.css
Original file line number Diff line number Diff line change
Expand Up @@ -556,6 +556,22 @@ footer{
color: #fff;
}

.msg-group .firstMessage{
margin: 5px;
padding: 5px;
height: fit-content;
width: 97%;
/* background: linear-gradient(to right, #2193b0, #202020); */
border-radius: 10px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3);
/* max-width: 100%; */
position: relative;
float: right;
text-align: right;
font-size: 1.2rem;
color: #111;
}

.msg-group a{
display: flex;
flex-direction: row;
Expand Down
4 changes: 4 additions & 0 deletions public/assets/javascript/threadView.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,6 +316,10 @@ let displayMessages = async (arr, msgId) => {
msgContainer.setAttribute('class', 'sender');
}

if(i == 0){
msgContainer.setAttribute('class', 'firstMessage');
}

msgGroup.appendChild(msgContainer);

// keep the scrollbar at the bottom when messages are displayed
Expand Down

0 comments on commit 18871c3

Please sign in to comment.