RELATION_LIMIT = 5
def show_pane_list
- panes = %w(Files Upload Provenance_graph Used_by Advanced)
+ panes = %w(Files Upload Tags Provenance_graph Used_by Advanced)
panes = panes - %w(Upload) unless (@object.editable? rescue false)
panes
end
end
arv_coll = Arv::Collection.new(@object.manifest_text)
- arv_coll.rename "./"+file_path, new_file_path
- if @object.update_attributes manifest_text: arv_coll.manifest_text
- show
- else
+ if arv_coll.exist?(new_file_path)
+ @errors = 'Duplicate file path. Please use a different name.'
self.render_error status: 422
+ else
+ arv_coll.rename "./"+file_path, new_file_path
+
+ if @object.update_attributes manifest_text: arv_coll.manifest_text
+ show
+ else
+ self.render_error status: 422
+ end
end
else
# Not a file rename; use default
end
end
+ def tags
+ render
+ end
+
+ def save_tags
+ if params['tag_data']
+ props = @object.properties
+ props[:tags] = params['tag_data']
+
+ if @object.update_attributes properties: props
+ else
+ self.render_error status: 422
+ end
+ end
+ end
+
protected
def find_usable_token(token_list)