Skip to content
This repository has been archived by the owner on May 29, 2019. It is now read-only.

Commit

Permalink
React to aspnet/Razor#281 changes
Browse files Browse the repository at this point in the history
  • Loading branch information
ajaybhargavb committed Mar 17, 2015
1 parent 36a3262 commit 68a125b
Showing 1 changed file with 16 additions and 14 deletions.
30 changes: 16 additions & 14 deletions src/MusicStore/Areas/Admin/Views/StoreManager/Index.cshtml
Original file line number Diff line number Diff line change
@@ -1,17 +1,5 @@
@model IEnumerable<MusicStore.Models.Album>

@helper Truncate(string input, int length)
{
if (input.Length <= length)
{
@input
}
else
{
@input.Substring(0, length)<text>...</text>
}
}

@{
ViewBag.Title = "Index";
}
Expand Down Expand Up @@ -45,10 +33,24 @@
@Html.DisplayFor(modelItem => item.Genre.Name)
</td>
<td>
@Truncate(item.Artist.Name, 25)
@if (item.Artist.Name.Length <= 25)
{
@item.Artist.Name
}
else
{
@item.Artist.Name.Substring(0, 25)<text>...</text>
}
</td>
<td>
@Truncate(item.Title, 25)
if (item.Title.Length <= 25)
{
@item.Title
}
else
{
@item.Title.Substring(0, 25)<text>...</text>
}
</td>
<td>
@Html.DisplayFor(modelItem => item.Price)
Expand Down

0 comments on commit 68a125b

Please sign in to comment.