Commit 3b8b5180b6efeb06cf4ca2391c640256d403d9b4
1 parent
8d4c86ea
Exists in
refactor_software_communities
software-communities: refactoring namespaces
- Controllers Signed-off-by: Luciano Prestes Cavalcanti <lucianopcbr@gmail.com>
Showing
3 changed files
with
17 additions
and
17 deletions
Show diff stats
src/noosfero-spb/software_communities/controllers/software_communities_plugin_controller.rb
... | ... | @@ -5,8 +5,8 @@ class SoftwareCommunitiesPluginController < ApplicationController |
5 | 5 | def get_license_data |
6 | 6 | return render :json=>{} if !request.xhr? || params[:query].nil? |
7 | 7 | |
8 | - data = LicenseHelper.find_licenses(params[:query]) if params[:query] | |
9 | - data ||= LicenseInfo.all | |
8 | + data = SoftwareCommunitiesPlugin::LicenseHelper.find_licenses(params[:query]) if params[:query] | |
9 | + data ||= SoftwareCommunitiesPlugin::LicenseInfo.all | |
10 | 10 | |
11 | 11 | render :json=> data.collect { |license| |
12 | 12 | {:id=>license.id, :label=>license.version} |
... | ... | @@ -42,7 +42,7 @@ class SoftwareCommunitiesPluginController < ApplicationController |
42 | 42 | protected |
43 | 43 | |
44 | 44 | def get_model_by_params_field |
45 | - return DatabaseDescription unless params[:field] == "software_language" | |
46 | - return ProgrammingLanguage | |
45 | + return SoftwareCommunitiesPlugin::DatabaseDescription unless params[:field] == "software_language" | |
46 | + return SoftwareCommunitiesPlugin::ProgrammingLanguage | |
47 | 47 | end |
48 | 48 | end | ... | ... |
src/noosfero-spb/software_communities/controllers/software_communities_plugin_myprofile_controller.rb
... | ... | @@ -10,10 +10,10 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
10 | 10 | @community = Community.new(params[:community]) |
11 | 11 | @community.environment = environment |
12 | 12 | |
13 | - @license_info = LicenseInfo.find_by_id(params[:license][:license_infos_id]) if params[:license] | |
14 | - @license_info ||= LicenseInfo.new | |
13 | + @license_info = SoftwareCommunitiesPlugin::LicenseInfo.find_by_id(params[:license][:license_infos_id]) if params[:license] | |
14 | + @license_info ||= SoftwareCommunitiesPlugin::LicenseInfo.new | |
15 | 15 | |
16 | - @software_info = SoftwareInfo.new(params[:software_info]) | |
16 | + @software_info = SoftwareCommunitiesPlugin::SoftwareInfo.new(params[:software_info]) | |
17 | 17 | @software_info.community = @community |
18 | 18 | @software_info.license_info = @license_info |
19 | 19 | |
... | ... | @@ -90,7 +90,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
90 | 90 | def create_software |
91 | 91 | @software_info = @profile.software_info |
92 | 92 | params[:software][:public_software] ||= false unless @software_info.public_software? |
93 | - @license = LicenseInfo.find(params[:license][:license_infos_id]) | |
93 | + @license = SoftwareCommunitiesPlugin::LicenseInfo.find(params[:license][:license_infos_id]) | |
94 | 94 | @software_info.license_info = @license |
95 | 95 | @software_info.update_attributes(params[:software]) |
96 | 96 | |
... | ... | @@ -109,10 +109,10 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
109 | 109 | end |
110 | 110 | |
111 | 111 | def create_list_model_helpers |
112 | - @list_libraries = LibraryHelper.list_library(params[:library]) | |
113 | - @list_languages = SoftwareLanguageHelper.list_language(params[:language]) | |
114 | - @list_databases = DatabaseHelper.list_database(params[:database]) | |
115 | - @list_operating_systems = OperatingSystemHelper.list_operating_system(params[:operating_system]) | |
112 | + @list_libraries = SoftwareCommunitiesPlugin::LibraryHelper.list_library(params[:library]) | |
113 | + @list_languages = SoftwareCommunitiesPlugin::SoftwareLanguageHelper.list_language(params[:language]) | |
114 | + @list_databases = SoftwareCommunitiesPlugin::DatabaseHelper.list_database(params[:database]) | |
115 | + @list_operating_systems = SoftwareCommunitiesPlugin::OperatingSystemHelper.list_operating_system(params[:operating_system]) | |
116 | 116 | end |
117 | 117 | |
118 | 118 | def send_software_to_moderation |
... | ... | @@ -122,7 +122,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
122 | 122 | another_license_version = params[:license][:version] |
123 | 123 | another_license_link = params[:license][:link] |
124 | 124 | end |
125 | - @software_info = SoftwareInfo.create_after_moderation(user, | |
125 | + @software_info = SoftwareCommunitiesPlugin::SoftwareInfo.create_after_moderation(user, | |
126 | 126 | params[:software_info].merge({ |
127 | 127 | :environment => environment, |
128 | 128 | :name => params[:community][:name], |
... | ... | @@ -158,7 +158,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
158 | 158 | @another_license_version = "" |
159 | 159 | @another_license_link = "" |
160 | 160 | |
161 | - license_another = LicenseInfo.find_by_version("Another") | |
161 | + license_another = SoftwareCommunitiesPlugin::LicenseInfo.find_by_version("Another") | |
162 | 162 | if license_another && @software_info.license_info_id == license_another.id |
163 | 163 | @license_version = "Another" |
164 | 164 | @another_license_version = @software_info.license_info.version |
... | ... | @@ -167,7 +167,7 @@ class SoftwareCommunitiesPluginMyprofileController < MyProfileController |
167 | 167 | end |
168 | 168 | |
169 | 169 | def set_software_as_template |
170 | - software_template = SoftwareHelper.software_template | |
170 | + software_template = SoftwareCommunitiesPlugin::SoftwareHelper.software_template | |
171 | 171 | software_valid = !software_template.blank? && !params['community'].blank? |
172 | 172 | if software_valid |
173 | 173 | params['community']['template_id'] = software_template.id if software_valid | ... | ... |
src/noosfero-spb/software_communities/controllers/software_communities_plugin_profile_controller.rb
... | ... | @@ -9,11 +9,11 @@ class SoftwareCommunitiesPluginProfileController < ProfileController |
9 | 9 | } |
10 | 10 | |
11 | 11 | def download_file |
12 | - download_block = DownloadBlock.find_by_id params[:block] | |
12 | + download_block = SoftwareCommunitiesPlugin::DownloadBlock.find_by_id params[:block] | |
13 | 13 | index = params[:download_index].to_i |
14 | 14 | |
15 | 15 | if download_block and (index < download_block.downloads.size) |
16 | - download = Download.new(download_block.downloads[index]) | |
16 | + download = SoftwareCommunitiesPlugin::Download.new(download_block.downloads[index]) | |
17 | 17 | |
18 | 18 | download.total_downloads += 1 |
19 | 19 | download_block.downloads[index] = download.to_hash | ... | ... |