Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2021-049
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
2021-049
2021-049
Commits
5fdf3eef
Commit
5fdf3eef
authored
Nov 20, 2021
by
Hasitha Samarasekara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add class view popup and student request to class with db request
parent
7bc7617b
Changes
5
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
367 additions
and
13 deletions
+367
-13
BackEnd/WebBackEnd/models/ClassStudentRquestList.model.js
BackEnd/WebBackEnd/models/ClassStudentRquestList.model.js
+16
-0
BackEnd/WebBackEnd/routes/createClass.route.js
BackEnd/WebBackEnd/routes/createClass.route.js
+61
-0
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/AdvertisementTopSmall.js
...frontend/src/Components/HomePage/AdvertisementTopSmall.js
+6
-6
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
...oach-frontend/src/Components/HomePage/TutorProfileView.js
+281
-5
WebFrontEnd/smartcoach-frontend/src/Components/Navbar.js
WebFrontEnd/smartcoach-frontend/src/Components/Navbar.js
+3
-2
No files found.
BackEnd/WebBackEnd/models/ClassStudentRquestList.model.js
0 → 100644
View file @
5fdf3eef
const
mongoose
=
require
(
'
mongoose
'
);
const
Schema
=
mongoose
.
Schema
;
const
ClassStudentRequestSchema
=
new
Schema
({
class_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
Classes
'
},
student_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
student
'
},
tutor_id
:{
type
:
mongoose
.
Schema
.
Types
.
ObjectId
,
ref
:
'
tutor
'
},
},{
timestamps
:
true
,
});
const
ClassStudentRequestList
=
mongoose
.
model
(
'
ClassStudentRequestList
'
,
ClassStudentRequestSchema
);
module
.
exports
=
ClassStudentRequestList
;
\ No newline at end of file
BackEnd/WebBackEnd/routes/createClass.route.js
View file @
5fdf3eef
...
...
@@ -2,6 +2,7 @@ const router = require('express').Router();
let
classes
=
require
(
'
../models/createClass.model
'
);
let
student
=
require
(
'
../models/student.user.model
'
);
let
studentList
=
require
(
'
../models/ClassStudentList.model
'
);
let
studentRequestList
=
require
(
'
../models/ClassStudentRquestList.model
'
);
const
mongoose
=
require
(
"
mongoose
"
);
router
.
route
(
'
/add
'
).
post
(
async
(
req
,
res
)
=>
{
...
...
@@ -161,4 +162,64 @@ router.route('/studentList/:id').get(function (req, res) {
});
});
router
.
route
(
'
/studentRequestList/add
'
).
post
((
req
,
res
)
=>
{
const
class_id
=
req
.
body
.
_id
;
const
student_id
=
req
.
body
.
student_id
;
const
tutor_id
=
req
.
body
.
tutor_id
;
console
.
log
(
"
classID:
"
+
class_id
);
console
.
log
(
"
student_nic:
"
+
student_id
);
classes
.
findById
(
class_id
,
function
(
err
,
tutorsClass
){
if
(
!
tutorsClass
)
res
.
status
(
404
).
send
(
"
Sorry Class Could not Found.
"
);
else
{
student
.
find
({
"
_id
"
:
student_id
}).
then
(
student
=>
{
console
.
log
(
student
)
console
.
log
(
student
[
0
].
_id
)
if
(
student
[
0
].
student_nic
===
""
){
res
.
status
(
500
).
send
(
"
Sorry, This Student Not Registered
"
);
}
else
{
const
student_id
=
student
[
0
].
_id
;
const
newClassStudent
=
new
studentRequestList
({
class_id
,
student_id
,
tutor_id
});
studentRequestList
.
find
({
"
student_id
"
:
student_id
,
"
class_id
"
:
class_id
}).
then
(
reqClass
=>
{
console
.
log
(
"
reqClass :
"
)
console
.
log
(
reqClass
)
if
(
reqClass
.
length
>
0
){
res
.
status
(
501
).
send
(
"
Already Request to this Class
"
);
}
else
{
newClassStudent
.
save
().
then
(
result
=>
{
res
.
json
(
'
Student Requested is complete!
'
);
})
.
catch
(
err
=>
{
res
.
status
(
500
).
send
(
"
Update not possible
"
);
});
}
})
}
}).
catch
(
err
=>
res
.
status
(
500
).
json
(
'
Eroor:
'
+
err
));
}
});
});
module
.
exports
=
router
;
\ No newline at end of file
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/AdvertisementTopSmall.js
View file @
5fdf3eef
...
...
@@ -27,9 +27,9 @@ export default class AdvertisementTopSmall extends Component{
<
div
className
=
"
row
"
>
<
div
className
=
"
col
"
>
<
Carousel
style
=
{{
width
:
'
100%
'
,
height
:
'
100px
'
,
margin
Left
:
'
2
0px
'
}}
nextLabel
=
{
false
}
prevLabel
=
{
false
}
indicators
=
{
false
}
>
<
Carousel
style
=
{{
width
:
'
100%
'
,
height
:
'
100px
'
,
margin
:
'
1
0px
'
}}
nextLabel
=
{
false
}
prevLabel
=
{
false
}
indicators
=
{
false
}
>
<
Carousel
.
Item
>
<
img
<
img
style
=
{{
width
:
'
90%
'
}}
className
=
"
toast-bottom-full-width
"
src
=
{
AddR1
}
alt
=
"
First slide
"
...
...
@@ -39,7 +39,7 @@ export default class AdvertisementTopSmall extends Component{
<
/Carousel.Caption
>
<
/Carousel.Item
>
<
Carousel
.
Item
>
<
img
<
img
style
=
{{
width
:
'
90%
'
}}
className
=
"
d-block w-100
"
src
=
{
AddR1
}
alt
=
"
Second slide
"
...
...
@@ -64,9 +64,9 @@ export default class AdvertisementTopSmall extends Component{
<
/div
>
<
div
className
=
"
col
"
>
<
Carousel
style
=
{{
width
:
'
100%
'
,
height
:
'
100px
'
,
margin
Left
:
'
2
0px
'
}}
nextLabel
=
{
false
}
prevLabel
=
{
false
}
indicators
=
{
false
}
>
<
Carousel
style
=
{{
width
:
'
100%
'
,
height
:
'
100px
'
,
margin
:
'
1
0px
'
}}
nextLabel
=
{
false
}
prevLabel
=
{
false
}
indicators
=
{
false
}
>
<
Carousel
.
Item
>
<
img
<
img
style
=
{{
width
:
'
90%
'
}}
className
=
"
toast-bottom-full-width
"
src
=
{
AddR1
}
alt
=
"
First slide
"
...
...
@@ -76,7 +76,7 @@ export default class AdvertisementTopSmall extends Component{
<
/Carousel.Caption
>
<
/Carousel.Item
>
<
Carousel
.
Item
>
<
img
<
img
style
=
{{
width
:
'
90%
'
}}
className
=
"
d-block w-100
"
src
=
{
AddR1
}
alt
=
"
Second slide
"
...
...
WebFrontEnd/smartcoach-frontend/src/Components/HomePage/TutorProfileView.js
View file @
5fdf3eef
This diff is collapsed.
Click to expand it.
WebFrontEnd/smartcoach-frontend/src/Components/Navbar.js
View file @
5fdf3eef
...
...
@@ -65,8 +65,9 @@ export default class NavBar extends Component {
top
:
'
15px
'
,
right
:
'
120px
'
,
color
:
'
#EAE4E4
'
,
marginRight
:
'
50px
'
}}
><
h5
>
{
this
.
state
.
user_name
!==
null
?
<
span
style
=
{{
cursor
:
'
pointer
'
}}
onClick
=
{()
=>
{
window
.
location
.
replace
(
"
/studentDashboard
"
);}}
>
{
this
.
state
.
user_name
}
<
/span> : <label onClick={
()
=>
{
marginRight
:
'
50px
'
,
cursor
:
'
pointer
'
}}
><
h5
>
{
this
.
state
.
user_name
!==
null
?
<
span
style
=
{{
cursor
:
'
pointer
'
}}
onClick
=
{()
=>
{
window
.
location
.
replace
(
"
/studentDashboard
"
);}}
>
{
this
.
state
.
user_name
}
<
/span> : <label style={{cursor:'pointer'}} onClick={
()
=>
{
// window.location.replace("UserLogin");
window
.
location
=
'
/UserLogin
'
;
}}
>
Login
<
/label>} </
h5
><
/label
>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment