To/From Fields enabled/disabled, reply message fix

This commit is contained in:
Cody 2020-06-04 21:20:48 -07:00 committed by GitHub
parent 41348b285d
commit 7b9cd39cb7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,15 +1,9 @@
@namespace Oqtane.Modules.Admin.UserProfile
@inherits ModuleBase
@inject NavigationManager NavigationManager
@inject IUserService UserService
@inject INotificationService NotificationService
@if (PageState.User != null)
@if (PageState.User != null)
{
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">@title: </label>
<label class="control-label">@title: </label>
</td>
<td>
<input class="form-control" @bind="@username" />
@ -17,47 +11,85 @@
</tr>
<tr>
<td>
<label class="control-label">Subject: </label>
<label class="control-label">Subject: </label>
</td>
<td>
<input class="form-control" @bind="@subject" />
</td>
</tr>
@if (title == "From")
{
<td>
<input class="form-control" @bind="@subject" readonly />
</td>
}
@if (title == "To")
{
<td>
<input class="form-control" @bind="@subject" />
</td>
</tr>}
@if (title == "From")
{
<tr>
<td>
<label class="control-label">Date: </label>
<label class="control-label">Date: </label>
</td>
<td>
<input class="form-control" @bind="@createdon" />
<input class="form-control" @bind="@createdon" readonly />
</td>
</tr>
}
@if (title == "From")
{
<tr>
<td>
<label class="control-label">Message: </label>
</td>
<td>
<textarea class="form-control" @bind="@body" rows="5" readonly />
</td>
</tr>
}
@if (title == "To")
{
<tr>
<td>
<label class="control-label">Message: </label>
</td>
<td>
<textarea class="form-control" @bind="@body" rows="5" />
</td>
</tr>
}
<tr>
<td>
<label class="control-label">Message: </label>
</td>
<td>
<textarea class="form-control" @bind="@body" rows="5" />
</td>
</tr>
</table>
@if (reply != string.Empty)
{
<button type="button" class="btn btn-primary" @onclick="Send">Send</button>
}
<button type="button" class="btn btn-primary" @onclick="Send">Send</button> }
else
{
if (title == "From")
{
<button type="button" class="btn btn-primary" @onclick="Reply">Reply</button>
}
<button type="button" class="btn btn-primary" @onclick="Reply">Reply</button>}
}
<NavLink class="btn btn-secondary" href="@NavigateUrl()">Cancel</NavLink>
<br />
<br />
<p>@reply</p>
@if (title == "To")
{
<table class="table table-borderless">
<tr>
<td>
<label class="control-label">Original Message: </label>
</td>
<td>
<textarea class="form-control" @bind="@reply" rows="5" readonly />
</td>
</tr>
</table>
}
}
@code {
@ -124,8 +156,12 @@
private void Reply()
{
title = "To";
subject = "RE: " + subject;
if (!subject.Contains("RE:"))
{
subject = "RE: " + subject;
}
reply = body;
body = "\n\n--------------------------------------------\nSent: " + createdon + "\nSubject: " + subject + "\n\n" + body;
StateHasChanged();
}