Skip to content

Commit

Permalink
warn for existing responses
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Jan 4, 2016
1 parent 5e3a8eb commit 02465e3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion js/app.js
Expand Up @@ -59,7 +59,13 @@ $.getJSON("logic.json", function(logic){
if(!permissions.is_admin && ($.inArray("author", roles) < 0) && ($.inArray("supervisor", roles) < 0)){
alert("You are not admin or author of this campaign. You won't be able to submit changes.");
} else {
$("#update_campaign_button").removeClass("hide");
oh.survey.count(urn).done(function(counts){
if(Object.keys(counts).length){
alert("This campaign has existing responses. You won't be able to submit changes.");
} else {
$("#update_campaign_button").removeClass("hide");
}
});
}
});
});
Expand Down

0 comments on commit 02465e3

Please sign in to comment.