Commit 67f99b16dee00d34ba52c1446ce3748ba236ee86
1 parent
8f2bf863
Exists in
master
and in
5 other branches
software_search: Add the Any option for the select boxes.
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Luciano Prestes <lucianopcbr@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
2 changed files
with
5 additions
and
5 deletions
Show diff stats
lib/controlled_vocabulary_helper.rb
| 1 | module ControlledVocabularyHelper | 1 | module ControlledVocabularyHelper |
| 2 | 2 | ||
| 3 | def self.get_categories_as_options | 3 | def self.get_categories_as_options |
| 4 | - categories = [] | 4 | + categories = ["<option>Any</option>".html_safe] |
| 5 | 5 | ||
| 6 | ControlledVocabulary.attribute_names.each do |attribute| | 6 | ControlledVocabulary.attribute_names.each do |attribute| |
| 7 | if attribute.to_s != "id" && attribute.to_s != "software_info_id" then | 7 | if attribute.to_s != "id" && attribute.to_s != "software_info_id" then |
views/search/search_forms/_software_fields.html.erb
| @@ -7,28 +7,28 @@ | @@ -7,28 +7,28 @@ | ||
| 7 | <tr> | 7 | <tr> |
| 8 | <td> <%= _("Database") %> </td> | 8 | <td> <%= _("Database") %> </td> |
| 9 | <td> | 9 | <td> |
| 10 | - <%= select_tag("database_description", SoftwareHelper.select_options(DatabaseDescription.all)) %> | 10 | + <%= collection_select(:database_description, :id, DatabaseDescription.all, :id, :name, :prompt=>_("Any")) %> |
| 11 | </td> | 11 | </td> |
| 12 | </tr> | 12 | </tr> |
| 13 | 13 | ||
| 14 | <tr> | 14 | <tr> |
| 15 | <td> <%= _("Programming Language") %> </td> | 15 | <td> <%= _("Programming Language") %> </td> |
| 16 | <td> | 16 | <td> |
| 17 | - <%= select_tag("programming_language", SoftwareHelper.select_options(ProgrammingLanguage.all)) %> | 17 | + <%= collection_select(:programming_language, :id, ProgrammingLanguage.all, :id, :name, :prompt=>_("Any")) %> |
| 18 | </td> | 18 | </td> |
| 19 | </tr> | 19 | </tr> |
| 20 | 20 | ||
| 21 | <tr> | 21 | <tr> |
| 22 | <td> <%= _("Operating System") %> </td> | 22 | <td> <%= _("Operating System") %> </td> |
| 23 | <td> | 23 | <td> |
| 24 | - <%= select_tag("operating_system", SoftwareHelper.select_options(OperatingSystemName.all)) %> | 24 | + <%= collection_select(:operating_system, :id, OperatingSystemName.all, :id, :name, :prompt=>_("Any")) %> |
| 25 | </td> | 25 | </td> |
| 26 | </tr> | 26 | </tr> |
| 27 | 27 | ||
| 28 | <tr> | 28 | <tr> |
| 29 | <td> <%= _("Controlled Vocabulary") %> </td> | 29 | <td> <%= _("Controlled Vocabulary") %> </td> |
| 30 | <td> | 30 | <td> |
| 31 | - <%= select_tag("controlled_vocabulary", ControlledVocabularyHelper.get_categories_as_options) %> | 31 | + <%= select_tag("controlled_vocabulary", (ControlledVocabularyHelper.get_categories_as_options)) %> |
| 32 | </td> | 32 | </td> |
| 33 | </tr> | 33 | </tr> |
| 34 | 34 |