Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Commit

Permalink
Update to Umbraco 8.5.3 + add markdown editor
Browse files Browse the repository at this point in the history
  • Loading branch information
mjbarlow committed Jan 28, 2020
1 parent b1d2eba commit 350f4f9
Show file tree
Hide file tree
Showing 26 changed files with 7,332 additions and 107 deletions.
18 changes: 13 additions & 5 deletions U8StarterKit.Web/App_Code/RazorHelper.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,7 @@
break;

default:
srcSet = image.GetCropUrl(480) + " 480w, " +
image.GetCropUrl(769) + " 769w, " +
image.GetCropUrl(1024) + " 1024w, " +
image.GetCropUrl(1216) + " 1216w, " +
image.GetCropUrl(1408) + " 1408w";
srcSet = SetImageSrcSet(image.Url);
break;
}
<img srcset="@srcSet" alt="@alt" class="@classList">
Expand Down Expand Up @@ -110,4 +106,16 @@
}
return result;
}

public static string SetImageSrcSet(string url)
{
var imageSrcSet = url.GetCropUrl(480) + " 480w, " +
url.GetCropUrl(769) + " 769w, " +
url.GetCropUrl(1024) + " 1024w, " +
url.GetCropUrl(1216) + " 1216w, " +
url.GetCropUrl(1408) + " 1408w";

return imageSrcSet;
}

}
55 changes: 55 additions & 0 deletions U8StarterKit.Web/App_Data/Models/Markdown.generated.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
//
// Umbraco.ModelsBuilder v8.1.0
//
// Changes to this file will be lost if the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

using System;
using System.Collections.Generic;
using System.Linq.Expressions;
using System.Web;
using Umbraco.Core.Models;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
using Umbraco.ModelsBuilder;
using Umbraco.ModelsBuilder.Umbraco;

namespace Umbraco.Web.PublishedModels
{
/// <summary>Markdown</summary>
[PublishedModel("markdown")]
public partial class Markdown : PublishedElementModel
{
// helpers
#pragma warning disable 0109 // new is redundant
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.1.0")]
public new const string ModelTypeAlias = "markdown";
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.1.0")]
public new const PublishedItemType ModelItemType = PublishedItemType.Content;
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.1.0")]
public new static IPublishedContentType GetModelContentType()
=> PublishedModelUtility.GetModelContentType(ModelItemType, ModelTypeAlias);
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.1.0")]
public static IPublishedPropertyType GetModelPropertyType<TValue>(Expression<Func<Markdown, TValue>> selector)
=> PublishedModelUtility.GetModelPropertyType(GetModelContentType(), selector);
#pragma warning restore 0109

// ctor
public Markdown(IPublishedElement content)
: base(content)
{ }

// properties

///<summary>
/// Content: Add content in markdown.
///</summary>
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder", "8.1.0")]
[ImplementPropertyType("content")]
public IHtmlString Content => this.Value<IHtmlString>("content");
}
}
92 changes: 51 additions & 41 deletions U8StarterKit.Web/App_Plugins/uSync8/changeDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,65 +7,75 @@
hide-description="true">
</umb-editor-header>
<umb-editor-container>
<umb-box>
<umb-box-content>
<strong>uSync Beta</strong> We are working on making the change report better, for now you might see blank change reports.
</umb-box-content>
</umb-box>
<umb-box>
<umb-box-header title="{{vm.item.Name}}"
description="{{vm.getTypeName(vm.item.ItemType)}}">
description="{{vm.getTypeName(vm.item.ItemType)}} {{vm.item.Message}}">
</umb-box-header>
<umb-box-container>
<umb-box-content>
<p>
{{vm.item.Message}}
</p>

<div class="usync-item-details">
<div class="umb-table">
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell"></div>
<div class="umb-table-cell usync-detail-action-cell">Action</div>
<div class="umb-table-cell umb-table__name">Item</div>
<div class="umb-table-cell">Old Value</div>
<div class="umb-table-cell">New Value</div>
</div>
</div>
<div class="umb-table-body">
<div ng-repeat="detail in vm.item.Details" class="umb-table-row"
ng-class="{'usync-row-delete': detail.Change == 'Delete', 'usync-row-create' : detail.Change == 'Create'}">
<div class="umb-table-cell">
<i ng-if="detail.Change == 'Create'" class="icon icon-add color-green"></i>
<i ng-if="detail.Change == 'NoChange'" class="icon icon-check color-green"></i>
<i ng-if="detail.Change == 'Update'" class="icon icon-sync color-orange"></i>
<i ng-if="detail.Change == 'Delete'" class="icon icon-wrong color-red"></i>
</div>
<div class="umb-table-cell usync-detail-action-cell">
{{detail.Change}}
</div>
<div class="umb-table-cell umb-table__name">
{{detail.Name}}
<div ng-if="vm.item.Details.length > 0">
<h5>Detected changes</h5>
<div class="usync-item-details">
<div class="umb-table">
<div class="umb-table-head">
<div class="umb-table-row">
<div class="umb-table-cell"></div>
<div class="umb-table-cell usync-detail-action-cell">Action</div>
<div class="umb-table-cell umb-table__name">Item</div>
<div class="umb-table-cell">Old Value</div>
<div class="umb-table-cell">New Value</div>
</div>
<div class="umb-table-cell usync-old-value">
{{detail.OldValue}}
</div>
<div class="umb-table-cell usync-new-value">
{{detail.NewValue}}
</div>
<div class="umb-table-body">
<div ng-repeat="detail in vm.item.Details" class="umb-table-row"
ng-class="{'usync-row-delete': detail.Change == 'Delete', 'usync-row-create' : detail.Change == 'Create'}">
<div class="umb-table-cell">
<i ng-if="detail.Change == 'Create'" class="icon icon-add color-green"></i>
<i ng-if="detail.Change == 'NoChange'" class="icon icon-check color-green"></i>
<i ng-if="detail.Change == 'Update'" class="icon icon-sync color-orange"></i>
<i ng-if="detail.Change == 'Delete'" class="icon icon-wrong color-red"></i>
</div>
<div class="umb-table-cell usync-detail-action-cell">
{{detail.Change}}
</div>
<div class="umb-table-cell umb-table__name">
{{detail.Name}}
</div>
<div class="umb-table-cell usync-old-value">
{{detail.OldValue}}
</div>
<div class="umb-table-cell usync-new-value">
{{detail.NewValue}}
</div>
</div>
</div>
</div>
</div>
</div>

<div ng-if="vm.item.Details.length == 0 && vm.item.Change == 'Update'" class="alert alert-info">
<h4>No Changes detected</h4>
<p>
It is possible that the .config file is diffrent, because it contains extra information
(such as xml comments) but no properties or values on this item will change when the file
is processed.
</p>
</div>

<div ng-if="vm.item.Change == 'Create'" class="alert alert-success">
<h4>Create</h4>
<p>
This item doesn't currently exist, and will be created on import.
</p>
</div>
</umb-box-content>
</umb-box-container>
</umb-box>
</umb-editor-container>
<umb-editor-footer>
<umb-editor-footer-content-right>
<umb-button type="button"
button-style="default"
button-style="link"
label-key="general_close"
action="vm.close()">
</umb-button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,14 @@
</div>
</div>
</div>
<div class="flex justify-center">
<div class="text-center">
<h4 class="usync-action-message">{{vm.status.Message}}</h4>
<small>{{vm.update.Message}}</small>
<div class="progress usync-not-animated" style="height: 3px;">
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.update)}}%;" aria-valuenow="{{vm.calcPercentage(vm.update)}}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
<div class="flex items-center flex-column">
<h4 class="usync-action-message">{{vm.status.Message}}</h4>
<small>{{vm.update.Message}}</small>
<div class="progress usync-not-animated" style="height: 3px; width: 160px">
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.update)}}%;" aria-valuenow="{{vm.calcPercentage(vm.update)}}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
<div class="progress" style="height: 1px;">
<div class="progress usync-main-progress" style="height: 1px;">
<div class="bar" role="progressbar" style="width: {{vm.calcPercentage(vm.status)}}%;" aria-valuenow="{{vm.calcPercentage(vm.status)}}" aria-valuemin="0" aria-valuemax="100"></div>
</div>
</div>
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
<div class="umb-table-cell">
<localize key="usync_tableMessage"></localize>
</div>
<div class="umb-table-cell"></div>
<div class="umb-table-cell usync-detail-link-cell"></div>
<div class="umb-table-cell"></div>
</div>
</div>
Expand All @@ -56,7 +56,7 @@
<div class="umb-table-cell">
{{result.Message}}
</div>
<div class="umb-table-cell">
<div class="umb-table-cell usync-detail-link-cell">
<umb-button type="button"
button-style="link"
label-key="usync_details"
Expand All @@ -81,7 +81,9 @@
</div>
</div>
<div class="flex justify-center items-center padded" ng-if="vm.countChanges(vm.results) == 0 && !vm.showAll">
<localize key="usync_nochange"></localize>
<div>
<localize key="usync_nochange"></localize>
</div>
</div>
</umb-box>
</div>
20 changes: 10 additions & 10 deletions U8StarterKit.Web/App_Plugins/uSync8/package.manifest
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
{
"javascript": [
"~/app_plugins/uSync8/backoffice/uSync8/uSyncDashboardController.js",
"~/app_plugins/uSync8/settings/settingsController.js",
"~/app_plugins/uSync8/settings/expansionController.js",
"~/app_plugins/uSync8/settings/uSyncController.js",
"~/App_Plugins/uSync8/backoffice/uSync8/uSyncDashboardController.js?",
"~/App_Plugins/uSync8/settings/settingsController.js",
"~/App_Plugins/uSync8/settings/expansionController.js",
"~/App_Plugins/uSync8/settings/uSyncController.js",

"~/app_plugins/uSync8/uSyncService.js",
"~/app_plugins/uSync8/uSyncHub.js",
"~/app_plugins/uSync8/changeDialogController.js",
"~/App_Plugins/uSync8/uSyncService.js",
"~/App_Plugins/uSync8/uSyncHub.js",
"~/App_Plugins/uSync8/changeDialogController.js",

"~/app_plugins/uSync8/components/uSyncReportViewComponent.js",
"~/app_plugins/uSync8/components/uSyncProgressViewComponent.js"
"~/App_Plugins/uSync8/components/uSyncReportViewComponent.js",
"~/App_Plugins/uSync8/components/uSyncProgressViewComponent.js"
],
"css": [
"~/app_plugins/uSync8/usync.css"
"~/App_Plugins/uSync8/usync.css"
],

}
10 changes: 4 additions & 6 deletions U8StarterKit.Web/App_Plugins/uSync8/settings/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,16 @@
</div>
</div>

<div class="umb-permission">
<div class="umb-permission" ng-if="vm.umbracoVersion < '8.4.0'">
<umb-toggle class="umb-permission__toggle"
checked="vm.settings.RebuildCacheOnCompleation"
on-click="vm.settings.RebuildCacheOnCompleation = !vm.settings.RebuildCacheOnCompleation">
checked="vm.settings.RebuildCacheOnCompletion"
on-click="vm.settings.RebuildCacheOnCompletion = !vm.settings.RebuildCacheOnCompletion">
</umb-toggle>
<div class="umb-permission__content" ng-click="vm.settings.RebuildCacheOnCompleation = !vm.settings.RebuildCacheOnCompleation">
<div class="umb-permission__content" ng-click="vm.settings.RebuildCacheOnCompletion = !vm.settings.RebuildCacheOnCompletion">
<div>Rebuild Cache after import</div>
<div class="umb-permission__description">Request that Umbraco rebuilds its cache after an import</div>
</div>
</div>


</umb-box-content>
</umb-box>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
vm.working = false;
vm.loading = true;

vm.umbracoVersion = Umbraco.Sys.ServerVariables.application.version;

vm.saveSettings = saveSettings;

init();
Expand Down
12 changes: 12 additions & 0 deletions U8StarterKit.Web/App_Plugins/uSync8/usync.css
Original file line number Diff line number Diff line change
Expand Up @@ -294,4 +294,16 @@

.usync-handler-box .umb-box-header {
cursor: pointer;
}

.usync-detail-link-cell {
min-width: 120px;
}

.usync-detail-link-cell .btn {
padding: 6px;
}

.usync-main-progress {
margin: 0 -20px -20px -20px;
}
18 changes: 18 additions & 0 deletions U8StarterKit.Web/Properties/PublishProfiles/FolderProfile.pubxml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0" encoding="utf-8"?>
<!--
This file is used by the publish/package process of your Web project. You can customize the behavior of this process
by editing this MSBuild file. In order to learn more about this please visit https://go.microsoft.com/fwlink/?LinkID=208121.
-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<WebPublishMethod>FileSystem</WebPublishMethod>
<PublishProvider>FileSystem</PublishProvider>
<LastUsedBuildConfiguration>Release</LastUsedBuildConfiguration>
<LastUsedPlatform>Any CPU</LastUsedPlatform>
<SiteUrlToLaunchAfterPublish />
<LaunchSiteAfterPublish>True</LaunchSiteAfterPublish>
<ExcludeApp_Data>False</ExcludeApp_Data>
<publishUrl>C:\Users\Matt\Desktop\bulma</publishUrl>
<DeleteExistingFiles>True</DeleteExistingFiles>
</PropertyGroup>
</Project>
Loading

0 comments on commit 350f4f9

Please sign in to comment.