Merge branch 'dev-v7' into temp-U4-8624
This commit is contained in:
@@ -355,19 +355,39 @@ namespace Umbraco.Core.Sync
|
||||
/// <summary>
|
||||
/// Ensure that the last instruction that was processed is still in the database.
|
||||
/// </summary>
|
||||
/// <remarks>If the last instruction is not in the database anymore, then the messenger
|
||||
/// <remarks>
|
||||
/// If the last instruction is not in the database anymore, then the messenger
|
||||
/// should not try to process any instructions, because some instructions might be lost,
|
||||
/// and it should instead cold-boot.</remarks>
|
||||
/// and it should instead cold-boot.
|
||||
/// However, if the last synced instruction id is '0' and there are '0' records, then this indicates
|
||||
/// that it's a fresh site and no user actions have taken place, in this circumstance we do not want to cold
|
||||
/// boot. See: http://issues.umbraco.org/issue/U4-8627
|
||||
/// </remarks>
|
||||
private void EnsureInstructions()
|
||||
{
|
||||
var sql = new Sql().Select("*")
|
||||
if (_lastId == 0)
|
||||
{
|
||||
var sql = new Sql().Select("COUNT(*)")
|
||||
.From<CacheInstructionDto>(_appContext.DatabaseContext.SqlSyntax);
|
||||
|
||||
var count = _appContext.DatabaseContext.Database.ExecuteScalar<int>(sql);
|
||||
|
||||
//if there are instructions but we haven't synced, then a cold boot is necessary
|
||||
if (count > 0)
|
||||
_lastId = -1;
|
||||
}
|
||||
else
|
||||
{
|
||||
var sql = new Sql().Select("*")
|
||||
.From<CacheInstructionDto>(_appContext.DatabaseContext.SqlSyntax)
|
||||
.Where<CacheInstructionDto>(dto => dto.Id == _lastId);
|
||||
|
||||
var dtos = _appContext.DatabaseContext.Database.Fetch<CacheInstructionDto>(sql);
|
||||
var dtos = _appContext.DatabaseContext.Database.Fetch<CacheInstructionDto>(sql);
|
||||
|
||||
if (dtos.Count == 0)
|
||||
_lastId = -1;
|
||||
//if the last synced instruction is not found in the db, then a cold boot is necessary
|
||||
if (dtos.Count == 0)
|
||||
_lastId = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -53,8 +53,8 @@
|
||||
|
||||
<form novalidate name="localPackageForm">
|
||||
<div class="umb-package-icon">
|
||||
<i ng-if="!vm.localPackage.icon" class="icon-box"></i>
|
||||
<img ng-if="vm.localPackage.icon" ng-src="{{vm.localPackage.icon}}" alt="" />
|
||||
<i ng-if="!vm.localPackage.iconUrl" class="icon-box"></i>
|
||||
<img ng-if="vm.localPackage.iconUrl" ng-src="{{vm.localPackage.iconUrl}}" alt="" />
|
||||
</div>
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
<strong>Author</strong>
|
||||
<a href="{{ vm.localPackage.authorLink }}" target="_blank">{{ vm.localPackage.author }}</a>
|
||||
<a href="{{ vm.localPackage.authorUrl }}" target="_blank">{{ vm.localPackage.author }}</a>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
@@ -73,7 +73,7 @@
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
<strong>License</strong>
|
||||
<a href="{{ vm.localPackage.licenseUrl }}">{{ vm.localPackage.license }}</a>
|
||||
<a href="{{ vm.localPackage.licenseUrl }}" target="_blank">{{ vm.localPackage.license }}</a>
|
||||
</div>
|
||||
|
||||
<div class="umb-info-local-item">
|
||||
|
||||
@@ -233,6 +233,7 @@ namespace Umbraco.Web.Editors
|
||||
model.Name = ins.Name;
|
||||
model.Author = ins.Author;
|
||||
model.AuthorUrl = ins.AuthorUrl;
|
||||
model.IconUrl = ins.IconUrl;
|
||||
model.License = ins.License;
|
||||
model.LicenseUrl = ins.LicenseUrl;
|
||||
model.ReadMe = ins.ReadMe;
|
||||
|
||||
@@ -83,5 +83,8 @@ namespace Umbraco.Web.Models
|
||||
|
||||
[DataMember(Name = "author")]
|
||||
public string Author { get; set; }
|
||||
|
||||
[DataMember(Name = "iconUrl")]
|
||||
public string IconUrl { get; set; }
|
||||
}
|
||||
}
|
||||
@@ -135,9 +135,8 @@
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\packages\Lucene.Net.2.9.4.1\lib\net40\Lucene.Net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="MarkdownSharp, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Markdown.1.14.4\lib\net45\MarkdownSharp.dll</HintPath>
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<Reference Include="MarkdownSharp, Version=1.14.5.0, Culture=neutral, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Markdown.1.14.7\lib\net45\MarkdownSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.AspNet.Identity.Core, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
|
||||
@@ -1081,66 +1081,121 @@ namespace Umbraco.Web
|
||||
return text.ToMd5();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strips all html tags from a given string, all contents of the tags will remain.
|
||||
/// </summary>
|
||||
public HtmlString StripHtml(IHtmlString html, params string[] tags)
|
||||
{
|
||||
return StripHtml(html.ToHtmlString(), tags);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strips all html tags from a given string, all contents of the tags will remain.
|
||||
/// </summary>
|
||||
public HtmlString StripHtml(DynamicNull html, params string[] tags)
|
||||
{
|
||||
return new HtmlString(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Strips all html tags from a given string, all contents of the tags will remain.
|
||||
/// </summary>
|
||||
public HtmlString StripHtml(string html, params string[] tags)
|
||||
{
|
||||
return _stringUtilities.StripHtmlTags(html, tags);
|
||||
}
|
||||
|
||||
|
||||
/// <summary>
|
||||
/// Will take the first non-null value in the collection and return the value of it.
|
||||
/// </summary>
|
||||
public string Coalesce(params object[] args)
|
||||
{
|
||||
return _stringUtilities.Coalesce<DynamicNull>(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Will take the first non-null value in the collection and return the value of it.
|
||||
/// </summary>
|
||||
public string Concatenate(params object[] args)
|
||||
{
|
||||
return _stringUtilities.Concatenate<DynamicNull>(args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Joins any number of int/string/objects into one string and seperates them with the string seperator parameter.
|
||||
/// </summary>
|
||||
public string Join(string seperator, params object[] args)
|
||||
{
|
||||
return _stringUtilities.Join<DynamicNull>(seperator, args);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(IHtmlString html, int length)
|
||||
{
|
||||
return Truncate(html.ToHtmlString(), length, true, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis)
|
||||
{
|
||||
return Truncate(html.ToHtmlString(), length, addElipsis, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(IHtmlString html, int length, bool addElipsis, bool treatTagsAsContent)
|
||||
{
|
||||
return Truncate(html.ToHtmlString(), length, addElipsis, treatTagsAsContent);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(DynamicNull html, int length)
|
||||
{
|
||||
return new HtmlString(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis)
|
||||
{
|
||||
return new HtmlString(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(DynamicNull html, int length, bool addElipsis, bool treatTagsAsContent)
|
||||
{
|
||||
return new HtmlString(string.Empty);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(string html, int length)
|
||||
{
|
||||
return Truncate(html, length, true, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(string html, int length, bool addElipsis)
|
||||
{
|
||||
return Truncate(html, length, addElipsis, false);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Truncates a string to a given length, can add a elipsis at the end (...). Method checks for open html tags, and makes sure to close them
|
||||
/// </summary>
|
||||
public IHtmlString Truncate(string html, int length, bool addElipsis, bool treatTagsAsContent)
|
||||
{
|
||||
return _stringUtilities.Truncate(html, length, addElipsis, treatTagsAsContent);
|
||||
@@ -1151,10 +1206,17 @@ namespace Umbraco.Web
|
||||
|
||||
#region If
|
||||
|
||||
/// <summary>
|
||||
/// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned.
|
||||
/// </summary>
|
||||
public HtmlString If(bool test, string valueIfTrue, string valueIfFalse)
|
||||
{
|
||||
return test ? new HtmlString(valueIfTrue) : new HtmlString(valueIfFalse);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// If the test is true, the string valueIfTrue will be returned, otherwise the valueIfFalse will be returned.
|
||||
/// </summary>
|
||||
public HtmlString If(bool test, string valueIfTrue)
|
||||
{
|
||||
return test ? new HtmlString(valueIfTrue) : new HtmlString(string.Empty);
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<package id="Examine" version="0.1.69.0-beta" targetFramework="net45" />
|
||||
<package id="HtmlAgilityPack" version="1.4.9" targetFramework="net45" />
|
||||
<package id="Lucene.Net" version="2.9.4.1" targetFramework="net45" />
|
||||
<package id="Markdown" version="1.14.4" targetFramework="net45" />
|
||||
<package id="Markdown" version="1.14.7" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Identity.Core" version="2.2.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Identity.Owin" version="2.2.1" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.Mvc" version="5.2.3" targetFramework="net45" />
|
||||
|
||||
Reference in New Issue
Block a user