mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merge remote-tracking branch 'origin/3.0'
This commit is contained in:
commit
6d5d3d19b4
@ -159,7 +159,11 @@ class ModelAsController extends Controller implements NestedController {
|
||||
'SiteTree',
|
||||
"\"URLSegment\" = '$URLSegment'" . ($useParentIDFilter ? ' AND "ParentID" = ' . (int)$parentID : '')
|
||||
);
|
||||
if($pages && $pages->Count() == 1) return $pages->First();
|
||||
|
||||
if($pages && $pages->Count() == 1 && ($page = $pages->First())) {
|
||||
$parent = $page->ParentID ? $page->Parent() : $page;
|
||||
if($parent->isPublished()) return $page;
|
||||
}
|
||||
}
|
||||
|
||||
// Get an old version of a page that has been renamed.
|
||||
@ -175,8 +179,9 @@ class ModelAsController extends Controller implements NestedController {
|
||||
$record = $query->execute()->first();
|
||||
|
||||
if($record && ($oldPage = DataObject::get_by_id('SiteTree', $record['RecordID']))) {
|
||||
$oldParent = $oldPage->ParentID ? $oldPage->Parent() : $oldPage;
|
||||
// Run the page through an extra filter to ensure that all extensions are applied.
|
||||
if(SiteTree::get_by_link($oldPage->RelativeLink())) return $oldPage;
|
||||
if(SiteTree::get_by_link($oldPage->RelativeLink()) && $oldParent->isPublished()) return $oldPage;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -9,6 +9,7 @@ sass_dir = "scss"
|
||||
images_dir = "images"
|
||||
javascripts_dir = "javascript"
|
||||
output_style = :compact
|
||||
line_comments = false
|
||||
# To enable relative paths to assets via compass helper functions. Uncomment:
|
||||
# relative_assets = true
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger { display: inline-block; margin: 0 0 2px 0; position: absolute; top: 8px; right: 4px; }
|
||||
.cms-content-tools #cms-content-treeview .cms-tree-expand-trigger span.ui-button-text { padding-right: 8px; }
|
||||
.cms-content-tools #cms-content-treeview .cms-tree .badge, .cms-content-tools #cms-content-treeview .cms-tree a > .jstree-icon { display: none; }
|
||||
.cms-content-tools #cms-content-treeview .cms-tree a:hover > .text > .badge { display: inline-block; }
|
||||
.cms-content-tools #cms-content-treeview .cms-tree a:hover > .text > .badge, .cms-content-tools #cms-content-treeview .cms-tree .jstree-clicked > .text > .badge { display: inline-block; }
|
||||
|
||||
/** ------------------------------------------------------------------ URLSegment field ----------------------------------------------------------------- */
|
||||
.field.urlsegment.disabled { color: #444; padding-left: 0px; margin-left: 0px; background: none; border-color: transparent; }
|
||||
|
36
javascript/lang/ja_JP.js
Normal file
36
javascript/lang/ja_JP.js
Normal file
@ -0,0 +1,36 @@
|
||||
if(typeof(ss) == 'undefined' || typeof(ss.i18n) == 'undefined') {
|
||||
if(typeof(console) != 'undefined') console.error('Class ss.i18n not defined');
|
||||
} else {
|
||||
ss.i18n.addDictionary('ja_JP', {
|
||||
'CMSMAIN.WARNINGSAVEPAGESBEFOREADDING' : "子ページを追加する前に,そのページを保存する必要があります.",
|
||||
'CMSMAIN.CANTADDCHILDREN' : "選択されたノードには子供を追加することはできません.",
|
||||
'CMSMAIN.ERRORADDINGPAGE' : 'ページの追加でエラーが起きました.',
|
||||
'CMSMAIN.FILTEREDTREE' : '変更されたページのみ表示するフィルタされたツリー',
|
||||
'CMSMAIN.ERRORFILTERPAGES' : '変更されたページのみ表示するようにツリーをフィルタできませんでした<br />%s',
|
||||
'CMSMAIN.ERRORUNFILTER' : 'フィルタされていないツリー',
|
||||
'CMSMAIN.PUBLISHINGPAGES' : 'ページを公開しています...',
|
||||
'CMSMAIN.SELECTONEPAGE' : "最低でも1ページ選択してください.",
|
||||
'CMSMAIN.ERRORPUBLISHING' : 'ページを公開中にエラー',
|
||||
'CMSMAIN.REALLYDELETEPAGES' : "Do you really want to delete the %s marked pages?",
|
||||
'CMSMAIN.DELETINGPAGES' : 'ページを削除しています',
|
||||
'CMSMAIN.ERRORDELETINGPAGES': 'ページ削除においてエラー',
|
||||
'CMSMAIN.PUBLISHING' : '公開しています...',
|
||||
'CMSMAIN.RESTORING': '復元しています...',
|
||||
'CMSMAIN.ERRORREVERTING': 'Error reverting to live content',
|
||||
'CMSMAIN.SAVING' : '保存しています...',
|
||||
'CMSMAIN.SELECTMOREPAGES' : "You have %s pages selected.\n\nDo you really want to perform this action?",
|
||||
'CMSMAIN.ALERTCLASSNAME': 'ページ保存後にページの種類は更新されます.',
|
||||
'CMSMAIN.URLSEGMENTVALIDATION': 'URLはアルファベットの文字か数値,及びハイフンのみから構成されます.',
|
||||
'AssetAdmin.BATCHACTIONSDELETECONFIRM': "%sフォルダを本当に削除しますか?",
|
||||
'AssetTableField.REALLYDELETE': 'マークされているファイルを本当に削除しますか?',
|
||||
'AssetTableField.MOVING': '%sファイルを移動中.',
|
||||
'CMSMAIN.AddSearchCriteria': 'Add Criteria',
|
||||
'WidgetAreaEditor.TOOMANY': '申し訳ございません.このエリアにおけるウィジェットの最大数に到達しました.',
|
||||
'AssetAdmin.ConfirmDelete': 'このフォルダとフォルダに含まれるすべてのファイルを本当に削除しますか?',
|
||||
'Folder.Name': 'フォルダ名',
|
||||
'Tree.AddSubPage': 'ここに新しいページを追加',
|
||||
'Tree.EditPage': '編集',
|
||||
'CMSMain.ConfirmRestoreFromLive': "公開されているコンテンツを下書きサイトへ本当にコピーしますか?",
|
||||
'CMSMain.RollbackToVersion': "このページのバージョン#%sへ本当にロールバックしますか?"
|
||||
});
|
||||
}
|
@ -84,7 +84,7 @@
|
||||
}
|
||||
|
||||
// Show badge on hovered node
|
||||
a:hover > .text > .badge {
|
||||
a:hover > .text > .badge, .jstree-clicked > .text > .badge {
|
||||
display: inline-block;
|
||||
}
|
||||
}
|
||||
|
@ -22,7 +22,7 @@ $ExtraTreeTools
|
||||
</div>
|
||||
<% end_if %>
|
||||
|
||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-addpage="{$LinkPageAdd}AddForm/?action_doAdd=1&ParentID=%s&PageType=%s&SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
|
||||
<div class="cms-tree" data-url-tree="$Link(getsubtree)" data-url-savetreenode="$Link(savetreenode)" data-url-updatetreenodes="$Link(updatetreenodes)" data-url-addpage="{$LinkPageAdd}AddForm/?action_doAdd=1&ParentID=%s&PageType=%s&SecurityID=$SecurityID" data-url-editpage="$LinkPageEdit('%s')" data-hints="$SiteTreeHints">
|
||||
$SiteTreeAsUL
|
||||
</div>
|
||||
</div>
|
||||
|
@ -234,4 +234,32 @@ class ModelAsControllerTest extends FunctionalTest {
|
||||
$this->assertEquals(false, $response );
|
||||
}
|
||||
|
||||
/**
|
||||
* go to a page that's been published but is child of an unpublished page
|
||||
*
|
||||
* NOTE: This test requires nested_urls
|
||||
*/
|
||||
function testChildOfDraft() {
|
||||
RootURLController::reset();
|
||||
SiteTree::enable_nested_urls();
|
||||
|
||||
$draft = new Page();
|
||||
$draft->Title = 'Root Leve Draft Page';
|
||||
$draft->URLSegment = 'root';
|
||||
$draft->write();
|
||||
|
||||
$published = new Page();
|
||||
$published->Title = 'Published Page Under Draft Page';
|
||||
$published->URLSegment = 'sub-root';
|
||||
$published->write();
|
||||
$published->publish('Stage', 'Live');
|
||||
$response = $this->get('root/sub-root');
|
||||
|
||||
$this->assertEquals(
|
||||
$response->getStatusCode(),
|
||||
404,
|
||||
'The page should not be found since its parent has not been published, in this case http://<yousitename>/root/sub-root or http://<yousitename>/sub-root'
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user