Skip to content

Commit

Permalink
Tidy up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
Mosnar committed Jun 21, 2022
1 parent 236163d commit fc549e1
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 49 deletions.
3 changes: 0 additions & 3 deletions src/controllers/BulkEditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,14 +81,11 @@ public function actionGetFields(): Response

$service = Plugin::getInstance()->bulkEdit;
$customFields = $service->getFieldWrappersForElementQuery($this->getElementQuery());
// $attributes = $service->getAttributeWrappersForElementQuery($this->getElementQuery());
$attributes = [];

$view = Craft::$app->getView();
$view->setNamespace($namespace);
$modalHtml = $view->renderTemplate('venveo-bulk-edit/elementactions/BulkEdit/_fields', [
'fieldWrappers' => $customFields,
'attributeWrappers' => [],
'bulkedit' => $service,
'selectedTotal' => $this->getElementQuery()->count(),
'selectAllTotal' => $this->getElementQuery()->id(null)->count(),
Expand Down
47 changes: 1 addition & 46 deletions src/templates/elementactions/BulkEdit/_fields.twig
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<h2>{{ "Select Fields"|t('venveo-bulk-edit') }}</h2>
<p>Editing <strong>{{ selectedTotal }}</strong> elements on site
<strong>{{ site.name }} ({{ site.language }})</strong></p>
{% if fieldWrappers|length or attributeWrappers|length %}
{% if fieldWrappers|length %}

<div style="margin-bottom: 10px;">
{{ forms.checkbox({
Expand Down Expand Up @@ -84,51 +84,6 @@
{% else %}
<p>These elements have no associated fields.</p>
{% endif %}

{% if attributeWrappers|length %}
<table class="data fullwidth" id="attributes-table">
<thead>
<th scope="col" class="col-header">
<span class="heading-text">
Attribute
</span>
</th>
<th scope="col" class="col-header">
<span class="heading-text">
Edit
</span>
</th>
<th scope="col" class="col-header">
<span class="heading-text">
Strategy
</span>
</th>
</thead>
{# fieldWrapper #}
{% for attributeWrapper in attributeWrappers %}
<tr>
<td>
<span>
{{ attributeWrapper.name|t('site') }}
</span>
</td>
<td>
<span>
{{ forms.lightswitchField({
id: 'attributeEnabled-'~attributeWrapper.handle,
name: 'attributes['~attributeWrapper.handle~'][enabled]',
on: false,
value: true,
}) }}
</span>
</td>
<td>
<span></span>
</td>
</tr>
{% endfor %}
</table>
{% endif %}
<div class="field-edit-modal-bar">
<div class="buttons right">
<div class="btn" id="field-edit-cancel">Cancel</div>
Expand Down

0 comments on commit fc549e1

Please sign in to comment.