Skip to content
This repository was archived by the owner on Feb 10, 2024. It is now read-only.

Commit 8991d2c

Browse files
Fixed issue with ViewExists throwing exception
Added some extra css styles for easier preview overrides
1 parent 311e6fc commit 8991d2c

File tree

4 files changed

+12
-10
lines changed

4 files changed

+12
-10
lines changed
10 Bytes
Binary file not shown.

Src/Our.Umbraco.DocTypeGridEditor/Our.Umbraco.DocTypeGridEditor.csproj

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,9 +231,9 @@
231231
<PropertyGroup>
232232
<PostBuildEvent>IF %25ComputerName%25 == MBP13-PC-BC (
233233
IF NOT "$(SolutionDir)" == "*Undefined*" (
234-
xcopy /s /y "$(TargetPath)" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.2.2\bin"
235-
xcopy /s /y "$(TargetDir)$(ProjectName).pdb" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.2.2\bin"
236-
xcopy /s /y "$(ProjectDir)Web\UI\*.*" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoCms.7.2.2"
234+
xcopy /s /y "$(TargetPath)" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoUHangoutDemo\bin"
235+
xcopy /s /y "$(TargetDir)$(ProjectName).pdb" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoUHangoutDemo\bin"
236+
xcopy /s /y "$(ProjectDir)Web\UI\*.*" "C:\Users\Matt\Work\Sandbox\Umbraco\UmbracoUHangoutDemo"
237237
)
238238
)</PostBuildEvent>
239239
</PropertyGroup>

Src/Our.Umbraco.DocTypeGridEditor/Web/Extensions/HtmlHelperExtensions.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,13 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
1313
IPublishedContent content,
1414
string viewPath = "",
1515
string previewViewPath = "")
16-
{
17-
if (content == null)
16+
{
17+
if (content == null)
1818
return new HtmlString(string.Empty);
1919

2020
var controllerName = content.DocumentTypeAlias + "Surface";
2121

22-
if (!string.IsNullOrWhiteSpace(viewPath))
22+
if (!string.IsNullOrWhiteSpace(viewPath))
2323
viewPath = viewPath.TrimEnd('/') + "/";
2424

2525
if (!string.IsNullOrWhiteSpace(previewViewPath))
@@ -38,12 +38,12 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
3838
});
3939
}
4040

41-
// Check for preview view
41+
// Check for preview view
4242
if (!string.IsNullOrWhiteSpace(previewViewPath)
4343
&& helper.ViewContext.RequestContext.HttpContext.Request.QueryString["dtgePreview"] == "1")
4444
{
4545
var fullPreviewViewPath = previewViewPath + content.DocumentTypeAlias + ".cshtml";
46-
if (ViewEngines.Engines.ViewExists(helper.ViewContext.Controller.ControllerContext, fullPreviewViewPath, true))
46+
if (ViewEngines.Engines.ViewExists(helper.ViewContext, fullPreviewViewPath, true))
4747
{
4848
return helper.Partial(fullPreviewViewPath, content);
4949
}
@@ -53,7 +53,7 @@ public static HtmlString RenderDocTypeGridEditorItem(this HtmlHelper helper,
5353
if (!string.IsNullOrWhiteSpace(viewPath))
5454
{
5555
var fullViewPath = viewPath + content.DocumentTypeAlias + ".cshtml";
56-
if (ViewEngines.Engines.ViewExists(helper.ViewContext.Controller.ControllerContext, fullViewPath, true))
56+
if (ViewEngines.Engines.ViewExists(helper.ViewContext, fullViewPath, true))
5757
{
5858
return helper.Partial(fullViewPath, content);
5959
}

Src/Our.Umbraco.DocTypeGridEditor/Web/UI/App_Plugins/DocTypeGridEditor/Views/doctypegrideditor.html

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
<div ng-controller="Our.Umbraco.DocTypeGridEditor.GridEditors.DocTypeGridEditor">
22

3-
<div class="usky-editor-placeholder" ng-click="setDocType()">
3+
<div class="usky-editor-placeholder dtge-editor-placeholder"
4+
ng-click="setDocType()"
5+
ng-class="{ 'dtge-editor-placeholder--preview' : preview }">
46
<div ng-if="!preview">
57
<i class="icon {{icon}}"></i>
68
<div class="help-text">{{title}}</div>

0 commit comments

Comments
 (0)