|
20 | 20 | {% for entryType in entryTypes %}
|
21 | 21 | {% if entryType.fieldlayout.customFields|length %}
|
22 | 22 | <h3 class="table-heading">{{ entryType.name }} (
|
23 |
| - <div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ entryType.handle }}')"> |
| 23 | + <div class="fields-handle-attribute code small light copytextbtn" |
| 24 | + title="Copy to clipboard" |
| 25 | + role="button" |
| 26 | + aria-label="Copy to clipboard" |
| 27 | + tabindex="0" |
| 28 | + onclick="navigator.clipboard.writeText('{{ entryType.handle }}')" |
| 29 | + style="display: inline;" |
| 30 | + > |
24 | 31 | <input type="text" value="{{ entryType.handle }}" readonly="" size="{{ entryType.handle|length }}" tabindex="-1">
|
25 | 32 | <span data-icon="clipboard" aria-hidden="true"></span>
|
26 | 33 | </div>
|
|
36 | 43 | <th class="thin">{{ 'Enabled' |t('chatgpt-integration') }}</th>
|
37 | 44 | </tr>
|
38 | 45 | </thead>
|
| 46 | + <tbody> |
| 47 | + |
39 | 48 | {% for field in entryType.fieldlayout.customFields %}
|
40 |
| - <tbody> |
41 | 49 | <tr class="s-{{ field.id }}">
|
42 | 50 | <td class="label-column">{{ field.name }}</td>
|
43 | 51 | <td class="handle-column">
|
44 | 52 | <div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ field.handle }}')">
|
45 | 53 | <input type="text" value="{{ field.handle }}" readonly="" size="{{ field.handle|length }}" tabindex="-1">
|
46 | 54 | <span data-icon="clipboard" aria-hidden="true"></span>
|
47 | 55 | </div></td>
|
48 |
| - <td class="group-column">{{ craft.chatgptIntegration.getClass(field) }}</td> |
| 56 | + <td class="field-type-column">{{ craft.chatgptIntegration.getClass(field) }}</td> |
49 | 57 | <td class="enabled-column">
|
50 | 58 | {% if craft.chatgptIntegration.getClass(field) != "craft\\fields\\Matrix" %}
|
51 | 59 | {{ forms.lightswitch({
|
|
55 | 63 | {% endif %}
|
56 | 64 | </td>
|
57 | 65 | </tr>
|
58 |
| - </tbody> |
59 | 66 |
|
60 | 67 | {% if craft.chatgptIntegration.getClass(field) == "craft\\fields\\Matrix" %}
|
61 |
| - {% for block in field.getBlockTypes() %} |
| 68 | + {% for block in field.getEntryTypes() %} |
62 | 69 | {% for matrixField in block.customFields %}
|
63 |
| - <tbody> |
64 | 70 | <tr class="s-{{ matrixField.id }}">
|
65 | 71 | <td class="label-column" style="text-indent: 2em;">{{ block.name }}: {{ matrixField.name }}</td>
|
66 | 72 | <td class="handle-column">
|
67 | 73 | <div class="fields-handle-attribute code small light copytextbtn" title="Copy to clipboard" role="button" aria-label="Copy to clipboard" tabindex="0" onclick="navigator.clipboard.writeText('{{ matrixField.handle }}')">
|
68 | 74 | <input type="text" value="{{ matrixField.handle }}" readonly="" size="{{ matrixField.handle|length }}" tabindex="-1">
|
69 | 75 | <span data-icon="clipboard" aria-hidden="true"></span>
|
70 | 76 | </div></td>
|
71 |
| - <td class="group-column">{{ craft.chatgptIntegration.getClass(matrixField) }}</td> |
72 |
| - <td class="group-column">{{ matrixField.group ?? field.group }}</td> |
| 77 | + <td class="field-type-column">{{ craft.chatgptIntegration.getClass(matrixField) }}</td> |
73 | 78 | <td class="enabled-column">
|
74 | 79 | {{ forms.lightswitch({
|
75 | 80 | name: 'enabledFields[' ~ entryType.handle ~ '_' ~field.handle~'].key',
|
76 | 81 | on: settings.enabledFields|length and settings.enabledFields[entryType.handle ~ '_' ~field.handle] is defined and settings.enabledFields[ entryType.handle ~ '_' ~field.handle]
|
77 | 82 | }) }}
|
78 | 83 | </td>
|
79 | 84 | </tr>
|
80 |
| - </tbody> |
81 | 85 | {% endfor %}
|
82 | 86 | {% endfor %}
|
83 | 87 | {% endif %}
|
84 | 88 | {% endfor %}
|
| 89 | + </tbody> |
| 90 | + |
85 | 91 | </table>
|
86 | 92 | </div>
|
87 | 93 | {% else %}
|
88 | 94 | <div>
|
89 | 95 | <p>{{ 'No fields exist yet.'|t('chatgpt-integration') }}</p>
|
90 | 96 | </div>
|
91 | 97 | {% endif %}
|
| 98 | + |
| 99 | + {% else %} |
| 100 | + <div> |
| 101 | + <p>{{ 'No fields exist yet.'|t('chatgpt-integration') }}</p> |
| 102 | + </div> |
92 | 103 | {% endfor %}
|
93 | 104 |
|
94 | 105 | {% endnamespace %}
|
|
0 commit comments