Skip to content

Commit

Permalink
Text field editors (#2946)
Browse files Browse the repository at this point in the history
  • Loading branch information
agriffard authored and sebastienros committed Dec 31, 2018
1 parent 5c29b34 commit 8ae921b
Show file tree
Hide file tree
Showing 8 changed files with 85 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;

@{
var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>();
}

<fieldset class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<input asp-for="Text" class="form-control content-preview-text" type="color" />
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</fieldset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
string currentEditor = Model.Editor;
}
<option value="Color" selected="@String.IsNullOrEmpty(currentEditor)">@T["Color"]</option>
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;

@{
var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>();
}

<fieldset class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<div class="input-group mb-2">
<div class="input-group-prepend">
<div class="input-group-text">@@</div>
</div>
<input asp-for="Text" class="form-control content-preview-text" type="email" />
</div>
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</fieldset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
string currentEditor = Model.Editor;
}
<option value="Email" selected="@(currentEditor == "Email")">@T["Email"]</option>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;

@{
var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>();
}

<fieldset class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<input asp-for="Text" class="form-control content-preview-text" type="tel" />
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</fieldset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
string currentEditor = Model.Editor;
}
<option value="Tel" selected="@String.IsNullOrEmpty(currentEditor)">@T["Phone"]</option>
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
@model OrchardCore.ContentFields.ViewModels.EditTextFieldViewModel
@using OrchardCore.ContentManagement.Metadata.Models
@using OrchardCore.ContentFields.Settings;

@{
var settings = Model.PartFieldDefinition.Settings.ToObject<TextFieldSettings>();
}

<fieldset class="form-group">
<label asp-for="Text">@Model.PartFieldDefinition.DisplayName()</label>
<input asp-for="Text" class="form-control content-preview-text" type="url" />
@if (!String.IsNullOrEmpty(settings.Hint))
{
<span class="hint">@settings.Hint</span>
}
</fieldset>
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
@{
string currentEditor = Model.Editor;
}
<option value="Url" selected="@String.IsNullOrEmpty(currentEditor)">@T["Url"]</option>

0 comments on commit 8ae921b

Please sign in to comment.