mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
replace save draft / save & publish buttons with save, publish
This commit is contained in:
parent
b5f64aebec
commit
ca8b728580
@ -1623,7 +1623,7 @@ class CMSMain extends LeftAndMain implements CurrentPageIdentifier, PermissionPr
|
|||||||
$form->saveInto($record);
|
$form->saveInto($record);
|
||||||
$record->write();
|
$record->write();
|
||||||
|
|
||||||
// If the 'Save & Publish' button was clicked, also publish the page
|
// If the 'Publish' button was clicked, also publish the page
|
||||||
if ($doPublish) {
|
if ($doPublish) {
|
||||||
$record->publishRecursive();
|
$record->publishRecursive();
|
||||||
$message = _t(
|
$message = _t(
|
||||||
|
@ -2263,7 +2263,7 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
->setAttribute('data-btn-alternate-add', 'btn-primary font-icon-save')
|
->setAttribute('data-btn-alternate-add', 'btn-primary font-icon-save')
|
||||||
->setAttribute('data-btn-alternate-remove', $noChangesClasses)
|
->setAttribute('data-btn-alternate-remove', $noChangesClasses)
|
||||||
->setUseButtonTag(true)
|
->setUseButtonTag(true)
|
||||||
->setAttribute('data-text-alternate', _t('SilverStripe\\CMS\\Controllers\\CMSMain.SAVEDRAFT', 'Save draft'))
|
->setAttribute('data-text-alternate', _t('SilverStripe\\CMS\\Controllers\\CMSMain.SAVEDRAFT', 'Save'))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -2275,13 +2275,13 @@ class SiteTree extends DataObject implements PermissionProvider, i18nEntityProvi
|
|||||||
->setAttribute('data-btn-alternate-add', 'btn-primary font-icon-rocket')
|
->setAttribute('data-btn-alternate-add', 'btn-primary font-icon-rocket')
|
||||||
->setAttribute('data-btn-alternate-remove', $noChangesClasses)
|
->setAttribute('data-btn-alternate-remove', $noChangesClasses)
|
||||||
->setUseButtonTag(true)
|
->setUseButtonTag(true)
|
||||||
->setAttribute('data-text-alternate', _t(__CLASS__.'.BUTTONSAVEPUBLISH', 'Save & publish'))
|
->setAttribute('data-text-alternate', _t(__CLASS__.'.BUTTONSAVEPUBLISH', 'Publish'))
|
||||||
);
|
);
|
||||||
|
|
||||||
// Set up the initial state of the button to reflect the state of the underlying SiteTree object.
|
// Set up the initial state of the button to reflect the state of the underlying SiteTree object.
|
||||||
if ($stagesDiffer) {
|
if ($stagesDiffer) {
|
||||||
$publish->addExtraClass('btn-primary font-icon-rocket');
|
$publish->addExtraClass('btn-primary font-icon-rocket');
|
||||||
$publish->setTitle(_t(__CLASS__.'.BUTTONSAVEPUBLISH', 'Save & publish'));
|
$publish->setTitle(_t(__CLASS__.'.BUTTONSAVEPUBLISH', 'Publish'));
|
||||||
$publish->removeExtraClass($noChangesClasses);
|
$publish->removeExtraClass($noChangesClasses);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -58,7 +58,7 @@ en:
|
|||||||
ROLLEDBACKPUBv2: 'Rolled back to published version.'
|
ROLLEDBACKPUBv2: 'Rolled back to published version.'
|
||||||
ROLLEDBACKVERSIONv2: 'Rolled back to version #{version}.'
|
ROLLEDBACKVERSIONv2: 'Rolled back to version #{version}.'
|
||||||
SAVED: 'Saved ''{title}'' successfully.'
|
SAVED: 'Saved ''{title}'' successfully.'
|
||||||
SAVEDRAFT: 'Save draft'
|
SAVEDRAFT: 'Save'
|
||||||
SHOW_AS_LIST: 'show as list'
|
SHOW_AS_LIST: 'show as list'
|
||||||
TOO_MANY_PAGES: 'Too many pages'
|
TOO_MANY_PAGES: 'Too many pages'
|
||||||
TabContent: Content
|
TabContent: Content
|
||||||
@ -180,7 +180,7 @@ en:
|
|||||||
BUTTONDELETEDESC: 'Remove from draft/live and send to archive'
|
BUTTONDELETEDESC: 'Remove from draft/live and send to archive'
|
||||||
BUTTONPUBLISHED: Published
|
BUTTONPUBLISHED: Published
|
||||||
BUTTONSAVED: Saved
|
BUTTONSAVED: Saved
|
||||||
BUTTONSAVEPUBLISH: 'Save & publish'
|
BUTTONSAVEPUBLISH: 'Publish'
|
||||||
BUTTONUNPUBLISH: Unpublish
|
BUTTONUNPUBLISH: Unpublish
|
||||||
BUTTONUNPUBLISHDESC: 'Remove this page from the published site'
|
BUTTONUNPUBLISHDESC: 'Remove this page from the published site'
|
||||||
Comments: Comments
|
Comments: Comments
|
||||||
|
@ -14,7 +14,7 @@ Feature: Apply rich formatting to content
|
|||||||
When I press the "Align right" HTML field button
|
When I press the "Align right" HTML field button
|
||||||
Then "My awesome headline" in the "Content" HTML field should be right aligned
|
Then "My awesome headline" in the "Content" HTML field should be right aligned
|
||||||
But "Some amazing content" in the "Content" HTML field should be left aligned
|
But "Some amazing content" in the "Content" HTML field should be left aligned
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
Then "My awesome headline" in the "Content" HTML field should be right aligned
|
Then "My awesome headline" in the "Content" HTML field should be right aligned
|
||||||
|
|
||||||
Scenario: I can bold selected content
|
Scenario: I can bold selected content
|
||||||
@ -22,6 +22,6 @@ Feature: Apply rich formatting to content
|
|||||||
When I press the "Bold" HTML field button
|
When I press the "Bold" HTML field button
|
||||||
Then "awesome" in the "Content" HTML field should be bold
|
Then "awesome" in the "Content" HTML field should be bold
|
||||||
But "My" in the "Content" HTML field should not be bold
|
But "My" in the "Content" HTML field should not be bold
|
||||||
When I press the "Save draft" button
|
When I press the "Save" button
|
||||||
Then "awesome" in the "Content" HTML field should be bold
|
Then "awesome" in the "Content" HTML field should be bold
|
||||||
But "My" in the "Content" HTML field should not be bold
|
But "My" in the "Content" HTML field should not be bold
|
||||||
|
@ -19,6 +19,6 @@ Feature: Duplicate a page
|
|||||||
Then I should see a "Duplicated 'Page1' and children successfully" notice
|
Then I should see a "Duplicated 'Page1' and children successfully" notice
|
||||||
|
|
||||||
When I fill in "MenuTitle" with "Duplicate Page"
|
When I fill in "MenuTitle" with "Duplicate Page"
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
Then I should see "Page1" in the tree
|
Then I should see "Page1" in the tree
|
||||||
And I should see "Duplicate Page" in the tree
|
And I should see "Duplicate Page" in the tree
|
||||||
|
@ -21,7 +21,7 @@ Feature: Edit a page
|
|||||||
|
|
||||||
When I fill in "Title" with "About Us!"
|
When I fill in "Title" with "About Us!"
|
||||||
And I fill in the "Content" HTML field with "<p>my new content</p>"
|
And I fill in the "Content" HTML field with "<p>my new content</p>"
|
||||||
And I press the "Save draft" button
|
And I press the "Save" button
|
||||||
Then I should see the "Saved" button
|
Then I should see the "Saved" button
|
||||||
|
|
||||||
When I click on "About Us" in the tree
|
When I click on "About Us" in the tree
|
||||||
|
@ -24,7 +24,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=2]">awesome</a>"
|
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=2]">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
|
||||||
Scenario: I can link to an anchor in an internal page
|
Scenario: I can link to an anchor in an internal page
|
||||||
When I select "awesome" in the "Content" HTML field
|
When I select "awesome" in the "Content" HTML field
|
||||||
@ -41,7 +41,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=3]#youranchor">awesome</a>"
|
Then the "Content" HTML field should contain "<a title="my desc" href="[sitetree_link,id=3]#youranchor">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
|
||||||
Scenario: I can edit a link to an internal page
|
Scenario: I can edit a link to an internal page
|
||||||
Given I fill in the "Content" HTML field with "<a title='my desc' href='[sitetree_link,id=2]'>awesome</a>"
|
Given I fill in the "Content" HTML field with "<a title='my desc' href='[sitetree_link,id=2]'>awesome</a>"
|
||||||
@ -58,7 +58,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "<a title="my new desc" href="[sitetree_link,id=1]">awesome</a>"
|
Then the "Content" HTML field should contain "<a title="my new desc" href="[sitetree_link,id=1]">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
|
||||||
Scenario: I can link to an external URL
|
Scenario: I can link to an external URL
|
||||||
Given I select "awesome" in the "Content" HTML field
|
Given I select "awesome" in the "Content" HTML field
|
||||||
@ -70,7 +70,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "<a rel="noopener" href="http://silverstripe.org" target="_blank">awesome</a>"
|
Then the "Content" HTML field should contain "<a rel="noopener" href="http://silverstripe.org" target="_blank">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
|
||||||
Scenario: I can edit a link
|
Scenario: I can edit a link
|
||||||
Given I fill in the "Content" HTML field with "<p>My <a href='http://silverstripe.org'>awesome</a> content"
|
Given I fill in the "Content" HTML field with "<p>My <a href='http://silverstripe.org'>awesome</a> content"
|
||||||
@ -84,7 +84,7 @@ So that I can link to a external website or a page on my site
|
|||||||
And I press the "Insert" button
|
And I press the "Insert" button
|
||||||
Then the "Content" HTML field should contain "<a href="http://google.com">awesome</a>"
|
Then the "Content" HTML field should contain "<a href="http://google.com">awesome</a>"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
|
||||||
Scenario: I can remove a link
|
Scenario: I can remove a link
|
||||||
Given I fill in the "Content" HTML field with "My <a href='http://silverstripe.org'>awesome</a> content"
|
Given I fill in the "Content" HTML field with "My <a href='http://silverstripe.org'>awesome</a> content"
|
||||||
@ -93,4 +93,4 @@ So that I can link to a external website or a page on my site
|
|||||||
Then the "Content" HTML field should contain "My awesome content"
|
Then the "Content" HTML field should contain "My awesome content"
|
||||||
And the "Content" HTML field should not contain "http://silverstripe.org"
|
And the "Content" HTML field should not contain "http://silverstripe.org"
|
||||||
# Required to avoid "unsaved changes" browser dialog
|
# Required to avoid "unsaved changes" browser dialog
|
||||||
Then I press the "Save draft" button
|
Then I press the "Save" button
|
||||||
|
@ -23,7 +23,7 @@ Feature: Manage page permissions
|
|||||||
|
|
||||||
Scenario: I can limit page view permissions to logged-in users
|
Scenario: I can limit page view permissions to logged-in users
|
||||||
Given I select "Logged-in users" from "Who can view this page?" input group
|
Given I select "Logged-in users" from "Who can view this page?" input group
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
When I am not logged in
|
When I am not logged in
|
||||||
And I go to the homepage
|
And I go to the homepage
|
||||||
Then I should see a log-in form
|
Then I should see a log-in form
|
||||||
@ -34,7 +34,7 @@ Feature: Manage page permissions
|
|||||||
Scenario: I can limit page view permissions to certain groups
|
Scenario: I can limit page view permissions to certain groups
|
||||||
Given I select "Only these groups (choose from list)" from "Who can view this page?" input group
|
Given I select "Only these groups (choose from list)" from "Who can view this page?" input group
|
||||||
And I select "AUTHOR group" in the "#Form_EditForm_ViewerGroups_Holder" tree dropdown
|
And I select "AUTHOR group" in the "#Form_EditForm_ViewerGroups_Holder" tree dropdown
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
When I am not logged in
|
When I am not logged in
|
||||||
And I go to the homepage
|
And I go to the homepage
|
||||||
Then I should see a log-in form
|
Then I should see a log-in form
|
||||||
@ -48,14 +48,14 @@ Feature: Manage page permissions
|
|||||||
|
|
||||||
Scenario: I can limit page edit permissions to logged-in users
|
Scenario: I can limit page edit permissions to logged-in users
|
||||||
Given I select "Logged-in users" from "Who can edit this page?" input group
|
Given I select "Logged-in users" from "Who can edit this page?" input group
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
Then pages should be editable by "AUTHOR"
|
Then pages should be editable by "AUTHOR"
|
||||||
And pages should be editable by "ADMIN"
|
And pages should be editable by "ADMIN"
|
||||||
|
|
||||||
Scenario: I can limit page edit permissions to certain groups
|
Scenario: I can limit page edit permissions to certain groups
|
||||||
Given I select "Only these groups (choose from list)" from "Who can edit this page?" input group
|
Given I select "Only these groups (choose from list)" from "Who can edit this page?" input group
|
||||||
And I select "ADMIN group" in the "#Form_EditForm_EditorGroups_Holder" tree dropdown
|
And I select "ADMIN group" in the "#Form_EditForm_EditorGroups_Holder" tree dropdown
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
Then pages should not be editable by "AUTHOR"
|
Then pages should not be editable by "AUTHOR"
|
||||||
But pages should be editable by "ADMIN"
|
But pages should be editable by "ADMIN"
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ Feature: Preview a page
|
|||||||
And I fill in the "Content" HTML field with "<p>first content</p>"
|
And I fill in the "Content" HTML field with "<p>first content</p>"
|
||||||
And I press the "Publish" button
|
And I press the "Publish" button
|
||||||
And I fill in the "Content" HTML field with "<p>my new content</p>"
|
And I fill in the "Content" HTML field with "<p>my new content</p>"
|
||||||
And I press the "Save draft" button
|
And I press the "Save" button
|
||||||
And I set the CMS mode to "Preview mode"
|
And I set the CMS mode to "Preview mode"
|
||||||
|
|
||||||
When I switch the preview to "Published"
|
When I switch the preview to "Published"
|
||||||
|
@ -18,7 +18,7 @@ Feature: Publish a page
|
|||||||
And I go to "/admin/pages"
|
And I go to "/admin/pages"
|
||||||
And I should see "My Page" in the tree
|
And I should see "My Page" in the tree
|
||||||
And I click on "My Page" in the tree
|
And I click on "My Page" in the tree
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
|
|
||||||
Then I am not logged in
|
Then I am not logged in
|
||||||
And I go to "/my-page"
|
And I go to "/my-page"
|
||||||
@ -36,16 +36,16 @@ Feature: Publish a page
|
|||||||
Then I should see "Not published" in the "#ActionMenus_MoreOptions" element
|
Then I should see "Not published" in the "#ActionMenus_MoreOptions" element
|
||||||
And I should not see an "Unpublish" button
|
And I should not see an "Unpublish" button
|
||||||
And I should see an "Archive" button
|
And I should see an "Archive" button
|
||||||
And I should see a "Save & publish" button
|
And I should see a "Publish" button
|
||||||
And I should see a "Saved" button
|
And I should see a "Saved" button
|
||||||
|
|
||||||
When I fill in the "Content" HTML field with "<p>my new content</p>"
|
When I fill in the "Content" HTML field with "<p>my new content</p>"
|
||||||
And I click "More options" in the "#ActionMenus" element
|
And I click "More options" in the "#ActionMenus" element
|
||||||
Then I should not see an "Unpublish" button
|
Then I should not see an "Unpublish" button
|
||||||
And I should see a "Save & publish" button
|
And I should see a "Publish" button
|
||||||
And I should see a "Save draft" button
|
And I should see a "Save" button
|
||||||
|
|
||||||
When I press the "Save & publish" button
|
When I press the "Publish" button
|
||||||
And I click "More options" in the "#ActionMenus" element
|
And I click "More options" in the "#ActionMenus" element
|
||||||
Then I should see an "Unpublish" button
|
Then I should see an "Unpublish" button
|
||||||
And I should see an "Unpublish and archive" button
|
And I should see an "Unpublish and archive" button
|
||||||
@ -76,7 +76,7 @@ Feature: Publish a page
|
|||||||
And I go to "/admin/pages"
|
And I go to "/admin/pages"
|
||||||
And I should see "My Page" in the tree
|
And I should see "My Page" in the tree
|
||||||
And I click on "My Page" in the tree
|
And I click on "My Page" in the tree
|
||||||
And I press the "Save & publish" button
|
And I press the "Publish" button
|
||||||
And I click "More options" in the "#ActionMenus" element
|
And I click "More options" in the "#ActionMenus" element
|
||||||
Then I should see an "Unpublish" button
|
Then I should see an "Unpublish" button
|
||||||
|
|
||||||
@ -87,9 +87,9 @@ Feature: Publish a page
|
|||||||
When I press the "Archive" button, confirming the dialog
|
When I press the "Archive" button, confirming the dialog
|
||||||
Then I should see a "Restore" button
|
Then I should see a "Restore" button
|
||||||
And I should not see a "Published" button
|
And I should not see a "Published" button
|
||||||
And I should not see a "Save & publish" button
|
And I should not see a "Publish" button
|
||||||
And I should not see a "Saved" button
|
And I should not see a "Saved" button
|
||||||
And I should not see a "Save draft" button
|
And I should not see a "Save" button
|
||||||
|
|
||||||
When I press the "Restore" button, confirming the dialog
|
When I press the "Restore" button, confirming the dialog
|
||||||
Then I should see a "Save & publish" button
|
Then I should see a "Publish" button
|
||||||
|
@ -80,7 +80,7 @@ Feature: Search for a page
|
|||||||
Then I should see an edit page form
|
Then I should see an edit page form
|
||||||
|
|
||||||
When I fill in the "Content" HTML field with "<p>my new content</p>"
|
When I fill in the "Content" HTML field with "<p>my new content</p>"
|
||||||
And I press the "Save draft" button
|
And I press the "Save" button
|
||||||
Then I should see "Saved" in the "button#Form_EditForm_action_save" element
|
Then I should see "Saved" in the "button#Form_EditForm_action_save" element
|
||||||
|
|
||||||
When I go to "/admin/pages"
|
When I go to "/admin/pages"
|
||||||
|
Loading…
Reference in New Issue
Block a user