Merge branch 'dev' into feature/importexport-full-roundtrip

This commit is contained in:
Sipke Schoorstra
2015-07-09 12:30:09 +01:00
8 changed files with 23 additions and 22 deletions

View File

@@ -117,9 +117,8 @@ namespace Orchard.Autoroute.Drivers {
var homepage = _aliasService.Get(string.Empty); var homepage = _aliasService.Get(string.Empty);
var displayRouteValues = _contentManager.GetItemMetadata(part).DisplayRouteValues; var displayRouteValues = _contentManager.GetItemMetadata(part).DisplayRouteValues;
if (homepage.Match(displayRouteValues)) { viewModel.IsHomePage = homepage.Match(displayRouteValues);
viewModel.PromoteToHomePage = true; viewModel.PromoteToHomePage = viewModel.IsHomePage || part.DisplayAlias == "/";
}
if (settings.PerItemConfiguration) { if (settings.PerItemConfiguration) {
// if enabled, the list of all available patterns is displayed, and the user can // if enabled, the list of all available patterns is displayed, and the user can

View File

@@ -5,6 +5,7 @@ namespace Orchard.Autoroute.ViewModels {
public class AutoroutePartEditViewModel { public class AutoroutePartEditViewModel {
public AutorouteSettings Settings { get; set; } public AutorouteSettings Settings { get; set; }
public bool IsHomePage { get; set; }
public bool PromoteToHomePage { get; set; } public bool PromoteToHomePage { get; set; }
public string CurrentUrl { get; set; } public string CurrentUrl { get; set; }
public string CustomPattern { get; set; } public string CustomPattern { get; set; }

View File

@@ -27,7 +27,8 @@
<span>@Html.TextBoxFor(m => m.CurrentUrl, new { @class = "text is-url" })</span> <span>@Html.TextBoxFor(m => m.CurrentUrl, new { @class = "text is-url" })</span>
</span> </span>
<span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span> <span class="hint">@T("Save the current item and leave the input empty to have it automatically generated using the pattern {0} e.g., {1}", pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Name, pattern.ElementAtOrDefault(Convert.ToInt32(defaultPattern.PatternIndex)).Description)</span>
} else { }
else {
var hintClass = string.Empty; var hintClass = string.Empty;
if (!string.IsNullOrEmpty(Model.CurrentUrl)) { if (!string.IsNullOrEmpty(Model.CurrentUrl)) {
hintClass = "hint"; hintClass = "hint";
@@ -58,6 +59,7 @@
<span class="hint">@T("Check to promote this content as the home page")</span> <span class="hint">@T("Check to promote this content as the home page")</span>
</fieldset> </fieldset>
} }
} else { }
else {
<span>@T("This content is the current home page")</span> <span>@T("This content is the current home page")</span>
} }

File diff suppressed because one or more lines are too long

View File

@@ -1 +1 @@
var LayoutEditor;!function(e,t){t.Fieldset=function(n,i,o,r,l,d,a,c,s,h,m){t.Element.call(this,"Fieldset",n,i,o,r,l),t.Container.call(this,["Grid","Content"],m);var u=this;this.isContainable=!0,this.dropTargetClass="layout-common-holder",this.contentType=a,this.contentTypeLabel=c,this.contentTypeClass=s,this.legend=d||"",this.hasEditor=h,this.toObject=function(){var e=this.elementToObject();return e.legend=this.legend,e.children=this.childrenToObject(),e};var p=this.getEditorObject;this.getEditorObject=function(){var t=p();return e.extend(t,{Legend:this.legend})},this.setChildren=function(e){this.children=e,_(this.children).each(function(e){e.parent=u})},this.applyElementEditorModel=function(e){this.legend=e.legend},this.setChildren(m)},t.Fieldset.from=function(e){return new t.Fieldset(e.data,e.htmlId,e.htmlClass,e.htmlStyle,e.isTemplated,e.legend,e.contentType,e.contentTypeLabel,e.contentTypeClass,e.hasEditor,t.childrenFrom(e.children))},t.registerFactory("Fieldset",function(e){return t.Fieldset.from(e)})}(jQuery,LayoutEditor||(LayoutEditor={}));var LayoutEditor;!function(e,t){t.Form=function(n,i,o,r,l,d,a,c,s,h,m,u,p){t.Element.call(this,"Form",n,i,o,r,l,u),t.Container.call(this,["Grid","Content"],p);var f=this;this.isContainable=!0,this.dropTargetClass="layout-common-holder",this.contentType=c,this.contentTypeLabel=s,this.contentTypeClass=h,this.name=d||"Untitled",this.formBindingContentType=a,this.hasEditor=m,this.toObject=function(){var e=this.elementToObject();return e.name=this.name,e.formBindingContentType=this.formBindingContentType,e.children=this.childrenToObject(),e};var y=this.getEditorObject;this.getEditorObject=function(){var t=y();return e.extend(t,{FormName:this.name,FormBindingContentType:this.formBindingContentType})},this.allowSealedFocus=function(){return 0===this.children.length},this.setChildren=function(e){this.children=e,_(this.children).each(function(e){e.setParent(f)})},this.onDescendantAdded=function(t){var n=t.getEditorObject;t.getEditorObject=function(){var t=n();return e.extend(t,{FormBindingContentType:f.formBindingContentType})}},this.applyElementEditorModel=function(e){this.name=e.name,this.formBindingContentType=e.formBindingContentType},this.setChildren(p)},t.Form.from=function(e){return new t.Form(e.data,e.htmlId,e.htmlClass,e.htmlStyle,e.isTemplated,e.name,e.formBindingContentType,e.contentType,e.contentTypeLabel,e.contentTypeClass,e.hasEditor,e.rule,t.childrenFrom(e.children))},t.registerFactory("Form",function(e){return t.Form.from(e)})}(jQuery,LayoutEditor||(LayoutEditor={})),angular.module("LayoutEditor").directive("orcLayoutFieldset",["$compile","scopeConfigurator","environment",function(e,t,n){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,n){t.configureForElement(e,n),t.configureForContainer(e,n),e.sortableOptions.axis="y",e.edit=function(){e.$root.editElement(e.element).then(function(t){t.cancel||e.$apply(function(){e.element.data=decodeURIComponent(t.element.data),e.element.applyElementEditorModel(t.elementEditorModel)})})}}],templateUrl:n.templateUrl("Fieldset"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutForm",["$compile","scopeConfigurator","environment",function(e,t,n){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,n){t.configureForElement(e,n),t.configureForContainer(e,n),e.sortableOptions.axis="y",e.edit=function(){e.$root.editElement(e.element).then(function(t){t.cancel||e.$apply(function(){e.element.data=decodeURIComponent(t.element.data),e.element.applyElementEditorModel(t.elementEditorModel)})})}}],templateUrl:n.templateUrl("Form"),replace:!0}}]); var LayoutEditor;!function(e,t){t.Fieldset=function(n,i,o,r,l,d,a,c,s,h,m){t.Element.call(this,"Fieldset",n,i,o,r,l),t.Container.call(this,["Grid","Content"],m);var u=this;this.isContainable=!0,this.dropTargetClass="layout-common-holder",this.contentType=a,this.contentTypeLabel=c,this.contentTypeClass=s,this.legend=d||"",this.hasEditor=h,this.toObject=function(){var e=this.elementToObject();return e.legend=this.legend,e.children=this.childrenToObject(),e};var p=this.getEditorObject;this.getEditorObject=function(){var t=p();return e.extend(t,{Legend:this.legend})},this.setChildren=function(e){this.children=e,_(this.children).each(function(e){e.parent=u})},this.applyElementEditorModel=function(e){this.legend=e.legend},this.setChildren(m)},t.Fieldset.from=function(e){return new t.Fieldset(e.data,e.htmlId,e.htmlClass,e.htmlStyle,e.isTemplated,e.legend,e.contentType,e.contentTypeLabel,e.contentTypeClass,e.hasEditor,t.childrenFrom(e.children))},t.registerFactory("Fieldset",function(e){return t.Fieldset.from(e)})}(jQuery,LayoutEditor||(LayoutEditor={}));var LayoutEditor;!function(e,t){t.Form=function(n,i,o,r,l,d,a,c,s,h,m,u){t.Element.call(this,"Form",n,i,o,r,l),t.Container.call(this,["Grid","Content"],u);var p=this;this.isContainable=!0,this.dropTargetClass="layout-common-holder",this.contentType=c,this.contentTypeLabel=s,this.contentTypeClass=h,this.name=d||"Untitled",this.formBindingContentType=a,this.hasEditor=m,this.toObject=function(){var e=this.elementToObject();return e.name=this.name,e.formBindingContentType=this.formBindingContentType,e.children=this.childrenToObject(),e};var f=this.getEditorObject;this.getEditorObject=function(){var t=f();return e.extend(t,{FormName:this.name,FormBindingContentType:this.formBindingContentType})},this.setChildren=function(e){this.children=e,_(this.children).each(function(e){e.setParent(p)})},this.onDescendantAdded=function(t){var n=t.getEditorObject;t.getEditorObject=function(){var t=n();return e.extend(t,{FormBindingContentType:p.formBindingContentType})}},this.applyElementEditorModel=function(e){this.name=e.name,this.formBindingContentType=e.formBindingContentType},this.setChildren(u)},t.Form.from=function(e){return new t.Form(e.data,e.htmlId,e.htmlClass,e.htmlStyle,e.isTemplated,e.name,e.formBindingContentType,e.contentType,e.contentTypeLabel,e.contentTypeClass,e.hasEditor,t.childrenFrom(e.children))},t.registerFactory("Form",function(e){return t.Form.from(e)})}(jQuery,LayoutEditor||(LayoutEditor={})),angular.module("LayoutEditor").directive("orcLayoutFieldset",["$compile","scopeConfigurator","environment",function(e,t,n){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,n){t.configureForElement(e,n),t.configureForContainer(e,n),e.sortableOptions.axis="y",e.edit=function(){e.$root.editElement(e.element).then(function(t){t.cancel||e.$apply(function(){e.element.data=decodeURIComponent(t.element.data),e.element.applyElementEditorModel(t.elementEditorModel)})})}}],templateUrl:n.templateUrl("Fieldset"),replace:!0}}]),angular.module("LayoutEditor").directive("orcLayoutForm",["$compile","scopeConfigurator","environment",function(e,t,n){return{restrict:"E",scope:{element:"="},controller:["$scope","$element",function(e,n){t.configureForElement(e,n),t.configureForContainer(e,n),e.sortableOptions.axis="y",e.edit=function(){e.$root.editElement(e.element).then(function(t){t.cancel||e.$apply(function(){e.element.data=decodeURIComponent(t.element.data),e.element.applyElementEditorModel(t.elementEditorModel)})})}}],templateUrl:n.templateUrl("Form"),replace:!0}}]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long