1
0
Fork 0
mirror of https://github.com/Radarr/Radarr synced 2024-12-27 02:09:59 +00:00

More grid work. Row partial views are now sent a bool set to true if it is an alternate row.

This commit is contained in:
Mark McDowall 2012-02-06 19:48:26 -08:00
parent 93355a4ae1
commit 854d66c1f5
7 changed files with 31 additions and 24 deletions

View file

@ -65,17 +65,6 @@
background: #f0f5ff; background: #f0f5ff;
} }
/*
.seriesTable tr:nth-child(4n)
{
background: #f0f5ff;
}
.seriesTable tr:nth-child(4n+1)
{
background: #f0f5ff;
}*/
/* Episode Grid Row Colouring */ /* Episode Grid Row Colouring */
.episodeIgnored .episodeIgnored
{ {

View file

@ -38,7 +38,7 @@ public SeriesController(SeriesProvider seriesProvider, EpisodeProvider episodePr
public ActionResult Index() public ActionResult Index()
{ {
var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount()).OrderBy(o => SortHelper.SkipArticles(o.Title)); var series = GetSeriesModels(_seriesProvider.GetAllSeriesWithEpisodeCount()).OrderBy(o => SortHelper.SkipArticles(o.Title)).ToList();
return View(series); return View(series);
} }

View file

@ -555,9 +555,6 @@
<ItemGroup> <ItemGroup>
<Content Include="Views\Series\SeriesEditor.cshtml" /> <Content Include="Views\Series\SeriesEditor.cshtml" />
</ItemGroup> </ItemGroup>
<ItemGroup>
<Content Include="Views\Upcoming\Index2.cshtml" />
</ItemGroup>
<ItemGroup> <ItemGroup>
<Content Include="Views\Upcoming\UpcomingEpisode.cshtml" /> <Content Include="Views\Upcoming\UpcomingEpisode.cshtml" />
</ItemGroup> </ItemGroup>

View file

@ -1,7 +1,7 @@
@using NzbDrone.Web.Helpers @using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.EpisodeModel @model NzbDrone.Web.Models.EpisodeModel
<tr class="@Model.EpisodeId data-row"> <tr class="@Model.EpisodeId data-row@(ViewData["AltRow"] == null || !(bool)ViewData["AltRow"] ? "" : " alt-row")">
<td>@Model.EpisodeNumber</td> <td>@Model.EpisodeNumber</td>
<td>@Model.Title</td> <td>@Model.Title</td>
<td>@Model.AirDate</td> <td>@Model.AirDate</td>
@ -29,7 +29,7 @@
@Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename episode", @class = "renameImage" }, "Rename", "Episode", new { EpisodeFileId = Model.EpisodeFileId }, null, null) @Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename episode", @class = "renameImage" }, "Rename", "Episode", new { EpisodeFileId = Model.EpisodeFileId }, null, null)
</td> </td>
</tr> </tr>
<tr class="detail-row"> <tr class="detail-row@(ViewData["AltRow"] == null || !(bool)ViewData["AltRow"] ? "" : " alt-row")">
<td colspan="5"> <td colspan="5">
@Model.Overview <br /> @Model.Overview <br />
<b>@Model.Path</b> <b>@Model.Path</b>

View file

@ -1,7 +1,7 @@
@using NzbDrone.Common @using NzbDrone.Common
@using NzbDrone.Web.Helpers @using NzbDrone.Web.Helpers
@using NzbDrone.Web.Models; @using NzbDrone.Web.Models;
@model IEnumerable<NzbDrone.Web.Models.SeriesModel> @model List<NzbDrone.Web.Models.SeriesModel>
@{ViewBag.Title = "NzbDrone";} @{ViewBag.Title = "NzbDrone";}
@section HeaderContent @section HeaderContent
@ -117,9 +117,20 @@
</th> </th>
</tr> </tr>
@foreach (var series in Model)
@for (int i = 0; i < Model.Count; i++)
{ {
Html.RenderPartial("Series", series); var series = Model[i];
if (i % 2 == 0)
{
Html.RenderPartial("Series", series);
}
else
{
Html.RenderPartial("Series", series, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
}
} }
</table> </table>

View file

@ -27,8 +27,18 @@
@Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename all episodes in this season", @class = "renameImage renameImageMaster" }, "RenameSeason", "Episode", new { SeriesId = Model.SeriesId, SeasonNumber = Model.SeasonNumber }, null, null) @Ajax.ImageActionLink("../../Content/Images/Rename.png", new { Alt = "Rename", Title = "Rename all episodes in this season", @class = "renameImage renameImageMaster" }, "RenameSeason", "Episode", new { SeriesId = Model.SeriesId, SeasonNumber = Model.SeasonNumber }, null, null)
</th> </th>
</tr> </tr>
@foreach (var episode in Model.Episodes) @for (int i = 0; i < Model.Episodes.Count; i++)
{ {
Html.RenderPartial("Episode", episode); var episode = Model.Episodes[i];
if (i % 2 == 0)
{
Html.RenderPartial("Episode", episode);
}
else
{
Html.RenderPartial("Episode", episode, new ViewDataDictionary { new KeyValuePair<string, object>("AltRow", true) });
}
} }
</table> </table>

View file

@ -1,7 +1,7 @@
@using NzbDrone.Web.Helpers @using NzbDrone.Web.Helpers
@model NzbDrone.Web.Models.SeriesModel @model NzbDrone.Web.Models.SeriesModel
<tr class="@Model.SeriesId data-row"> <tr class="@Model.SeriesId data-row @(ViewData["AltRow"] == null || !(bool)ViewData["AltRow"] ? "" : " alt-row")">
<td>@Html.ActionLink(Model.Title, "Details", "Series", new { seriesId = Model.SeriesId }, null)</td> <td>@Html.ActionLink(Model.Title, "Details", "Series", new { seriesId = Model.SeriesId }, null)</td>
<td>@Model.SeasonsCount</td> <td>@Model.SeasonsCount</td>
<td>@Model.QualityProfileName</td> <td>@Model.QualityProfileName</td>
@ -20,7 +20,7 @@
<img src="../../Content/Images/Delete.png" class="deleteButton" value="@Model.SeriesId" rel="@Model.Title" /> <img src="../../Content/Images/Delete.png" class="deleteButton" value="@Model.SeriesId" rel="@Model.Title" />
</td> </td>
</tr> </tr>
<tr class="detail-row details_@(Model.SeriesId)"> <tr class="detail-row details_@(Model.SeriesId) @(ViewData["AltRow"] == null || !(bool)ViewData["AltRow"] ? "" : " alt-row")">
<td colspan="7"> <td colspan="7">
<b>Airs Day of Week:</b> @Model.AirsDayOfWeek <br/> <b>Airs Day of Week:</b> @Model.AirsDayOfWeek <br/>
<b>Overview:</b> @Model.Overview <b>Overview:</b> @Model.Overview