Skip to content

Commit

Permalink
Merge pull request #143 from SSchulze1989/develop
Browse files Browse the repository at this point in the history
v 0.11.7
  • Loading branch information
SSchulze1989 authored Feb 27, 2024
2 parents 77d956c + e78562d commit 5039ce8
Show file tree
Hide file tree
Showing 16 changed files with 293 additions and 363 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
Label="@Label"
HelperText="@HelperText"
Variant="Variant"
AnchorOrigin="Origin.BottomCenter">
AnchorOrigin="Origin.BottomCenter"
ToStringFunc="ToStringFunc">
@if (ItemTemplate is not null)
{
@foreach (var item in Items)
Expand Down
8 changes: 7 additions & 1 deletion src/iRLeagueManager.Web/Components/DisplayMarkdown.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,17 @@
@inject MarkdownPipeline Pipeline
@inject HtmlSanitizer Sanitizer

@((MarkupString)RenderBody())
<div class="@Class" style="@Style">
@((MarkupString)RenderBody())
</div>

@code {
[Parameter, EditorRequired]
public string Text { get; set; } = string.Empty;
[Parameter]
public string Class { get; set; } = string.Empty;
[Parameter]
public string Style { get; set; } = string.Empty;

private string RenderBody()
{
Expand Down
30 changes: 14 additions & 16 deletions src/iRLeagueManager.Web/Components/InputMarkdown.razor
Original file line number Diff line number Diff line change
Expand Up @@ -4,22 +4,20 @@
@inherits InputBase<string>

<div class="@CssClass" @attributes=AdditionalAttributes>
<nav>
<div class="nav nav-tabs" id="nav-tab-@uuid" role="tablist">
<button class="nav-link active" data-bs-toggle="tab" id="nav-edit-tab-@uuid" data-bs-target="#nav-edit-@uuid" type="button" role="tab" aria-controls="nav-edit-@uuid" aria-selected="true">Edit</button>
<button class="nav-link" data-bs-toggle="tab" id="nav-preview-tab-@uuid" data-bs-target="#nav-preview-@uuid" type="button" role="tab" aria-controls="nav-preview-@uuid" aria-selected="false">Preview</button>
</div>
</nav>
<div class="tab-content" id="nav-content-@uuid">
<div class="tab-pane tab-pane-keep-space show active" id="nav-edit-@uuid" role="tabpanel" aria-labelledby="nav-edit-tab-@uuid">
<textarea @bind=CurrentValueAsString class="form-control" style="height: 400px"/>
</div>
<div class="tab-pane" id="nav-preview-@uuid" role="tabpanel" aria-labelledby="nav-preview-tab-@uuid">
<div class="form-control" style="position: absolute; top: 0; left: 0; height: 100%;">
<DisplayMarkdown Text=@Value />
</div>
</div>
</div>
<MudTabs>
<MudTabPanel Text="Edit">
<MudTextField @bind-Value="CurrentValueAsString"
Variant="Variant.Outlined"
Lines="25"
FullWidth="true"
Style="font-family: 'Consolas', 'Lucida Console'"/>
</MudTabPanel>
<MudTabPanel Text="Preview">
<MudField Variant="Variant.Outlined">
<DisplayMarkdown Text=@Value Style="width: 100%; overflow: auto;" />
</MudField>
</MudTabPanel>
</MudTabs>
</div>

@code {
Expand Down

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
@namespace iRLeagueManager.Web.Components
@using Ganss.Xss
@using iRLeagueManager.Web.Components
@using iRLeagueApiCore.Common.Models
@inherits PromptDialog<string>
@inject HtmlSanitizer Sanitizer

<MudDialog>
<DialogContent>
<EditForm Model=Value>
<InputMarkdown @bind-Value="Value" />
</EditForm>
</DialogContent>
<DialogActions>
<PromptDialogButtons OkText="Ok" OkClick="Submit" CancelText="Cancel" CancelClick="Cancel" />
</DialogActions>
</MudDialog>

@code {
protected override async Task Submit()
{
// sanitize input before saving
Value = Sanitizer.Sanitize(Value);
await base.Submit();
}
}
Loading

0 comments on commit 5039ce8

Please sign in to comment.