small changes

pull/332/head
tidusjar 9 years ago
parent 3e16d8acf0
commit eb6d8af92e

@ -0,0 +1,51 @@
#region Copyright
// /************************************************************************
// Copyright (c) 2016 Jamie Rees
// File: IssuesDetailsViewModel.cs
// Created By: Jamie Rees
//
// Permission is hereby granted, free of charge, to any person obtaining
// a copy of this software and associated documentation files (the
// "Software"), to deal in the Software without restriction, including
// without limitation the rights to use, copy, modify, merge, publish,
// distribute, sublicense, and/or sell copies of the Software, and to
// permit persons to whom the Software is furnished to do so, subject to
// the following conditions:
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
// ************************************************************************/
#endregion
using System.Collections.Generic;
using PlexRequests.Core.Models;
using PlexRequests.Store;
namespace PlexRequests.UI.Models
{
public class IssuesDetailsViewModel
{
public IssuesDetailsViewModel()
{
Issues = new List<IssueModel>();
}
public int Id { get; set; }
public string Title { get; set; }
public string PosterUrl { get; set; }
public int RequestId { get; set; }
public List<IssueModel> Issues { get; set; }
public bool Deleted { get; set; }
public RequestType Type { get; set; }
public IssueStatus IssueStatus { get; set; }
public int ProviderId { get; set; }
}
}

@ -135,10 +135,23 @@ namespace PlexRequests.UI.Modules
public async Task<Negotiator> Details(int id)
{
var issue = await IssuesService.GetAsync(id);
if (issue == null)
return Index();
issue = Order(issue);
return issue == null
? Index()
: View["Details", issue];
var m = new IssuesDetailsViewModel
{
Issues = issue.Issues,
RequestId = issue.RequestId,
Title = issue.Title,
IssueStatus = issue.IssueStatus,
Deleted = issue.Deleted,
Type = issue.Type,
ProviderId = issue.ProviderId,
PosterUrl = issue.PosterUrl,
Id = issue.Id
};
return View["Details", m];
}
private async Task<Response> ReportRequestIssue(int requestId, IssueState issue, string comment)

@ -177,6 +177,7 @@
<Compile Include="ModelDataProviders\UserUpdateViewModelDataProvider.cs" />
<Compile Include="ModelDataProviders\RequestedModelDataProvider.cs" />
<Compile Include="Models\DatatablesModel.cs" />
<Compile Include="Models\IssuesDetailsViewModel.cs" />
<Compile Include="Models\IssuesViewMOdel.cs" />
<Compile Include="Models\JsonUpdateAvailableModel.cs" />
<Compile Include="Models\LandingPageViewModel.cs" />

@ -15,5 +15,6 @@
@Html.GetSidebarUrl(Context, "/admin/slacknotification", "Slack Notifications")
@Html.GetSidebarUrl(Context, "/admin/logs", "Logs")
@Html.GetSidebarUrl(Context, "/admin/status", "Status")
@Html.GetSidebarUrl(Context, "/admin/scheduledjobs", "Scheduled Jobs")
</div>
</div>

@ -1,7 +1,6 @@
@using System.Linq
@using PlexRequests.Core.Models
@using PlexRequests.UI.Helpers
@inherits Nancy.ViewEngines.Razor.NancyRazorViewBase<IssuesModel>
@{
var baseUrl = Html.GetBaseUrl();
var formAction = string.Empty;
@ -24,15 +23,15 @@
<h1>Details</h1>
<div class="row">
<div class="col-md-2">
<div class="col-md-3">
<img src="@Model.PosterUrl" />
</div>
<div class="col-md-10">
<div class="col-md-9">
<h4>Issues For "@Model.Title"</h4>
</div>
@if (isAdmin)
{
<div class="col-md-2">
<div class="col-md-1">
@if (Model.IssueStatus == IssueStatus.PendingIssue)
{

Loading…
Cancel
Save