hide description when bio is empty (#122)

This commit is contained in:
Geoffrey Huntley 2017-01-19 20:18:02 +11:00 коммит произвёл GitHub
Родитель b95f468d30
Коммит 42d27a5a7b
2 изменённых файлов: 36 добавлений и 32 удалений

0
a.out Normal file
Просмотреть файл

Просмотреть файл

@ -13,43 +13,47 @@
</p>
<p class="description">
@if (Model is IWorkAtXamarinOrMicrosoft)
@if (!string.IsNullOrWhiteSpace(Model.ShortBioOrTagLine))
{
<text>@Model.FirstName @Model.LastName @Model.ShortBioOrTagLine at Microsoft</text>
}
else
{
if (Model is IAmAXamarinMVP || Model is IAmAMicrosoftMVP)
if (Model is IWorkAtXamarinOrMicrosoft)
{
<text>@Model.FirstName @Model.LastName is</text>
var output = string.Empty;
var xamarinMvpModel = Model as IAmAXamarinMVP;
if (xamarinMvpModel != null)
{
output += "a Xamarin";
}
if (Model is IAmAXamarinMVP && Model is IAmAMicrosoftMVP)
{
output += " and Microsoft";
}
else
{
var microsoftMvpModel = Model as IAmAMicrosoftMVP;
if (microsoftMvpModel != null)
{
output += "a Microsoft";
}
}
output += " MVP ";
<text>@Html.Raw(output)</text>
<text>who @Model.ShortBioOrTagLine</text>
<text>@Model.FirstName @Model.LastName @Model.ShortBioOrTagLine at Microsoft</text>
}
else
{
<text>@Model.FirstName @Model.LastName @Model.ShortBioOrTagLine</text>
if (Model is IAmAXamarinMVP || Model is IAmAMicrosoftMVP)
{
<text>@Model.FirstName @Model.LastName is</text>
var output = string.Empty;
var xamarinMvpModel = Model as IAmAXamarinMVP;
if (xamarinMvpModel != null)
{
output += "a Xamarin";
}
if (Model is IAmAXamarinMVP && Model is IAmAMicrosoftMVP)
{
output += " and Microsoft";
}
else
{
var microsoftMvpModel = Model as IAmAMicrosoftMVP;
if (microsoftMvpModel != null)
{
output += "a Microsoft";
}
}
output += " MVP ";
<text>@Html.Raw(output)</text>
<text>who @Model.ShortBioOrTagLine</text>
}
else
{
<text>@Model.FirstName @Model.LastName @Model.ShortBioOrTagLine</text>
}
}
}
</p>