update_count();
}
- var combine_selected_files_into_collection = function () {
-
- }
-
var update_count = function(e) {
var lst = get_selection_list();
$("#persistent-selection-count").text(lst.length);
-
if (lst.length > 0) {
$('#selection-form-content').html('<li><input type="submit" name="combine_selected_files_into_collection" id="combine_selected_files_into_collection" value="Combine selected collections and files into a new collection"/></li>'
+ '<li><a href="#" id="clear_selections_button">Clear selections</a></li>'
+ '<li class="notification"><table style="width: 100%"></table></li>');
+
for (var i = 0; i < lst.length; i++) {
$('#selection-form-content > li > table').append("<tr>"
+ "<td>"
+ "</tr>");
}
} else {
- $('#persistent-selection-list').html("<li class='notification empty'>No selections.</li>");
+ $('#selection-form-content').html("<li class='notification empty'>No selections.</li>");
}
var checkboxes = $('.persistent-selection:checkbox');
$('.remove-selection').on('click', remove_selection_click);
$('#clear_selections_button').on('click', clear_selections);
- $('#combine_selected_files_into_collection').on('click', combine_selected_files_into_collection);
};
$(document).
newc = Collection.new({:uuid => newuuid, :manifest_text => normalized})
newc.save!
+ chash.each do |k,v|
+ l = Link.new({
+ tail_kind: "arvados#Collection",
+ tail_uuid: k,
+ head_kind: "arvados#Collection",
+ head_uuid: newuuid,
+ link_class: "provenance",
+ name: "provided"
+ })
+ l.save!
+ end
+
'/collections/' + newc.uuid
end
def self.collection_uuid(uuid)
m = CollectionsHelper.match(uuid)
if m
- #if m[2]
- return m[1]
- #else
+ if m[2]
+ return m[1]+m[2]
+ else
+ return m[1]
+ end
# Collection.where(uuid: ['contains', m[1]]).each do |u|
# puts "fixup #{uuid} to #{u.uuid}"
# return u.uuid