mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge branch '3.0'
Conflicts: composer.json
This commit is contained in:
commit
e6e12fe00e
@ -1,6 +1,6 @@
|
|||||||
## SilverStripe CMS
|
## SilverStripe CMS
|
||||||
|
|
||||||
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-cms.png)](http://travis-ci.org/silverstripe/silverstripe-cms)
|
[![Build Status](https://secure.travis-ci.org/silverstripe/silverstripe-cms.png?branch=3.0)](http://travis-ci.org/silverstripe/silverstripe-cms)
|
||||||
|
|
||||||
PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/sapphire) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project.
|
PHP5 Content Management System (CMS), see [http://silverstripe.org](http://silverstripe.org). Requires the [`framework`](http://github.com/silverstripe/sapphire) module and a [`silverstripe-installer`](http://github.com/silverstripe/silverstripe-installer) base project.
|
||||||
|
|
||||||
@ -19,7 +19,7 @@ and [installation from source](http://doc.silverstripe.org/framework/en/installa
|
|||||||
|
|
||||||
## License ##
|
## License ##
|
||||||
|
|
||||||
Copyright (c) 2007-2011, SilverStripe Limited - www.silverstripe.com
|
Copyright (c) 2007-2012, SilverStripe Limited - www.silverstripe.com
|
||||||
All rights reserved.
|
All rights reserved.
|
||||||
|
|
||||||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
|
||||||
|
@ -120,11 +120,17 @@ JS
|
|||||||
|
|
||||||
// Category filter
|
// Category filter
|
||||||
if(isset($params['AppCategory'])) {
|
if(isset($params['AppCategory'])) {
|
||||||
$exts = File::$app_categories[$params['AppCategory']];
|
if(isset(File::$app_categories[$params['AppCategory']])) {
|
||||||
|
$exts = File::$app_categories[$params['AppCategory']];
|
||||||
|
} else {
|
||||||
|
$exts = array();
|
||||||
|
}
|
||||||
$categorySQLs = array();
|
$categorySQLs = array();
|
||||||
foreach($exts as $ext) $categorySQLs[] = '"File"."Name" LIKE \'%.' . $ext . '\'';
|
foreach($exts as $ext) $categorySQLs[] = '"File"."Name" LIKE \'%.' . $ext . '\'';
|
||||||
// TODO Use DataList->filterAny() once OR connectives are implemented properly
|
// TODO Use DataList->filterAny() once OR connectives are implemented properly
|
||||||
$list = $list->where('(' . implode(' OR ', $categorySQLs) . ')');
|
if (count($categorySQLs) > 0) {
|
||||||
|
$list = $list->where('(' . implode(' OR ', $categorySQLs) . ')');
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $list;
|
return $list;
|
||||||
|
@ -27,6 +27,8 @@ class SiteTreeURLSegmentField extends TextField {
|
|||||||
|
|
||||||
public function Field($properties = array()) {
|
public function Field($properties = array()) {
|
||||||
Requirements::javascript(CMS_DIR . '/javascript/SiteTreeURLSegmentField.js');
|
Requirements::javascript(CMS_DIR . '/javascript/SiteTreeURLSegmentField.js');
|
||||||
|
Requirements::add_i18n_javascript(CMS_DIR . '/javascript/lang', false, true);
|
||||||
|
Requirements::css(CMS_DIR . "/css/screen.css");
|
||||||
return parent::Field($properties);
|
return parent::Field($properties);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,6 @@ class SiteConfig extends DataObject implements PermissionProvider {
|
|||||||
* @return FieldList
|
* @return FieldList
|
||||||
*/
|
*/
|
||||||
public function getCMSFields() {
|
public function getCMSFields() {
|
||||||
Requirements::javascript(CMS_DIR . "/javascript/SitetreeAccess.js");
|
|
||||||
|
|
||||||
$groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray();
|
$groupsMap = Group::get()->map('ID', 'Breadcrumbs')->toArray();
|
||||||
asort($groupsMap);
|
asort($groupsMap);
|
||||||
|
@ -24,5 +24,8 @@
|
|||||||
"branch-alias": {
|
"branch-alias": {
|
||||||
"dev-master": "3.1.x-dev"
|
"dev-master": "3.1.x-dev"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"autoload": {
|
||||||
|
"classmap": ["tests/behat/"]
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -166,7 +166,7 @@
|
|||||||
// edit button
|
// edit button
|
||||||
editAction = $('<button />', {
|
editAction = $('<button />', {
|
||||||
'class': 'ss-ui-button ss-ui-button-small edit',
|
'class': 'ss-ui-button ss-ui-button-small edit',
|
||||||
'text': ss.i18n._t('URLSEGMENT.Edit'),
|
'text': ss.i18n._t('URLSEGMENT.Edit', 'Edit'),
|
||||||
'click': function(e) {
|
'click': function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.edit();
|
self.edit();
|
||||||
@ -177,7 +177,7 @@
|
|||||||
// update button
|
// update button
|
||||||
updateAction = $('<button />', {
|
updateAction = $('<button />', {
|
||||||
'class': 'update ss-ui-button-small',
|
'class': 'update ss-ui-button-small',
|
||||||
'text': ss.i18n._t('URLSEGMENT.OK'),
|
'text': ss.i18n._t('URLSEGMENT.OK', 'OK'),
|
||||||
'click': function(e) {
|
'click': function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.update();
|
self.update();
|
||||||
@ -188,7 +188,7 @@
|
|||||||
cancelAction = $('<button />', {
|
cancelAction = $('<button />', {
|
||||||
'class': 'cancel ss-ui-action-minor ss-ui-button-small',
|
'class': 'cancel ss-ui-action-minor ss-ui-button-small',
|
||||||
'href': '#',
|
'href': '#',
|
||||||
'text': ss.i18n._t('URLSEGMENT.Cancel'),
|
'text': ss.i18n._t('URLSEGMENT.Cancel', 'Cancel'),
|
||||||
'click': function(e) {
|
'click': function(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
self.cancel();
|
self.cancel();
|
||||||
|
10
lang/en.yml
10
lang/en.yml
@ -1,6 +1,7 @@
|
|||||||
en:
|
en:
|
||||||
AssetAdmin:
|
AssetAdmin:
|
||||||
ADDFILES: 'Add Files'
|
ADDFILES: 'Add Files'
|
||||||
|
ALLOWEDEXTS: 'Allowed extensions'
|
||||||
ActionAdd: 'Add folder'
|
ActionAdd: 'Add folder'
|
||||||
AppCategoryArchive: Archive
|
AppCategoryArchive: Archive
|
||||||
AppCategoryAudio: Audio
|
AppCategoryAudio: Audio
|
||||||
@ -138,7 +139,6 @@ en:
|
|||||||
MENUTITLE: Pages
|
MENUTITLE: Pages
|
||||||
TreeView: 'Tree View'
|
TreeView: 'Tree View'
|
||||||
CMSPagesController_ContentToolbar.ss:
|
CMSPagesController_ContentToolbar.ss:
|
||||||
ENABLEDRAGGING: 'Drag''n''drop'
|
|
||||||
MULTISELECT: Multi-selection
|
MULTISELECT: Multi-selection
|
||||||
CMSPagesController_Tools.ss:
|
CMSPagesController_Tools.ss:
|
||||||
FILTER: Filter
|
FILTER: Filter
|
||||||
@ -173,7 +173,7 @@ en:
|
|||||||
PUBLISHEDSITE: 'Published Site'
|
PUBLISHEDSITE: 'Published Site'
|
||||||
Password: Password
|
Password: Password
|
||||||
PostInstallTutorialIntro: 'This website is a simplistic version of a SilverStripe 3 site. To extend this, please take a look at {link}.'
|
PostInstallTutorialIntro: 'This website is a simplistic version of a SilverStripe 3 site. To extend this, please take a look at {link}.'
|
||||||
StartEditing: 'You can start editing your site\''s content by opening <a href="{link}">the CMS</a>.'
|
StartEditing: 'You can start editing your content by opening <a href="{link}">the CMS</a>.'
|
||||||
UnableDeleteInstall: 'Unable to delete installation files. Please delete the files below manually'
|
UnableDeleteInstall: 'Unable to delete installation files. Please delete the files below manually'
|
||||||
VIEWPAGEIN: 'View Page in:'
|
VIEWPAGEIN: 'View Page in:'
|
||||||
ErrorPage:
|
ErrorPage:
|
||||||
@ -323,9 +323,9 @@ en:
|
|||||||
LINKCHANGENOTE: 'Changing this page''s link will also affect the links of all child pages.'
|
LINKCHANGENOTE: 'Changing this page''s link will also affect the links of all child pages.'
|
||||||
MENUTITLE: 'Navigation label'
|
MENUTITLE: 'Navigation label'
|
||||||
METADESC: 'Meta Description'
|
METADESC: 'Meta Description'
|
||||||
METADESCHELP: 'Search engines use this content for displaying search results (although it will not influence their ranking).'
|
|
||||||
METAEXTRA: 'Custom Meta Tags'
|
METAEXTRA: 'Custom Meta Tags'
|
||||||
METAEXTRAHELP: 'HTML tags for additional meta information. For example <meta name="customName" content="your custom content here" />'
|
METAKEYWORDS: 'Meta Keywords'
|
||||||
|
METATITLE: 'Meta Title'
|
||||||
MODIFIEDONDRAFTHELP: 'Page has unpublished changes'
|
MODIFIEDONDRAFTHELP: 'Page has unpublished changes'
|
||||||
MODIFIEDONDRAFTSHORT: Modified
|
MODIFIEDONDRAFTSHORT: Modified
|
||||||
MetadataToggle: Metadata
|
MetadataToggle: Metadata
|
||||||
@ -387,8 +387,6 @@ en:
|
|||||||
VIEWLAST: 'View last'
|
VIEWLAST: 'View last'
|
||||||
VIEWNEXT: 'View next'
|
VIEWNEXT: 'View next'
|
||||||
VIEWPREVIOUS: 'View previous'
|
VIEWPREVIOUS: 'View previous'
|
||||||
TreeTools:
|
|
||||||
DisplayLabel: 'Display:'
|
|
||||||
ViewArchivedEmail.ss:
|
ViewArchivedEmail.ss:
|
||||||
CANACCESS: 'You can access the archived site at this link:'
|
CANACCESS: 'You can access the archived site at this link:'
|
||||||
HAVEASKED: 'You have asked to view the content of our site on'
|
HAVEASKED: 'You have asked to view the content of our site on'
|
||||||
|
1
tests/behat/README.md
Normal file
1
tests/behat/README.md
Normal file
@ -0,0 +1 @@
|
|||||||
|
See https://github.com/silverstripe-labs/silverstripe-behat-extension
|
0
tests/behat/_manifest_exclude
Normal file
0
tests/behat/_manifest_exclude
Normal file
34
tests/behat/behat.yml
Normal file
34
tests/behat/behat.yml
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
default:
|
||||||
|
context:
|
||||||
|
class: SilverStripe\Cms\Test\Behaviour\FeatureContext
|
||||||
|
extensions:
|
||||||
|
SilverStripe\BehatExtension\Extension: ~
|
||||||
|
Behat\MinkExtension\Extension:
|
||||||
|
# Adjust this to your local environment
|
||||||
|
base_url: http://localhost/
|
||||||
|
files_path: %behat.paths.features%/files/
|
||||||
|
default_session: selenium2
|
||||||
|
javascript_session: selenium2
|
||||||
|
goutte: ~
|
||||||
|
selenium2:
|
||||||
|
browser: firefox
|
||||||
|
|
||||||
|
# Alternative profile, use with "vendor/bin/behat --profile chrome"
|
||||||
|
chrome:
|
||||||
|
extensions:
|
||||||
|
Behat\MinkExtension\Extension:
|
||||||
|
selenium2:
|
||||||
|
browser: chrome
|
||||||
|
|
||||||
|
# Saucelabs.com sample setup, use with "vendor/bin/behat --profile saucelabs"
|
||||||
|
saucelabs:
|
||||||
|
extensions:
|
||||||
|
Behat\MinkExtension\Extension:
|
||||||
|
selenium2:
|
||||||
|
browser: firefox
|
||||||
|
# Add your own username and API token here
|
||||||
|
wd_host: <user>:<api-token>@ondemand.saucelabs.com/wd/hub
|
||||||
|
capabilities:
|
||||||
|
platform: "Windows 2008"
|
||||||
|
browser: "firefox"
|
||||||
|
version: "15"
|
38
tests/behat/features/bootstrap/FeatureContext.php
Normal file
38
tests/behat/features/bootstrap/FeatureContext.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace SilverStripe\Cms\Test\Behaviour;
|
||||||
|
|
||||||
|
use SilverStripe\BehatExtension\Context\SilverStripeContext,
|
||||||
|
SilverStripe\BehatExtension\Context\BasicContext,
|
||||||
|
SilverStripe\BehatExtension\Context\LoginContext,
|
||||||
|
SilverStripe\Test\Behaviour\CmsFormsContext,
|
||||||
|
SilverStripe\Test\Behaviour\CmsUiContext;
|
||||||
|
|
||||||
|
// PHPUnit
|
||||||
|
require_once 'PHPUnit/Autoload.php';
|
||||||
|
require_once 'PHPUnit/Framework/Assert/Functions.php';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Features context
|
||||||
|
*
|
||||||
|
* Context automatically loaded by Behat.
|
||||||
|
* Uses subcontexts to extend functionality.
|
||||||
|
*/
|
||||||
|
class FeatureContext extends SilverStripeContext
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Initializes context.
|
||||||
|
* Every scenario gets it's own context object.
|
||||||
|
*
|
||||||
|
* @param array $parameters context parameters (set them up through behat.yml)
|
||||||
|
*/
|
||||||
|
public function __construct(array $parameters)
|
||||||
|
{
|
||||||
|
$this->useContext('BasicContext', new BasicContext($parameters));
|
||||||
|
$this->useContext('LoginContext', new LoginContext($parameters));
|
||||||
|
$this->useContext('CmsFormsContext', new CmsFormsContext($parameters));
|
||||||
|
$this->useContext('CmsUiContext', new CmsUiContext($parameters));
|
||||||
|
|
||||||
|
parent::__construct($parameters);
|
||||||
|
}
|
||||||
|
}
|
15
tests/behat/features/create-a-page.feature
Normal file
15
tests/behat/features/create-a-page.feature
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
@database-defaults
|
||||||
|
Feature: Create a page
|
||||||
|
As an author
|
||||||
|
I want to create a page in the CMS
|
||||||
|
So that I can grow my website
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can create a page from the pages section
|
||||||
|
Given I am logged in with "ADMIN" permissions
|
||||||
|
And I go to "/admin/pages"
|
||||||
|
And I should see a "Add new" button in CMS Content Toolbar
|
||||||
|
When I press the "Add new" button
|
||||||
|
And I check "Page"
|
||||||
|
And I press the "Create" button
|
||||||
|
Then I should see an edit page form
|
29
tests/behat/features/edit-a-page.feature
Normal file
29
tests/behat/features/edit-a-page.feature
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
@database-defaults
|
||||||
|
Feature: Edit a page
|
||||||
|
As an author
|
||||||
|
I want to edit a page in the CMS
|
||||||
|
So that I correct errors and provide new information
|
||||||
|
|
||||||
|
Background:
|
||||||
|
Given I am logged in with "ADMIN" permissions
|
||||||
|
And I go to "/admin/pages"
|
||||||
|
Then I should see "About Us" in CMS Tree
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can open a page for editing from the pages tree
|
||||||
|
When I follow "About Us"
|
||||||
|
Then I should see an edit page form
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can edit title and content and see the changes on draft
|
||||||
|
When I follow "About Us"
|
||||||
|
Then I should see an edit page form
|
||||||
|
|
||||||
|
When I fill in "Title" with "About Us!"
|
||||||
|
And I fill in the content form with "my new content"
|
||||||
|
And I press the "Save Draft" button
|
||||||
|
Then I should see a "Saved." notice
|
||||||
|
|
||||||
|
When I follow "About Us"
|
||||||
|
Then the "Title" field should contain "About Us!"
|
||||||
|
And the content form should contain "my new content"
|
41
tests/behat/features/preview-a-page.feature
Normal file
41
tests/behat/features/preview-a-page.feature
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
@database-defaults
|
||||||
|
Feature: Preview a page
|
||||||
|
As an author
|
||||||
|
I want to preview the page I'm editing in the CMS
|
||||||
|
So that I can see how it would look like to my visitors
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can show a preview of the current page from the pages section
|
||||||
|
Given I am logged in with "ADMIN" permissions
|
||||||
|
And I go to "/admin/pages"
|
||||||
|
Then I should see "About Us" in CMS Tree
|
||||||
|
|
||||||
|
When I follow "About Us"
|
||||||
|
And I press the "Preview »" button
|
||||||
|
Then I can see the preview panel
|
||||||
|
And the preview contains "About Us"
|
||||||
|
|
||||||
|
# TODO:
|
||||||
|
# - Only tests correctly on fresh database
|
||||||
|
# - We should continue testing against it after we have fixtures ready
|
||||||
|
@javascript
|
||||||
|
Scenario: I can see an updated preview when editing content
|
||||||
|
Given I am logged in with "ADMIN" permissions
|
||||||
|
And I go to "/admin/pages"
|
||||||
|
Then I should see "About Us" in CMS Tree
|
||||||
|
|
||||||
|
When I follow "About Us"
|
||||||
|
And I fill in the content form with "my new content"
|
||||||
|
And I press the "Save Draft" button
|
||||||
|
And I press the "Preview »" button
|
||||||
|
|
||||||
|
When I follow "Published Site"
|
||||||
|
Then the preview does not contain "my new content"
|
||||||
|
And the preview contains "You can fill"
|
||||||
|
|
||||||
|
When I follow "Draft Site"
|
||||||
|
Then the preview does not contain "You can fill"
|
||||||
|
And the preview contains "my new content"
|
||||||
|
|
||||||
|
When I press the "« Edit" button
|
||||||
|
Then I should see an edit page form
|
4
tests/behat/features/publish-a-page.feature
Normal file
4
tests/behat/features/publish-a-page.feature
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
Feature: Create a page
|
||||||
|
As a site owner
|
||||||
|
I want content to go to a draft site before being published
|
||||||
|
So that only high quality changes are seen by our visitors
|
18
tests/behat/features/search-for-a-page.feature
Normal file
18
tests/behat/features/search-for-a-page.feature
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
@database-defaults
|
||||||
|
Feature: Search for a page
|
||||||
|
As an author
|
||||||
|
I want to search for a page in the CMS
|
||||||
|
So that I can efficiently navigate nested content structures
|
||||||
|
|
||||||
|
@javascript
|
||||||
|
Scenario: I can search for a page by its title
|
||||||
|
Given I am logged in with "ADMIN" permissions
|
||||||
|
And I go to "/admin/pages"
|
||||||
|
Then I should see "About Us" in CMS Tree
|
||||||
|
And I should see "Contact Us" in CMS Tree
|
||||||
|
|
||||||
|
When I expand the "Filter" CMS Panel
|
||||||
|
And I fill in "Content" with "About Us"
|
||||||
|
And I press the "Apply Filter" button
|
||||||
|
Then I should see "About Us" in CMS Tree
|
||||||
|
But I should not see "Contact Us" in CMS Tree
|
Loading…
Reference in New Issue
Block a user