Compare View
Commits (2)
-
- Reorder radiobuttons - Filter with "all softwares" by default Signed-off-by: Tallys Martins <tallysmartins@gmail.com> Signed-off-by: Thiago Ribeiro <thiagitosouza@hotmail.com> Signed-off-by: Tallys Martins <tallysmartins@gmail.com>
-
Software search catalog radio buttons fix See merge request !237
Showing
3 changed files
Show diff stats
src/noosfero-spb/software_communities/features/software_catalog.feature
@@ -28,6 +28,10 @@ Feature: Search software | @@ -28,6 +28,10 @@ Feature: Search software | ||
28 | Then I should see "Software One" | 28 | Then I should see "Software One" |
29 | Then I should see "Software Two" | 29 | Then I should see "Software Two" |
30 | 30 | ||
31 | + Scenario: Show all "public_software" softwares when open search page | ||
32 | + Given I go to /search/software_infos | ||
33 | + Then the "all_radio_button" checkbox should be checked | ||
34 | + | ||
31 | Scenario: Show all "public_software" softwares when search software | 35 | Scenario: Show all "public_software" softwares when search software |
32 | Given I go to /search/software_infos | 36 | Given I go to /search/software_infos |
33 | And I fill in "search-input" with "Software" | 37 | And I fill in "search-input" with "Software" |
src/noosfero-spb/software_communities/lib/ext/search_controller.rb
@@ -151,7 +151,7 @@ class SearchController | @@ -151,7 +151,7 @@ class SearchController | ||
151 | @selected_categories_id = params[:selected_categories_id] | 151 | @selected_categories_id = params[:selected_categories_id] |
152 | @selected_categories_id ||= [] | 152 | @selected_categories_id ||= [] |
153 | @selected_categories_id = @selected_categories_id.map(&:to_i) | 153 | @selected_categories_id = @selected_categories_id.map(&:to_i) |
154 | - @all_selected = params[:software_type] == "all" | 154 | + @all_selected = params[:software_type] == "all" || params[:software_type].blank? |
155 | @public_software_selected = !@all_selected | 155 | @public_software_selected = !@all_selected |
156 | @per_page = prepare_per_page | 156 | @per_page = prepare_per_page |
157 | end | 157 | end |
src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb
@@ -12,13 +12,13 @@ | @@ -12,13 +12,13 @@ | ||
12 | <%= hidden_field_tag :filter, params[:filter] %> | 12 | <%= hidden_field_tag :filter, params[:filter] %> |
13 | 13 | ||
14 | <div class="radio-buttons"> | 14 | <div class="radio-buttons"> |
15 | - <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> | ||
16 | - <span class="doubts-catalog-software" title="<%= _('Softwares in accordance with the technical and legal requirements of IN 01/2011.') %>">?</span> | ||
17 | - <!-- Projetos que passaram pelo processo do Avalia SPB de acordo com os requisitos da IN 01/2011. --> | ||
18 | - | ||
19 | <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> | 15 | <%= labelled_radio_button _('All'), :software_type, 'all', @all_selected, :id => "all_radio_button", :class => "project-software" %> |
20 | <span class="doubts-catalog-software" title="<%= _('Public softwares and softwares that meet the requirements of Art. 14 of IN 01/2011, government software.') %>">?</span> | 16 | <span class="doubts-catalog-software" title="<%= _('Public softwares and softwares that meet the requirements of Art. 14 of IN 01/2011, government software.') %>">?</span> |
21 | <!-- Projetos incluídos no portal, conforme casos previstos na IN 01/2011. --> | 17 | <!-- Projetos incluídos no portal, conforme casos previstos na IN 01/2011. --> |
18 | + | ||
19 | + <%= labelled_radio_button _('Public Software'), :software_type, 'public_software', @public_software_selected, :id => "public_software_radio_button", :class => "project-software" %> | ||
20 | + <span class="doubts-catalog-software" title="<%= _('Softwares in accordance with the technical and legal requirements of IN 01/2011.') %>">?</span> | ||
21 | + <!-- Projetos que passaram pelo processo do Avalia SPB de acordo com os requisitos da IN 01/2011. --> | ||
22 | </div> | 22 | </div> |
23 | 23 | ||
24 | <div class="search-field"> | 24 | <div class="search-field"> |