Skip to content

Commit

Permalink
Added new field is_filter on meta_fields form
Browse files Browse the repository at this point in the history
  • Loading branch information
shraddha404 committed Feb 9, 2024
1 parent f316418 commit 4443f40
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 6 deletions.
1 change: 1 addition & 0 deletions app/Http/Controllers/CollectionController.php
Original file line number Diff line number Diff line change
Expand Up @@ -366,6 +366,7 @@ public function saveMeta(Request $request){
}
$meta_field->display_order = $request->input('display_order');
$meta_field->is_required = $request->input('is_required');
$meta_field->is_filter = $request->input('is_filter');
$meta_field->save();
return $this->metaInformation($request->input('collection_id'));
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class AddColumnIsFilterMetaFields extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('meta_fields', function (Blueprint $table) {
//
$table->tinyInteger('is_filter')->nullable();
});
}

/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('meta_fields', function (Blueprint $table) {
//
$table->dropColumn('is_filter');
});
}
}
30 changes: 24 additions & 6 deletions resources/views/metainformation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,19 @@
$("#options-field").hide();
}
if(val === 'TaxonomyTree'){
$("#taxonomy-tree-selection").show();
}
else{
$("#taxonomy-tree-selection").hide();
}
if(val === 'TaxonomyTree'){
$("#taxonomy-tree-selection").show();
}
else{
$("#taxonomy-tree-selection").hide();
}
if(val === "Select" || val === "SelectCombo" || val === "MultiSelect" || val === 'Date' || val === 'TaxonomyTree') {
$("#is_filter_div").show();
}
else{
$("#is_filter_div").hide();
}
});
});
Expand Down Expand Up @@ -170,6 +177,17 @@ function showMetaFieldForm(){
</div>
</div>

<div class="form-group row" id="is_filter_div">
<div class="col-md-4">
</div>
<div class="col-md-8">
<input type="checkbox" name="is_filter" id="is_filter" class="form-control1" value="1"
@if($edit_field->is_filter == 1) {{ 'checked' }} @endif
/>
<label for="is_required">Is filter</label>
</div>
</div>

<div class="form-group row mb-0"><div class="col-md-12 offset-md-4">
<button type="submit" class="btn btn-primary">
Save
Expand Down

0 comments on commit 4443f40

Please sign in to comment.