diff --git a/controllers/software_communities_plugin_controller.rb b/controllers/software_communities_plugin_controller.rb index e3a3902..d3bb2c5 100644 --- a/controllers/software_communities_plugin_controller.rb +++ b/controllers/software_communities_plugin_controller.rb @@ -16,61 +16,6 @@ class SoftwareCommunitiesPluginController < ApplicationController end - def download_file - download_block = Block.find(params[:block_id]) - - file_link = DownloadFileHelper.get_file_link(download_block, params[:link_index].to_i) - file = DownloadFileHelper.get_file(file_link) - - owner = download_block.owner - download_software = owner.software_info - download_software.download_counter += 1 - - if not file.nil? - file_body = send_file file.full_filename - - self.response.body = Enumerator::new do |enum| - file_body.each {|file_data| enum << file_data} - - # Only save when the download is finished - download_software.save! - end - else - download_software.save! - - # If it is not in noosfero(like a external link), - # just send the user to this location - redirect_to file_link - end - end - - def hide_registration_incomplete_percentage - response = false - - if request.xhr? && params[:hide] - session[:hide_incomplete_percentage] = true - response = session[:hide_incomplete_percentage] - end - - render :json=>response.to_json - end - - def create_institution - @show_sisp_field = environment.admins.include?(current_user.person) - @state_list = get_state_list() ->>>>>>> e8d6ff3... Retrive version logic. - - data = if params[:query].empty? - LicenseInfo.all - else - LicenseInfo.where("version ILIKE ?", "%#{params[:query]}%").select("id, version") - end - - render :json=> data.collect { |license| - {:id=>license.id, :label=>license.version} - } - end - def get_block_template render 'box_organizer/_download_list_template', :layout => false end -- libgit2 0.21.2