Skip to content

Commit

Permalink
Merge branch 'pr/1924' into 24.08.00
Browse files Browse the repository at this point in the history
  • Loading branch information
mdnoble73 committed Jul 29, 2024
2 parents ced7941 + 59e7ba4 commit de982bd
Show file tree
Hide file tree
Showing 7 changed files with 46 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,14 @@
z-index: 1;
position: relative;
}
.fa-save {
background-color: #3174AF;
border: 1px solid #3174AF;
}
.gjs-block-label {
font-size: 10px;
}
</style>
</body>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
<html lang="en">
<head>
<meta charset="UTF-8">
{if $canEdit}
<div style="position:absolute;top:50px;right:10px"><button onclick="window.location.href='{$editPageUrl|escape: 'html'}'">{translate text="Edit Page" isPublicFacing=false}</button></div>
{/if}
<title>{$title|escape: 'html'}</title>
</head>
<body>
Expand Down
9 changes: 9 additions & 0 deletions code/web/interface/themes/responsive/WebBuilder/grapesjs.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,15 @@
z-index: 1;
position: relative;
}
.fa-save {
background-color: #3174AF;
border: 1px solid #3174AF;
}
.gjs-block-label {
font-size: 10px;
}
</style>
</body>
</html>
3 changes: 3 additions & 0 deletions code/web/release_notes/24.08.00.MD
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
- Added ability to create templates that can be selected and used for Grapes Pages (*AB*)
- Added Grapes Pages to Web Indexer so that Grapes Pages are displayed in line with other WebBuilder pages when url is navigated to. (*AB*)
- Add a switch to disable grapes pages during testing period. (*MDN*)
- Added the option to create a Grapes Page from no template. (*AB*)
- Increased the font size of the labels for the Grapes JS components (*AB*)
- Added a blue background to the save button on the Grapes JS Editor in order to make it easier for users to find (*AB*)

// jacob

Expand Down
12 changes: 11 additions & 1 deletion code/web/services/WebBuilder/GrapesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,11 @@ function launch() {
$title = $this->grapesPage->title;
$interface->assign('id', $this->grapesPage->id);
$interface->assign('contents', $this->grapesPage->getFormattedContents());

$editButton = $this->generateEditPageUrl();
$interface->assign('editPageUrl', $editButton);
$canEdit = UserAccount::userHasPermission( 'Administer All Grapes Pages',
'Administer Library Grapes Pages');
$interface->assign('canEdit', $canEdit);
// $interface->assign('templateContent', $this->grapesPage->templateContent);
// $interface->assign('title', $title);

Expand All @@ -62,6 +66,12 @@ function canView(): bool {
return true;
}

function generateEditPageUrl() {
$objectId = $this->grapesPage->id;
$templatesSelect - $this->grapesPage->templatesSelect;
return '/services/WebBuilder/GrapesJSEditor?objectAction=edit&id=' . $objectId . '&tempalteId=' . $templatesSelect;
}

function getBreadcrumbs(): array {
$breadcrumbs = [];
$breadcrumbs[] = new Breadcrumb('/', 'Home');
Expand Down
13 changes: 10 additions & 3 deletions code/web/sys/DBMaintenance/grapes_web_builder_updates.php
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,13 @@ function getGrapesWebBuilderUpdates() {
'sql' => [
"ALTER TABLE system_variables ADD COLUMN enableGrapesEditor TINYINT(1) DEFAULT 0"
],
]
];
}
],
'add_a_blank_template_to_template_list' => [
'title' => 'Add a blank template to list',
'description' => 'Add a blank template to template list',
'sql' => [
"INSERT INTO templates (templateName, templateContent) VALUES ('No Template', ' ')",
],
],
];
}
2 changes: 2 additions & 0 deletions code/web/sys/WebBuilder/GrapesPage.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ static function getObjectStructure($context = ''): array {
'description' => 'The title of the page',
'size' => '40',
'maxLength' => 100,
'required' => true,
],
'urlAlias' => [
'property' => 'urlAlias',
Expand All @@ -52,6 +53,7 @@ static function getObjectStructure($context = ''): array {
'description' => 'The url of the page (no domain name)',
'size' => '40',
'maxLength' => 100,
'required' => true,
],
'teaser' => [
'property' => 'teaser',
Expand Down

0 comments on commit de982bd

Please sign in to comment.