Merge remote-tracking branch 'origin/v8/dev' into v8/feature/block-editor-list

# Conflicts:
#	src/Umbraco.Web.UI/Umbraco/config/lang/en.xml
#	src/Umbraco.Web.UI/Umbraco/config/lang/en_us.xml
This commit is contained in:
Niels Lyngsø
2020-05-29 11:04:13 +02:00
21 changed files with 209 additions and 57 deletions
@@ -32,6 +32,7 @@
@param {boolean} required Set the checkbox to be required.
@param {callback} onChange Callback when the value of the checkbox change by interaction.
@param {string} cssClass Set a css class modifier
@param {boolean} disableDirtyCheck Disable checking if the model is dirty
**/
@@ -84,7 +85,8 @@
required: "<",
onChange: "&?",
cssClass: "@?",
iconClass: "@?"
iconClass: "@?",
disableDirtyCheck: "=?"
}
};
@@ -16,10 +16,15 @@ angular.module("umbraco.directives")
replace: true,
templateUrl: 'views/components/property/umb-property.html',
link: function (scope) {
userService.getCurrentUser().then(function (u) {
var isAdmin = u.userGroups.indexOf('admin') !== -1;
scope.propertyAlias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.property.alias : null;
});
scope.controlLabelTitle = null;
if(Umbraco.Sys.ServerVariables.isDebuggingEnabled) {
userService.getCurrentUser().then(function (u) {
if(u.allowedSections.indexOf("settings") !== -1 ? true : false) {
scope.controlLabelTitle = scope.property.alias;
}
});
}
},
//Define a controller for this directive to expose APIs to other directives
controller: function ($scope) {
@@ -102,10 +102,15 @@
if (!scope.editLabelKey) {
scope.editLabelKey = "general_edit";
}
userService.getCurrentUser().then(function (u) {
var isAdmin = u.userGroups.indexOf('admin') !== -1;
scope.alias = (Umbraco.Sys.ServerVariables.isDebuggingEnabled === true || isAdmin) ? scope.alias : null;
});
scope.nodeNameTitle = null;
if(Umbraco.Sys.ServerVariables.isDebuggingEnabled) {
userService.getCurrentUser().then(function (u) {
if (u.allowedSections.indexOf("settings") !== -1 ? true : false) {
scope.nodeNameTitle = scope.alias;
}
});
}
}
var directive = {
@@ -239,6 +239,7 @@
@import "dashboards/umbraco-forms.less";
@import "dashboards/examine-management.less";
@import "dashboards/healthcheck.less";
@import "dashboards/content-templates.less";
@import "dashboards/nucache.less";
@import "typeahead.less";
@@ -18,6 +18,8 @@ label.umb-form-check--checkbox{
}
.umb-form-check__info {
margin-left:20px;
position: relative;
top: 3px;
}
@@ -0,0 +1,22 @@
.content-templates-dashboard{
p{
line-height: 1.6em;
margin-bottom: 30px;
&:last-child{
margin-bottom: 0;
}
}
ul{
margin-bottom: 15px;
}
li{
margin-bottom: 5px;
&:last-child{
margin-bottom: 0;
}
}
}
@@ -863,11 +863,11 @@
.bootstrap-datetimepicker-widget .picker-switch .btn{ background: none; border: none;}
.umb-datepicker .input-append .add-on{cursor: pointer;}
.umb-datepicker .input-append .on-top {
border: 0 none;
position: absolute;
margin-left: -31px;
margin-top: 1px;
display: inline-block;
height: 22px;
padding: 5px 6px 3px 6px;
font-size: @baseFontSize;
font-weight: normal;
@@ -15,7 +15,14 @@
<umb-dropdown-item class="umb-action" ng-class="{'sep':action.separatorm, '-opens-dialog': action.opensDialog}" ng-repeat="action in actions">
<button type="button" ng-click="executeMenuItem(action)">
<i class="icon icon-{{action.cssclass}}" aria-hidden="true"></i>
<span class="menu-label">{{action.name}}</span>
<!-- Render the text that will be visually displayed -->
<span class="menu-label" aria-hidden="true">{{action.name}}</span>
<!-- Render the textDescription from the language files if it's attached to the action object-->
<span class="sr-only" ng-if="action.textDescription">
<localize key="visuallyHiddenTexts_{{action.alias}}Description" tokens="[currentNode.name]"></localize>
</span>
<!-- Otherwise render a combination of the nodename and the currentNode name-->
<span class="sr-only" ng-if="!action.textDescription">{{action.name}} {{currentNode.name}}</span>
</button>
</umb-dropdown-item>
</umb-dropdown>
@@ -1,7 +1,7 @@
<label class="checkbox umb-form-check umb-form-check--checkbox {{vm.cssClass}}" ng-class="{ 'umb-form-check--disabled': vm.disabled }">
<div class="umb-form-check__symbol">
<input type="checkbox"
<input ng-if="vm.disableDirtyCheck"
type="checkbox"
id="{{vm.inputId}}"
name="{{vm.name}}"
value="{{vm.value}}"
@@ -10,7 +10,20 @@
ng-model="vm.model"
ng-disabled="vm.disabled"
ng-required="vm.required"
ng-change="vm.change()"/>
ng-change="vm.change()"
no-dirty-check />
<input ng-if="!vm.disableDirtyCheck"
type="checkbox"
id="{{vm.inputId}}"
name="{{vm.name}}"
value="{{vm.value}}"
class="umb-form-check__input"
val-server-field="{{vm.serverValidationField}}"
ng-model="vm.model"
ng-disabled="vm.disabled"
ng-required="vm.required"
ng-change="vm.change()"/>
<span class="umb-form-check__state" aria-hidden="true">
<span class="umb-form-check__check">
@@ -11,7 +11,7 @@
<localize key="contentTypeEditor_inheritedFrom"></localize> {{inheritsFrom}}
</small>
<label class="control-label" for="{{property.alias}}" ng-attr-title="{{propertyAlias}}">
<label class="control-label" for="{{property.alias}}" ng-attr-title="{{controlLabelTitle}}">
{{property.label}}
@@ -3,7 +3,7 @@
<i ng-if="icon" class="umb-node-preview__icon {{ icon }}" aria-hidden="true"></i>
<div class="umb-node-preview__content">
<div class="umb-node-preview__name" ng-attr-title="{{alias}}">{{ name }}</div>
<div class="umb-node-preview__name" ng-attr-title="{{nodeNameTitle}}">{{ name }}</div>
<div class="umb-node-preview__description" ng-if="description">{{ description }}</div>
<div class="umb-user-group-preview__permissions" ng-if="permissions">
@@ -12,21 +12,32 @@
<umb-editor-container>
<umb-box>
<umb-box-content>
<h3>What are Content Templates?</h3>
<p style="line-height: 1.6em; margin-bottom: 30px;">Content Templates are pre-defined content that can be selected when creating a new content node.</p>
<umb-box-content class="content-templates-dashboard">
<h3>
<localize key="contentTemplatesDashboard_whatHeadline">What are Content Templates?</localize>
</h3>
<p>
<localise key="contentTemplatesDashboard_whatDescription">Content Templates are pre-defined content that can be selected when creating a new content node.</localize>
</p>
<h4 class="bold">How do I create a Content Template?</h4>
<p style="line-height: 1.6em;">There are two ways to create a Content Template:</p>
<ul style="margin-bottom: 15px;">
<li style="margin-bottom: 5px;">Right-click a content node and select "Create Content Template" to create a new Content Template.</li>
<li>Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.</li>
</ul>
<p style="line-height: 1.6em; margin-bottom: 30px;">Once given a name, editors can start using the Content Template as a foundation for their new page.</p>
<h4 class="bold">
<localize key="contentTemplatesDashboard_createHeadline">How do I create a Content Template?</localize>
</h4>
<localize key="contentTemplatesDashboard_createDescription">
<p>There are two ways to create a Content Template:</p>
<ul>
<li>Right-click a content node and select "Create Content Template" to create a new Content Template.</li>
<li>Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.</li>
</ul>
<p>Once given a name, editors can start using the Content Template as a foundation for their new page.</p>
</localize>
<h4 class="bold">How do I manage Content Templates</h4>
<p style="line-height: 1.6em;">You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the
Content Template is based on and click it to edit or delete it.</p>
<h4 class="bold">
<localize key="contentTemplatesDashboard_manageHeadline">How do I manage Content Templates?</localize>
</h4>
<p>
<localize key="contentTemplatesDashboard_manageDescription">You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Just expand the Document Type which the Content Template is based on and click it to edit or delete it.</localize>
</p>
</umb-box-content>
</umb-box>
@@ -20,10 +20,11 @@
ng-required="model.validation.mandatory"
val-server="value"
class="datepickerinput">
<span class="on-top" ng-click="clearDate()" ng-show="hasDatetimePickerValue === true || datePickerForm.datepicker.$error.pickerError === true">
<i class="icon-delete"></i>
</span>
<span class="add-on">
<button type="button" class="on-top" ng-click="clearDate()" ng-show="hasDatetimePickerValue === true || datePickerForm.datepicker.$error.pickerError === true">
<i class="icon-delete" aria-hidden="true"></i>
<span class="sr-only"><localize key="content_removeDate">Clear date</localize></span>
</button>
<span class="add-on" aria-hidden="true">
<i class="icon-calendar"></i>
</span>
</div>
+2 -2
View File
@@ -16,7 +16,7 @@ gulp.task('docs', [], function (cb) {
var options = {
html5Mode: false,
startPage: '/api',
title: "Umbraco Backoffice UI API Documentation",
title: "Umbraco 8 Backoffice UI API Documentation",
dest: './api',
styles: ['./umb-docs.css'],
image: "https://our.umbraco.com/assets/images/logo.svg"
@@ -53,4 +53,4 @@ gulp.task('open:docs', function (cb) {
gulp.src(__filename)
.pipe(open(options));
cb();
});
});
+24 -15
View File
@@ -4,7 +4,7 @@ html {
}
body {
font-family: 'Segoe UI', Tahoma, Helvetica, sans-serif;
}
.container, .navbar-static-top .container, .navbar-fixed-top .container, .navbar-fixed-bottom .container {
@@ -33,37 +33,43 @@ body {
font-family: inherit;
}
.navbar .container{
min-height: inherit;
display: flex;
align-items: center;
}
.navbar .brand {
display: block;
float: left;
padding: 10px 20px 10px;
margin-left: -20px;
font-size: 20px;
font-weight: 200;
color: rgba(0,0,0,.8);
color: white;
text-shadow: none;
}
.navbar-fixed-top .navbar-inner {
min-height: 50px;
background: #a3db78;
background: #3544b1;
}
.form-search .well {
background-color: #f5fbf1;
background-color: #f7f7f7;
}
.form-search > ul.nav > li.module {
background-color: #daf0c9;
background-color: #3544b1;
}
.breadcrumb {
background-color: #f5fbf1;
.form-search > ul.nav > li.module a {
color: white;
}
a {
color: #f36f21;
.form-search > ul.nav > li.section {
background-color: #ccc;
}
.breadcrumb {
background-color: #f7f7f7;
}
a:hover {
text-decoration: none;
color: rgba(0,0,0,.8);
@@ -87,9 +93,12 @@ a:hover {
color: #000;
}
.form-search > ul.nav > li.module > a:hover{
color: #fff;
}
.header img {
width: 50px;
margin-top: 5px;
}
.content .methods code {
@@ -250,7 +250,7 @@
<key alias="routeErrorCannotRoute">Dette dokument er udgivet, men dets URL kan ikke dirigeres</key>
<key alias="publish">Udgiv</key>
<key alias="published">Udgivet</key>
<key alias="publishedPendingChanges">Udgivet (Afventende ændringer)</key>
<key alias="publishedPendingChanges">Udgivet (Ventede ændringer)</key>
<key alias="publishStatus">Udgivelsesstatus</key>
<key alias="publishDescendantsHelp"><![CDATA[Klik <em>Udgiv med undersider</em> for at udgive <strong>%0%</strong> og alle sider under og dermed gøre deres indhold offentligt tilgængelige.]]></key>
<key alias="publishDescendantsWithVariantsHelp"><![CDATA[Klik <em>Udgiv med undersider</em> for at udgive <strong>de valgte sprog</strong> og de samme sprog for sider under og dermed gøre deres indhold offentligt tilgængelige.]]></key>
@@ -429,6 +429,7 @@
<key alias="linkinternal">Internt link:</key>
<key alias="linklocaltip">Ved lokalt link, indsæt da en "#" foran linket</key>
<key alias="linknewwindow">Åben i nyt vindue?</key>
<key alias="macroContainerSettings">Makroindstillinger</key>
<key alias="macroDoesNotHaveProperties">Denne makro har ingen egenskaber du kan redigere</key>
<key alias="paste">Indsæt tekst</key>
<key alias="permissionsEdit">Rediger rettigheder for</key>
@@ -667,6 +668,7 @@
<key alias="icon">Ikon</key>
<key alias="id">Id</key>
<key alias="import">Importer</key>
<key alias="includeFromsubFolders">Inkludér undermapper i søgning</key>
<key alias="excludeFromSubFolders">Søg kun i denne mappe</key>
<key alias="info">Info</key>
<key alias="innerMargin">Indre margen</key>
@@ -1753,6 +1755,12 @@ Mange hilsner fra Umbraco robotten
<key alias="openBackofficeSearch">Åben backoffice søgning</key>
<key alias="openCloseBackofficeHelp">Åben/Luk backoffice hjælp</key>
<key alias="openCloseBackofficeProfileOptions">Åben/Luk dine profil indstillinger</key>
<key alias="assignDomainDescription">Tilføj domæne på %0%</key>
<key alias="createDescription">Opret ny node under %0%</key>
<key alias="protectDescription">Opsæt offentlig adgang på %0%</key>
<key alias="rightsDescription">Opsæt rettigheder på %0%</key>
<key alias="sortDescription">Juster soterings rækkefølgen for %0%</key>
<key alias="createblueprintDescription">Opret indholds skabelon baseret på %0%</key>
<key alias="currentLanguage">Aktivt sprog</key>
<key alias="switchLanguage">Skift sprog til</key>
<key alias="createNewFolder">Opret ny mappe</key>
@@ -143,6 +143,7 @@
<key alias="saveToPublish">Save and send for approval</key>
<key alias="saveListView">Save list view</key>
<key alias="schedulePublish">Schedule</key>
<key alias="showPage">Preview</key>
<key alias="saveAndPreview">Save and preview</key>
<key alias="showPageDisabled">Preview is disabled because there's no template assigned</key>
<key alias="styleChoose">Choose style</key>
@@ -695,6 +696,7 @@
<key alias="icon">Icon</key>
<key alias="id">Id</key>
<key alias="import">Import</key>
<key alias="includeFromsubFolders">Include subfolders in search</key>
<key alias="excludeFromSubFolders">Search only this folder</key>
<key alias="info">Info</key>
<key alias="innerMargin">Inner margin</key>
@@ -2237,6 +2239,12 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="openBackofficeSearch">Open backoffice search</key>
<key alias="openCloseBackofficeHelp">Open/Close backoffice help</key>
<key alias="openCloseBackofficeProfileOptions">Open/Close your profile options</key>
<key alias="assignDomainDescription">Setup Culture and Hostnames for %0%</key>
<key alias="createDescription">Create new node under %0%</key>
<key alias="protectDescription">Setup Public access on %0%</key>
<key alias="rightsDescription">Setup Permissions on %0%</key>
<key alias="sortDescription">Change sort order for %0%</key>
<key alias="createblueprintDescription">Create Content Template based on %0%</key>
<key alias="openContextMenu">Open context menu for</key>
<key alias="currentLanguage">Current language</key>
<key alias="switchLanguage">Switch language to</key>
@@ -2456,4 +2464,21 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="tabClipboard">Clipboard</key>
<key alias="tabBlockSettings">Settings</key>
</area>
<area alias="contentTemplatesDashboard">
<key alias="whatHeadline">What are Content Templates?</key>
<key alias="whatDescription">Content Templates are pre-defined content that can be selected when creating a new content node.</key>
<key alias="createHeadline">How do I create a Content Template?</key>
<key alias="createDescription">
<![CDATA[
<p>There are two ways to create a Content Template:</p>
<ul>
<li>Right-click a content node and select "Create Content Template" to create a new Content Template.</li>
<li>Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.</li>
</ul>
<p>Once given a name, editors can start using the Content Template as a foundation for their new page.</p>
]]>
</key>
<key alias="manageHeadline">How do I manage Content Templates?</key>
<key alias="manageDescription">You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Expand the Document Type which the Content Template is based on and click it to edit or delete it.</key>
</area>
</language>
@@ -142,6 +142,7 @@
<key alias="saveToPublish">Send for approval</key>
<key alias="saveListView">Save list view</key>
<key alias="schedulePublish">Schedule</key>
<key alias="showPage">Preview</key>
<key alias="saveAndPreview">Save and preview</key>
<key alias="showPageDisabled">Preview is disabled because there's no template assigned</key>
<key alias="styleChoose">Choose style</key>
@@ -373,7 +374,8 @@
<key alias="noDocumentTypesAllowedAtRoot"><![CDATA[There are no allowed document types available for creating content here. You must enable these in <strong>Document Types</strong> within the <strong>Settings</strong> section, by changing the <strong>Allow as root</strong> option under <strong>Permissions</strong>.]]></key>
<key alias="noMediaTypes" version="7.0"><![CDATA[There are no allowed media types available for creating media here. You must enable these in <strong>Media Types Types</strong> within the <strong>Settings</strong> section, by editing the <strong>Allowed child node types</strong> under <strong>Permissions</strong>.]]></key>
<key alias="noMediaTypesWithNoSettingsAccess">The selected media in the tree doesn't allow for any other media to be created below it.</key>
<key alias="noMediaTypesEditPermissions">Edit permissions for this media type</key> <key alias="documentTypeWithoutTemplate">Document Type without a template</key>
<key alias="noMediaTypesEditPermissions">Edit permissions for this media type</key>
<key alias="documentTypeWithoutTemplate">Document Type without a template</key>
<key alias="newFolder">New folder</key>
<key alias="newDataType">New data type</key>
<key alias="newJavascriptFile">New JavaScript file</key>
@@ -577,6 +579,9 @@
<key alias="anchor">#value or ?key=value</key>
<key alias="enterAlias">Enter alias...</key>
<key alias="generatingAlias">Generating alias...</key>
<key alias="a11yCreateItem">Create item</key>
<key alias="a11yEdit">Edit</key>
<key alias="a11yName">Name</key>
</area>
<area alias="editcontenttype">
<key alias="createListView" version="7.2">Create custom list view</key>
@@ -698,6 +703,7 @@
<key alias="icon">Icon</key>
<key alias="id">Id</key>
<key alias="import">Import</key>
<key alias="includeFromsubFolders">Include subfolders in search</key>
<key alias="excludeFromSubFolders">Search only this folder</key>
<key alias="info">Info</key>
<key alias="innerMargin">Inner margin</key>
@@ -2252,6 +2258,12 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="openBackofficeSearch">Open backoffice search</key>
<key alias="openCloseBackofficeHelp">Open/Close backoffice help</key>
<key alias="openCloseBackofficeProfileOptions">Open/Close your profile options</key>
<key alias="assignDomainDescription">Setup Culture and Hostnames for %0%</key>
<key alias="createDescription">Create new node under %0%</key>
<key alias="protectDescription">Setup Public access on %0%</key>
<key alias="rightsDescription">Setup Permissions on %0%</key>
<key alias="sortDescription">Change sort order for %0%</key>
<key alias="createblueprintDescription">Create Content Template based on %0%</key>
<key alias="openContextMenu">Open context menu for</key>
<key alias="currentLanguage">Current language</key>
<key alias="switchLanguage">Switch language to</key>
@@ -2471,4 +2483,21 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="tabClipboard">Clipboard</key>
<key alias="tabBlockSettings">Settings</key>
</area>
<area alias="contentTemplatesDashboard">
<key alias="whatHeadline">What are Content Templates?</key>
<key alias="whatDescription">Content Templates are pre-defined content that can be selected when creating a new content node.</key>
<key alias="createHeadline">How do I create a Content Template?</key>
<key alias="createDescription">
<![CDATA[
<p>There are two ways to create a Content Template:</p>
<ul>
<li>Right-click a content node and select "Create Content Template" to create a new Content Template.</li>
<li>Right-click the Content Templates tree in the Settings section and select the Document Type you want to create a Content Template for.</li>
</ul>
<p>Once given a name, editors can start using the Content Template as a foundation for their new page.</p>
]]>
</key>
<key alias="manageHeadline">How do I manage Content Templates?</key>
<key alias="manageDescription">You can edit and delete Content Templates from the "Content Templates" tree in the Settings section. Expand the Document Type which the Content Template is based on and click it to edit or delete it.</key>
</area>
</language>
+8 -1
View File
@@ -5,6 +5,7 @@ using System.Collections.Generic;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
using System.Threading;
namespace Umbraco.Web.Models.Trees
{
@@ -28,12 +29,15 @@ namespace Umbraco.Web.Models.Trees
Name = name;
}
public MenuItem(string alias, ILocalizedTextService textService)
: this()
{
var values = textService.GetAllStoredValues(Thread.CurrentThread.CurrentUICulture);
values.TryGetValue($"visuallyHiddenTexts/{alias}_description", out var textDescription);
Alias = alias;
Name = textService.Localize($"actions/{Alias}");
TextDescription = textDescription;
}
/// <summary>
@@ -74,6 +78,9 @@ namespace Umbraco.Web.Models.Trees
[Required]
public string Alias { get; set; }
[DataMember(Name = "textDescription")]
public string TextDescription { get; set; }
/// <summary>
/// Ensures a menu separator will exist before this menu item
/// </summary>
+8 -3
View File
@@ -1,5 +1,6 @@
using System;
using System.Collections.Generic;
using System.Threading;
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Actions;
@@ -75,7 +76,7 @@ namespace Umbraco.Web.Models.Trees
}
return null;
}
internal MenuItem CreateMenuItem<T>(string name, bool hasSeparator = false, bool opensDialog = false)
where T : IAction
{
@@ -96,14 +97,18 @@ namespace Umbraco.Web.Models.Trees
var item = Current.Actions.GetAction<T>();
if (item == null) return null;
var values = textService.GetAllStoredValues(Thread.CurrentThread.CurrentUICulture);
values.TryGetValue($"visuallyHiddenTexts/{item.Alias}Description", out var textDescription);
var menuItem = new MenuItem(item, textService.Localize($"actions/{item.Alias}"))
{
SeparatorBefore = hasSeparator,
OpensDialog = opensDialog
OpensDialog = opensDialog,
TextDescription = textDescription,
};
return menuItem;
}
}
}
@@ -323,7 +323,7 @@ namespace Umbraco.Web.Trees
private void AddActionNode<TAction>(IUmbracoEntity item, MenuItemCollection menu, bool hasSeparator = false, bool opensDialog = false)
where TAction : IAction
{
var menuItem = menu.Items.Add<TAction>(Services.TextService.Localize("actions", _actions.GetAction<TAction>().Alias), hasSeparator, opensDialog);
var menuItem = menu.Items.Add<TAction>(Services.TextService, hasSeparator, opensDialog);
}
public IEnumerable<SearchResultEntity> Search(string query, int pageSize, long pageIndex, out long totalFound, string searchFrom = null)