Add Existing with Refresh button after modifying root dirs.

Renamed AddSeries/Add to AddSeries/Index
This commit is contained in:
Mark McDowall 2011-05-31 13:50:19 -07:00
parent cd4268cf4a
commit 8d38f98338
7 changed files with 48 additions and 20 deletions

View File

@ -260,6 +260,11 @@ button, input[type="button"], input[type="submit"], input[type="reset"]
margin: 10px;
}
button:active, input[type="button"]:active, input[type="submit"]:active, input[type="reset"]:active
{
border-color: #0C48B6;
}
.listButton
{
padding: 2px 10px 2px 10px;

View File

@ -71,19 +71,25 @@ namespace NzbDrone.Web.Controllers
return View();
}
public ActionResult Add()
public ActionResult Index()
{
ViewData["RootDirs"] = _rootFolderProvider.GetAll();
var unmappedList = new List<String>();
var rootDirs = _rootFolderProvider.GetAll();
var profiles = _qualityProvider.GetAllProfiles();
var defaultQuality = Convert.ToInt32(_configProvider.DefaultQualityProfile);
var selectList = new SelectList(profiles, "QualityProfileId", "Name", defaultQuality);
ViewData["qualities"] = selectList;
foreach (var folder in _rootFolderProvider.GetAll())
return View(rootDirs);
}
public ActionResult AddExisting()
{
var rootDirs = _rootFolderProvider.GetAll();
var unmappedList = new List<String>();
foreach (var folder in rootDirs)
{
unmappedList.AddRange(_rootFolderProvider.GetUnmappedFolders(folder.Path));
}

View File

@ -664,7 +664,7 @@
<Content Include="Scripts\jquery-tgc-countdown-1.0.js" />
<Content Include="Scripts\jquery.simpledropdown.js" />
<Content Include="Scripts\Notification.js" />
<Content Include="Views\AddSeries\Add.cshtml" />
<Content Include="Views\AddSeries\Index.cshtml" />
<Content Include="Views\AddSeries\AddNew.cshtml" />
<Content Include="Views\AddSeries\AddSeriesItem.cshtml" />
<Content Include="Web.config">
@ -871,6 +871,9 @@
<ItemGroup>
<Content Include="Views\Series\SingleSeason.cshtml" />
</ItemGroup>
<ItemGroup>
<Content Include="Views\AddSeries\AddExisting.cshtml" />
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.

View File

@ -0,0 +1,15 @@
@model IEnumerable<String>
@{
Layout = null;
}
@if (Model.Count() == 0)
{
@Html.DisplayText("No Series to Add");
}
@foreach (var path in Model)
{
Html.RenderAction("RenderPartial", "AddSeries", new {path});
}

View File

@ -1,4 +1,4 @@
@model IEnumerable<String>
@model List<RootDir>
@using NzbDrone.Core.Repository
<script type="text/javascript" src="../../Scripts/2011.1.315/telerik.window.min.js"></script>
@ -51,11 +51,12 @@
</div>
<div id="root-dirs">
@foreach (var root in ViewData["RootDirs"] as List<RootDir>)
@foreach (var root in Model)
{
Html.RenderAction("GetRootDirView", root);
}
</div>
<button onclick="reloadExistingSeries()" style="padding: 2px 10px 2px 10px; margin: 5px; margin-bottom: 10px;">Refresh Unmapped</button>
</div>
</text>);
}).Render();
@ -69,15 +70,9 @@
</div>
@if (Model.Count() == 0)
{
@Html.DisplayText("No Series to Add");
}
@foreach (var path in Model)
{
Html.RenderAction("RenderPartial", "AddSeries", new {path});
}
<div id="existingSeries">
@{ Html.RenderAction("AddExisting", "AddSeries"); }
</div>
}
<script type="text/javascript">
@ -171,4 +166,8 @@
}
});
}
function reloadExistingSeries() {
$('#existingSeries').load('@Url.Action("AddExisting", "AddSeries")');
}
</script>

View File

@ -9,7 +9,7 @@
@Html.TextBoxFor(m => m.Path, new { @class = "root_dir_text", id = "path_" + Model.Id })
<a href="#" class="deleteRow" onclick="deleteRootDir('@ViewData["RootDirId"]')">
<img src="../../Content/Images/X.png" alt="Delete" width="20px" height="20px" style="vertical-align: middle; margin-top: 7px;"/></a>
<input type="button" value="Save" style="padding: 2px 10px 2px 10px; vertical-align: middle; margin: 0px; margin-top: 7px;" onclick="saveRootDir(@Model.Id)"/>
<button style="padding: 2px 10px 2px 10px; vertical-align: middle; margin: 0px; margin-top: 7px;" onclick="saveRootDir(@Model.Id)">Save</button>
@Html.HiddenFor(x => x.Id, new { id = "id_" + Model.Id })
</fieldset>

View File

@ -2,7 +2,7 @@
@{Html.Telerik().Menu().Name("telerikGrid").Items(items =>
{
items.Add().Text("Add Series").Action<AddSeriesController>(c => c.Add());
items.Add().Text("Add Series").Action<AddSeriesController>(c => c.Index());
items.Add().Text("Start RSS Sync").Action<SeriesController>(c => c.RssSync());
items.Add().Text("Rename All").Action<SeriesController>(c => c.RenameAll());
}).Render();}