Skip to content

Commit

Permalink
Merge pull request #1 from lokenx/master
Browse files Browse the repository at this point in the history
Merge with 1.7.1
  • Loading branch information
RickyGrassmuck committed Feb 27, 2016
2 parents 7d4ea07 + abfc32b commit e9b428b
Show file tree
Hide file tree
Showing 5 changed files with 55 additions and 3 deletions.
10 changes: 9 additions & 1 deletion client/templates/requests/requests.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ <h1>Requests</h1>
{{#unless approved}}<p><button class="btn btn-sm btn-success-outline approve-item">Approve</button></p>{{/unless}}
<p><button class="btn btn-sm btn-danger-outline delete-item">Delete</button></p>
<p><button class="btn btn-sm btn-info-outline clear-issues">Clear Issues</button></p>
{{/if}}

{{#if searchType 'Movies'}}
{{#if available}}
<p><button class="btn btn-sm btn-secondary-outline mark-unavailable">Mark Unavailable</button></p>
{{else}}
<p><button class="btn btn-sm btn-success-outline mark-available">Mark Available</button></p>
{{/if}}
{{/if}}
{{/if}}
<p>
<div class="btn-group">
<button type="button" class="btn btn-sm btn-warning-outline dropdown-toggle report-item" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
Expand Down
30 changes: 30 additions & 0 deletions client/templates/requests/requests.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ Template.requests.helpers({
}
return approval;
},
'available': function () {
if (this.imdb) {
return (this.downloaded) ? true : false;
}
else {
return;
}
},
'requesting_user' : function () {
if (Meteor.user()) {
return "<li><strong>User:</strong> " + this.user + "</li>";
Expand Down Expand Up @@ -247,6 +255,28 @@ Template.requests.events({
},
'click .go-to-top': function () {
$('body').animate({ scrollTop: 0 }, "slow")
},
'click .mark-available': function (event, template) {
var movie = this;
Meteor.call('markAvailability', movie, true, function(error, res) {

if (error) {
console.error(error);
Bert.alert("Error marking as available, please try again!", "danger");
}
Bert.alert(movie.title + " marked as available!", "success");
})
},
'click .mark-unavailable': function (event, template) {
var movie = this;
Meteor.call('markAvailability', movie, false, function(error, res) {

if (error) {
console.error(error);
Bert.alert("Error marking as unavailable, please try again!", "danger");
}
Bert.alert(movie.title + " marked as unavailable!", "success");
})
}
});

Expand Down
2 changes: 1 addition & 1 deletion server/methods/admin/version.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Meteor.methods({
return "master";
},
getVersion: function () {
return "1.7.0";
return "1.7.1";
},
checkForUpdate : function () {
var branch = Meteor.call('getBranch');
Expand Down
14 changes: 14 additions & 0 deletions server/methods/requests/markAvailability.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
Meteor.methods({
"markAvailability": function(movie, status) {
check(movie, Object);
check(status, Boolean);

Movies.update(movie._id, {$set: { downloaded: status}}, function (err, res) {

if (err) {
throw err;
}
return res;
});
}
});
2 changes: 1 addition & 1 deletion version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.7.0
1.7.1

0 comments on commit e9b428b

Please sign in to comment.