Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] - Added _rowCssClass parameter to Pager and Settings #94

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Client/Index.razor
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ else
@if (_blogs.Any())
{
@((MarkupString)_summaryHeader)
<Pager Format="Grid" Items="@_blogs" DisplayPages="1" PageSize="@_items.ToString()" ColumnClass="@_columnCssClass" SearchProperties="@_searchProperties" Toolbar="@_pagerPosition">
<Pager Format="Grid" Items="@_blogs" DisplayPages="1" PageSize="@_items.ToString()" ColumnClass="@_columnCssClass" RowClass="@_rowCssClass" SearchProperties="@_searchProperties" Toolbar="@_pagerPosition">
<Row>
@((MarkupString)Utilities.FormatContent(FormatTemplate(_summary, context), PageState.Alias, "render"))
@if (UserSecurity.IsAuthorized(PageState.User, PermissionNames.Edit, ModuleState.PermissionList) && PageState.EditMode)
Expand Down Expand Up @@ -218,6 +218,7 @@ else
private string _searchProperties;
private string _pagerPosition;
private string _columnCssClass;
private string _rowCssClass;
private string _blogName;
private string _metaTags;
private string _pageTitle;
Expand Down
10 changes: 8 additions & 2 deletions Client/Resources/Oqtane.Blogs.Settings.resx
Original file line number Diff line number Diff line change
Expand Up @@ -154,10 +154,10 @@
<value>Allow Search?</value>
</data>
<data name="ColumnCssClass.HelpText" xml:space="preserve">
<value>Enter the CSS class for each summary blog post</value>
<value>Enter the Column CSS class for each summary blog post</value>
</data>
<data name="ColumnCssClass.Text" xml:space="preserve">
<value>Summary CSS Class:</value>
<value>Summary Column CSS Class:</value>
</data>
<data name="Bottom" xml:space="preserve">
<value>Bottom</value>
Expand Down Expand Up @@ -234,4 +234,10 @@
<data name="Both" xml:space="preserve">
<value>Both</value>
</data>
<data name="RowCssClass.HelpText" xml:space="preserve">
<value>Enter the Row CSS class for each summary blog post</value>
</data>
<data name="RowCssClass.Text" xml:space="preserve">
<value>Summary Row CSS Class:</value>
</data>
</root>
11 changes: 10 additions & 1 deletion Client/Settings.razor
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,17 @@
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="columnCssClass" ResourceKey="ColumnCssClass" ResourceType="@resourceType" HelpText="Enter the CSS class for each summary blog post">Summary CSS Class: </Label>
<Label Class="col-sm-3" For="columnCssClass" ResourceKey="ColumnCssClass" ResourceType="@resourceType" HelpText="Enter the Column CSS class for each summary blog post">Summary Column CSS Class: </Label>
<div class="col-sm-9">
<input id="columnCssClass" type="text" class="form-control" @bind="@_columnCssClass" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="rowCssClass" ResourceKey="rowCssClass" ResourceType="@resourceType" HelpText="Enter the Row CSS class for each summary blog post">Summary Row CSS Class: </Label>
<div class="col-sm-9">
<input id="rowCssClass" type="text" class="form-control" @bind="@_rowCssClass" />
</div>
</div>
<div class="row mb-1 align-items-center">
<Label Class="col-sm-3" For="summary" ResourceKey="Summary" ResourceType="@resourceType" HelpText="Enter the summary blog template">Summary Template: </Label>
<div class="col-sm-9">
Expand Down Expand Up @@ -160,6 +166,7 @@

private string _items;
private string _columnCssClass;
private string _rowCssClass;
private string _summary;
private string _detail;
private string _comment;
Expand Down Expand Up @@ -193,6 +200,7 @@
_searchProperties = SettingService.GetSetting(ModuleState.Settings, "SearchProperties", BlogConstants.DefaultSearchProperties);
_pagerPosition = SettingService.GetSetting(ModuleState.Settings, "PagerPosition", BlogConstants.DefaultPagerPosition);
_columnCssClass = SettingService.GetSetting(ModuleState.Settings, "ColumnCssClass", BlogConstants.DefaultColumnCssClass);
_rowCssClass = SettingService.GetSetting(ModuleState.Settings, "RowCssClass", BlogConstants.DefaultRowCssClass);
_subscriptions = SettingService.GetSetting(ModuleState.Settings, "Subscriptions", "False");
_sender = SettingService.GetSetting(ModuleState.Settings, "Sender", string.Empty);
_blogName = SettingService.GetSetting(ModuleState.Settings, "BlogName", "Blog");
Expand All @@ -219,6 +227,7 @@
var settings = await SettingService.GetModuleSettingsAsync(ModuleState.ModuleId);
settings = SettingService.SetSetting(settings, "Items", _items);
settings = SettingService.SetSetting(settings, "ColumnCssClass", _columnCssClass);
settings = SettingService.SetSetting(settings, "RowCssClass", _rowCssClass);
settings = SettingService.SetSetting(settings, "Summary", _summary);
settings = SettingService.SetSetting(settings, "Detail", _detail);
settings = SettingService.SetSetting(settings, "Comment", _comment);
Expand Down
1 change: 1 addition & 0 deletions Shared/BlogConstants.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ public sealed class BlogConstants
public const int DefaultVersion = 1;

public const string DefaultColumnCssClass = "col-lg-4 col-md-6";
public const string DefaultRowCssClass = "row";
public const string DefaultSummaryTemplate = "<a href=\"[URL]\"><h2>[TITLE]</h2></a><p>[SUMMARY]</p>";
public const string DefaultDetailTemplate = "<h2>[TITLE]</h2><p>[CONTENT]</p>";
public const string DefaultCommentTemplate = "<figure><blockquote class=\"blockquote\"><p>[COMMENT]</p></blockquote><figcaption class=\"blockquote-footer\">[NAME] on [DATE] at [TIME]</figcaption></figure>";
Expand Down