@ -41,8 +41,8 @@ class NewProfile extends Component {
username : "" ,
username : "" ,
address : "" ,
address : "" ,
email : "" ,
email : "" ,
gender : window . t ( "دختر") ,
gender : "دختر",
userRoleId : window . t ( "دانش آموز") ,
userRoleId : "دانش آموز",
nationalId : "" ,
nationalId : "" ,
provinceId : "" ,
provinceId : "" ,
phone : "" ,
phone : "" ,
@ -67,7 +67,7 @@ class NewProfile extends Component {
}
}
onChange = ( name , value ) => {
onChange = ( name , value ) => {
if ( name === "gardeId" && this . state . userRoleId === window . t ( "معلم") ) {
if ( name === "gardeId" && this . state . userRoleId === "معلم") {
this . setState ( ( prevState ) => ( {
this . setState ( ( prevState ) => ( {
gradeId : [ ... prevState . gradeId , value ] ,
gradeId : [ ... prevState . gradeId , value ] ,
} ) ) ;
} ) ) ;
@ -187,19 +187,19 @@ class NewProfile extends Component {
render ( ) {
render ( ) {
const { profile } = this . props ;
const { profile } = this . props ;
const grades = [
const grades = [
window . t ( "پیش دبستان") ,
"پیش دبستان",
window . t ( "اول") ,
"اول",
window . t ( "دوم") ,
"دوم",
window . t ( "سوم") ,
"سوم",
window . t ( "چهارم") ,
"چهارم",
window . t ( "پنجم") ,
"پنجم",
window . t ( "ششم") ,
"ششم",
window . t ( "هفتم") ,
"هفتم",
window . t ( "هشتم") ,
"هشتم",
window . t ( "نهم") ,
"نهم",
window . t ( "دهم") ,
"دهم",
window . t ( "یازدهم") ,
"یازدهم",
window . t ( "دوازدهم") ,
"دوازدهم",
] ;
] ;
return (
return (
< >
< >
@ -221,7 +221,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
name = "firstName"
name = "firstName"
label = window . t ( "نام")
label = "نام"
parent = { this }
parent = { this }
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
@ -229,7 +229,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
name = "lastName"
name = "lastName"
label = window . t ( "نام خانوادگی")
label = "نام خانوادگی"
parent = { this }
parent = { this }
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
@ -237,7 +237,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
name = "username"
name = "username"
label = window . t ( window . t ( "نام کاربری") )
label = "نام کاربری"
parent = { this }
parent = { this }
defaultValue = { profile }
defaultValue = { profile }
align = "left"
align = "left"
@ -246,7 +246,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< Gender
< Gender
options = { [ window . t ( "دختر") , window . t ( "پسر") ] }
options = { [ "دختر", "پسر"] }
parent = { this }
parent = { this }
name = "gender"
name = "gender"
selectedOption = { this . state . gender }
selectedOption = { this . state . gender }
@ -255,7 +255,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
name = "nationalId"
name = "nationalId"
label = window . t ( "کد ملی")
label = "کد ملی"
parent = { this }
parent = { this }
align = "left"
align = "left"
defaultValue = { profile }
defaultValue = { profile }
@ -272,49 +272,49 @@ class NewProfile extends Component {
< div className = "mb-2" style = { { minWidth : "100%" } } >
< div className = "mb-2" style = { { minWidth : "100%" } } >
< Gender
< Gender
parent = { this }
parent = { this }
options = { [ window . t ( "معلم") , window . t ( "دانش آموز") ] }
options = { [ "معلم", "دانش آموز"] }
name = "userRoleId"
name = "userRoleId"
label = { window . t ( "عنوان") }
label = { "عنوان"}
selectedOption = { this . state . userRoleId }
selectedOption = { this . state . userRoleId }
/ >
/ >
< / d i v >
< / d i v >
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
{ this . state . userRoleId === "دانش آموز" ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Select
< Select
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { window . t ( window . t ( "پایه تحصیلی") ) }
label = { "پایه تحصیلی"}
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "معلم") ? (
{ this . state . userRoleId === "معلم" ? (
< div className = "mb-2" >
< div className = "mb-2" >
< MultipleSelector
< MultipleSelector
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { window . t ( window . t ( "پایه تحصیلی") ) }
label = { "پایه تحصیلی"}
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "دانش آموز") &&
{ this . state . userRoleId === "دانش آموز" &&
this . state . gradeId > 9 ? (
this . state . gradeId > 9 ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Select
< Select
parent = { this }
parent = { this }
options = { [
options = { [
window . t ( "ریاضی") ,
"ریاضی",
window . t ( "تجربی") ,
"تجربی",
window . t ( "انسانی") ,
"انسانی",
window . t ( "فنی حرفه ای") ,
"فنی حرفه ای",
window . t ( "کاردانش") ,
"کاردانش",
window . t ( "معارف") ,
"معارف",
] }
] }
name = "field"
name = "field"
label = { window . t ( "رشته تحصیلی") }
label = { "رشته تحصیلی"}
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
< / d i v >
< / d i v >
@ -325,7 +325,7 @@ class NewProfile extends Component {
parent = { this }
parent = { this }
options = { [ "karaj" , "tehran" ] }
options = { [ "karaj" , "tehran" ] }
name = "province"
name = "province"
label = { window . t ( "استان") }
label = { "استان"}
/ >
/ >
< / d i v >
< / d i v >
< div className = "mb-2" >
< div className = "mb-2" >
@ -333,7 +333,7 @@ class NewProfile extends Component {
parent = { this }
parent = { this }
options = { [ "karaj" , "tehran" ] }
options = { [ "karaj" , "tehran" ] }
name = "city"
name = "city"
label = { window . t ( "شهرستان") }
label = { "شهرستان"}
/ >
/ >
< / d i v >
< / d i v >
< div className = "mb-2" >
< div className = "mb-2" >
@ -341,25 +341,25 @@ class NewProfile extends Component {
parent = { this }
parent = { this }
options = { [ "chaharbagh" , "mahalat" ] }
options = { [ "chaharbagh" , "mahalat" ] }
name = "zoneId"
name = "zoneId"
label = { window . t ( "شهر/روستا") }
label = { "شهر/روستا"}
/ >
/ >
< / d i v >
< / d i v >
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
{ this . state . userRoleId === "دانش آموز" ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
parent = { this }
parent = { this }
name = "schoolId"
name = "schoolId"
label = { window . t ( "نام مدرسه") }
label = { "نام مدرسه"}
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "معلم") ? (
{ this . state . userRoleId === "معلم" ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
parent = { this }
parent = { this }
name = "schoolId"
name = "schoolId"
label = { window . t ( "محل تدریس") }
label = { "محل تدریس"}
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
< / d i v >
< / d i v >
@ -368,7 +368,7 @@ class NewProfile extends Component {
< Input
< Input
parent = { this }
parent = { this }
name = "postalCode"
name = "postalCode"
label = { window . t ( "کد پستی") }
label = { "کد پستی"}
align = "left"
align = "left"
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
@ -376,7 +376,7 @@ class NewProfile extends Component {
< div className = "mb-2" >
< div className = "mb-2" >
< TextArea
< TextArea
parent = { this }
parent = { this }
label = { window . t ( "آدرس محل سکونت") }
label = { "آدرس محل سکونت"}
name = "address"
name = "address"
/ >
/ >
< / d i v >
< / d i v >
@ -398,31 +398,31 @@ class NewProfile extends Component {
< Upload name = "file" parent = { this } / >
< Upload name = "file" parent = { this } / >
< Input
< Input
name = "firstName"
name = "firstName"
label = window . t ( "نام")
label = "نام"
parent = { this }
parent = { this }
onInput = { this . forcePersian }
onInput = { this . forcePersian }
/ >
/ >
< Input
< Input
name = "lastName"
name = "lastName"
label = window . t ( "نام خانوادگی")
label = "نام خانوادگی"
parent = { this }
parent = { this }
onInput = { this . forcePersian }
onInput = { this . forcePersian }
/ >
/ >
< Input
< Input
name = "username"
name = "username"
label = window . t ( window . t ( "نام کاربری") )
label = "نام کاربری"
parent = { this }
parent = { this }
align = "left"
align = "left"
/ >
/ >
< Gender
< Gender
options = { [ window . t ( "دختر") , window . t ( "پسر") ] }
options = { [ "دختر", "پسر"] }
parent = { this }
parent = { this }
name = "gender"
name = "gender"
selectedOption = { this . state . gender }
selectedOption = { this . state . gender }
/ >
/ >
< Input
< Input
name = "nationalId"
name = "nationalId"
label = window . t ( "کد ملی")
label = "کد ملی"
parent = { this }
parent = { this }
align = "left"
align = "left"
maxLength = { 10 }
maxLength = { 10 }
@ -431,41 +431,41 @@ class NewProfile extends Component {
< Birthdate / >
< Birthdate / >
< Gender
< Gender
parent = { this }
parent = { this }
options = { [ window . t ( "معلم") , window . t ( "دانش آموز") ] }
options = { [ "معلم", "دانش آموز"] }
name = "userRoleId"
name = "userRoleId"
selectedOption = { this . state . userRoleId }
selectedOption = { this . state . userRoleId }
/ >
/ >
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
{ this . state . userRoleId === "دانش آموز" ? (
< Select
< Select
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { window . t ( window . t ( "پایه تحصیلی") ) }
label = { "پایه تحصیلی"}
/ >
/ >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "معلم") ? (
{ this . state . userRoleId === "معلم" ? (
< MultipleSelector
< MultipleSelector
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { window . t ( window . t ( "پایه تحصیلی") ) }
label = { "پایه تحصیلی"}
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "دانش آموز") &&
{ this . state . userRoleId === "دانش آموز" &&
Number ( this . state . gradeId ) > 9 ? (
Number ( this . state . gradeId ) > 9 ? (
< Select
< Select
parent = { this }
parent = { this }
options = { [
options = { [
window . t ( "ریاضی") ,
"ریاضی",
window . t ( "تجربی") ,
"تجربی",
window . t ( "انسانی") ,
"انسانی",
window . t ( "فنی حرفه ای") ,
"فنی حرفه ای",
window . t ( "کاردانش") ,
"کاردانش",
window . t ( "معارف") ,
"معارف",
] }
] }
name = "field"
name = "field"
label = { window . t ( "رشته تحصیلی") }
label = { "رشته تحصیلی"}
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
) : null }
) : null }
@ -474,36 +474,36 @@ class NewProfile extends Component {
parent = { this }
parent = { this }
options = { [ "karaj" , "tehran" ] }
options = { [ "karaj" , "tehran" ] }
name = "provinceId"
name = "provinceId"
label = { window . t ( "استان") }
label = { "استان"}
/ >
/ >
< Select
< Select
parent = { this }
parent = { this }
options = { [ "karaj" , "tehran" ] }
options = { [ "karaj" , "tehran" ] }
name = "cityId"
name = "cityId"
label = { window . t ( "شهرستان") }
label = { "شهرستان"}
/ >
/ >
< Select
< Select
parent = { this }
parent = { this }
options = { [ "chaharbagh" , "mahalat" ] }
options = { [ "chaharbagh" , "mahalat" ] }
name = "zoneId"
name = "zoneId"
label = { window . t ( "شهر/روستا") }
label = { "شهر/روستا"}
/ >
/ >
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
{ this . state . userRoleId === "دانش آموز" ? (
< Input parent = { this } name = "schoolId" label = { window . t ( "نام مدرسه") } / >
< Input parent = { this } name = "schoolId" label = { "نام مدرسه"} / >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "معلم") ? (
{ this . state . userRoleId === "معلم" ? (
< Input parent = { this } name = "schoolId" label = { window . t ( "محل تدریس") } / >
< Input parent = { this } name = "schoolId" label = { "محل تدریس"} / >
) : null }
) : null }
{ this . state . userRoleId === window . t ( "معلم") ? (
{ this . state . userRoleId === "معلم" ? (
< Document parent = { this } name = "docFileIds" / >
< Document parent = { this } name = "docFileIds" / >
) : null }
) : null }
< Input
< Input
parent = { this }
parent = { this }
name = "postalCode"
name = "postalCode"
label = { window . t ( "کد پستی") }
label = { "کد پستی"}
align = "left"
align = "left"
/ >
/ >
< TextArea parent = { this } label = { window . t ( "آدرس محل سکونت") } name = "address" / >
< TextArea parent = { this } label = { "آدرس محل سکونت"} name = "address" / >
< div className = "mobile-auth-profile__footer d-flex justify-content-center" >
< div className = "mobile-auth-profile__footer d-flex justify-content-center" >
< button onClick = { ( ) => this . onSubmit ( ) } > ذخیره < / b u t t o n >
< button onClick = { ( ) => this . onSubmit ( ) } > ذخیره < / b u t t o n >
< / d i v >
< / d i v >