Commit a8563d11e2372a5f8230b2a74431cf7029e07c08
Committed by
Fabio Teixeira
1 parent
2ec7dec9
Exists in
master
and in
5 other branches
Clean registration software view.
- Create finality field - Create new view with old software registration struct - Save software only with name and finality field.
Showing
5 changed files
with
372 additions
and
304 deletions
Show diff stats
controllers/mpog_software_plugin_myprofile_controller.rb
| ... | ... | @@ -14,85 +14,85 @@ class MpogSoftwarePluginMyprofileController < MyProfileController |
| 14 | 14 | @community = Community.new(params[:community]) |
| 15 | 15 | @community.environment = environment |
| 16 | 16 | @software_info = SoftwareInfo.new(params[:software_info]) |
| 17 | - @list_libraries = LibraryHelper.list_libraries(params[:library]) | |
| 18 | - @list_languages = SoftwareLanguageHelper.list_language(params[:language]) | |
| 19 | - @list_databases = DatabaseHelper.list_database(params[:database]) | |
| 20 | - @software_categories = SoftwareCategories::new params[:software_categories] | |
| 21 | - @list_operating_systems = OperatingSystemHelper.list_operating_system(params[:operating_system]) | |
| 22 | - @license_info = if params[:license_info].nil? | |
| 23 | - LicenseInfo::new | |
| 24 | - else | |
| 25 | - LicenseInfo.find(:first, :conditions =>["version = ?","#{params[:license_info][:version]}"]) | |
| 26 | - end | |
| 17 | + #@list_libraries = LibraryHelper.list_libraries(params[:library]) | |
| 18 | + #@list_languages = SoftwareLanguageHelper.list_language(params[:language]) | |
| 19 | + #@list_databases = DatabaseHelper.list_database(params[:database]) | |
| 20 | + #@software_categories = SoftwareCategories::new params[:software_categories] | |
| 21 | + #@list_operating_systems = OperatingSystemHelper.list_operating_system(params[:operating_system]) | |
| 22 | + #@license_info = if params[:license_info].nil? | |
| 23 | + # LicenseInfo::new | |
| 24 | + #else | |
| 25 | + # LicenseInfo.find(:first, :conditions =>["version = ?","#{params[:license_info][:version]}"]) | |
| 26 | + #end | |
| 27 | 27 | |
| 28 | - if not @list_libraries.nil? | |
| 29 | - @list_libraries.each do |library| | |
| 30 | - @software_info.libraries << library | |
| 31 | - end | |
| 32 | - end | |
| 28 | + #if not @list_libraries.nil? | |
| 29 | + # @list_libraries.each do |library| | |
| 30 | + # @software_info.libraries << library | |
| 31 | + # end | |
| 32 | + #end | |
| 33 | 33 | |
| 34 | - if not @list_languages.nil? | |
| 35 | - @list_languages.each do |language| | |
| 36 | - @software_info.software_languages << language | |
| 37 | - end | |
| 38 | - end | |
| 34 | + #if not @list_languages.nil? | |
| 35 | + # @list_languages.each do |language| | |
| 36 | + # @software_info.software_languages << language | |
| 37 | + # end | |
| 38 | + #end | |
| 39 | 39 | |
| 40 | - if not @list_databases.nil? | |
| 41 | - @list_databases.each do |database| | |
| 42 | - @software_info.software_databases << database | |
| 43 | - end | |
| 44 | - end | |
| 40 | + #if not @list_databases.nil? | |
| 41 | + # @list_databases.each do |database| | |
| 42 | + # @software_info.software_databases << database | |
| 43 | + # end | |
| 44 | + #end | |
| 45 | 45 | |
| 46 | - if not @list_operating_systems.nil? | |
| 47 | - @list_operating_systems.each do |operating_system| | |
| 48 | - @software_info.operating_systems << operating_system | |
| 49 | - end | |
| 50 | - end | |
| 46 | + #if not @list_operating_systems.nil? | |
| 47 | + # @list_operating_systems.each do |operating_system| | |
| 48 | + # @software_info.operating_systems << operating_system | |
| 49 | + # end | |
| 50 | + #end | |
| 51 | 51 | |
| 52 | - valid_community = request.post? && @community.valid? | |
| 53 | - valid_software_info = request.post? && @software_info.valid? | |
| 54 | - valid_license = (request.post? && @license_info.valid?) | |
| 55 | - valid_libraries = @list_libraries.empty? || LibraryHelper.valid_list_libraries?(@list_libraries) | |
| 56 | - valid_database = DatabaseHelper.valid_list_database?(@list_databases) | |
| 57 | - valid_language = SoftwareLanguageHelper.valid_list_language?(@list_languages) | |
| 58 | - valid_operating_system = OperatingSystemHelper.valid_list_operating_system?(@list_operating_systems) | |
| 59 | - valid_software_categories = request.post? && @software_categories.valid? | |
| 52 | + valid_community = request.post? && @community.valid? | |
| 53 | + valid_software_info = request.post? && @software_info.valid? | |
| 54 | + #valid_license = (request.post? && @license_info.valid?) | |
| 55 | + #valid_libraries = @list_libraries.empty? || LibraryHelper.valid_list_libraries?(@list_libraries) | |
| 56 | + #valid_database = DatabaseHelper.valid_list_database?(@list_databases) | |
| 57 | + #valid_language = SoftwareLanguageHelper.valid_list_language?(@list_languages) | |
| 58 | + #valid_operating_system = OperatingSystemHelper.valid_list_operating_system?(@list_operating_systems) | |
| 59 | + #valid_software_categories = request.post? && @software_categories.valid? | |
| 60 | 60 | |
| 61 | - if valid_software_info && valid_community && valid_libraries && valid_license && valid_language && valid_database && valid_operating_system && valid_software_categories | |
| 62 | - @community = Community.create_after_moderation(user, {:environment => environment}.merge(params[:community]), @software_info, @license_info, @software_categories) | |
| 61 | + if valid_software_info && valid_community | |
| 62 | + @community = Community.create_after_moderation(user, {:environment => environment}.merge(params[:community]), @software_info ) | |
| 63 | + redirect_to :controller => 'memberships', :action => 'index' | |
| 63 | 64 | |
| 64 | - unless params[:q].nil? | |
| 65 | - admins = params[:q].split(/,/).map{|n| environment.people.find n.to_i} | |
| 65 | + unless params[:q].nil? | |
| 66 | + admins = params[:q].split(/,/).map{|n| environment.people.find n.to_i} | |
| 66 | 67 | |
| 67 | - admins.each do |admin| | |
| 68 | - @community.add_member(admin) | |
| 69 | - @community.add_admin(admin) | |
| 70 | - end | |
| 71 | - end | |
| 68 | + admins.each do |admin| | |
| 69 | + @community.add_member(admin) | |
| 70 | + @community.add_admin(admin) | |
| 71 | + end | |
| 72 | + end | |
| 72 | 73 | |
| 73 | - redirect_to :controller => 'memberships', :action => 'index' | |
| 74 | - else | |
| 75 | - @list_libraries.each do |lib| | |
| 76 | - @errors |= lib.errors.full_messages | |
| 77 | - end | |
| 78 | - | |
| 79 | - @list_languages.each do |lng| | |
| 80 | - @errors |= lng.errors.full_messages | |
| 81 | - end | |
| 82 | - | |
| 83 | - @list_databases.each do |db| | |
| 84 | - @errors |= db.errors.full_messages | |
| 85 | - end | |
| 74 | + else | |
| 75 | + # @list_libraries.each do |lib| | |
| 76 | + # @errors |= lib.errors.full_messages | |
| 77 | + # end | |
| 78 | + # | |
| 79 | + # @list_languages.each do |lng| | |
| 80 | + # @errors |= lng.errors.full_messages | |
| 81 | + # end | |
| 82 | + # | |
| 83 | + # @list_databases.each do |db| | |
| 84 | + # @errors |= db.errors.full_messages | |
| 85 | + # end | |
| 86 | 86 | |
| 87 | - @list_operating_systems.each do |os| | |
| 88 | - @errors |= os.errors.full_messages | |
| 89 | - end | |
| 87 | + # @list_operating_systems.each do |os| | |
| 88 | + # @errors |= os.errors.full_messages | |
| 89 | + # end | |
| 90 | 90 | |
| 91 | - @errors |= @community.errors.full_messages | |
| 92 | - @errors |= @software_info.errors.full_messages | |
| 93 | - @errors |= @license_info.errors.full_messages | |
| 94 | - @errors |= @software_categories.errors.full_messages | |
| 95 | - end | |
| 91 | + @errors |= @community.errors.full_messages | |
| 92 | + @errors |= @software_info.errors.full_messages | |
| 93 | + # @errors |= @license_info.errors.full_messages | |
| 94 | + # @errors |= @software_categories.errors.full_messages | |
| 95 | + #end | |
| 96 | 96 | end |
| 97 | 97 | |
| 98 | 98 | def search_offerers |
| ... | ... | @@ -101,3 +101,4 @@ class MpogSoftwarePluginMyprofileController < MyProfileController |
| 101 | 101 | render :text => prepare_to_token_input(result).to_json |
| 102 | 102 | end |
| 103 | 103 | end |
| 104 | +end | ... | ... |
db/migrate/20141007140419_add_finality_field_to_software_table.rb
0 → 100644
lib/software_info.rb
| 1 | 1 | class SoftwareInfo < ActiveRecord::Base |
| 2 | - attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform, :demonstration_url, :acronym, :objectives, :features, :license_infos_id, :community_id | |
| 3 | - | |
| 4 | - has_many :libraries, :dependent => :destroy | |
| 5 | - has_many :software_databases | |
| 6 | - has_many :database_descriptions, :through => :software_databases | |
| 7 | - has_many :software_languages | |
| 8 | - has_many :operating_systems | |
| 9 | - has_many :programming_languages, :through => :software_languages | |
| 10 | - has_many :operating_system_names, :through => :operating_systems | |
| 11 | - | |
| 12 | - belongs_to :community | |
| 13 | - belongs_to :license_info | |
| 14 | - | |
| 15 | - has_one :software_categories | |
| 16 | - | |
| 17 | - validates :features, :objectives, | |
| 18 | - :presence=>true, | |
| 19 | - :length => { | |
| 20 | - :maximum => 4000, | |
| 21 | - :too_long => _("Software features is too long (maximum is 4000 characters)") | |
| 22 | - } | |
| 23 | - | |
| 24 | - validate :validate_operating_platform, :validate_acronym, :valid_software_info, :valid_databases, :valid_operating_systems | |
| 2 | + # attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform, :demonstration_url, :acronym, :objectives, :features, :license_infos_id, :community_id, :finality | |
| 3 | + attr_accessible :finality | |
| 4 | + | |
| 5 | + #has_many :libraries, :dependent => :destroy | |
| 6 | + #has_many :software_databases | |
| 7 | + #has_many :database_descriptions, :through => :software_databases | |
| 8 | + #has_many :software_languages | |
| 9 | + #has_many :operating_systems | |
| 10 | + #has_many :programming_languages, :through => :software_languages | |
| 11 | + #has_many :operating_system_names, :through => :operating_systems | |
| 12 | + | |
| 13 | + belongs_to :community | |
| 14 | + #belongs_to :license_info | |
| 15 | + | |
| 16 | + #has_one :software_categories | |
| 17 | + | |
| 18 | + #validates :features, :objectives, | |
| 19 | + # :presence=>true, | |
| 20 | + # :length => { | |
| 21 | + # :maximum => 4000, | |
| 22 | + # :too_long => _("Software features is too long (maximum is 4000 characters)") | |
| 23 | + # } | |
| 24 | + | |
| 25 | + #validate :validate_operating_platform, :validate_acronym, :valid_software_info, :valid_databases, :valid_operating_systems | |
| 26 | + | |
| 27 | + #validate :finality, :presence => {:message => "Finality cannot be blank"} | |
| 28 | + validate :validate_finality | |
| 29 | + | |
| 25 | 30 | |
| 26 | 31 | # used on find_by_contents |
| 27 | 32 | scope :like_search, lambda{ |name| |
| ... | ... | @@ -115,6 +120,11 @@ class SoftwareInfo < ActiveRecord::Base |
| 115 | 120 | end |
| 116 | 121 | end |
| 117 | 122 | |
| 123 | + def validate_finality | |
| 124 | + self.errors.add(:finality, _("can't be blank")) if self.finality.blank? && self.errors.messages[:finality].nil? | |
| 125 | + end | |
| 126 | + | |
| 127 | + | |
| 118 | 128 | def valid_operating_systems |
| 119 | 129 | self.errors.add(:operating_system, _(": at least one must be filled")) if self.operating_systems.empty? |
| 120 | 130 | end | ... | ... |
views/mpog_software_plugin_myprofile/new_software.html.erb
| ... | ... | @@ -28,222 +28,11 @@ |
| 28 | 28 | |
| 29 | 29 | <%= fields_for @software_info do |swf| %> |
| 30 | 30 | <div class="formfield type-text"> |
| 31 | - <%= swf.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | |
| 32 | - <%= swf.text_field(:acronym) %> | |
| 33 | - </div> | |
| 34 | - | |
| 35 | - <div class="formfieldline"> | |
| 36 | - <%= swf.label _("Adherent to e-PING ?") %> | |
| 37 | - | |
| 38 | - <%= swf.label "e_ping_true", "Yes" %> | |
| 39 | - <%= swf.radio_button(:e_ping,true)%> | |
| 40 | - <%= swf.label "e_ping_false", "No"%> | |
| 41 | - <%= swf.radio_button(:e_ping,false)%> | |
| 42 | - </div> | |
| 43 | - | |
| 44 | - <div class="formfieldline"> | |
| 45 | - <%= swf.label _("Adherent to e-MAG ?") %> | |
| 46 | - | |
| 47 | - <%= swf.label "e_mag_true", "Yes"%> | |
| 48 | - <%= swf.radio_button(:e_mag,true)%> | |
| 49 | - <%= swf.label "e_mag_false", "No"%> | |
| 50 | - <%= swf.radio_button(:e_mag,false)%> | |
| 51 | - </div> | |
| 52 | - | |
| 53 | - <div class="formfieldline"> | |
| 54 | - <%= swf.label _("Adherent to ICP-Brasil ?") %> | |
| 55 | - | |
| 56 | - <%= swf.label "icp_brasil_true", "Yes"%> | |
| 57 | - <%= swf.radio_button(:icp_brasil,true)%> | |
| 58 | - <%= swf.label "icp_brasil_false", "No"%> | |
| 59 | - <%= swf.radio_button(:icp_brasil,false)%> | |
| 60 | - </div> | |
| 61 | - | |
| 62 | - <div class="formfieldline"> | |
| 63 | - <%= swf.label _("Adherent to e-ARQ ?") %> | |
| 64 | - | |
| 65 | - <%= swf.label "e_arq_true", "Yes"%> | |
| 66 | - <%= swf.radio_button(:e_arq,true)%> | |
| 67 | - <%= swf.label "e_arq_false", "No"%> | |
| 68 | - <%= swf.radio_button(:e_arq,false)%> | |
| 69 | - </div> | |
| 70 | - | |
| 71 | - <div class="formfieldline"> | |
| 72 | - <%= swf.label _("Internacionalizable ?") %> | |
| 73 | - | |
| 74 | - <%= swf.label "intern_true", "Yes" %> | |
| 75 | - <%= swf.radio_button(:intern,true)%> | |
| 76 | - <%= swf.label "intern_false", "No"%> | |
| 77 | - <%= swf.radio_button(:intern,false)%> | |
| 78 | - <div class="formfieldline"> | |
| 79 | - <%= swf.label "operating_platform", _("Operating Platform: ") %> <br /> | |
| 80 | - <%= swf.text_area(:operating_platform) %> | |
| 81 | - </div> | |
| 82 | - | |
| 83 | - <div class="formfieldline"> | |
| 84 | - <%= swf.label "objectives", _("Objectives: ")%><br /> | |
| 85 | - <%= required swf.text_area(:objectives) %> | |
| 86 | - </div> | |
| 87 | - | |
| 88 | - <div class="formfieldline"> | |
| 89 | - <%= swf.label "features", _("Features: ")%><br /> | |
| 90 | - <%= required swf.text_area(:features) %> | |
| 91 | - </div> | |
| 92 | - | |
| 93 | - <div class="formfieldline formfield type-text"> | |
| 94 | - <%= swf.label "demonstration_url", _("Demonstration URL: ") %> | |
| 95 | - <%= swf.text_field(:demonstration_url) %> | |
| 31 | + <%= swf.label("finality" ,_("Finality"), :class=>"formlabel") %> | |
| 32 | + <%= required swf.text_field(:finality) %> | |
| 96 | 33 | </div> |
| 97 | 34 | <% end %> |
| 98 | 35 | |
| 99 | - <div class="formfieldline"> | |
| 100 | - <%= content_tag('label', _('Fill in the search field to add offerers for this Software'), :id => "text-input-search-offerers") %> | |
| 101 | - <%= token_input_field_tag(:q, 'search-offerers', {:action => 'search_offerers'}, { :focus => true, :hint_text => _('Type in a search term for a person to be added as | |
| 102 | -offerers'), :pre_populate => @tokenized_children}) %> | |
| 103 | - </div> | |
| 104 | - | |
| 105 | - <div id='libraries_fields'> | |
| 106 | - <h4> <%= _("Libraries") %> </h4> | |
| 107 | - <%= render :partial => 'library_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :libraries => @list_libraries } %> | |
| 108 | - </div> | |
| 109 | - <br /> | |
| 110 | - | |
| 111 | - <div id='operating_system_fields'> | |
| 112 | - <h4> <%= _("Operating Systems") %> </h4> | |
| 113 | - <% if @list_operating_systems.blank? %> | |
| 114 | - <%= OperatingSystemHelper.operating_system_as_tables(nil, false).call %> | |
| 115 | - <% end %> | |
| 116 | - <%= render :partial => 'operating_system_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %> | |
| 117 | - </div> | |
| 118 | - <br /> | |
| 119 | - | |
| 120 | - <%= fields_for @license_info do |lcv| %> | |
| 121 | - <div class="formfieldline"> | |
| 122 | - <h4> <%= lcv.label _("License Version: ") %> </h4> | |
| 123 | - <%= lcv.select(:version, LicenseInfo.all.map {|l| [l.version, l.version]}, {:selected=>1}, :onchange => "get_license_link('license_info_version')") %> | |
| 124 | - | |
| 125 | - <h4> <%= _("License link") %> </h4> | |
| 126 | - <% LicenseHelper.getListLicenses.each do | license | %> | |
| 127 | - <input type="hidden" id = "version_<%=license.id %>" value = "<%=license.link%>"> | |
| 128 | - <% end %> | |
| 129 | - <a id = "version_link" href="<%= LicenseInfo.first.link %>" target="_BLANK"> <%=LicenseInfo.first.link %> </a> | |
| 130 | - | |
| 131 | - </div> | |
| 132 | - <% end %> | |
| 133 | - | |
| 134 | - <br /> | |
| 135 | - <div id='programming_languages_fields'> | |
| 136 | - <h4> <%= _("Programming languages") %> </h4> | |
| 137 | - <% if @list_languages.blank? %> | |
| 138 | - <%= SoftwareLanguageHelper.language_as_tables(nil, false).call %> | |
| 139 | - <% end %> | |
| 140 | - | |
| 141 | - <%= render :partial => 'language_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :languages => @list_languages } %> | |
| 142 | - </div> | |
| 143 | - | |
| 144 | - <br /> | |
| 145 | - <div id='database_fields'> | |
| 146 | - <h4> <%= _("Databases") %> </h4> | |
| 147 | - <% if @list_databases.blank? %> | |
| 148 | - <%= DatabaseHelper.database_as_tables(nil, true).call %> | |
| 149 | - <% end %> | |
| 150 | - | |
| 151 | - <%= render :partial => 'database_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :database => @list_databases } %> | |
| 152 | - </div> | |
| 153 | - | |
| 154 | - <%= fields_for @software_categories do |cv| %> | |
| 155 | - <div id="software_categories_fields"> | |
| 156 | - <h4> <%= _("Software Categories:") %> </h4> | |
| 157 | - | |
| 158 | - <%= cv.check_box :administration %> | |
| 159 | - <%= cv.label :administration, _("Administration") %><br /> | |
| 160 | - | |
| 161 | - <%= cv.check_box :agriculture %> | |
| 162 | - <%= cv.label :agriculture, _("Agriculture") %><br /> | |
| 163 | - | |
| 164 | - <%= cv.check_box :business_and_services %> | |
| 165 | - <%= cv.label :business_and_services, _("Business_and Services") %><br /> | |
| 166 | - | |
| 167 | - <%= cv.check_box :communication %> | |
| 168 | - <%= cv.label :communication, _("Communication") %><br /> | |
| 169 | - | |
| 170 | - <%= cv.check_box :culture %> | |
| 171 | - <%= cv.label :culture, _("Culture") %><br /> | |
| 172 | - | |
| 173 | - <%= cv.check_box :national_defense %> | |
| 174 | - <%= cv.label :national_defense, _("National Defense") %><br /> | |
| 175 | - | |
| 176 | - <%= cv.check_box :economy_and_finances %> | |
| 177 | - <%= cv.label :economy_and_finances, _("Economy and Finances") %><br /> | |
| 178 | - | |
| 179 | - <%= cv.check_box :education %> | |
| 180 | - <%= cv.label :education, _("Education") %><br /> | |
| 181 | - | |
| 182 | - <%= cv.check_box :energy %> | |
| 183 | - <%= cv.label :energy, _("Energy") %><br /> | |
| 184 | - | |
| 185 | - <%= cv.check_box :sports %> | |
| 186 | - <%= cv.label :sports, _("Sports") %><br /> | |
| 187 | - | |
| 188 | - <%= cv.check_box :habitation %> | |
| 189 | - <%= cv.label :habitation, _("Habitation") %><br /> | |
| 190 | - | |
| 191 | - <%= cv.check_box :industry %> | |
| 192 | - <%= cv.label :industry, _("Industry") %><br /> | |
| 193 | - | |
| 194 | - <%= cv.check_box :environment %> | |
| 195 | - <%= cv.label :environment, _("Environment") %><br /> | |
| 196 | - | |
| 197 | - <%= cv.check_box :research_and_development %> | |
| 198 | - <%= cv.label :research_and_development, _("Research and Development") %><br /> | |
| 199 | - | |
| 200 | - <%= cv.check_box :social_security %> | |
| 201 | - <%= cv.label :social_security, _("Social Security") %><br /> | |
| 202 | - | |
| 203 | - <%= cv.check_box :social_protection %> | |
| 204 | - <%= cv.label :social_protection, _("Social Protection") %><br /> | |
| 205 | - | |
| 206 | - <%= cv.check_box :sanitation %> | |
| 207 | - <%= cv.label :sanitation, _("Sanitation") %><br /> | |
| 208 | - | |
| 209 | - <%= cv.check_box :health %> | |
| 210 | - <%= cv.label :health, _("Health") %><br /> | |
| 211 | - | |
| 212 | - <%= cv.check_box :security_public_order %> | |
| 213 | - <%= cv.label :security_public_order, _("Security and Public Order") %><br /> | |
| 214 | - | |
| 215 | - <%= cv.check_box :work %> | |
| 216 | - <%= cv.label :work, _("Work") %><br /> | |
| 217 | - | |
| 218 | - <%= cv.check_box :transportation %> | |
| 219 | - <%= cv.label :transportation, _("Transportation") %><br /> | |
| 220 | - | |
| 221 | - <%= cv.check_box :urbanism %> | |
| 222 | - <%= cv.label :urbanism, _("Urbanism") %><br /> | |
| 223 | - </div> | |
| 224 | - <% end %> | |
| 225 | - <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'community', :profile => @community } %> | |
| 226 | - | |
| 227 | - <%= f.fields_for :image_builder, @community.image do |i| %> | |
| 228 | - <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %> | |
| 229 | - <% end %> | |
| 230 | - | |
| 231 | - <div style='margin-bottom: 1em; margin-top: 1em;'> | |
| 232 | - <%= _('New members must be approved:')%> | |
| 233 | - </div> | |
| 234 | - <div style='margin-bottom: 0.5em' id='community-join-before'> | |
| 235 | - <%= radio_button 'community', 'closed', 'true', :style => 'float: left' %> | |
| 236 | - <div style='margin-left: 30px'> | |
| 237 | - <%= _('<strong>Before</strong> joining this group (a moderator has to accept the member in pending request before member can access the intranet and/or the website).') %> | |
| 238 | - </div> | |
| 239 | - </div> | |
| 240 | - <div id='community-join-after'> | |
| 241 | - <%= radio_button 'community', 'closed', 'false', :style => 'float: left' %> | |
| 242 | - <div style='margin-left: 30px'> | |
| 243 | - <%= _('<strong>After</strong> joining this group (a moderator can always desactivate access for users later).') %> | |
| 244 | - </div> | |
| 245 | - </div> | |
| 246 | - | |
| 247 | 36 | <%= template_options(:communities, 'community')%> |
| 248 | 37 | |
| 249 | 38 | <%= hidden_field_tag('back_to', @back_to) %> | ... | ... |
views/mpog_software_plugin_myprofile/public_software_info.html.erb
0 → 100644
| ... | ... | @@ -0,0 +1,258 @@ |
| 1 | +<%= javascript_include_tag "mpog-validations" %> | |
| 2 | + | |
| 3 | +<h1><%= _('Creating new software') %></h1> | |
| 4 | + | |
| 5 | +<% if environment.enabled?('admin_must_approve_new_communities') %> | |
| 6 | + <div class='explanation'> | |
| 7 | + <%= _("Note that the creation of communities in this environment is restricted. Your request to create this new community will be sent to %{environment} administrators and will be approved or rejected according to their methods and criteria.") % { :environment => environment.name }%> | |
| 8 | + </div> | |
| 9 | +<%end %> | |
| 10 | + | |
| 11 | +<% unless @errors.blank? %> | |
| 12 | +<div class="errorExplanation" id="errorExplanation"> | |
| 13 | + <h2> <%= _("Can`t create new software: #{@errors.length} errors") %> </h2> | |
| 14 | + <ul> | |
| 15 | + <% @errors.each do |error| %> | |
| 16 | + <li> <%= error %> </li> | |
| 17 | + <% end %> | |
| 18 | + </ul> | |
| 19 | +</div> | |
| 20 | +<% end %> | |
| 21 | + | |
| 22 | +<div> | |
| 23 | + <%= labelled_form_for :community, :html => { :multipart => true } do |f| %> | |
| 24 | + | |
| 25 | + <%= required_fields_message %> | |
| 26 | + | |
| 27 | + <%= required f.text_field(:name) %> | |
| 28 | + | |
| 29 | + <%= fields_for @software_info do |swf| %> | |
| 30 | + <div class="formfield type-text"> | |
| 31 | + <%= swf.label("acronym" ,_("Acronym"), :class=>"formlabel") %> | |
| 32 | + <%= swf.text_field(:acronym) %> | |
| 33 | + </div> | |
| 34 | + | |
| 35 | + <div class="formfieldline"> | |
| 36 | + <%= swf.label _("Adherent to e-PING ?") %> | |
| 37 | + | |
| 38 | + <%= swf.label "e_ping_true", "Yes" %> | |
| 39 | + <%= swf.radio_button(:e_ping,true)%> | |
| 40 | + <%= swf.label "e_ping_false", "No"%> | |
| 41 | + <%= swf.radio_button(:e_ping,false)%> | |
| 42 | + </div> | |
| 43 | + | |
| 44 | + <div class="formfieldline"> | |
| 45 | + <%= swf.label _("Adherent to e-MAG ?") %> | |
| 46 | + | |
| 47 | + <%= swf.label "e_mag_true", "Yes"%> | |
| 48 | + <%= swf.radio_button(:e_mag,true)%> | |
| 49 | + <%= swf.label "e_mag_false", "No"%> | |
| 50 | + <%= swf.radio_button(:e_mag,false)%> | |
| 51 | + </div> | |
| 52 | + | |
| 53 | + <div class="formfieldline"> | |
| 54 | + <%= swf.label _("Adherent to ICP-Brasil ?") %> | |
| 55 | + | |
| 56 | + <%= swf.label "icp_brasil_true", "Yes"%> | |
| 57 | + <%= swf.radio_button(:icp_brasil,true)%> | |
| 58 | + <%= swf.label "icp_brasil_false", "No"%> | |
| 59 | + <%= swf.radio_button(:icp_brasil,false)%> | |
| 60 | + </div> | |
| 61 | + | |
| 62 | + <div class="formfieldline"> | |
| 63 | + <%= swf.label _("Adherent to e-ARQ ?") %> | |
| 64 | + | |
| 65 | + <%= swf.label "e_arq_true", "Yes"%> | |
| 66 | + <%= swf.radio_button(:e_arq,true)%> | |
| 67 | + <%= swf.label "e_arq_false", "No"%> | |
| 68 | + <%= swf.radio_button(:e_arq,false)%> | |
| 69 | + </div> | |
| 70 | + | |
| 71 | + <div class="formfieldline"> | |
| 72 | + <%= swf.label _("Internacionalizable ?") %> | |
| 73 | + | |
| 74 | + <%= swf.label "intern_true", "Yes" %> | |
| 75 | + <%= swf.radio_button(:intern,true)%> | |
| 76 | + <%= swf.label "intern_false", "No"%> | |
| 77 | + <%= swf.radio_button(:intern,false)%> | |
| 78 | + <div class="formfieldline"> | |
| 79 | + <%= swf.label "operating_platform", _("Operating Platform: ") %> <br /> | |
| 80 | + <%= swf.text_area(:operating_platform, :class=>"expand-field") %> | |
| 81 | + </div> | |
| 82 | + | |
| 83 | + <div class="formfieldline"> | |
| 84 | + <%= swf.label "objectives", _("Objectives: ")%><br /> | |
| 85 | + <%= required swf.text_area(:objectives, :class=>"expand-field") %> | |
| 86 | + </div> | |
| 87 | + | |
| 88 | + <div class="formfieldline"> | |
| 89 | + <%= swf.label "features", _("Features: ")%><br /> | |
| 90 | + <%= required swf.text_area(:features, :class=>"expand-field") %> | |
| 91 | + </div> | |
| 92 | + | |
| 93 | + <div class="formfieldline formfield type-text"> | |
| 94 | + <%= swf.label "demonstration_url", _("Demonstration URL: ") %> | |
| 95 | + <%= swf.text_field(:demonstration_url) %> | |
| 96 | + </div> | |
| 97 | + <% end %> | |
| 98 | + | |
| 99 | + <div class="formfieldline"> | |
| 100 | + <%= content_tag('label', _('Fill in the search field to add offerers for this Software'), :id => "text-input-search-offerers") %> | |
| 101 | + <%= token_input_field_tag(:q, 'search-offerers', {:action => 'search_offerers'}, { :focus => true, :hint_text => _('Type in a search term for a person to be added as | |
| 102 | +offerers'), :pre_populate => @tokenized_children}) %> | |
| 103 | + </div> | |
| 104 | + | |
| 105 | + <div id='libraries_fields'> | |
| 106 | + <h4> <%= _("Libraries") %> </h4> | |
| 107 | + <%= render :partial => 'library_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :libraries => @list_libraries } %> | |
| 108 | + </div> | |
| 109 | + <br /> | |
| 110 | + | |
| 111 | + <div id='operating_system_fields'> | |
| 112 | + <h4> <%= _("Operating Systems") %> </h4> | |
| 113 | + <% if @list_operating_systems.blank? %> | |
| 114 | + <%= OperatingSystemHelper.operating_system_as_tables(nil, false).call %> | |
| 115 | + <% end %> | |
| 116 | + <%= render :partial => 'operating_system_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :operating_systems_fields => @list_operating_systems} %> | |
| 117 | + </div> | |
| 118 | + <br /> | |
| 119 | + | |
| 120 | + <%= fields_for @license_info do |lcv| %> | |
| 121 | + <div class="formfieldline"> | |
| 122 | + <h4> <%= lcv.label _("License Version: ") %> </h4> | |
| 123 | + <%= lcv.select(:version, LicenseInfo.all.map {|l| [l.version, l.version]}, {:selected=>1}, :onchange => "get_license_link('license_info_version')") %> | |
| 124 | + | |
| 125 | + <h4> <%= _("License link") %> </h4> | |
| 126 | + <% LicenseHelper.getListLicenses.each do | license | %> | |
| 127 | + <input type="hidden" id = "version_<%=license.id %>" value = "<%=license.link%>"> | |
| 128 | + <% end %> | |
| 129 | + <a id = "version_link" href="<%= LicenseInfo.first.link %>" target="_BLANK"> <%=LicenseInfo.first.link %> </a> | |
| 130 | + | |
| 131 | + </div> | |
| 132 | + <% end %> | |
| 133 | + | |
| 134 | + <br /> | |
| 135 | + <div id='programming_languages_fields'> | |
| 136 | + <h4> <%= _("Programming languages") %> </h4> | |
| 137 | + <% if @list_languages.blank? %> | |
| 138 | + <%= SoftwareLanguageHelper.language_as_tables(nil, false).call %> | |
| 139 | + <% end %> | |
| 140 | + | |
| 141 | + <%= render :partial => 'language_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :languages => @list_languages } %> | |
| 142 | + </div> | |
| 143 | + | |
| 144 | + <br /> | |
| 145 | + <div id='database_fields'> | |
| 146 | + <h4> <%= _("Databases") %> </h4> | |
| 147 | + <% if @list_databases.blank? %> | |
| 148 | + <%= DatabaseHelper.database_as_tables(nil, true).call %> | |
| 149 | + <% end %> | |
| 150 | + | |
| 151 | + <%= render :partial => 'database_fields', :locals => { :f => f, :object_name => 'community', :profile => @community, :database => @list_databases } %> | |
| 152 | + </div> | |
| 153 | + | |
| 154 | + <%= fields_for @software_categories do |cv| %> | |
| 155 | + <div id="software_categories_fields"> | |
| 156 | + <h4> <%= _("Software Categories:") %> </h4> | |
| 157 | + | |
| 158 | + <%= cv.check_box :administration %> | |
| 159 | + <%= cv.label :administration, _("Administration") %><br /> | |
| 160 | + | |
| 161 | + <%= cv.check_box :agriculture %> | |
| 162 | + <%= cv.label :agriculture, _("Agriculture") %><br /> | |
| 163 | + | |
| 164 | + <%= cv.check_box :business_and_services %> | |
| 165 | + <%= cv.label :business_and_services, _("Business_and Services") %><br /> | |
| 166 | + | |
| 167 | + <%= cv.check_box :communication %> | |
| 168 | + <%= cv.label :communication, _("Communication") %><br /> | |
| 169 | + | |
| 170 | + <%= cv.check_box :culture %> | |
| 171 | + <%= cv.label :culture, _("Culture") %><br /> | |
| 172 | + | |
| 173 | + <%= cv.check_box :national_defense %> | |
| 174 | + <%= cv.label :national_defense, _("National Defense") %><br /> | |
| 175 | + | |
| 176 | + <%= cv.check_box :economy_and_finances %> | |
| 177 | + <%= cv.label :economy_and_finances, _("Economy and Finances") %><br /> | |
| 178 | + | |
| 179 | + <%= cv.check_box :education %> | |
| 180 | + <%= cv.label :education, _("Education") %><br /> | |
| 181 | + | |
| 182 | + <%= cv.check_box :energy %> | |
| 183 | + <%= cv.label :energy, _("Energy") %><br /> | |
| 184 | + | |
| 185 | + <%= cv.check_box :sports %> | |
| 186 | + <%= cv.label :sports, _("Sports") %><br /> | |
| 187 | + | |
| 188 | + <%= cv.check_box :habitation %> | |
| 189 | + <%= cv.label :habitation, _("Habitation") %><br /> | |
| 190 | + | |
| 191 | + <%= cv.check_box :industry %> | |
| 192 | + <%= cv.label :industry, _("Industry") %><br /> | |
| 193 | + | |
| 194 | + <%= cv.check_box :environment %> | |
| 195 | + <%= cv.label :environment, _("Environment") %><br /> | |
| 196 | + | |
| 197 | + <%= cv.check_box :research_and_development %> | |
| 198 | + <%= cv.label :research_and_development, _("Research and Development") %><br /> | |
| 199 | + | |
| 200 | + <%= cv.check_box :social_security %> | |
| 201 | + <%= cv.label :social_security, _("Social Security") %><br /> | |
| 202 | + | |
| 203 | + <%= cv.check_box :social_protection %> | |
| 204 | + <%= cv.label :social_protection, _("Social Protection") %><br /> | |
| 205 | + | |
| 206 | + <%= cv.check_box :sanitation %> | |
| 207 | + <%= cv.label :sanitation, _("Sanitation") %><br /> | |
| 208 | + | |
| 209 | + <%= cv.check_box :health %> | |
| 210 | + <%= cv.label :health, _("Health") %><br /> | |
| 211 | + | |
| 212 | + <%= cv.check_box :security_public_order %> | |
| 213 | + <%= cv.label :security_public_order, _("Security and Public Order") %><br /> | |
| 214 | + | |
| 215 | + <%= cv.check_box :work %> | |
| 216 | + <%= cv.label :work, _("Work") %><br /> | |
| 217 | + | |
| 218 | + <%= cv.check_box :transportation %> | |
| 219 | + <%= cv.label :transportation, _("Transportation") %><br /> | |
| 220 | + | |
| 221 | + <%= cv.check_box :urbanism %> | |
| 222 | + <%= cv.label :urbanism, _("Urbanism") %><br /> | |
| 223 | + </div> | |
| 224 | + <% end %> | |
| 225 | + <%= render :partial => 'shared/organization_custom_fields', :locals => { :f => f, :object_name => 'community', :profile => @community } %> | |
| 226 | + | |
| 227 | + <%= f.fields_for :image_builder, @community.image do |i| %> | |
| 228 | + <%= file_field_or_thumbnail(_('Image:'), @community.image, i) %> | |
| 229 | + <% end %> | |
| 230 | + | |
| 231 | + <div style='margin-bottom: 1em; margin-top: 1em;'> | |
| 232 | + <%= _('New members must be approved:')%> | |
| 233 | + </div> | |
| 234 | + <div style='margin-bottom: 0.5em' id='community-join-before'> | |
| 235 | + <%= radio_button 'community', 'closed', 'true', :style => 'float: left' %> | |
| 236 | + <div style='margin-left: 30px'> | |
| 237 | + <%= _('<strong>Before</strong> joining this group (a moderator has to accept the member in pending request before member can access the intranet and/or the website).') %> | |
| 238 | + </div> | |
| 239 | + </div> | |
| 240 | + <div id='community-join-after'> | |
| 241 | + <%= radio_button 'community', 'closed', 'false', :style => 'float: left' %> | |
| 242 | + <div style='margin-left: 30px'> | |
| 243 | + <%= _('<strong>After</strong> joining this group (a moderator can always desactivate access for users later).') %> | |
| 244 | + </div> | |
| 245 | + </div> | |
| 246 | + | |
| 247 | + <%= template_options(:communities, 'community')%> | |
| 248 | + | |
| 249 | + <%= hidden_field_tag('back_to', @back_to) %> | |
| 250 | + | |
| 251 | + <% button_bar do %> | |
| 252 | + <%= submit_button(:save, _('Create')) %> | |
| 253 | + <%= button(:cancel, _('Cancel'), @back_to ) %> | |
| 254 | + <% end %> | |
| 255 | + | |
| 256 | + <% end %> | |
| 257 | + | |
| 258 | +</div> | ... | ... |