@ -41,8 +41,8 @@ class NewProfile extends Component {
username : "" ,
username : "" ,
address : "" ,
address : "" ,
email : "" ,
email : "" ,
gender : "دختر",
gender : window . t ( "دختر") ,
userRoleId : "دانش آموز",
userRoleId : window . t ( "دانش آموز") ,
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 === "معلم") {
if ( name === "gardeId" && this . state . userRoleId === window . t ( "معلم") ) {
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 = "نام"
label = window . t ( "نام")
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 = "نام خانوادگی"
label = window . t ( "نام خانوادگی")
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 = "نام کاربری"
label = window . t ( window . t ( "نام کاربری") )
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 = { [ "دختر", "پسر"] }
options = { [ window . t ( "دختر") , window . t ( "پسر") ] }
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 = "کد ملی"
label = window . t ( "کد ملی")
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 = { [ "معلم", "دانش آموز"] }
options = { [ window . t ( "معلم") , window . t ( "دانش آموز") ] }
name = "userRoleId"
name = "userRoleId"
label = { "عنوان"}
label = { window . t ( "عنوان") }
selectedOption = { this . state . userRoleId }
selectedOption = { this . state . userRoleId }
/ >
/ >
< / d i v >
< / d i v >
{ this . state . userRoleId === "دانش آموز" ? (
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Select
< Select
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { "پایه تحصیلی"}
label = { window . t ( window . t ( "پایه تحصیلی") ) }
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === "معلم" ? (
{ this . state . userRoleId === window . t ( "معلم") ? (
< div className = "mb-2" >
< div className = "mb-2" >
< MultipleSelector
< MultipleSelector
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { "پایه تحصیلی"}
label = { window . t ( window . t ( "پایه تحصیلی") ) }
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === "دانش آموز" &&
{ this . state . userRoleId === window . t ( "دانش آموز") &&
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 = { "رشته تحصیلی"}
label = { window . t ( "رشته تحصیلی") }
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 = { "استان"}
label = { window . t ( "استان") }
/ >
/ >
< / 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 = { "شهرستان"}
label = { window . t ( "شهرستان") }
/ >
/ >
< / 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 = { "شهر/روستا"}
label = { window . t ( "شهر/روستا") }
/ >
/ >
< / d i v >
< / d i v >
{ this . state . userRoleId === "دانش آموز" ? (
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
parent = { this }
parent = { this }
name = "schoolId"
name = "schoolId"
label = { "نام مدرسه"}
label = { window . t ( "نام مدرسه") }
defaultValue = { profile }
defaultValue = { profile }
/ >
/ >
< / d i v >
< / d i v >
) : null }
) : null }
{ this . state . userRoleId === "معلم" ? (
{ this . state . userRoleId === window . t ( "معلم") ? (
< div className = "mb-2" >
< div className = "mb-2" >
< Input
< Input
parent = { this }
parent = { this }
name = "schoolId"
name = "schoolId"
label = { "محل تدریس"}
label = { window . t ( "محل تدریس") }
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 = { "کد پستی"}
label = { window . t ( "کد پستی") }
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 = { "آدرس محل سکونت"}
label = { window . t ( "آدرس محل سکونت") }
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 = "نام"
label = window . t ( "نام")
parent = { this }
parent = { this }
onInput = { this . forcePersian }
onInput = { this . forcePersian }
/ >
/ >
< Input
< Input
name = "lastName"
name = "lastName"
label = "نام خانوادگی"
label = window . t ( "نام خانوادگی")
parent = { this }
parent = { this }
onInput = { this . forcePersian }
onInput = { this . forcePersian }
/ >
/ >
< Input
< Input
name = "username"
name = "username"
label = "نام کاربری"
label = window . t ( window . t ( "نام کاربری") )
parent = { this }
parent = { this }
align = "left"
align = "left"
/ >
/ >
< Gender
< Gender
options = { [ "دختر", "پسر"] }
options = { [ window . t ( "دختر") , window . t ( "پسر") ] }
parent = { this }
parent = { this }
name = "gender"
name = "gender"
selectedOption = { this . state . gender }
selectedOption = { this . state . gender }
/ >
/ >
< Input
< Input
name = "nationalId"
name = "nationalId"
label = "کد ملی"
label = window . t ( "کد ملی")
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 = { [ "معلم", "دانش آموز"] }
options = { [ window . t ( "معلم") , window . t ( "دانش آموز") ] }
name = "userRoleId"
name = "userRoleId"
selectedOption = { this . state . userRoleId }
selectedOption = { this . state . userRoleId }
/ >
/ >
{ this . state . userRoleId === "دانش آموز" ? (
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
< Select
< Select
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { "پایه تحصیلی"}
label = { window . t ( window . t ( "پایه تحصیلی") ) }
/ >
/ >
) : null }
) : null }
{ this . state . userRoleId === "معلم" ? (
{ this . state . userRoleId === window . t ( "معلم") ? (
< MultipleSelector
< MultipleSelector
parent = { this }
parent = { this }
options = { grades }
options = { grades }
name = "gradeId"
name = "gradeId"
label = { "پایه تحصیلی"}
label = { window . t ( window . t ( "پایه تحصیلی") ) }
selectedOptions = { this . state . gradeId }
selectedOptions = { this . state . gradeId }
/ >
/ >
) : null }
) : null }
{ this . state . userRoleId === "دانش آموز" &&
{ this . state . userRoleId === window . t ( "دانش آموز") &&
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 = { "رشته تحصیلی"}
label = { window . t ( "رشته تحصیلی") }
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 = { "استان"}
label = { window . t ( "استان") }
/ >
/ >
< Select
< Select
parent = { this }
parent = { this }
options = { [ "karaj" , "tehran" ] }
options = { [ "karaj" , "tehran" ] }
name = "cityId"
name = "cityId"
label = { "شهرستان"}
label = { window . t ( "شهرستان") }
/ >
/ >
< Select
< Select
parent = { this }
parent = { this }
options = { [ "chaharbagh" , "mahalat" ] }
options = { [ "chaharbagh" , "mahalat" ] }
name = "zoneId"
name = "zoneId"
label = { "شهر/روستا"}
label = { window . t ( "شهر/روستا") }
/ >
/ >
{ this . state . userRoleId === "دانش آموز" ? (
{ this . state . userRoleId === window . t ( "دانش آموز") ? (
< Input parent = { this } name = "schoolId" label = { "نام مدرسه"} / >
< Input parent = { this } name = "schoolId" label = { window . t ( "نام مدرسه") } / >
) : null }
) : null }
{ this . state . userRoleId === "معلم" ? (
{ this . state . userRoleId === window . t ( "معلم") ? (
< Input parent = { this } name = "schoolId" label = { "محل تدریس"} / >
< Input parent = { this } name = "schoolId" label = { window . t ( "محل تدریس") } / >
) : null }
) : null }
{ this . state . userRoleId === "معلم" ? (
{ this . state . userRoleId === window . t ( "معلم") ? (
< Document parent = { this } name = "docFileIds" / >
< Document parent = { this } name = "docFileIds" / >
) : null }
) : null }
< Input
< Input
parent = { this }
parent = { this }
name = "postalCode"
name = "postalCode"
label = { "کد پستی"}
label = { window . t ( "کد پستی") }
align = "left"
align = "left"
/ >
/ >
< TextArea parent = { this } label = { "آدرس محل سکونت"} name = "address" / >
< TextArea parent = { this } label = { window . t ( "آدرس محل سکونت") } 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 >