Skip to content

Commit

Permalink
Merge pull request #84 from creative-commoners/pulls/2.0/button-styles
Browse files Browse the repository at this point in the history
FIX Make update button primary, add icon (SS 4.2+) for explore addons, reorder buttons
  • Loading branch information
ScopeyNZ committed May 31, 2018
2 parents 9a89efa + 27f9c24 commit 1b5a778
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
2 changes: 1 addition & 1 deletion src/Forms/GridFieldRefreshButton.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ public function getHTMLFragments($gridField)
null
);

$button->addExtraClass('btn btn-secondary font-icon-sync');
$button->addExtraClass('btn btn-primary font-icon-sync');

$button->setAttribute('data-check', $gridField->Link('check'));
$button->setAttribute(
Expand Down
29 changes: 17 additions & 12 deletions src/Reports/SiteSummary.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,23 @@

namespace BringYourOwnIdeas\Maintenance\Reports;

use BringYourOwnIdeas\Maintenance\Forms\GridFieldDropdownFilter;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldHtmlFragment;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldLinkButton;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldRefreshButton;
use BringYourOwnIdeas\Maintenance\Model\Package;
use SilverStripe\Core\Config\Config;
use BringYourOwnIdeas\Maintenance\Tasks\UpdatePackageInfoTask;
use SilverStripe\Core\Config\Config;
use SilverStripe\Core\Injector\Injector;
use SilverStripe\Forms\GridField\GridField;
use SilverStripe\Forms\GridField\GridFieldConfig;
use SilverStripe\View\Requirements;
use SilverStripe\Forms\GridField\GridFieldExportButton;
use SilverStripe\View\ArrayData;
use SilverStripe\Core\Injector\Injector;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldDropdownFilter;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldRefreshButton;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldLinkButton;
use BringYourOwnIdeas\Maintenance\Forms\GridFieldHtmlFragment;
use SilverStripe\Forms\GridField\GridFieldPaginator;
use SilverStripe\Forms\GridField\GridFieldPrintButton;
use SilverStripe\ORM\FieldType\DBField;
use SilverStripe\Reports\Report;
use SilverStripe\View\ArrayData;
use SilverStripe\View\Requirements;

/**
* A report listing all installed modules used in this site (from a cache).
Expand Down Expand Up @@ -98,14 +99,18 @@ public function getReportField()
'buttons-before-left'
),
$this->getDropdownFilter(),
$this->getInfoLink(),
Injector::inst()->create(GridFieldHtmlFragment::class, 'header', $versionHtml)
);

// Re-order the paginator to ensure it counts correctly.
// Re-order the paginator to ensure it counts correctly, and reorder the buttons
$paginator = $config->getComponentByType(GridFieldPaginator::class);
$config->removeComponent($paginator);
$config->addComponent($paginator);
$config->removeComponent($paginator)->addComponent($paginator);

$exportButton = $config->getComponentByType(GridFieldExportButton::class);
$config->removeComponent($exportButton)->addComponent($exportButton);

$printButton = $config->getComponentByType(GridFieldPrintButton::class);
$config->removeComponentsByType($printButton)->addComponent($printButton);

return $grid;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
<a class="gridfield-button-link btn btn-secondary"
href="$Link.ATT" target="_blank">
<a class="gridfield-button-link btn btn-secondary font-icon-explore-addons" href="$Link.ATT" target="_blank">
$Caption.XML
</a>

0 comments on commit 1b5a778

Please sign in to comment.