Merge branch 'development'
This commit is contained in:
commit
dbf77ca4ee
2 changed files with 19 additions and 13 deletions
|
@ -78,18 +78,21 @@
|
||||||
<label class="col-md-3 form-control-label" for="text-input">Budget Type</label>
|
<label class="col-md-3 form-control-label" for="text-input">Budget Type</label>
|
||||||
<div class="col-md-9">
|
<div class="col-md-9">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6 btn-group-vertical">
|
<div class="col-md-6">
|
||||||
<label class="btn btn-secondary mb-0" [class.active]="categoryId == ''">
|
<div>
|
||||||
<input value="" type="radio" name="radios" style="display:none;" [(ngModel)]="categoryId">Uncategorised
|
<input value="" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
</label>
|
<label>Uncategorised</label>
|
||||||
<label *ngFor="let category of leftCategoryIdList, let i=index" class="btn btn-secondary mb-0" [class.active]="categoryId == category">
|
</div>
|
||||||
<input [value]="category" type="radio" name="radios" style="display:none;" [(ngModel)]="categoryId">{{ categoryNameList[i] }}
|
<div class="radio" *ngFor="let category of leftCategoryIdList, let i=index">
|
||||||
</label>
|
<input [value]="category" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
|
<label>{{ leftCategoryNameList[i] }}</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<div class="radio" *ngFor="let category2 of rightCategoryIdList, let i=index">
|
||||||
|
<input [value]="category2" type="radio" name="radios" [(ngModel)]="categoryId">
|
||||||
|
<label>{{ rightCategoryNameList[i] }}</label>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-6 btn-group-vertical">
|
|
||||||
<label *ngFor="let category2 of rightCategoryIdList, let i=index" class="btn btn-secondary mb-0" [class.active]=" categoryId == category2">
|
|
||||||
<input [value]="category2" type="radio" name="radios" style="display:none;" [(ngModel)]="categoryId">{{ categoryNameList[category2 - 1] }}
|
|
||||||
</label>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<span class="help-block"><strong>Optional:</strong> Choose the Budget Type for the majority of the purchase.</span>
|
<span class="help-block"><strong>Optional:</strong> Choose the Budget Type for the majority of the purchase.</span>
|
||||||
|
|
|
@ -44,7 +44,8 @@ export class AddDataComponent implements OnInit {
|
||||||
minDate: any;
|
minDate: any;
|
||||||
leftCategoryIdList: number[] = [];
|
leftCategoryIdList: number[] = [];
|
||||||
rightCategoryIdList: number[] = [];
|
rightCategoryIdList: number[] = [];
|
||||||
categoryNameList: string[] = [];
|
leftCategoryNameList: number[] = [];
|
||||||
|
rightCategoryNameList: number[] = [];
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
private formBuilder: FormBuilder,
|
private formBuilder: FormBuilder,
|
||||||
|
@ -90,10 +91,12 @@ export class AddDataComponent implements OnInit {
|
||||||
|
|
||||||
private setCategoryList(data: any) {
|
private setCategoryList(data: any) {
|
||||||
let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
let categoryIdList = Object.keys(data.ids).map(key => data.ids[key]);
|
||||||
this.categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
let categoryNameList = Object.keys(data.names).map(key => data.names[key]);
|
||||||
let halfLength = Math.floor(categoryIdList.length / 2);
|
let halfLength = Math.floor(categoryIdList.length / 2);
|
||||||
this.leftCategoryIdList = categoryIdList.splice(0, halfLength);
|
this.leftCategoryIdList = categoryIdList.splice(0, halfLength);
|
||||||
|
this.leftCategoryNameList = categoryNameList.splice(0, halfLength);
|
||||||
this.rightCategoryIdList = categoryIdList;
|
this.rightCategoryIdList = categoryIdList;
|
||||||
|
this.rightCategoryNameList = categoryNameList;
|
||||||
}
|
}
|
||||||
|
|
||||||
getMinDate() {
|
getMinDate() {
|
||||||
|
|
Reference in a new issue