U4-11372 - Make history section on Info tab translatable (#2650)

This commit is contained in:
Anders Brohus
2018-06-28 19:49:28 +02:00
committed by Sebastiaan Janssen
parent ffd0adb0f3
commit 9c8d73dcfa
10 changed files with 171 additions and 107 deletions

View File

@@ -694,7 +694,7 @@ namespace Umbraco.Core.Services
}
query.Where(x => x.Path.SqlStartsWith(string.Format("{0},", contentPath[0].Path), TextColumnType.NVarchar));
}
// get filter
IQuery<IContent> filterQuery = null;
@@ -991,7 +991,7 @@ namespace Umbraco.Core.Services
FROM umbracoNode
JOIN cmsDocument ON umbracoNode.id=cmsDocument.nodeId AND cmsDocument.published=@0
WHERE umbracoNode.trashed=@1 AND umbracoNode.id IN (@2)",
true, false, ids);
true, false, ids);
var x = uow.Database.Fetch<int>(sql);
return ids.Length == x.Count;
}
@@ -1260,7 +1260,7 @@ namespace Umbraco.Core.Services
var repository = RepositoryFactory.CreateContentBlueprintRepository(uow);
var blueprint = repository.Get(id);
if (blueprint != null)
((Content) blueprint).IsBlueprint = true;
((Content)blueprint).IsBlueprint = true;
return blueprint;
}
}
@@ -1283,7 +1283,7 @@ namespace Umbraco.Core.Services
if (content.ParentId != -1)
content.ParentId = -1;
((Content) content).IsBlueprint = true;
((Content)content).IsBlueprint = true;
using (new WriteLock(Locker))
{
@@ -1357,7 +1357,7 @@ namespace Umbraco.Core.Services
}
var blueprints = repository.GetByQuery(query).Select(x =>
{
((Content) x).IsBlueprint = true;
((Content)x).IsBlueprint = true;
return x;
}).ToArray();
@@ -1373,7 +1373,7 @@ namespace Umbraco.Core.Services
public void DeleteBlueprintsOfType(int contentTypeId, int userId = 0)
{
DeleteBlueprintsOfTypes(new[] {contentTypeId}, userId);
DeleteBlueprintsOfTypes(new[] { contentTypeId }, userId);
}
/// <summary>
@@ -1597,7 +1597,7 @@ namespace Umbraco.Core.Services
/// <param name="userId">Optional Id of the user issueing the delete operation</param>
public void DeleteContentOfType(int contentTypeId, int userId = 0)
{
DeleteContentOfTypes(new[] {contentTypeId}, userId);
DeleteContentOfTypes(new[] { contentTypeId }, userId);
}
/// <summary>
@@ -1854,7 +1854,9 @@ namespace Umbraco.Core.Services
foreach (var tag in tags)
uow.Database.Insert(new TagRelationshipDto
{
NodeId = copy.Id, TagId = tag.TagId, PropertyTypeId = tag.PropertyTypeId
NodeId = copy.Id,
TagId = tag.TagId,
PropertyTypeId = tag.PropertyTypeId
});
}
uow.Commit(); // todo - this should flush, not commit
@@ -2143,7 +2145,7 @@ namespace Umbraco.Core.Services
}
return repository.GetByQuery(query).Select(x =>
{
((Content) x).IsBlueprint = true;
((Content)x).IsBlueprint = true;
return x;
});
}
@@ -2567,7 +2569,7 @@ namespace Umbraco.Core.Services
//We need to check if children and their publish state to ensure that we 'republish' content that was previously published
if (published && previouslyPublished == false && HasChildren(content.Id))
{
//TODO: Horrible for performance if there are lots of descendents! We should page if anything but this is crazy
//TODO: Horrible for performance if there are lots of descendents! We should page if anything but this is crazy
var descendants = GetPublishedDescendants(content);
_publishingStrategy.PublishingFinalized(uow, descendants, false);
}

View File

@@ -165,7 +165,7 @@ namespace Umbraco.Core.Services
CacheHelper cache,
RepositoryFactory repositoryFactory,
ILogger logger,
IEventMessagesFactory eventMessagesFactory,
IEventMessagesFactory eventMessagesFactory,
IdkMap idkMap)
{
EventMessagesFactory = eventMessagesFactory;

View File

@@ -26,7 +26,8 @@ namespace Umbraco.Core.Strategies
relationType = new RelationType(new Guid(Constants.ObjectTypes.Document),
new Guid(Constants.ObjectTypes.Document),
Constants.Conventions.RelationTypes.RelateDocumentOnCopyAlias,
Constants.Conventions.RelationTypes.RelateDocumentOnCopyName) { IsBidirectional = true };
Constants.Conventions.RelationTypes.RelateDocumentOnCopyName)
{ IsBidirectional = true };
relationService.Save(relationType);
}

View File

@@ -69,8 +69,8 @@ namespace Umbraco.Core.Strategies
item.Entity.Id);
}
}
}
}
}
}

View File

@@ -1,7 +1,7 @@
<div class="umb-package-details">
<div class="umb-package-details__main-content">
<umb-box data-element="node-info-urls">
<umb-box-header title-key="general_links"></umb-box-header>
<umb-box-content class="block-form">
@@ -23,34 +23,32 @@
<umb-box data-element="node-info-history">
<umb-box-header title-key="general_history"></umb-box-header>
<umb-box-content class="block-form">
<div style="position: relative;">
<div ng-if="loadingAuditTrail" style="background: rgba(255, 255, 255, 0.8); position: absolute; top: 0; left: 0; right: 0; bottom: 0;"></div>
<umb-load-indicator ng-if="loadingAuditTrail"></umb-load-indicator>
<div ng-if="auditTrail.length === 0" style="padding: 10px;">
<umb-empty-state
position="center"
size="small">
<umb-empty-state position="center"
size="small">
<localize key="content_noChanges"></localize>
</umb-empty-state>
</div>
<div class="history">
<div ng-if="auditTrail.length > 1" class="history-line"></div>
<div ng-if="auditTrail.length > 1" class="history-line"></div>
<div class="history-item" ng-repeat="item in auditTrail">
<div class="history-item__break">
<div class="history-item__avatar">
<umb-avatar
color="secondary"
size="xs"
name="{{item.userName}}"
img-src="{{item.userAvatars[3]}}"
img-srcset="{{item.userAvatars[4]}} 2x, {{item.userAvatars[4]}} 3x">
<umb-avatar color="secondary"
size="xs"
name="{{item.userName}}"
img-src="{{item.userAvatars[3]}}"
img-srcset="{{item.userAvatars[4]}} 2x, {{item.userAvatars[4]}} 3x">
</umb-avatar>
</div>
@@ -59,32 +57,35 @@
<div class="history-item__date">{{item.timestampFormatted}}</div>
</div>
</div>
<div class="history-item__break">
<umb-badge
size="xs"
color="{{item.logTypeColor}}">
{{ item.logType }}
<umb-badge size="xs"
color="{{item.logTypeColor}}">
<!--{{ item.logType }}-->
<localize key="auditTrails_small{{ item.logType }}">{{ item.logType }}</localize>
</umb-badge>
<span>{{ item.comment }}</span>
<span>
<localize key="auditTrails_{{ item.logType | lowercase }}">{{ item.comment }}</localize>
</span>
<!--<span>{{ item.comment }}</span>-->
</div>
</div>
</div>
</div>
<div class="flex justify-center">
<umb-pagination
ng-if="auditTrailOptions.totalPages > 1"
page-number="auditTrailOptions.pageNumber"
total-pages="auditTrailOptions.totalPages"
on-change="auditTrailPageChange(pageNumber)">
<umb-pagination ng-if="auditTrailOptions.totalPages > 1"
page-number="auditTrailOptions.pageNumber"
total-pages="auditTrailOptions.totalPages"
on-change="auditTrailPageChange(pageNumber)">
</umb-pagination>
</div>
</umb-box-content>
</umb-box>
</umb-box-content>
</umb-box>
</div>
<div class="umb-package-details__sidebar">
@@ -95,15 +96,14 @@
<div class="date-wrapper">
<div class="flex items-center flex-column">
<umb-date-time-picker
data-element="node-info-publish"
options="datePickerConfig"
on-change="datePickerChange(event, 'publish')">
<umb-date-time-picker data-element="node-info-publish"
options="datePickerConfig"
on-change="datePickerChange(event, 'publish')">
<div class="date-container">
<div class="date-container__title">
<localize key="content_releaseDate"></localize>
</div>
@@ -114,12 +114,12 @@
<div class="date-wrapper__date">{{node.releaseDateDay}} {{node.releaseDateTime}}</div>
</div>
<a href="" ng-if="!node.releaseDate" class="bold" style="color: #00aea2; text-decoration: underline;"><localize key="content_setDate">Set date</localize></a>
<a href="" ng-if="!node.releaseDate" class="bold" style="color: #00aea2; text-decoration: underline;"><localize key="content_setDate">Set date</localize></a>
</div>
</umb-date-time-picker>
<a ng-if="node.releaseDate" ng-click="clearPublishDate()" href="" style="text-decoration: underline;">
<small><localize key="content_removeDate">Clear date</localize></small>
</a>
@@ -129,17 +129,16 @@
<div class="date-separate"></div>
<div class="flex items-center flex-column">
<umb-date-time-picker
data-element="node-info-unpublish"
options="datePickerConfig"
on-change="datePickerChange(event, 'unpublish')">
<umb-date-time-picker data-element="node-info-unpublish"
options="datePickerConfig"
on-change="datePickerChange(event, 'unpublish')">
<div class="date-container">
<div class="date-container__title">
<localize key="content_unpublishDate"></localize>
</div>
<div class="date-container__date" ng-if="node.removeDate">
<div class="date-wrapper__date">{{node.removeDateMonth}} {{node.removeDateYear}}</div>
<div class="date-wrapper__number">{{node.removeDateDayNumber}}</div>
@@ -158,7 +157,7 @@
</div>
</div>
</umb-box-content>
</umb-box>
@@ -186,7 +185,7 @@
</umb-node-preview>
</umb-control-group>
<umb-control-group ng-if="disableTemplates == false" data-element="node-info-template" label="@template_template">
<umb-control-group ng-if="disableTemplates == false" data-element="node-info-template" label="@template_template">
<select class="input-block-level"
ng-model="node.template"
ng-options="key as value for (key, value) in availableTemplates"
@@ -200,7 +199,7 @@
<small>{{ node.key }}</small>
</umb-control-group>
</umb-box-content>
</umb-box-content>
</umb-box>
</div>
</div>

View File

@@ -49,6 +49,7 @@
<RestorePackages>true</RestorePackages>
<MvcProjectUpgradeChecked>true</MvcProjectUpgradeChecked>
<UseGlobalApplicationHostFile />
<Use64BitIISExpress />
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<OutputPath>bin\</OutputPath>
@@ -1037,7 +1038,7 @@ xcopy "$(ProjectDir)"..\packages\SqlServerCE.4.0.0.1\x86\*.* "$(TargetDir)x86\"
<AutoAssignPort>True</AutoAssignPort>
<DevelopmentServerPort>7120</DevelopmentServerPort>
<DevelopmentServerVPath>/</DevelopmentServerVPath>
<IISUrl>http://localhost:7120</IISUrl>
<IISUrl>http://localhost:7111</IISUrl>
<NTLMAuthentication>False</NTLMAuthentication>
<UseCustomServer>False</UseCustomServer>
<CustomServerUrl>

View File

@@ -95,9 +95,6 @@
</key>
<key alias="setDomains">Domæner</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">For</key>
</area>
<area alias="buttons">
<key alias="clearSelection">Ryd valg</key>
<key alias="select">Vælg</key>
@@ -136,6 +133,27 @@
<key alias="undo">Fortryd</key>
<key alias="redo">Genskab</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">For</key>
<key alias="delete">Brugeren har slettet indholdet</key>
<key alias="unpublish">Brugeren har afpubliceret indholdet</key>
<key alias="publish">Brugeren har gemt og udgivet indholdet</key>
<key alias="save">Brugeren har gemt indholdet</key>
<key alias="move">Brugeren har flyttet indholdet</key>
<key alias="copy">Brugeren har kopieret indholdet</key>
<key alias="rollback">Brugeren har tilbagerullet indholdet til en tidligere tilstand</key>
<key alias="sendtopublish">Brugeren har sendt indholdet til udgivelse</key>
<key alias="sendtotranslate">Brugeren har sendt indholdet til oversættelse</key>
<key alias="smallCopy">Kopieret</key>
<key alias="smallPublish">Udgivet</key>
<key alias="smallMove">Flyttet</key>
<key alias="smallSave">Gemt</key>
<key alias="smallDelete">Slettet</key>
<key alias="smallUnPublish">Afpubliceret</key>
<key alias="smallRollBack">Indhold tilbagerullet</key>
<key alias="smallSendToPublish">Sendt til udgivelse</key>
<key alias="smallSendToTranslate">Sendt til oversættelse</key>
</area>
<area alias="changeDocType">
<key alias="changeDocTypeInstruction">For at skifte det valgte indholds dokumenttype, skal du først vælge en ny dokumenttype, som er gyldig på denne placering.</key>
<key alias="changeDocTypeInstruction2">Kontroller derefter, at alle egenskaber bliver overført rigtigt til den nye dokumenttype, og klik derefter på Gem.</key>
@@ -191,6 +209,9 @@
<key alias="parentNotPublishedAnomaly">Upd: dette dokument er udgiver, men er ikke i cachen (intern fejl)</key>
<key alias="getUrlException">Kunne ikke hente url'en</key>
<key alias="routeError">Dette dokument er udgivet, men dets url ville kollidere med indholdet %0%</key>
<key alias="publish">Udgiv</key>
<key alias="published">Udgivet</key>
<key alias="publishedPendingChanges">Udgivet (Ventede ændringer)</key>
<key alias="publish">Udgivet</key>
<key alias="publishStatus">Udgivelsesstatus</key>
<key alias="releaseDate">Udgivelsesdato</key>
@@ -204,6 +225,7 @@
<key alias="altTextOptional">Alternativ tekst (valgfri)</key>
<key alias="type">Type</key>
<key alias="unPublish">Afpublicér</key>
<key alias="unpublished">Afpubliceret</key>
<key alias="updateDate">Sidst redigeret</key>
<key alias="updateDateDesc" version="7.0">Tidspunkt for seneste redigering</key>
<key alias="uploadClear">Fjern fil</key>
@@ -1579,4 +1601,4 @@ Mange hilsner fra Umbraco robotten
<area alias="textbox">
<key alias="characters_left">Karakterer tilbage</key>
</area>
</language>
</language>

View File

@@ -100,9 +100,6 @@
</key>
<key alias="setDomains">Domains</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">Viewing for</key>
</area>
<area alias="buttons">
<key alias="clearSelection">Clear selection</key>
<key alias="select">Select</key>
@@ -141,6 +138,27 @@
<key alias="undo">Undo</key>
<key alias="redo">Redo</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">Viewing for</key>
<key alias="delete">Delete Content performed by user</key>
<key alias="unpublish">UnPublish performed by user</key>
<key alias="publish">Save and Publish performed by user</key>
<key alias="save">Save Content performed by user</key>
<key alias="move">Move Content performed by user</key>
<key alias="copy">Copy Content performed by user</key>
<key alias="rollback">Content rollback performed by user</key>
<key alias="sendtopublish">Content Send To Publish performed by user</key>
<key alias="sendtotranslate">Content Send To Translation performed by user</key>
<key alias="smallCopy">Copy</key>
<key alias="smallPublish">Publish</key>
<key alias="smallMove">Move</key>
<key alias="smallSave">Save</key>
<key alias="smallDelete">Delete</key>
<key alias="smallUnPublish">Unpublish</key>
<key alias="smallRollBack">Rollback</key>
<key alias="smallSendToPublish">Send To Publish</key>
<key alias="smallSendToTranslate">Send To Translation</key>
</area>
<area alias="changeDocType">
<key alias="changeDocTypeInstruction">To change the document type for the selected content, first select from the list of valid types for this location.</key>
<key alias="changeDocTypeInstruction2">Then confirm and/or amend the mapping of properties from the current type to the new, and click Save.</key>
@@ -1654,7 +1672,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="isSensitiveDataDescription">Hide this property value from content editors that don't have access to view sensitive information</key>
<key alias="showOnMemberProfile">Show on member profile</key>
<key alias="showOnMemberProfileDescription">Allow this property value to be displayed on the member profile page</key>
<key alias="tabHasNoSortOrder">tab has no sort order</key>
<key alias="compositionUsageHeading">Where is this composition used?</key>

View File

@@ -100,9 +100,6 @@
</key>
<key alias="setDomains">Domains</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">Viewing for</key>
</area>
<area alias="buttons">
<key alias="clearSelection">Clear selection</key>
<key alias="select">Select</key>
@@ -141,6 +138,28 @@
<key alias="undo">Undo</key>
<key alias="redo">Redo</key>
</area>
<area alias="auditTrails">
<key alias="atViewingFor">Viewing for</key>
<key alias="delete">Delete Content performed by user</key>
<key alias="unpublish">UnPublish performed by user</key>
<key alias="publish">Save and Publish performed by user</key>
<key alias="save">Save Content performed by user</key>
<key alias="move">Move Content performed by user</key>
<key alias="copy">Copy Content performed by user</key>
<key alias="rollback">Content rollback performed by user</key>
<key alias="sendtopublish">Content Send To Publish performed by user</key>
<key alias="sendtotranslate">Content Send To Translation performed by user</key>
<key alias="smallCopy">Copy</key>
<key alias="smallPublish">Publish</key>
<key alias="smallMove">Move</key>
<key alias="smallSave">Save</key>
<key alias="smallDelete">Delete</key>
<key alias="smallUnPublish">Unpublish</key>
<key alias="smallRollBack">Rollback</key>
<key alias="smallSendToPublish">Send To Publish</key>
<key alias="smallSendToTranslate">Send To Translation</key>
</area>
<area alias="changeDocType">
<key alias="changeDocTypeInstruction">To change the document type for the selected content, first select from the list of valid types for this location.</key>
<key alias="changeDocTypeInstruction2">Then confirm and/or amend the mapping of properties from the current type to the new, and click Save.</key>
@@ -1646,7 +1665,7 @@ To manage your website, simply open the Umbraco back office and start adding con
<key alias="isSensitiveDataDescription">Hide this property value from content editors that don't have access to view sensitive information</key>
<key alias="showOnMemberProfile">Show on member profile</key>
<key alias="showOnMemberProfileDescription">Allow this property value to be displayed on the member profile page</key>
<key alias="tabHasNoSortOrder">tab has no sort order</key>
<key alias="compositionUsageHeading">Where is this composition used?</key>

View File

@@ -15,19 +15,20 @@ using umbraco.cms.businesslogic.property;
namespace umbraco.presentation.dialogs
{
/// <summary>
/// Summary description for rollBack.
/// </summary>
public partial class rollBack : UmbracoEnsuredPage
{
public rollBack()
{
/// <summary>
/// Summary description for rollBack.
/// </summary>
public partial class rollBack : UmbracoEnsuredPage
{
public rollBack()
{
CurrentApp = BusinessLogic.DefaultApps.content.ToString();
}
}
private Document currentDoc = new Document(int.Parse(helper.Request("nodeId")));
protected void version_load(object sender, EventArgs e) {
protected void version_load(object sender, EventArgs e)
{
if (allVersions.SelectedValue != "")
{
@@ -94,7 +95,7 @@ namespace umbraco.presentation.dialogs
}
Button1.Visible = true;
}
else
@@ -105,8 +106,8 @@ namespace umbraco.presentation.dialogs
}
protected void Page_Load(object sender, System.EventArgs e)
{
protected void Page_Load(object sender, System.EventArgs e)
{
if (String.IsNullOrEmpty(allVersions.SelectedValue))
rbl_mode.AutoPostBack = false;
@@ -116,40 +117,41 @@ namespace umbraco.presentation.dialogs
currentVersionTitle.Text = currentDoc.Text;
currentVersionMeta.Text = ui.Text("content", "createDate") + ": " + currentDoc.VersionDate.ToShortDateString() + " " + currentDoc.VersionDate.ToShortTimeString();
if (!IsPostBack) {
allVersions.Items.Add(new ListItem(ui.Text("rollback", "selectVersion")+ "...", ""));
foreach (DocumentVersionList dl in currentDoc.GetVersions())
{
//we don't need to show the current version
if (dl.Version == currentDoc.Version)
continue;
if (!IsPostBack)
{
allVersions.Items.Add(new ListItem(ui.Text("rollback", "selectVersion") + "...", ""));
foreach (DocumentVersionList dl in currentDoc.GetVersions())
{
//we don't need to show the current version
if (dl.Version == currentDoc.Version)
continue;
allVersions.Items.Add(new ListItem(dl.Text + " (" + ui.Text("content", "createDate") + ": " + dl.Date.ToShortDateString() + " " + dl.Date.ToShortTimeString() + ")", dl.Version.ToString()));
}
Button1.Text = ui.Text("actions", "rollback");
}
}
protected void doRollback_Click(object sender, System.EventArgs e)
{
if (allVersions.SelectedValue.Trim() != "")
}
protected void doRollback_Click(object sender, System.EventArgs e)
{
if (allVersions.SelectedValue.Trim() != "")
{
Document d = new Document(int.Parse(helper.Request("nodeId")));
d.RollBack(new Guid(allVersions.SelectedValue), base.getUser());
BusinessLogic.Log.Add(BusinessLogic.LogTypes.RollBack, base.getUser(), d.Id, "Version rolled back to revision '" + allVersions.SelectedValue + "'");
Document rollback = new Document(d.Id, new Guid(allVersions.SelectedValue));
feedBackMsg.type = global::umbraco.uicontrols.Feedback.feedbacktype.success;
string[] vars = {rollback.Text, rollback.VersionDate.ToLongDateString()};
string[] vars = { rollback.Text, rollback.VersionDate.ToLongDateString() };
feedBackMsg.Text = ui.Text("rollback", "documentRolledBack", vars, new global::umbraco.BusinessLogic.User(0)) + "</p><p><a href='#' onclick='" + ClientTools.Scripts.CloseModalWindow() + "'>" + ui.Text("closeThisWindow") + "</a>";
diffPanel.Visible = false;
pl_buttons.Visible = false;
ClientTools.ReloadLocationIfMatched(string.Format("/content/content/edit/{0}", d.Id));
}
}
}
}
}
}