Skip to content

Commit 46d47f4

Browse files
authored
Merge pull request #153 from cloudscribe/version_8.5_claude
template changes waiting for 8.6 release
2 parents eef0f7b + 65189a9 commit 46d47f4

File tree

5 files changed

+65
-11
lines changed

5 files changed

+65
-11
lines changed

Content/WebApp/Views/Blog/CommentWrapperPartial.cshtml

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,25 @@
1-
@model cloudscribe.SimpleContent.Web.ViewModels.BlogViewModel
1+
@using cloudscribe.TalkAbout.Web.Components
2+
@using Microsoft.AspNetCore.Authorization
3+
4+
@model cloudscribe.SimpleContent.Web.ViewModels.BlogViewModel
25
@inject IStringLocalizer<SimpleContent> sr
6+
7+
@inject TalkAboutComments_SummernoteOptionsResolver talkAboutSummernoteOptions
8+
@inject IAuthorizationService _authorizationService
9+
10+
@{
11+
var summernoteOptions = await talkAboutSummernoteOptions.GetSummernoteOptions();
12+
var canUpload = (await _authorizationService.AuthorizeAsync(User, "TalkAboutImageUpload")).Succeeded;
13+
}
14+
315
@if ((Model.CurrentPost != null) && (!string.IsNullOrEmpty(Model.CurrentPost.Id)) && (Model.ShowComments) && Model.CurrentPost.PubDate.HasValue)
416
{
517
<div id="divComments"
18+
data-summernote-config-url="@summernoteOptions.CustomConfigPath"
19+
data-summernote-toolbar-config-url="@summernoteOptions.CustomToolbarConfigPath"
20+
data-summernote-config-language="@summernoteOptions.LanguageCode"
21+
data-summernote-config-dropfileuploadurl="@summernoteOptions.DropFileUrl"
22+
data-summernote-config-imageUploadAllowed="@canUpload"
623
data-talkabout-project-id="@Model.CurrentPost.BlogId"
724
data-talkabout-thread-id="@Model.CurrentPost.Id"
825
data-talkabout-thread-title="@Model.CurrentPost.Title"
@@ -14,6 +31,7 @@
1431
<h3>@sr["Comments"]</h3>
1532
<div data-bind="template: { name:'commentList' }"></div>
1633
<div data-bind="template: { name:'newCommentForm' }"></div>
34+
<!-- reCAPTCHA will be rendered here by JavaScript based on mode -->
1735
<div id="divRecaptcha"></div>
1836

1937
</div>

Content/WebApp/Views/Page/CommentWrapperPartial.cshtml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,26 @@
1-
@model cloudscribe.SimpleContent.Web.ViewModels.PageViewModel
1+
@using cloudscribe.TalkAbout.Web.Components
2+
@using Microsoft.AspNetCore.Authorization
3+
4+
@model cloudscribe.SimpleContent.Web.ViewModels.PageViewModel
25
@inject IStringLocalizer<SimpleContent> sr
6+
7+
@inject TalkAboutComments_SummernoteOptionsResolver talkAboutSummernoteOptions
8+
@inject IAuthorizationService _authorizationService
9+
10+
@{
11+
var summernoteOptions = await talkAboutSummernoteOptions.GetSummernoteOptions();
12+
var canUpload = (await _authorizationService.AuthorizeAsync(User, "TalkAboutImageUpload")).Succeeded;
13+
}
14+
15+
316
@if (Model.CurrentPage != null && Model.CurrentPage.ShowComments && Model.CurrentPage.PubDate.HasValue)
417
{
518
<div id="divComments"
19+
data-summernote-config-url="@summernoteOptions.CustomConfigPath"
20+
data-summernote-toolbar-config-url="@summernoteOptions.CustomToolbarConfigPath"
21+
data-summernote-config-language="@summernoteOptions.LanguageCode"
22+
data-summernote-config-dropfileuploadurl="@summernoteOptions.DropFileUrl"
23+
data-summernote-config-imageUploadAllowed="@canUpload"
624
data-talkabout-project-id="@Model.CurrentPage.ProjectId"
725
data-talkabout-thread-id="@Model.CurrentPage.Id"
826
data-talkabout-thread-title="@Model.CurrentPage.Title"
@@ -14,8 +32,8 @@
1432
<h3>@sr["Comments"]</h3>
1533
<div data-bind="template: { name:'commentList' }"></div>
1634
<div data-bind="template: { name:'newCommentForm' }"></div>
35+
<!-- reCAPTCHA will be rendered here by JavaScript based on mode -->
1736
<div id="divRecaptcha"></div>
18-
1937
</div>
2038

2139
<noscript>@sr["Please enable javascript to view or post comments."]</noscript>

Content/WebApp/Views/Shared/CommentScriptsPartial.cshtml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,8 @@
1717
</environment>
1818
@if (!User.Identity.IsAuthenticated)
1919
{
20-
<script src='https://www.google.com/recaptcha/api.js?onload=captchaOnloadCallback&render=explicit' async defer></script>
20+
@* Load reCAPTCHA API without onload callback - we'll initialize it manually after thread data loads *@
21+
<script src='https://www.google.com/recaptcha/api.js?render=explicit'></script>
2122
}
23+
24+
<partial name="SummernoteScripts" />

Content/WebApp/Views/Shared/CommentStylePartial.cshtml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,4 @@
22
<link rel="stylesheet" href="/cr/css/croppie.min.css" />
33
<link rel="stylesheet" href="/cr/css/croppie-cloudscribe.css" />
44
<link rel="stylesheet" href="/talk/css/talkabout.bootstrap.css" asp-append-version="true" />
5+
<link href="/cr/css/summernote-bs5.min.css" rel="stylesheet">

Content/WebApp/appsettings.json

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -18,13 +18,13 @@
1818
//#if (QueryTool)
1919
//QueryTool should use a different connection string than the main app for security reasons (possibly readonly and no DDL commands)
2020
//#if (SQLite)
21-
"QueryToolConnectionString": "Data Source=appdata.db;Pooling=false;Mode=ReadWrite"
21+
"QueryToolConnectionString": "Data Source=appdata.db;Pooling=false;Mode=ReadWrite",
2222
//#endif
2323
//#if (MSSQL)
24-
"QueryToolConnectionString": "Server=(localdb)\\mssqllocaldb;Database=WebApp-0353CAB0-205A-4FCD-9626-1282ECF47059;Trusted_Connection=True;MultipleActiveResultSets=true"
24+
"QueryToolConnectionString": "Server=(localdb)\\mssqllocaldb;Database=WebApp-0353CAB0-205A-4FCD-9626-1282ECF47059;Trusted_Connection=True;MultipleActiveResultSets=true",
2525
//#endif
2626
//#if (MySql)
27-
"QueryToolConnectionString": "Server=localhost;Database=yourdbname;Uid=yourdbuser;Pwd=yourdbpassword;Charset=utf8;"
27+
"QueryToolConnectionString": "Server=localhost;Database=yourdbname;Uid=yourdbuser;Pwd=yourdbpassword;Charset=utf8;",
2828
//#endif
2929
//#if (pgsql)
3030
"QueryToolConnectionString": "Server=yourserver;Port=5432;User Id=youruser;Password=yourpassword;Database=yourdbname;Pooling=true;Minimum Pool Size=0;Maximum Pool Size=20;"
@@ -48,10 +48,10 @@
4848
"MySqlEntityFrameworkConnection": "Server=localhost;Database=yourdbname;Uid=yourdbuser;Pwd=yourdbpassword;Charset=utf8;",
4949
//EFCore pgsql
5050
"PostgreSqlEntityFrameworkConnection": "Server=yourserver;Port=5432;User Id=youruser;Password=yourpassword;Database=yourdbname;Pooling=true;Minimum Pool Size=0;Maximum Pool Size=20;",
51-
//#if (QueryTool)
51+
//#if (QueryTool)
5252
//QueryTool should use a different connection string than the main app for security reasons (possibly readonly and no DDL commands)
53-
"QueryToolConnectionString": "Data Source=appdata.db;Pooling=false;Mode=ReadWrite" //or one of the above
54-
//#endif
53+
"QueryToolConnectionString": "Data Source=appdata.db;Pooling=false;Mode=ReadWrite" //or one of the above
54+
//#endif
5555
},
5656
//#endif
5757

@@ -126,6 +126,20 @@
126126
},
127127
//#endif
128128

129+
//#if (CommentSystem)
130+
"SummernoteOptions_TalkaboutComments": {
131+
"CustomConfigPath": "/talk/js/summernote-talkabout-comments-config.json",
132+
"CustomToolbarConfigPath": "/talk/js/summernote-talkabout-comments-toolbar-config.json",
133+
"FileBrowseUrl": "",
134+
"ImageBrowseUrl": "",
135+
"VideoBrowseUrl": "",
136+
"AudioBrowseUrl": "",
137+
"DropFileUrl": "",
138+
"CropFileUrl": "",
139+
"LanguageCode": ""
140+
},
141+
//#endif
142+
129143
//#if (KvpCustomRegistration)
130144
"ProfilePropertySetContainer": {
131145
"UserListingViewName": "index_kvp",
@@ -254,7 +268,7 @@
254268

255269
"ContentSettingsUIConfig": {
256270
//#if (CommentSystem)
257-
"ShowCommentSettings": false,
271+
"ShowCommentSettings": true,
258272
//#endif
259273
//#if (SimpleContentConfig != 'a')
260274
"ShowBlogMenuOptions": false,

0 commit comments

Comments
 (0)