From c8faf17017c24b11a51901064361b631ba57ef72 Mon Sep 17 00:00:00 2001
From: Mads Rasmussen
Date: Tue, 9 Feb 2016 12:33:03 +0100
Subject: [PATCH] Fixes: U4-7799 ModelsBuilder button in Content Type Editor
should save the current content type
---
.../views/documenttypes/edit.controller.js | 38 +++++++---
.../src/views/mediatypes/edit.controller.js | 38 +++++++---
.../src/views/membertypes/edit.controller.js | 37 +++++++---
.../umbraco/config/lang/en_us.xml | 70 +++++++++++--------
4 files changed, 123 insertions(+), 60 deletions(-)
diff --git a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js
index 67d31c6d7f..1158e4b3df 100644
--- a/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/documenttypes/edit.controller.js
@@ -118,6 +118,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
+ hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -125,21 +126,38 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
- labelKey: "buttons_generateModels",
+ hotKeyWhenHidden: true,
+ labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
- notificationsService.info("Building models", "this can take abit of time, don't worry");
- contentTypeHelper.generateModels().then(function (result) {
- vm.page.saveButtonState = "init";
- //clear and add success
- notificationsService.success("Models Generated");
- }, function () {
- notificationsService.error("Models could not be generated");
- vm.page.saveButtonState = "error";
+ vm.save().then(function (result) {
+
+ vm.page.saveButtonState = "busy";
+
+ localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
+ localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
+ notificationsService.info(headerValue, msgValue);
+ });
+ });
+
+ contentTypeHelper.generateModels().then(function (result) {
+ vm.page.saveButtonState = "init";
+ //clear and add success
+ localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
+ notificationsService.success(value);
+ });
+ }, function () {
+ localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
+ notificationsService.error(value);
+ });
+ vm.page.saveButtonState = "error";
+ });
+
});
+
}
}];
}
@@ -264,7 +282,7 @@
}
function init(contentType) {
-
+
// set all tab to inactive
if (contentType.groups.length !== 0) {
angular.forEach(contentType.groups, function (group) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js
index 8ece2cc9f1..1dd1597336 100644
--- a/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/mediatypes/edit.controller.js
@@ -103,6 +103,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
+ hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -110,21 +111,38 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
- labelKey: "buttons_generateModels",
+ hotKeyWhenHidden: true,
+ labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
- notificationsService.info("Building models", "this can take abit of time, don't worry");
- contentTypeHelper.generateModels().then(function(result) {
- vm.page.saveButtonState = "init";
- //clear and add success
- notificationsService.success("Models Generated");
- }, function() {
- notificationsService.error("Models could not be generated");
- vm.page.saveButtonState = "error";
+ vm.save().then(function (result) {
+
+ vm.page.saveButtonState = "busy";
+
+ localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
+ localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
+ notificationsService.info(headerValue, msgValue);
+ });
+ });
+
+ contentTypeHelper.generateModels().then(function (result) {
+ vm.page.saveButtonState = "init";
+ //clear and add success
+ localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
+ notificationsService.success(value);
+ });
+ }, function () {
+ localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
+ notificationsService.error(value);
+ });
+ vm.page.saveButtonState = "error";
+ });
+
});
+
}
}];
}
@@ -243,7 +261,7 @@
}
function init(contentType) {
-
+
// set all tab to inactive
if (contentType.groups.length !== 0) {
angular.forEach(contentType.groups, function (group) {
diff --git a/src/Umbraco.Web.UI.Client/src/views/membertypes/edit.controller.js b/src/Umbraco.Web.UI.Client/src/views/membertypes/edit.controller.js
index 9c88f79015..5b7f11b096 100644
--- a/src/Umbraco.Web.UI.Client/src/views/membertypes/edit.controller.js
+++ b/src/Umbraco.Web.UI.Client/src/views/membertypes/edit.controller.js
@@ -60,6 +60,7 @@
//Models builder mode:
vm.page.defaultButton = {
hotKey: "ctrl+s",
+ hotKeyWhenHidden: true,
labelKey: "buttons_save",
letter: "S",
type: "submit",
@@ -67,21 +68,39 @@
};
vm.page.subButtons = [{
hotKey: "ctrl+g",
- labelKey: "buttons_generateModels",
+ hotKeyWhenHidden: true,
+ labelKey: "buttons_saveAndGenerateModels",
letter: "G",
handler: function () {
vm.page.saveButtonState = "busy";
- notificationsService.info("Building models", "this can take abit of time, don't worry");
- contentTypeHelper.generateModels().then(function (result) {
- vm.page.saveButtonState = "init";
- //clear and add success
- notificationsService.success("Models Generated");
- }, function () {
- notificationsService.error("Models could not be generated");
- vm.page.saveButtonState = "error";
+ vm.save().then(function (result) {
+
+ vm.page.saveButtonState = "busy";
+
+ localizationService.localize("modelsBuilder_buildingModels").then(function (headerValue) {
+ localizationService.localize("modelsBuilder_waitingMessage").then(function(msgValue) {
+ notificationsService.info(headerValue, msgValue);
+ });
+ });
+
+ contentTypeHelper.generateModels().then(function (result) {
+ vm.page.saveButtonState = "init";
+ //clear and add success
+ localizationService.localize("modelsBuilder_modelsGenerated").then(function(value) {
+ notificationsService.success(value);
+ });
+ }, function () {
+ localizationService.localize("modelsBuilder_modelsGeneratedError").then(function(value) {
+ notificationsService.error(value);
+ });
+ vm.page.saveButtonState = "error";
+ });
+
+
});
+
}
}];
}
diff --git a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
index b6b67c09de..eb378e319c 100644
--- a/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
+++ b/src/Umbraco.Web.UI/umbraco/config/lang/en_us.xml
@@ -96,6 +96,7 @@
Show styles
Insert table
Generate models
+ Save and generate models
To change the document type for the selected content, first select from the list of valid types for this location.
@@ -164,7 +165,7 @@
Remove file(s)
Link to document
Member of group(s)
- Not a member of group(s)
+ Not a member of group(s)
Child items
Target
@@ -245,18 +246,18 @@
Pick item
View Cache Item
Create folder...
-
+
Relate to original
The friendliest community
-
+
Link to page
-
+
Opens the linked document in a new window or tab
Opens the linked document in the full body of the window
Opens the linked document in the parent frame
-
+
Link to media
-
+
Select media
Select icon
Select item
@@ -265,18 +266,18 @@
Select content
Select member
Select member group
-
+
There are no parameters for this macro
-
+
External login providers
Exception Details
Stacktrace
-
+
Link your
Un-Link your
-
+
account
-
+
Select editor
@@ -352,7 +353,7 @@
Error loading customControl (Assembly: %0%, Type: '%1%')
Error loading MacroEngine script (file: %0%)
"Error parsing XSLT file: %0%
- "Error reading XSLT file: %0%
+ "Error reading XSLT file: %0%
Please enter a title
Please choose a type
You're about to make the picture larger than the original size. Are you sure that you want to proceed?
@@ -498,14 +499,14 @@
Add template
Add child node
Add child
-
+
Edit data type
-
+
Navigate sections
-
+
Shortcuts
show shortcuts
-
+
Toggle list view
Toggle allow as root
@@ -542,7 +543,7 @@
Press the upgrade button to upgrade your database to Umbraco %0%
Don't worry - no content will be deleted and everything will continue working afterwards!
-
+
]]>
Press Next to
@@ -554,7 +555,7 @@
The Default user's password has been successfully changed since the installation!No further actions needs to be taken. Click Next to proceed.]]>
The password is changed!
- ('admin') and password ('default'). It's important that the password is changed to something unique.
+ ('admin') and password ('default'). It's important that the password is changed to something unique.
]]>
Get a great start, watch our introduction videos
By clicking the next button (or modifying the umbracoConfigurationStatus in web.config), you accept the license for this software as specified in the box below. Notice that this Umbraco distribution consists of two different licenses, the open source MIT license for the framework and the Umbraco freeware license that covers the UI.
@@ -622,9 +623,9 @@ You installed Runway, so why not see how your new website looks.]]>
Further help and information
Get help from our award winning community, browse the documentation or watch some free videos on how to build a simple site, how to use packages and a quick guide to the Umbraco terminology]]>
Umbraco %0% is installed and ready for use
- /web.config file and update the AppSetting key UmbracoConfigurationStatus in the bottom to the value of '%0%'.]]>
- started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco,
+ started instantly by clicking the "Launch Umbraco" button below.
If you are new to Umbraco,
you can find plenty of resources on our getting started pages.]]>
Launch Umbraco
To manage your website, simply open the Umbraco back office and start adding content, updating the templates and stylesheets or add new functionality]]>
@@ -654,7 +655,7 @@ To manage your website, simply open the Umbraco back office and start adding con
Happy Caturday
Log in below
Session timed out
- © 2001 - %0%
Umbraco.com ]]>
+ © 2001 - %0%
Umbraco.com ]]>
Dashboard
@@ -693,7 +694,7 @@ To manage your website, simply open the Umbraco back office and start adding con
Hi %0%
- This is an automated mail to inform you that the task '%1%'
+
This is an automated mail to inform you that the task '%1%'
has been performed on the page '%2%'
by the user '%3%'
@@ -711,7 +712,7 @@ To manage your website, simply open the Umbraco back office and start adding con
@@ -785,7 +786,7 @@ To manage your website, simply open the Umbraco back office and start adding con
+ ]]>
@@ -884,8 +885,8 @@ To manage your website, simply open the Umbraco back office and start adding con
Do not close this window during sorting]]>
- Validation
- Validation errors must be fixed before the item can be saved
+ Validation
+ Validation errors must be fixed before the item can be saved
Failed
Insufficient user permissions, could not complete the operation
Cancelled
@@ -1023,10 +1024,10 @@ To manage your website, simply open the Umbraco back office and start adding con
Inherited from
Add property
Required label
-
+
Enable list view
Configures the content item to show a sortable and searchable list of its children, the children will not be shown in the tree
-
+
Allowed Templates
Choose which templates editors are allowed to use on content of this type
Allow as root
@@ -1072,6 +1073,13 @@ To manage your website, simply open the Umbraco back office and start adding con
tab has no sort order
+
+ Building models
+ this can take abit of time, don't worry
+ Models generated
+ Models could not be generated
+
+
Alternative field
Alternative Text
@@ -1104,7 +1112,7 @@ To manage your website, simply open the Umbraco back office and start adding con
Tasks assigned to you
- assigned to you. To see a detailed view including comments, click on "Details" or just the page name.
+ assigned to you. To see a detailed view including comments, click on "Details" or just the page name.
You can also download the page as XML directly by clicking the "Download Xml" link.
To close a translation task, please go to the Details view and click the "Close" button.
]]>
@@ -1133,8 +1141,8 @@ To manage your website, simply open the Umbraco back office and start adding con
[%0%] Translation task for %1%
No translator users found. Please create a translator user before you start sending content to translation
Tasks created by you
- created by you. To see a detailed view including comments,
- click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
+ created by you. To see a detailed view including comments,
+ click on "Details" or just the page name. You can also download the page as XML directly by clicking the "Download Xml" link.
To close a translation task, please go to the Details view and click the "Close" button.
]]>
The page '%0%' has been send to translation