mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Making edit media screen suck less for non-images.
--HG-- branch : 1.x
This commit is contained in:
@@ -5,6 +5,11 @@
|
|||||||
@{
|
@{
|
||||||
Style.Require("MediaAdmin");
|
Style.Require("MediaAdmin");
|
||||||
Layout.Title = T("Edit Media - {0}", Model.Name).ToString();
|
Layout.Title = T("Edit Media - {0}", Model.Name).ToString();
|
||||||
|
var isPicture = new[] {".png", ".jpg", ".jpeg", ".gif", ".bmp", ".ico"}
|
||||||
|
.Contains(Path.GetExtension(Model.RelativePath ?? "").ToLowerInvariant());
|
||||||
|
var embedHTML = isPicture ?
|
||||||
|
"<img src=\"" + Model.PublicUrl + "\"/>" :
|
||||||
|
"<a href=\"" + Model.PublicUrl + "\">" + Model.Name + "</a>";
|
||||||
}
|
}
|
||||||
|
|
||||||
<div class="breadCrumbs">
|
<div class="breadCrumbs">
|
||||||
@@ -18,23 +23,24 @@
|
|||||||
|
|
||||||
<div class="sections clearBoth">
|
<div class="sections clearBoth">
|
||||||
<div class="primary">
|
<div class="primary">
|
||||||
<div>
|
@if (isPicture) {
|
||||||
<img src="@Model.PublicUrl" class="previewImage"/>
|
<div>
|
||||||
</div>
|
<img src="@Model.PublicUrl" class="previewImage"/>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
@* todo: make these real (including markup) *@
|
@* todo: make these real (including markup) *@
|
||||||
<div>
|
<div>
|
||||||
@* <label>@T("Dimensions: <span>500 x 375 pixels</span>")</label> *@
|
@* <label>@T("Dimensions: <span>500 x 375 pixels</span>")</label> *@
|
||||||
|
|
||||||
<label>@T("Size: <span>{0}</span>", Model.Size.ToFriendlySizeString())</label>
|
<label>@T("Size: <span>{0}</span>", Model.Size.ToFriendlySizeString())</label>
|
||||||
|
|
||||||
<label>@T("Added on: <span>{0}</span>", Model.LastUpdated)</label>
|
<label>@T("Added on: <span>{0}</span>", Model.LastUpdated)</label>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label for="embedPath">@T("Embed:")</label>
|
<label for="embedPath">@T("Embed:")</label>
|
||||||
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="<img src="@Model.PublicUrl" @* width="500" height="375" *@ />" />
|
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="@embedHTML" />
|
||||||
<span class="hint">@T("Copy this html to add this image to your site.")</span>
|
<span class="hint">@T("Copy this html to add this media file to your site.")</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@using (Html.BeginFormAntiForgeryPost()) {
|
@using (Html.BeginFormAntiForgeryPost()) {
|
||||||
|
|||||||
Reference in New Issue
Block a user