Skip to content

Commit

Permalink
created an add current domain button to the cultures and hostnames sc… (
Browse files Browse the repository at this point in the history
#13436)

* created an add current domain button to the cultures and hostnames screen

* removed unwanted space

(cherry picked from commit d86d298)
  • Loading branch information
prjseal authored and nul800sebastiaan committed Dec 14, 2022
1 parent 479dde2 commit 5db507c
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 3 deletions.
3 changes: 2 additions & 1 deletion src/Umbraco.Core/EmbeddedResources/Lang/en.xml
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,8 @@
</area>
<area alias="assignDomain">
<key alias="permissionDenied">Permission denied.</key>
<key alias="addNew">Add new Domain</key>
<key alias="addNew">Add new domain</key>
<key alias="addCurrent">Add current domain</key>
<key alias="remove">remove</key>
<key alias="invalidNode">Invalid node.</key>
<key alias="invalidDomain">One or more domains have an invalid format.</key>
Expand Down
3 changes: 2 additions & 1 deletion src/Umbraco.Core/EmbeddedResources/Lang/en_us.xml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@
</area>
<area alias="assignDomain">
<key alias="permissionDenied">Permission denied.</key>
<key alias="addNew">Add new Domain</key>
<key alias="addNew">Add new domain</key>
<key alias="addCurrent">Add current domain</key>
<key alias="remove">remove</key>
<key alias="invalidNode">Invalid node.</key>
<key alias="invalidDomain">One or more domains have an invalid format.</key>
Expand Down
7 changes: 7 additions & 0 deletions src/Umbraco.Web.UI.Client/src/views/content/assigndomain.html
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ <h5 class="umb-pane-title"><localize key="assignDomain_setDomains">Domains</loca
button-style="info">
</umb-button>

<umb-button
label-key="assignDomain_addCurrent"
action="vm.addCurrentDomain()"
type="button"
button-style="success">
</umb-button>

</umb-pane>

</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
(function () {
"use strict";

function AssignDomainController($scope, localizationService, languageResource, contentResource, navigationService, notificationsService) {
function AssignDomainController($scope, localizationService, languageResource, contentResource, navigationService, notificationsService, $location) {
var vm = this;

vm.closeDialog = closeDialog;
vm.addDomain = addDomain;
vm.addCurrentDomain = addCurrentDomain;
vm.removeDomain = removeDomain;
vm.save = save;
vm.languages = [];
Expand Down Expand Up @@ -82,6 +83,18 @@
});
}

function addCurrentDomain() {
var domainToAdd = $location.host();
var port = $location.port();
if (port != 80 && port != 443) {
domainToAdd += ":" + port;
}
vm.domains.push({
name: domainToAdd,
lang: vm.defaultLanguage
});
}

function removeDomain(index) {
vm.domains.splice(index, 1);
}
Expand Down

0 comments on commit 5db507c

Please sign in to comment.