mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2025-10-15 19:54:57 +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");
|
||||
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">
|
||||
@@ -18,23 +23,24 @@
|
||||
|
||||
<div class="sections clearBoth">
|
||||
<div class="primary">
|
||||
<div>
|
||||
<img src="@Model.PublicUrl" class="previewImage"/>
|
||||
</div>
|
||||
|
||||
@if (isPicture) {
|
||||
<div>
|
||||
<img src="@Model.PublicUrl" class="previewImage"/>
|
||||
</div>
|
||||
}
|
||||
@* todo: make these real (including markup) *@
|
||||
<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>
|
||||
<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" *@ />" />
|
||||
<span class="hint">@T("Copy this html to add this image to your site.")</span>
|
||||
<input id="embedPath" class="textMedium" name="embedPath" type="text" readonly="readonly" value="@embedHTML" />
|
||||
<span class="hint">@T("Copy this html to add this media file to your site.")</span>
|
||||
</div>
|
||||
|
||||
@using (Html.BeginFormAntiForgeryPost()) {
|
||||
|
Reference in New Issue
Block a user