Skip to content

Commit

Permalink
Sorted out some of the UI for #18
Browse files Browse the repository at this point in the history
  • Loading branch information
tidusjar committed Aug 30, 2016
1 parent 0ac114d commit 2f415cc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 6 additions & 1 deletion PlexRequests.UI/Content/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,7 @@ $(document).on("click", ".approve", function (e) {

approveRequest($form, null, function () {
$("#" + $self.attr('id') + "notapproved").prop("class", "fa fa-check");


var $group = $self.parent('.btn-split');
if ($group.length > 0) {
Expand All @@ -448,7 +449,11 @@ $(document).on("click", ".deny", function (e) {
loadingButton($self.attr('id')+"deny", "success");

denyRequest($form, function () {
//$("#" + $self.attr('id') + "notapproved").prop("class", "fa fa-check");
// Remove the form
$("#" + "deny" + $self.attr('id')).remove();
// remove the approve button
var id = $self.attr("custom-button");
$("#" + id).remove();

var $group = $self.parent('.btn-split');
if ($group.length > 0) {
Expand Down
7 changes: 4 additions & 3 deletions PlexRequests.UI/Views/Requests/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
</div>
<div class="col-sm-3 col-sm-push-3">
{{#if_eq admin true}}
{{#unless denied}}

{{#if_eq approved false}}
<form method="POST" action="@formAction/approval/approve" id="approve{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
Expand All @@ -248,12 +248,13 @@
<button id="{{requestId}}" custom-button="{{requestId}}" style="text-align: right" class="btn btn-sm btn-success-outline approve" type="submit"><i class="fa fa-plus"></i> @UI.Common_Approve</button>
{{/if_eq}}
</form>
{{#unless denied}}
<form method="POST" action="@formAction/approval/deny" id="deny{{requestId}}">
<input name="requestId" type="text" value="{{requestId}}" hidden="hidden" />
<input name="reason" type="text" hidden="hidden" />
<div class="btn-group btn-split">
<button type="button" class="btn btn-sm btn-danger-outline deny" id="{{requestId}}deny" custom-button="{{requestId}}"><i class="fa fa-times"></i> Deny</button>
<button type="button" class="btn btn-danger-outline dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<button type="button" class="btn btn-danger-outline dropdown-toggle" id="{{requestId}}denyToggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
<span class="caret"></span>
<span class="sr-only">@UI.Requests_ToggleDropdown</span>
</button>
Expand All @@ -262,8 +263,8 @@
</ul>
</div>
</form>
{{/if_eq}}
{{/unless}}
{{/if_eq}}
<form method="POST" action="@formAction/requests/delete" id="delete{{requestId}}">
<input name="Id" type="text" value="{{requestId}}" hidden="hidden" />
<button id="{{requestId}}" style="text-align: right" class="btn btn-sm btn-danger-outline delete" type="submit"><i class="fa fa-minus"></i> @UI.Common_Remove</button>
Expand Down

0 comments on commit 2f415cc

Please sign in to comment.