Skip to content

Commit

Permalink
Attachments must be hash in redmine 1.x
Browse files Browse the repository at this point in the history
  • Loading branch information
kawasima committed Sep 4, 2012
1 parent e8c5580 commit 770c9f2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions app/helpers/impasse_screenshots_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ def create_thumbnail(attachments)
end

def thumbnail_file(attachment)
thumbnail_file = File.join(File.dirname(attachment.diskfile), "impasse_thumbnail",
File.basename(attachment.diskfile, ".*") + "_s" + File.extname(attachment.diskfile))
thumbnail_dir = File.join(File.dirname(attachment.diskfile), "impasse_thumbnail")
Dir.mkdir thumbnail_dir unless File.exist? thumbnail_dir
thumbnail_file = File.join(thumbnail_dir,
File.basename(attachment.diskfile, ".*") + "_s" + File.extname(attachment.diskfile))
end
end
6 changes: 3 additions & 3 deletions assets/javascripts/test_case_tree.js
Original file line number Diff line number Diff line change
Expand Up @@ -209,11 +209,11 @@ jQuery(document).ready(function ($) {
tc["node[id]"] = node.attr("id").replace("node_","");
tc["node_type"] = node_type;
tc["node[parent_id]"] = $(data.rslt.parent).attr("id").replace("node_", "");
tc["node[node_order"] = data.rslt.obj.parent().children().index(data.rslt.obj);
tc["node[node_order]"] = data.rslt.obj.parent().children().index(data.rslt.obj);
if (window.FormData) {
var formData = new FormData();
$(".new-screenshot", dialog[node_type]).each(function() {
formData.append("attachments[][file]", dataURLtoBlob(this.src) ,'screenshot.png');
$(".new-screenshot", dialog[node_type]).each(function(i) {
formData.append("attachments["+i+"][file]", dataURLtoBlob(this.src) ,'screenshot.png');
});
for (var key in tc) { formData.append(key, tc[key]) }

Expand Down

0 comments on commit 770c9f2

Please sign in to comment.