Fixed view path conventions for menu items

This commit is contained in:
Shannon
2013-10-02 20:20:02 +10:00
parent 8f53bea3d7
commit 6560865f61
3 changed files with 22 additions and 9 deletions

View File

@@ -324,6 +324,9 @@ angular.module('umbraco.services')
if (!args.action) {
throw "The args parameter must have an 'action' property as the clicked menu action object";
}
if (!args.node) {
throw "The args parameter must have a 'node' as the active tree node";
}
//ensure the current dialog is cleared before creating another!
if (this.ui.currentDialog) {
@@ -348,11 +351,7 @@ angular.module('umbraco.services')
var templateUrl;
var iframe;
//TODO: fix hardcoded hack for content/media... once these trees are converted over to
// new c# trees we won't need to do this any longer.
var isCreateForContent = args.action.alias === "create" && (this.ui.currentSection === "content" || this.ui.currentSection === "media");
if (args.action.metaData["actionUrl"] && !isCreateForContent) {
if (args.action.metaData["actionUrl"]) {
templateUrl = args.action.metaData["actionUrl"];
iframe = true;
}
@@ -361,7 +360,12 @@ angular.module('umbraco.services')
iframe = false;
}
else {
templateUrl = "views/" + this.ui.currentSection + "/" + args.action.alias + ".html";
//by convention we will look into the /views/{treetype}/{action}.html
// for example: /views/content/create.html
templateUrl = "views/" + treeService.getTreeAlias(args.node) + "/" + args.action.alias + ".html";
iframe = false;
}

View File

@@ -45,7 +45,6 @@
}
],
javascript: [
'~/App_Plugins/MyPackage/Common/Js/MyPackage.js',
'~/App_Plugins/MyPackage/PropertyEditors/Js/CsvEditor.js',
'~/App_Plugins/MyPackage/PropertyEditors/Js/PostcodeEditor.js',
'~/App_Plugins/MyPackage/PropertyEditors/Js/RegexEditor.js'

View File

@@ -10,12 +10,22 @@ namespace Umbraco.Web.Trees.Menu
/// Used as a key for the AdditionalData to specify a specific dialog title instead of the menu title
/// </summary>
internal const string DialogTitleKey = "dialogTitle";
/// <summary>
/// Used to specify the URL that the dialog will launch to in an iframe
/// </summary>
internal const string ActionUrlKey = "actionUrl";
internal const string ActionUrlMethodKey = "actionUrlMethod";
/// <summary>
/// Used to specify the angular view that the dialog will launch
/// </summary>
internal const string ActionViewKey = "actionView";
/// <summary>
/// Sets the menu item to display a dialog based on a view path
/// Sets the menu item to display a dialog based on an angular view path
/// </summary>
/// <param name="menuItem"></param>
/// <param name="view"></param>
@@ -27,7 +37,7 @@ namespace Umbraco.Web.Trees.Menu
}
/// <summary>
/// Sets the menu item to display a dialog based on a url path
/// Sets the menu item to display a dialog based on a url path in an iframe
/// </summary>
/// <param name="menuItem"></param>
/// <param name="url"></param>