diff --git a/Controllers/threadController.js b/Controllers/threadController.js index ace70f7..2c74c6d 100644 --- a/Controllers/threadController.js +++ b/Controllers/threadController.js @@ -19,7 +19,7 @@ module.exports.submitRequests_post = (req, res) => { const token = req.cookies.jwt; - jwt.verify(token, 'esghsierhgoisio43jh5294utjgft*/*/4t*4et490wujt4*/w4t*/t4', (err, decodedToken) => { + jwt.verify(token, 'esghsierhgoisio43jh5294utjgft*/*/4t*4et490wujt4*/w4t*/t4', async (err, decodedToken) => { let id = decodedToken.id; @@ -50,7 +50,19 @@ module.exports.submitRequests_post = (req, res) => { messageObject['files'] = []; let messageId = database.addMessage(messageObject); - data['messageID_list'] = [messageId]; + + //create the main message for add/drop requests + let user = await db.collections.users.findOne({_id: mongoose.Types.ObjectId(id)}); + let message2; + if(bodyData.type == 'repeat' || bodyData.type == 'submission'){ + message2 = ('Module: ' + bodyData.module); + } + else{ + message2 = ('Current Module: ' + bodyData.module + '\nRequired Module: ' + bodyData.requiredModule); + } + let messageId2 = database.addMessage({'from': id, 'text': message2}); + + data['messageID_list'] = [messageId2, messageId]; database.addThread(data); res.redirect('/userProfile'); @@ -130,7 +142,6 @@ module.exports.getThreadData_post = (req, res) => { searchQuery['type'] = filter.type; let filterThreads = async (thread, filter) => { - console.log(filter); let string = filter.string.toLowerCase(); let searchWords = string.split(' '); diff --git a/profilePics/0d993272-2321-45fd-ad41-5990e1918b75-10cd73c02e713fc55986852f4a80d387 (1).png b/profilePics/0d993272-2321-45fd-ad41-5990e1918b75-10cd73c02e713fc55986852f4a80d387 (1).png new file mode 100644 index 0000000..1073faf Binary files /dev/null and b/profilePics/0d993272-2321-45fd-ad41-5990e1918b75-10cd73c02e713fc55986852f4a80d387 (1).png differ diff --git a/public/about.ejs b/public/about.ejs index f893618..4973485 100644 --- a/public/about.ejs +++ b/public/about.ejs @@ -5,6 +5,7 @@ + @@ -14,60 +15,65 @@ -
-

Team GTX

+
+
+ team_logo +
+

TEAM GTX

-
-

Second semester project for Engineering Skill Development : Student Request System

+
+
+

Second Semester Project: Student Request System

+
+ Contact Us: uom.studentrequestsystem@gmail.com

Team Members:

-
-
    -
  • - Oshanath Rajawasam +
    +
    +

    Oshanath Rajawasam (LOMCCA)

    +
      -
    • email
    • -
    • contact No.
    • +
    • email: oshanath.19@cse.mrt.ac.lk
    -
  • -
  • - Akash Tharuka +
+
+
+

Lasith Rajakarunaratne

+
    -
  • email
  • -
  • contact No.
  • +
  • email: lasith.19@cse.mrt.ac.lk
- -
  • - Kalana Rubasinghe +
  • +
    +
    +

    Kalana Rubasinghe

    +
      -
    • email
    • -
    • contact No.
    • +
    • email: kalana.19@cse.mrt.ac.lk
    - -
  • - Lasith Rajakaruna +
  • +
    +
    +

    Akash Tharuka

    +
      -
    • email
    • -
    • contact No.
    • +
    • email: akash.19@cse.mrt.ac.lk
    - -
  • - Samadhi Divyanjalee +
  • +
    +
    +

    Samadhi Divyanjali

    +
      -
    • email
    • -
    • contact No.
    • +
    • email: samadhi.19@cse.mrt.ac.lk
    - - -
    - -
    - Contact Us: uom.studentrequestsystem@gmail.com +
    +
    diff --git a/public/assets/css/contact.css b/public/assets/css/contact.css index 6a85865..41fa41a 100644 --- a/public/assets/css/contact.css +++ b/public/assets/css/contact.css @@ -9,118 +9,80 @@ body{ min-height: 100vh; margin: 0; font-family: 'Ubuntu', sans-serif; + background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.2)),url(../resources/unnamed.jpg); + background-size: cover; } -.container{ - background-color:rgba(255,255,255,0.5); - border-radius: 40px; - box-shadow: 0 2px 5px rgba(0, 0, 0, 0.3); - width: 35%; - max-width: 100%; - position: relative; -} - -.header{ - background-color: #70a9a1; - border-bottom: 1px solid #f0f0f0; - padding: 20px 40px; - border-radius: 20px; - text-align: center; - opacity:0.95; -} - -.header h2{ - margin: 0px; +h1{ + margin: 0; + margin-bottom: 20px; + padding: 0; + top: 0; + left: 0; + font-family: 'Ubuntu', sans-serif; + color: grey; } -.form{ - padding: 20px 40px; - opacity: 0.78; +.container{ + position: fixed; + top: 50%; + left: 50%; + transform: translate(-50%,-50%); + background: #fff; + width: 600px; + height: fit-content; + z-index: 6; + text-align:center; + padding: 20px; + box-sizing: border-box; + font-family: monospace; + border-radius: 10px; + align-self: center; + font-family: 'Ubuntu', sans-serif; + border: 1px solid lightgrey; + opacity: 0.7; } .form-control{ - margin-bottom: 4px; - padding: 14.5px; position: relative; - color: black; - font-size: 17px; + color: white; border-radius: 20px; - font-weight: bold; + margin-bottom: 8px; + padding-bottom: 20px; } +.form-control textarea, .form-control input{ - /*border: 2px solid #f0f0f0;*/ - border:none; - color: #373636; - font-weight: 520; - display: block; - font-size: 14.7px; - padding: 7px; - width: 100%; - outline: none; - background: transparent; - border-bottom: 2.3px solid black; - transition: all .3s; + border: 1px solid lightgrey; + border-radius: 6px; + display: block; + font-size: 14px; + padding: 10px; + width: 100%; + outline: none; + font-family: 'Ubuntu', sans-serif; } + .form-control input:-webkit-autofill { -webkit-background-clip: text; } + .form-control input:focus{ box-shadow: none; outline: none; border-color: #4E8975; } -.form-control select:focus{ - box-shadow: none; - outline: none; - - border-color:#4E8975; -} -.form-control input::placeholder{ - color: transparent; -} - -.form-control .form-label{ - position: absolute; - transform: translateY(-1.6em); - transform-origin: 0 0; - transition: all .3s; -} - -.form-control input:focus + .form-label, -.form-control input:not(:placeholder-shown) + .form-label, -.form-control input:-webkit-autofill + .form-label{ - transform: translateY(-2.9em) scale(0.8); -} #fileItem{ border-bottom: none; } -.form-control select{ - background-color: transparent; - border-bottom: 2px solid black; - transition: all .3s; -} - -.form-control input[name="gender"], input[name="type"]{ - display: inline-block; - width: 20px; -} - -.form-control.success input{ - border-color: #2ecc71; -} - -.form-control.error input{ - border-color: #e74c3c; -} - .form-control i{ position: absolute; - bottom: 30px; - right: 5px; + bottom: 0; + left: 0; visibility: hidden; + z-index: 5; } .form-control.success i.fa-check-circle{ @@ -137,13 +99,6 @@ body{ color: #e74c3c; } -.form-control i.far{ - z-index: 10; - color: black; - cursor: pointer; - visibility: visible; -} - .form-control small{ visibility: hidden; position: absolute; @@ -156,9 +111,7 @@ body{ visibility: visible; } - - -.button.signUp{ +.button.contact{ border: none; border-radius: 10px; display: block; @@ -174,69 +127,14 @@ body{ position: relative; } -.button.signUp:hover{ +.button.contact:hover{ background-color: #40798c; } -.button.signUp:active{ +.button.contact:active{ background-color: #2d4642 ; } .buttonText{ transition: all 0.2s; -} - -.main-body{ - background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.2)),url(../resources/pexels-min-an-1353938.jpg); - background-size: cover; - width: 100%; - height: 100%; -} - -.faculty,.question{ - border-style: none; - border-collapse: collapse; - outline: none; - font-size: 14px; - color: #666666; - - padding: 10px; - width: 100% -} - -h1{ - text-align: center; - color:black; -} -@media only screen and (max-width: 1100px){ - .container{ - width:55%; - border-radius: 35px; - - } - .form{ - padding: 20px 30px; - } -} - -@media only screen and (max-width: 780px){ - .container{ - width:70%; - border-radius: 35px; - - } - .form{ - padding: 20px 30px; - } -} - -@media only screen and (max-width: 450px){ - - .container{ - width:90%; - border-radius: 30px; - } - .form{ - padding: 10px 20px; - } } \ No newline at end of file diff --git a/public/assets/css/forgotPassword_styles.css b/public/assets/css/forgotPassword_styles.css index abc5f38..72ce642 100644 --- a/public/assets/css/forgotPassword_styles.css +++ b/public/assets/css/forgotPassword_styles.css @@ -100,10 +100,11 @@ body{ } .form-control input:focus + .form-label, -.form-control input:not(:placeholder-shown) + .form-label{ +.form-control input:not(:placeholder-shown) + .form-label, +.form-control input:-webkit-autofill + .form-label{ transform: translateY(-2.9em) scale(0.8); - } + .form-control.success input{ border-color: #2ecc71; } diff --git a/public/assets/css/styles_aboutUs.css b/public/assets/css/styles_aboutUs.css new file mode 100644 index 0000000..b08f48c --- /dev/null +++ b/public/assets/css/styles_aboutUs.css @@ -0,0 +1,39 @@ +body{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + min-height: 100vh; + margin: 0; + font-family: 'Ubuntu', sans-serif; + background-image: linear-gradient(rgba(0,0,0,0.5),rgba(0,0,0,0.2)),url(../resources/website-design-background.png); + background-size: cover; + color: lightgrey; +} + +.projectHeaderContainer{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; + color: grey; +} +.projectHeaderContainer span{ + font-weight: 900; +} + +.image-container img{ + height: 100px; + width: 100px; + border-radius: 50%; + padding: 0; + margin: 10px; +} + +.header, +.projectHeader{ + color: grey; + pointer-events: none; + position: relative; + display: flex; +} \ No newline at end of file diff --git a/public/assets/css/styles_popup.css b/public/assets/css/styles_popup.css index b9c5771..4bc9f74 100644 --- a/public/assets/css/styles_popup.css +++ b/public/assets/css/styles_popup.css @@ -55,10 +55,6 @@ body::-webkit-scrollbar-thumb { font-family: 'Ubuntu', sans-serif; } -/* .popup-window .divider{ - border-right: 1px solid lightgrey; -} */ - .popup-window .content { position: fixed; top: 50%; diff --git a/public/assets/css/styles_threadView.css b/public/assets/css/styles_threadView.css index 82a19f9..8afb6f9 100644 --- a/public/assets/css/styles_threadView.css +++ b/public/assets/css/styles_threadView.css @@ -561,6 +561,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; diff --git a/public/assets/javascript/formController.js b/public/assets/javascript/formController.js index 77c051c..b83904b 100644 --- a/public/assets/javascript/formController.js +++ b/public/assets/javascript/formController.js @@ -581,6 +581,9 @@ let validateContactEmail = async (emailInput) => { else if (! await (isEmail(emailValue))){ emailState = 'notAnEmail' } + else{ + emailState = 'success'; + } //calling setError and setSuccess according to email state if (emailState === 'blank'){ @@ -603,12 +606,19 @@ function addPinSubmit(formControlBtn){ formControl.setAttribute('class', 'form-control'); // add pincode input field let pinInput = document.createElement('input'); + let pinLabel = document.createElement('label'); pinInput.setAttribute('class', 'pinCode forgotPassword'); pinInput.setAttribute('type', 'text'); pinInput.setAttribute('name', 'pin'); pinInput.setAttribute('placeholder', 'Enter your pin'); + pinInput.setAttribute('id', 'pinInput'); + + pinLabel.setAttribute('class', 'form-label'); + pinLabel.setAttribute('for', 'pinInput'); + pinLabel.innerText = 'Pin Code:'; formControl.appendChild(pinInput); + formControl.appendChild(pinLabel); let successIcon = document.createElement('i'); successIcon.setAttribute('class', 'fa fa-check-circle'); @@ -865,6 +875,7 @@ const finalize = async (page, nonEmpty, normal, selected, existingPsw, newPsw, e }); resData = await response.json(); + window.alert("Your issue has been reported to administration"); window.location.href = '/login'; } diff --git a/public/assets/javascript/threadView.js b/public/assets/javascript/threadView.js index 5c1cd4b..bfda35b 100644 --- a/public/assets/javascript/threadView.js +++ b/public/assets/javascript/threadView.js @@ -152,7 +152,16 @@ let createThreadElement = async (thread) => { divType.setAttribute('class', 'type'); let smallType = document.createElement('small'); - smallType.innerText = thread.type; + //set thread type + if(thread.type == 'addDrop'){ + smallType.innerText = 'Add/Drop request'; + } + else if(thread.type == 'submission'){ + smallType.innerText = 'Deadline extenstion request'; + } + else if(thread.type == 'repeat'){ + smallType.innerText = 'Exam repeat request'; + } let iconAccepted = document.createElement('span'); iconAccepted.setAttribute('class', 'material-icons accepted'); @@ -307,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 diff --git a/public/contact.ejs b/public/contact.ejs index 530e45a..17f5d07 100644 --- a/public/contact.ejs +++ b/public/contact.ejs @@ -10,24 +10,21 @@
    -
    -

    Contact us

    -
    + +

    Contact us

    - - + - Error message + Error message
    - - + - Error message + Error message
    diff --git a/public/forgotPassword.ejs b/public/forgotPassword.ejs index d740bb0..75761ae 100644 --- a/public/forgotPassword.ejs +++ b/public/forgotPassword.ejs @@ -26,7 +26,7 @@
    - + Error message diff --git a/public/resources/contact-us.jpg b/public/resources/contact-us.jpg new file mode 100644 index 0000000..202fc5b Binary files /dev/null and b/public/resources/contact-us.jpg differ diff --git a/public/resources/gtx.jpg b/public/resources/gtx.jpg new file mode 100644 index 0000000..244d6b2 Binary files /dev/null and b/public/resources/gtx.jpg differ diff --git a/public/resources/unnamed.jpg b/public/resources/unnamed.jpg new file mode 100644 index 0000000..70281f8 Binary files /dev/null and b/public/resources/unnamed.jpg differ diff --git a/public/resources/website-design-background.png b/public/resources/website-design-background.png new file mode 100644 index 0000000..c3d49f5 Binary files /dev/null and b/public/resources/website-design-background.png differ diff --git a/public/userProfile.ejs b/public/userProfile.ejs index c43d206..c51e296 100644 --- a/public/userProfile.ejs +++ b/public/userProfile.ejs @@ -108,7 +108,7 @@

    Second thoughts on a module?

    diff --git a/uploads/299bd8b9-9e3e-4323-aa9f-8c1231bb12f7-10cd73c02e713fc55986852f4a80d387.jpg b/uploads/299bd8b9-9e3e-4323-aa9f-8c1231bb12f7-10cd73c02e713fc55986852f4a80d387.jpg new file mode 100644 index 0000000..8631989 Binary files /dev/null and b/uploads/299bd8b9-9e3e-4323-aa9f-8c1231bb12f7-10cd73c02e713fc55986852f4a80d387.jpg differ diff --git a/uploads/beedc8d5-eb0a-43e3-89fe-2f99b36ae9d4-10cd73c02e713fc55986852f4a80d387 (1).png b/uploads/beedc8d5-eb0a-43e3-89fe-2f99b36ae9d4-10cd73c02e713fc55986852f4a80d387 (1).png new file mode 100644 index 0000000..1073faf Binary files /dev/null and b/uploads/beedc8d5-eb0a-43e3-89fe-2f99b36ae9d4-10cd73c02e713fc55986852f4a80d387 (1).png differ