Skip to content

Commit

Permalink
Edit page classes
Browse files Browse the repository at this point in the history
Resolves #3439
  • Loading branch information
brandonkelly committed Nov 5, 2018
1 parent c3aa1d8 commit 5aae13c
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG-v3.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@
- Entries’ “Enabled” setting is now labeled “Enabled Globally” on multi-site installs. ([#2899](https://github.com/craftcms/cms/issues/2899))
- Entries’ “Enabled for site” setting now includes the site name in its label, and only shows up if the “Enabled Globally” setting is checked. ([#2899](https://github.com/craftcms/cms/issues/2899))
- The Set Status action on the Entries index page now includes a “Disabled for Site” option. ([#2899](https://github.com/craftcms/cms/issues/2899))
- Edit Category pages now have `edit-category` and `site--<SiteHandle>` classes on the `<body>`. ([#3439](https://github.com/craftcms/cms/issues/3439))
- Edit Entry pages now have `edit-entry` and `site--<SiteHandle>` classes on the `<body>`. ([#3439](https://github.com/craftcms/cms/issues/3439))
- Edit Global Set pages now have `edit-global-set` and `site--<SiteHandle>` classes on the `<body>`. ([#3439](https://github.com/craftcms/cms/issues/3439))
- Edit User pages now have an `edit-user` class on the `<body>`. ([#3439](https://github.com/craftcms/cms/issues/3439))

### Fixed
- Fixed a bug where the Edit User page could forget which permissions were selected when saving a user with validation errors, if the Username, First Name, and Last name fields were all blank. ([#3412](https://github.com/craftcms/cms/issues/3412))
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/CategoriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -328,6 +328,9 @@ public function actionEditCategory(string $groupHandle, int $categoryId = null,
// Other variables
// ---------------------------------------------------------------------

// Body class
$variables['bodyClass'] = 'edit-category site--' . $site->handle;

// Page title
if ($category->id === null) {
$variables['title'] = Craft::t('app', 'Create a new category');
Expand Down
3 changes: 3 additions & 0 deletions src/controllers/EntriesController.php
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,9 @@ public function actionEditEntry(string $sectionHandle, int $entryId = null, int
// Other variables
// ---------------------------------------------------------------------

// Body class
$variables['bodyClass'] = 'edit-entry site--' . $site->handle;

// Page title w/ revision label
$variables['showSites'] = (
Craft::$app->getIsMultiSite() &&
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/GlobalsController.php
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,9 @@ public function actionEditContent(string $globalSetHandle, string $siteHandle =
$globalSet = $editableGlobalSets[$globalSetHandle];
}

// Body class
$bodyClass = 'edit-global-set site--' . $site->handle;

// Define the content tabs
// ---------------------------------------------------------------------

Expand Down Expand Up @@ -209,6 +212,7 @@ public function actionEditContent(string $globalSetHandle, string $siteHandle =

// Render the template!
return $this->renderTemplate('globals/_edit', compact(
'bodyClass',
'editableGlobalSets',
'globalSet',
'tabs'
Expand Down
4 changes: 4 additions & 0 deletions src/controllers/UsersController.php
Original file line number Diff line number Diff line change
Expand Up @@ -829,6 +829,9 @@ public function actionEditUser($userId = null, User $user = null): Response
// Load the resources and render the page
// ---------------------------------------------------------------------

// Body class
$bodyClass = 'edit-user';

$this->getView()->registerAssetBundle(EditUserAsset::class);

$userIdJs = Json::encode($user->id);
Expand All @@ -843,6 +846,7 @@ public function actionEditUser($userId = null, User $user = null): Response
'isNewUser',
'statusLabel',
'actions',
'bodyClass',
'title',
'tabs',
'selectedTab',
Expand Down

0 comments on commit 5aae13c

Please sign in to comment.