|
5 | 5 | @if (Settings != null) |
6 | 6 | { |
7 | 7 | <div class="accordion accordion-flush" id="accordionFlushExample"> |
8 | | - @foreach (var section in Settings.Sections) |
| 8 | + @foreach (var item in Settings.Sections) |
9 | 9 | { |
| 10 | + var sec = item.Label.GetHashCode(); |
| 11 | + |
10 | 12 | <div class="accordion-item"> |
11 | | - <h2 class="accordion-header" id="head-@section.Label.GetHashCode()"> |
12 | | - <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#id-@section.Label.GetHashCode()" aria-expanded="false" aria-controls="id-@section.Label.GetHashCode()"> |
13 | | - @section.Label |
| 13 | + <h2 class="accordion-header" id="head-@sec"> |
| 14 | + <button class="accordion-button collapsed" type="button" data-bs-toggle="collapse" data-bs-target="#id-@sec" aria-expanded="false" aria-controls="id-@sec"> |
| 15 | + @item.Label |
14 | 16 | </button> |
15 | 17 | </h2> |
16 | | - <div id="id-@section.Label.GetHashCode()" class="accordion-collapse collapse" aria-labelledby="head-@section.Label.GetHashCode()" data-bs-parent="#accordionFlushExample"> |
| 18 | + <div id="id-@sec" class="accordion-collapse collapse" aria-labelledby="head-@sec" data-bs-parent="#accordionFlushExample"> |
17 | 19 | <!-- Test if this -half is good for this section, theme developers may need full width --> |
18 | 20 | <div class="accordion-body section-content -half"> |
19 | | - @foreach (var field in section.Fields) |
| 21 | + @foreach (var field in item.Fields) |
20 | 22 | { |
21 | 23 | <div class="form-item"> |
22 | 24 | @if (field.Type == "select") |
23 | 25 | { |
24 | 26 | <label class="form-label">@field.Label</label> |
25 | 27 | <select class="form-select selectpicker" id="@field.Id" name="@field.Id"> |
26 | | - @foreach (var item in field.Options) |
| 28 | + @foreach (var opt in field.Options) |
27 | 29 | { |
28 | | - if (field.Value == item) |
| 30 | + if (field.Value == opt) |
29 | 31 | { |
30 | | - <option value="@item" selected>@item</option> |
| 32 | + <option value="@opt" selected>@opt</option> |
31 | 33 | } |
32 | 34 | else |
33 | 35 | { |
34 | | - <option value="@item">@item</option> |
| 36 | + <option value="@opt">@opt</option> |
35 | 37 | } |
36 | 38 | } |
37 | 39 | </select> |
|
0 commit comments