#2594 e-madencilik add 3 fields to profile

This commit is contained in:
Diatrex 2020-11-06 18:55:18 +03:00
parent 14e9e47e09
commit aeff1f4f4e
5 changed files with 51 additions and 10 deletions

View File

@ -5,11 +5,6 @@ use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleProfileCreateProfessionAndEducationalFields extends Migration class VisiosoftModuleProfileCreateProfessionAndEducationalFields extends Migration
{ {
/**
* Run the migrations.
*
* @return void
*/
public function up() public function up()
{ {
if ($stream = $this->streams()->findBySlugAndNamespace('users', 'users')) { if ($stream = $this->streams()->findBySlugAndNamespace('users', 'users')) {
@ -40,7 +35,7 @@ class VisiosoftModuleProfileCreateProfessionAndEducationalFields extends Migrati
'name' => $field['name'], 'name' => $field['name'],
'namespace' => 'users', 'namespace' => 'users',
'slug' => $field['slug'], 'slug' => $field['slug'],
'type' => 'anomaly.field_type.tags', 'type' => 'anomaly.field_type.text',
'locked' => 0, 'locked' => 0,
]); ]);

View File

@ -11,7 +11,10 @@ return [
'upload_avatar', 'upload_avatar',
'show_tax_office', 'show_tax_office',
'show_checkbox_terms_on_register', 'show_checkbox_terms_on_register',
'show_education_profession' 'show_education_profession',
'education',
'state_of_education',
'profession',
], ],
], ],
'recaptcha' => [ 'recaptcha' => [

View File

@ -48,4 +48,7 @@ return [
'mode' => 'checkbox' 'mode' => 'checkbox'
] ]
], ],
"education" => "anomaly.field_type.tags",
"state_of_education" => "anomaly.field_type.tags",
"profession" => "anomaly.field_type.tags",
]; ];

View File

@ -28,4 +28,13 @@ return [
'name' => 'Score Threshold', 'name' => 'Score Threshold',
'instructions' => 'A value between 0 and 1. The higher the threshold the more strict ReCaptcha is in trying to determine if a user is a bot or not.', 'instructions' => 'A value between 0 and 1. The higher the threshold the more strict ReCaptcha is in trying to determine if a user is a bot or not.',
], ],
'education' => [
'name' => 'Education'
],
'state_of_education' => [
'name' => 'State of Education'
],
'profession' => [
'name' => 'Profession'
],
]; ];

View File

@ -156,7 +156,18 @@
<label class="control-label font-weight-bold"> <label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.education.name") }} {{ trans("visiosoft.module.profile::field.education.name") }}
</label> </label>
{{ profileForm.fields.education.input|raw }} {{ profileForm.fields.education.value.input|raw }}
<select name="education" class="custom-select form-control"
data-field="education" data-field_name="education"
data-provides="anomaly.field_type.select" id="education">
<option value="">Choose an option...</option>
{% for education in setting_value('visiosoft.module.profile::education') %}
<option value="{{ education }}"
{{ profileForm.fields.education.value == education ? 'selected' }}>
{{ education }}
</option>
{% endfor %}
</select>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@ -164,7 +175,17 @@
<label class="control-label font-weight-bold"> <label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.state_of_education.name") }} {{ trans("visiosoft.module.profile::field.state_of_education.name") }}
</label> </label>
{{ profileForm.fields.state_of_education.input|raw }} <select name="state_of_education" class="custom-select form-control"
data-field="state_of_education" data-field_name="state_of_education"
data-provides="anomaly.field_type.select" id="state_of_education">
<option value="">Choose an option...</option>
{% for state_of_education in setting_value('visiosoft.module.profile::state_of_education') %}
<option value="{{ state_of_education }}"
{{ profileForm.fields.state_of_education.value == state_of_education ? 'selected' }}>
{{ state_of_education }}
</option>
{% endfor %}
</select>
</div> </div>
</div> </div>
<div class="col-md-12"> <div class="col-md-12">
@ -172,7 +193,17 @@
<label class="control-label font-weight-bold"> <label class="control-label font-weight-bold">
{{ trans("visiosoft.module.profile::field.profession.name") }} {{ trans("visiosoft.module.profile::field.profession.name") }}
</label> </label>
{{ profileForm.fields.profession.input|raw }} <select name="profession" class="custom-select form-control"
data-field="profession" data-field_name="profession"
data-provides="anomaly.field_type.select" id="profession">
<option value="">Choose an option...</option>
{% for profession in setting_value('visiosoft.module.profile::profession') %}
<option value="{{ profession }}"
{{ profileForm.fields.profession.value == profession ? 'selected' }}>
{{ profession }}
</option>
{% endfor %}
</select>
</div> </div>
</div> </div>
{% endif %} {% endif %}