Commit 90d14588 authored by Hasitha Samarasekara's avatar Hasitha Samarasekara

Merge branch 'IT18063288' into 'master'

It18063288

See merge request !12
parents 13565272 bed0e292
...@@ -94,7 +94,7 @@ router.route('/add').post(async(req,res) =>{ ...@@ -94,7 +94,7 @@ router.route('/add').post(async(req,res) =>{
router.route('/tutorClass/:id').get(function (req, res) { router.route('/tutorClass/:id').get(function (req, res) {
let id = req.params.id; let id = req.params.id;
//console.log("TutorId : " + id) //console.log("TutorId : " + id)
classes.find({"tutor_id": id}).populate('institute_id').then(tutorsClasses => { classes.find({"tutor_id": id,"isActiveForStudent": true}).populate('institute_id').then(tutorsClasses => {
///console.log(tutor); ///console.log(tutor);
res.json(tutorsClasses); res.json(tutorsClasses);
}).catch(err => res.status(400).json('Eroor: '+ err)); }).catch(err => res.status(400).json('Eroor: '+ err));
......
...@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{ ...@@ -85,36 +85,36 @@ router.route('/add').post(async(req,res) =>{
.then(newUser =>{ .then(newUser =>{
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
// const content = ` const content = `
// Hi ${institute_name},\n Hi ${institute_name},\n
// You are Create a Institute Account on SmartCoach.\n You are Create a Institute Account on SmartCoach.\n
// You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}' You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
// Used institute email address as the username : ${user_email} Used institute email address as the username : ${user_email}
// Used given password as the password Used given password as the password
// Thank You, Thank You,
// Team SmartCoach Team SmartCoach
// `; `;
//
// var mail = { var mail = {
// from: institute_name, from: institute_name,
// to: user_email, to: user_email,
// subject: 'Email Verification - Institute', subject: 'Email Verification - Institute',
// text: content text: content
// } }
//
// transporter.sendMail(mail, (err, data) => { transporter.sendMail(mail, (err, data) => {
// if (err) { if (err) {
// res.json({ res.json({
// msg: 'fail' msg: 'fail'
// }) })
// } else { } else {
// res.json({ res.json({
// msg: 'success' msg: 'success'
// }) })
// } }
// }) })
// ; ;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
}) })
......
...@@ -133,41 +133,41 @@ router.route('/add').post(async(req,res) =>{ ...@@ -133,41 +133,41 @@ router.route('/add').post(async(req,res) =>{
.then(newUser =>{ .then(newUser =>{
console.log("Inside the Email Send part") console.log("Inside the Email Send part")
//////////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////////
// const content = ` const content = `
// Hi ${tutor_name},\n Hi ${tutor_name},\n
// You are Create a Tutor Account on SmartCoach.\n You are Create a Tutor Account on SmartCoach.\n
// You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}' You can verify your email address click on 'http://localhost:3000/AccountVerified/${newUser.id}'
//
// Used your email address as username : ${user_email} Used your email address as username : ${user_email}
// Thank You, Thank You,
// Team SmartCoach Team SmartCoach
// `; `;
//
// var mail = { var mail = {
// from: tutor_name, from: tutor_name,
// to: user_email, to: user_email,
// subject: 'Email Verification - Tutor', subject: 'Email Verification - Tutor',
// text: content text: content
// } }
//
// transporter.sendMail(mail, (err, data) => { transporter.sendMail(mail, (err, data) => {
// if (err) { if (err) {
// res.json({ res.json({
// msg: 'fail' msg: 'fail'
// }) })
// } else { } else {
// res.json({ res.json({
// msg: 'success' msg: 'success'
// }) })
// } }
// }) })
// ; ;
///////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////
}) })
.catch(err =>res.status(400).json('Error: '+err)); .catch(err =>res.status(400).json('Error: '+err));
// res.json('Tutor Successfully Added....'); res.json('Tutor Successfully Added....');
......
...@@ -29,4 +29,14 @@ router.route('/add').post(async(req,res) =>{ ...@@ -29,4 +29,14 @@ router.route('/add').post(async(req,res) =>{
}); });
router.route('/:id').get(function (req, res) {
let id = req.params.id;
//console.log("TutorId : " + id)
tutorRatingsRoute.find({"tutor_id": id}).populate('student_id').then(tutorReview => {
///console.log(tutor);
res.json(tutorReview);
}).catch(err => res.status(400).json('Eroor: '+ err));
});
module.exports = router; module.exports = router;
...@@ -307,9 +307,12 @@ export default class StudentRequestForClass extends Component{ ...@@ -307,9 +307,12 @@ export default class StudentRequestForClass extends Component{
<div className="" style={{marginTop:'15px'}}> <div className="" style={{marginTop:'15px'}}>
<div className="table-dark row"> <div className="table-dark row">
<div className="col-md-4" style={{textAlign:'left', paddingLeft:'30px'}}> <div className="col" style={{textAlign:'left', paddingLeft:'30px'}}>
<label>Batch Name</label> <label>Batch Name</label>
</div> </div>
<div className="col">
<label>Year</label>
</div>
<div className="col"> <div className="col">
<label>Starting Date</label> <label>Starting Date</label>
</div> </div>
...@@ -335,9 +338,12 @@ export default class StudentRequestForClass extends Component{ ...@@ -335,9 +338,12 @@ export default class StudentRequestForClass extends Component{
{this.state.TutorClassList.map((oneClass)=>{ {this.state.TutorClassList.map((oneClass)=>{
return( return(
<div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px', borderBottom: 'inset'}}> <div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px', borderBottom: 'inset'}}>
<div className="col-md-4" style={{textAlign:'left'}}> <div className="col" style={{textAlign:'left'}}>
<label style={{marginLeft:'20px'}}>{oneClass.batch_no}</label> <label style={{marginLeft:'20px'}}>{oneClass.batch_no}</label>
</div> </div>
<div className="col">
<label>{oneClass.batchYear}</label>
</div>
<div className="col"> <div className="col">
<label>{moment(oneClass.class_startingDate).format("L") }</label> <label>{moment(oneClass.class_startingDate).format("L") }</label>
</div> </div>
...@@ -525,16 +531,31 @@ export default class StudentRequestForClass extends Component{ ...@@ -525,16 +531,31 @@ export default class StudentRequestForClass extends Component{
<div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px', borderBottom: 'inset'}}> <div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px', borderBottom: 'inset'}}>
<div className="col-md-4" style={{textAlign:'left'}}> <div className="col-md-4" style={{textAlign:'left'}}>
<label ></label> <label >200114712426</label>
</div>
<div className="col">
<label>Amila Thenuwara</label>
</div>
<div className="col">
<button className="rounded" style={{background:'#086232', padding:'3px', width:'35px'}}><Icon.ArrowLeftCircle color="white" size={20}/></button>
<button className="rounded" style={{background:'#8D2828', padding:'3px', width:'35px', marginLeft:'10px'}}><Icon.Eraser color="white" size={20}/></button>
</div>
</div>
<div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px', borderBottom: 'inset'}}>
<div className="col-md-4" style={{textAlign:'left'}}>
<label >200177014551</label>
</div> </div>
<div className="col"> <div className="col">
<label></label> <label>Supun Malshan</label>
</div> </div>
<div className="col"> <div className="col">
<button className="rounded" style={{background:'#086232', padding:'3px', width:'35px'}}><Icon.ArrowLeftCircle color="white" size={20}/></button> <button className="rounded" style={{background:'#086232', padding:'3px', width:'35px'}}><Icon.ArrowLeftCircle color="white" size={20}/></button>
<button className="rounded" style={{background:'#8D2828', padding:'3px', width:'35px'}}><Icon.Eraser color="white" size={20}/></button> <button className="rounded" style={{background:'#8D2828', padding:'3px', width:'35px', marginLeft:'10px'}}><Icon.Eraser color="white" size={20}/></button>
</div> </div>
</div> </div>
......
...@@ -52,6 +52,7 @@ export default class AddClassDetails extends Component { ...@@ -52,6 +52,7 @@ export default class AddClassDetails extends Component {
this.onChangeDay = this.onChangeDay.bind(this); this.onChangeDay = this.onChangeDay.bind(this);
this.onChangeHours = this.onChangeHours.bind(this); this.onChangeHours = this.onChangeHours.bind(this);
this.onChangeAdmissionFee = this.onChangeAdmissionFee.bind(this); this.onChangeAdmissionFee = this.onChangeAdmissionFee.bind(this);
this.GetTutorClasses = this.GetTutorClasses.bind(this);
} }
...@@ -68,26 +69,31 @@ export default class AddClassDetails extends Component { ...@@ -68,26 +69,31 @@ export default class AddClassDetails extends Component {
subjectList: response.data.tutor_subjects, subjectList: response.data.tutor_subjects,
}, () => { }, () => {
axios.get(configs.BASE_URL + '/createClass/tutorClass/' + this.state.tutorID)
.then(response => {
console.log(response.data);
this.setState({ this.GetTutorClasses();
TutorClassList: response.data })
}, () => { })
}
GetTutorClasses(){
axios.get(configs.BASE_URL + '/createClass/tutorClass/' + this.state.tutorID)
.then(response => {
console.log(response.data);
}) this.setState({
TutorClassList: response.data
}, () => {
})
}) })
}) })
} }
onChangeAdmissionFee(e) { onChangeAdmissionFee(e) {
this.setState({ this.setState({
AdmissionFee: e.target.value AdmissionFee: e.target.value
...@@ -241,6 +247,7 @@ export default class AddClassDetails extends Component { ...@@ -241,6 +247,7 @@ export default class AddClassDetails extends Component {
.then(res => { .then(res => {
console.log(res) console.log(res)
swal("success!!!", res.data, "success").then(() => { swal("success!!!", res.data, "success").then(() => {
this.GetTutorClasses();
// e.target.reset(); // e.target.reset();
//window.location(); //window.location();
}); });
...@@ -514,9 +521,12 @@ export default class AddClassDetails extends Component { ...@@ -514,9 +521,12 @@ export default class AddClassDetails extends Component {
<div className="container" style={{marginTop: '15px'}}> <div className="container" style={{marginTop: '15px'}}>
<div className="table-dark row"> <div className="table-dark row">
<div className="col-md-4" style={{textAlign: 'left'}}> <div className="col" style={{textAlign: 'left'}}>
<label>Batch Name</label> <label>Batch Name</label>
</div> </div>
<div className="col" >
<label>Year</label>
</div>
<div className="col"> <div className="col">
<label>Starting Date</label> <label>Starting Date</label>
</div> </div>
...@@ -546,9 +556,12 @@ export default class AddClassDetails extends Component { ...@@ -546,9 +556,12 @@ export default class AddClassDetails extends Component {
paddingTop: '5px', paddingTop: '5px',
borderBottom: 'inset' borderBottom: 'inset'
}}> }}>
<div className="col-md-4" style={{textAlign: 'left', marginLeft:'10px'}}> <div className="col" style={{textAlign: 'left', marginLeft:'10px'}}>
<label style={{}}>{oneClass.batch_no}</label> <label style={{}}>{oneClass.batch_no}</label>
</div> </div>
<div className="col">
<label>{oneClass.batchYear}</label>
</div>
<div className="col"> <div className="col">
<label>{moment(oneClass.class_startingDate).format("L")}</label> <label>{moment(oneClass.class_startingDate).format("L")}</label>
</div> </div>
......
...@@ -356,9 +356,15 @@ export default class Home extends Component{ ...@@ -356,9 +356,15 @@ export default class Home extends Component{
valueForRating = 100 valueForRating = 100
} }
else if(Number(tutor.tutor_avg_rating) > 4.75){ else if(Number(tutor.tutor_avg_rating) > 4.75){
valueForRating = 75 valueForRating = 90
}
else if(Number(tutor.tutor_avg_rating) > 4.25){
valueForRating = 80
} }
else if(Number(tutor.tutor_avg_rating) > 4){ else if(Number(tutor.tutor_avg_rating) > 4){
valueForRating = 70
}
else if(Number(tutor.tutor_avg_rating) > 3.5){
valueForRating = 60 valueForRating = 60
} }
else if(Number(tutor.tutor_avg_rating) > 2){ else if(Number(tutor.tutor_avg_rating) > 2){
......
...@@ -5,6 +5,7 @@ import Star from "../../Images/star.png"; ...@@ -5,6 +5,7 @@ import Star from "../../Images/star.png";
import ReviewImg from "../../Images/note.png"; import ReviewImg from "../../Images/note.png";
import Calender from "../../Images/calender.png"; import Calender from "../../Images/calender.png";
import RecommendIcon from "../../Images/recomended.png"; import RecommendIcon from "../../Images/recomended.png";
import {Link} from "react-router-dom";
export default class TutorCard extends Component{ export default class TutorCard extends Component{
...@@ -84,8 +85,8 @@ export default class TutorCard extends Component{ ...@@ -84,8 +85,8 @@ export default class TutorCard extends Component{
</div> </div>
</div> </div>
<div className="row"> <div className="row">
<button className="form-control" value={this.props.data._id} <Link to={`/Home/ViewProfile/${this.props.data.tutor_id}`}> <button className="form-control"
style={{background:"#216E9B", color:"white", marginLeft:'15px', marginRight:'15px'}}><b>View Profile</b></button> style={{background:"#216E9B", color:"white", marginLeft:'15px', marginRight:'15px'}}><b>View Profile</b></button></Link>
</div> </div>
</div> </div>
......
import React, {Component} from "react"; import React, {Component} from "react";
import ItemNav from "../Navbar"; import ItemNav from "../Navbar";
import TestTeacher from "../../Images/teacher.jpg"; import TestTeacher from "../../Images/defaultimageicon.jpg";
import {FaStar} from "react-icons/fa"; import {FaStar} from "react-icons/fa";
import axios from "axios"; import axios from "axios";
import * as configs from "../../Config/config"; import * as configs from "../../Config/config";
...@@ -14,15 +14,15 @@ export default class TutorProfileView extends Component{ ...@@ -14,15 +14,15 @@ export default class TutorProfileView extends Component{
super(props); super(props);
this.state = { this.state = {
tutor_id :'6127b1d7ed4ff23bb0344538', tutor_id : props.match.params.id,
rating:0, rating:0,
overRollRating : 3.5, overRollRating : 0,
ratingCount:20, ratingCount:0,
ratingFive: 4, ratingFive: 0,
ratingFour: 2, ratingFour: 0,
ratingThree:5, ratingThree:0,
ratingTwo: 1, ratingTwo: 0,
ratingOne: 1, ratingOne: 0,
alreadyRate: false, alreadyRate: false,
review :'', review :'',
student_id : '', student_id : '',
...@@ -42,6 +42,7 @@ export default class TutorProfileView extends Component{ ...@@ -42,6 +42,7 @@ export default class TutorProfileView extends Component{
HomeVisit : '', HomeVisit : '',
Institute:'', Institute:'',
tutorManinCities : [], tutorManinCities : [],
detailReviewList : [],
}; };
...@@ -104,6 +105,53 @@ export default class TutorProfileView extends Component{ ...@@ -104,6 +105,53 @@ export default class TutorProfileView extends Component{
}, () => { }, () => {
axios.get(configs.BASE_URL + '/tutorRatings/' + this.state.tutor_id)
.then(response => {
console.log(response.data);
let TotalRating = 0;
let Rating5 = 0;
let Rating4 = 0;
let Rating3 = 0;
let Rating2 = 0;
let Rating1 = 0;
response.data.map((rate)=>{
TotalRating = TotalRating + Number(rate.rating);
if(Number(rate.rating) === 5){
Rating5++
}
else if(Number(rate.rating) === 4){
Rating4++
}
else if(Number(rate.rating) === 3){
Rating3++
}
else if(Number(rate.rating) === 2){
Rating2++
}
else if(Number(rate.rating) === 1){
Rating1++
}
})
console.log(TotalRating)
this.setState({
detailReviewList: response.data.sort((a,b) => b.rating - a.rating),
overRollRating : Number(TotalRating / response.data.length),
ratingCount : response.data.length,
ratingFive : Rating5,
ratingFour : Rating4,
ratingThree:Rating3,
ratingTwo: Rating2,
ratingOne: Rating1,
}, () => {
console.log(this.state.overRollRating)
})
})
}) })
...@@ -214,7 +262,7 @@ export default class TutorProfileView extends Component{ ...@@ -214,7 +262,7 @@ export default class TutorProfileView extends Component{
})} })}
</div> </div>
<div className="row"> <div className="row">
<label>11 reviews</label> <label>{this.state.ratingCount} reviews</label>
</div> </div>
</div> </div>
...@@ -286,7 +334,12 @@ export default class TutorProfileView extends Component{ ...@@ -286,7 +334,12 @@ export default class TutorProfileView extends Component{
</div> </div>
<div className="row" style={{marginLeft:'20px',marginTop:'10px'}}> <div className="row" style={{marginLeft:'20px',marginTop:'10px'}}>
<div className="col-"> <div className="col-">
<h6>Subjects : <b>{this.state.subjectList}</b></h6> <label>Subjects : {this.state.subjectList.map((subject)=>{
return(
<span><b>{subject} | </b></span>
)
})}</label>
</div> </div>
</div> </div>
...@@ -302,36 +355,41 @@ export default class TutorProfileView extends Component{ ...@@ -302,36 +355,41 @@ export default class TutorProfileView extends Component{
<label>Online Classes</label> <label>Online Classes</label>
</div> </div>
</div> </div>
<div className="" style={{marginLeft:'20px'}}> {this.state.OnlineClass !== "" ?
<div className="scroll-area"> <div className="" style={{marginLeft:'20px'}}>
<div className="table-dark row"> <div className="container">
<div className="col"> <div className="table-dark row">
<label>Class Type</label> <div className="col">
</div> <label>Class Type</label>
<div className="col"> </div>
<label>A/L Batch</label> <div className="col">
</div> <label>A/L Batch</label>
<div className="col"> </div>
<label>Starting Date</label> <div className="col">
</div> <label>Starting Date</label>
<div className="col"> </div>
<label>Subject</label> <div className="col">
</div> <label>Subject</label>
<div className="col"> </div>
<label>Day and Time</label> <div className="col">
</div> <label>Day and Time</label>
<div className="col"> </div>
<div className="col">
</div> </div>
</div>
</div> </div>
</div> </div>
:
<div></div>
}
</div>
{this.state.TutorClassList.map((tutorClass)=>{ {this.state.TutorClassList.map((tutorClass)=>{
if(tutorClass.class_method === "Online class"){ if(tutorClass.class_method === "Online class"){
return( return(
<div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px',marginLeft:'5px', borderBottom: 'inset'}}> <div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px',marginLeft:'20px',marginRight:'0px', borderBottom: 'inset'}}>
<div className="col"> <div className="col">
<label>{tutorClass.class_type}</label> <label>{tutorClass.class_type}</label>
</div> </div>
...@@ -348,7 +406,7 @@ export default class TutorProfileView extends Component{ ...@@ -348,7 +406,7 @@ export default class TutorProfileView extends Component{
<label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label> <label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label>
</div> </div>
<div className="col"> <div className="col">
<button className="rounded" style={{background:'Orange', padding:'3px', width:'35px'}} value={""} onClick={e => this.onSelectOneClass(e)}>+</button> <button className="rounded" style={{background:'Orange', padding:'3px', width:'60px'}} value={""} onClick={e => this.onSelectOneClass(e)}>View</button>
</div> </div>
</div> </div>
...@@ -369,18 +427,23 @@ export default class TutorProfileView extends Component{ ...@@ -369,18 +427,23 @@ export default class TutorProfileView extends Component{
<label>Home Visit</label> <label>Home Visit</label>
</div> </div>
</div> </div>
<div className="row" style={{marginLeft:'20px', marginTop:'0px'}}> {this.state.HomeVisit !== "" ?
<div className="col-" style={{marginLeft:'30px'}}> <div className="row" style={{marginLeft:'20px', marginTop:'0px'}}>
<Icon.GeoAlt color="black" size={18}/> <div className="col-" style={{marginLeft:'30px'}}>
</div> <Icon.GeoAlt color="black" size={18}/>
<div className="col-" style={{float:'left', marginLeft:'15px'}}> </div>
<label>Home Visit Areas : {this.state.tutorManinCities.map((city)=>{ <div className="col-" style={{float:'left', marginLeft:'15px'}}>
return( <label>Home Visit Areas : {this.state.tutorManinCities.map((city)=>{
<span>{city} | </span> return(
) <span>{city} | </span>
})}</label> )
})}</label>
</div>
</div> </div>
</div> :
<div></div>
}
<div className="row" style={{marginLeft:'20px', marginTop:'5px'}}> <div className="row" style={{marginLeft:'20px', marginTop:'5px'}}>
{this.state.Institute === "" ? {this.state.Institute === "" ?
<Icon.XOctagon color="black" size={18}/> <Icon.XOctagon color="black" size={18}/>
...@@ -403,39 +466,44 @@ export default class TutorProfileView extends Component{ ...@@ -403,39 +466,44 @@ export default class TutorProfileView extends Component{
})}</label> })}</label>
</div> </div>
</div> </div>
<div className="" style={{marginLeft:'20px'}}> {this.state.Institute !== "" ?
<div className="scroll-area"> <div className="" style={{marginLeft:'20px'}}>
<div className="table-dark row"> <div className="container">
<div className="col"> <div className="table-dark row">
<label>Class Type</label> <div className="col">
</div> <label>Class Type</label>
<div className="col"> </div>
<label>A/L Batch</label> <div className="col">
</div> <label>A/L Batch</label>
<div className="col"> </div>
<label>Starting Date</label> <div className="col">
</div> <label>Starting Date</label>
<div className="col"> </div>
<label>Subject</label> <div className="col">
</div> <label>Subject</label>
<div className="col"> </div>
<label>Institute</label> <div className="col">
</div> <label>Institute</label>
<div className="col"> </div>
<label>Day and Time</label> <div className="col">
</div> <label>Day and Time</label>
<div className="col"> </div>
<div className="col">
</div> </div>
</div>
</div> </div>
</div> </div>
:
<div></div>
}
</div>
{this.state.TutorClassList.map((tutorClass)=>{ {this.state.TutorClassList.map((tutorClass)=>{
if(tutorClass.class_method === "Institute"){ if(tutorClass.class_method === "Institute"){
return( return(
<div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px',marginLeft:'5px', borderBottom: 'inset'}}> <div className="row" style={{background:'#DCDCDC', paddingBottom:'5px', paddingTop:'5px',marginLeft:'20px',marginRight:'0px', borderBottom: 'inset'}}>
<div className="col"> <div className="col">
<label>{tutorClass.class_type}</label> <label>{tutorClass.class_type}</label>
</div> </div>
...@@ -455,7 +523,7 @@ export default class TutorProfileView extends Component{ ...@@ -455,7 +523,7 @@ export default class TutorProfileView extends Component{
<label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label> <label>{tutorClass.class_conduct_day} - {tutorClass.class_conduct_time}</label>
</div> </div>
<div className="col"> <div className="col">
<button className="rounded" style={{background:'Orange', padding:'3px', width:'35px'}} value={""} onClick={e => this.onSelectOneClass(e)}>+</button> <button className="rounded" style={{background:'Orange', padding:'3px', width:'60px'}} value={""} onClick={e => this.onSelectOneClass(e)}>View</button>
</div> </div>
</div> </div>
...@@ -463,7 +531,12 @@ export default class TutorProfileView extends Component{ ...@@ -463,7 +531,12 @@ export default class TutorProfileView extends Component{
} }
})} })}
{/*{this.state.TutorClassList.length > 0 ?*/}
{/* <div></div>*/}
{/* :*/}
{/* <div style={{padding:'20px'}}>No Active classes for students</div>*/}
{/*}*/}
</div> </div>
<div className="col"> <div className="col">
...@@ -615,6 +688,11 @@ export default class TutorProfileView extends Component{ ...@@ -615,6 +688,11 @@ export default class TutorProfileView extends Component{
</div> </div>
<div className="row" style={{marginTop:'20px',marginLeft:'0px', paddingLeft:'20px',paddingTop:'5px',paddingBottom:'5px',
background:'#022140',color:'white'}}>
<h5>You can review to this Tutor</h5>
</div>
<div className="row" style={{margin:'20px'}}> <div className="row" style={{margin:'20px'}}>
{[...Array(5)].map((star, i) => { {[...Array(5)].map((star, i) => {
const ratingValue = i + 1; const ratingValue = i + 1;
...@@ -630,27 +708,24 @@ export default class TutorProfileView extends Component{ ...@@ -630,27 +708,24 @@ export default class TutorProfileView extends Component{
</label> </label>
})} })}
</div> </div>
<div className="row" style={{margin:'20px'}}> <div className="row" style={{marginLeft:'20px'}}>
<span style={{marginLeft: '20px'}}>You Rate [{this.state.rating}] stars for the product.</span> <span style={{marginLeft: '20px'}}>You Rate [{this.state.rating}] stars for the product.</span>
</div> </div>
{/*<div className="row" style={{margin:'20px'}}>*/}
{/* <input type="text" id="tutorAddress" className="form-control"*/}
{/* placeholder="Tutor ID"*/}
{/* onChange={this.onTutorID}*/}
{/* style={{width: '50%'}} required/>*/}
{/*</div>*/}
{/*<div className="row" style={{margin:'20px'}}>*/}
{/* <input type="text" id="tutorAddress" className="form-control"*/}
{/* placeholder="SID"*/}
{/* onChange={this.onSID}*/}
{/* style={{width: '50%'}} required/>*/}
{/*</div>*/}
<div className="row" style={{margin:'20px'}}> <div className="row" style={{margin:'20px'}}>
<h5 style={{marginLeft: '20px'}}>You can review to this Tutor</h5> <textarea className="form-control" style={{width: '50%', marginLeft: '20px'}}
</div> placeholder="Your Idea about the tutor" value={this.state.comments} onChange={this.onChangeComment}/>
<div className="row" style={{margin:'20px'}}>
<input type="text" id="tutorAddress" className="form-control"
placeholder="Tutor ID"
onChange={this.onTutorID}
style={{width: '50%'}} required/>
</div>
<div className="row" style={{margin:'20px'}}>
<input type="text" id="tutorAddress" className="form-control"
placeholder="SID"
onChange={this.onSID}
style={{width: '50%'}} required/>
</div>
<div className="row" style={{margin:'20px'}}>
<textarea style={{width: '50%', marginLeft: '20px'}} value={this.state.comments}
onChange={this.onChangeComment}/>
</div> </div>
<div className="row" style={{margin:'20px'}}> <div className="row" style={{margin:'20px'}}>
{this.state.alreadyRate === false ? {this.state.alreadyRate === false ?
...@@ -658,10 +733,10 @@ export default class TutorProfileView extends Component{ ...@@ -658,10 +733,10 @@ export default class TutorProfileView extends Component{
className="profile-edit-btn nav-link btn btn-primary stop-color-final" className="profile-edit-btn nav-link btn btn-primary stop-color-final"
name="btnAddMore" name="btnAddMore"
style={{ style={{
float: 'left', marginLeft: '20px', marginTop: '00px', marginBottom: '20px', float: 'left', marginLeft: '20px', marginTop: '00px', marginBottom: '20px', color: 'white',
backgroundColor: 'orange', borderColor: 'orange', fontSize: '20px', width: '25%' backgroundColor: '#216E9B', borderColor: '#022140', fontSize: '20px', width: '25%'
}}> }}>
Add Comment Submit Review
</a> </a>
: :
<a type="submit" onClick={this.updateRating} <a type="submit" onClick={this.updateRating}
...@@ -675,6 +750,54 @@ export default class TutorProfileView extends Component{ ...@@ -675,6 +750,54 @@ export default class TutorProfileView extends Component{
</a> </a>
} }
</div> </div>
<div className="row" style={{marginTop:'20px',marginLeft:'0px', paddingLeft:'20px',paddingTop:'5px',paddingBottom:'5px',
background:'#022140',color:'white'}}>
<h5>Tutor's Reviews</h5>
</div>
<div className="container" style={{height:'800px'}}>
{this.state.detailReviewList.map((review) =>{
return(
<div className="row" style={{margin:'10px'}}>
<div className="main-card mb card" style={{width:'100%'}}>
<div className="row">
<div className="col-">
<img src={TestTeacher} className="rounded-circle" style={{width:'80px', height:'80px', float:'left', margin:'30px'}}/>
</div>
<div className="col">
<div className="row" style={{marginLeft:'15px', marginTop:'15px'}}>
<h4>{review.student_id.student_name}</h4>
</div>
<div className="row" style={{marginLeft:'10px', marginTop:'5px'}}>
{[...Array(5)].map((star, i) => {
const ratingValue = i + 1.0;
return <label style={{marginLeft: '5px', float: 'left'}}>
<input type="radio" name="rating"
style={{display: "none"}}
value={ratingValue}
//onClick={this.onClickRatingValue}
/>
<FaStar size={20}
color={ratingValue <= (review.rating) ? "#ffc107" : "#e4e5e9"}
//onMouseEnter={() => this.onMouseEnter(i + 1)}
/>
</label>
})}
</div>
<div className="row" style={{marginLeft:'15px'}}>
<label style={{textAlign:'initial',marginRight:'25px'}}>{review.review}</label>
</div>
</div>
</div>
</div>
</div>
)
})}
</div>
</div> </div>
</div> </div>
......
...@@ -580,7 +580,7 @@ export default class SignUp extends Component { ...@@ -580,7 +580,7 @@ export default class SignUp extends Component {
else { else {
axios.post(configs.BASE_URL + '/studentSingUp/add', student) axios.post(configs.BASE_URL + '/studentSingUp/add', student)
.then(res =>{ .then(res =>{
console.log("Inside Then") //console.log("Inside Then")
window.location = '/beforeConfirm' window.location = '/beforeConfirm'
}) })
.catch(function (error) { .catch(function (error) {
...@@ -664,7 +664,7 @@ export default class SignUp extends Component { ...@@ -664,7 +664,7 @@ export default class SignUp extends Component {
axios.post(configs.BASE_URL + '/tutorSingUp/add', Tutor) axios.post(configs.BASE_URL + '/tutorSingUp/add', Tutor)
.then(res =>{ .then(res =>{
console.log("Inside Then") //console.log("Inside Then")
window.location = '/beforeConfirm' window.location = '/beforeConfirm'
}) })
.catch(function (error) { .catch(function (error) {
...@@ -716,7 +716,7 @@ export default class SignUp extends Component { ...@@ -716,7 +716,7 @@ export default class SignUp extends Component {
axios.post(configs.BASE_URL + '/instituteSingUp/add', institute) axios.post(configs.BASE_URL + '/instituteSingUp/add', institute)
.then(res =>{ .then(res =>{
console.log("Inside Then") //console.log("Inside Then")
window.location = '/beforeConfirm' window.location = '/beforeConfirm'
}) })
.catch(function (error) { .catch(function (error) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment