fix issue in theme creator

This commit is contained in:
Shaun Walker
2021-06-01 15:49:06 -04:00
parent 3c48657e73
commit 8dfe8eba27
8 changed files with 22 additions and 11 deletions

View File

@ -43,7 +43,7 @@
<option value="-">&lt;@Localizer["Select Template"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Name</option>
<option value="@template.Name">@template.Title</option>
}
</select>
</td>
@ -170,7 +170,7 @@ else
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
return !string.IsNullOrEmpty(name) && name.ToLower() != "module" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)

View File

@ -43,7 +43,7 @@
<option value="-">&lt;@Localizer["Select Template"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Name</option>
<option value="@template.Name">@template.Title</option>
}
</select>
</td>
@ -133,7 +133,7 @@
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
return !string.IsNullOrEmpty(name) && name.ToLower() != "module" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)

View File

@ -36,7 +36,7 @@
<option value="-">&lt;@Localizer["Select Template"]&gt;</option>
@foreach (Template template in _templates)
{
<option value="@template.Name">@template.Name</option>
<option value="@template.Name">@template.Title</option>
}
</select>
</td>
@ -125,7 +125,7 @@
private bool IsValid(string name)
{
// must contain letters, underscores and digits and first character must be letter or underscore
return !string.IsNullOrEmpty(name) && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
return !string.IsNullOrEmpty(name) && name.ToLower() != "theme" && Regex.IsMatch(name, "^[A-Za-z_][A-Za-z0-9_]*$");
}
private void TemplateChanged(ChangeEventArgs e)