Commit afd60bffe7a6e269b6da4566cea3c3ffbd12f354
1 parent
008c7b1f
Exists in
master
and in
79 other branches
software_search: New view to make custom searchs for communities
Signed-off-by: Gabriela Navarro <navarro1703@gmail.com> Signed-off-by: Parley Martins <parley@outlook.com>
Showing
2 changed files
with
13 additions
and
1 deletions
Show diff stats
lib/mpog_software_plugin.rb
@@ -341,6 +341,18 @@ class MpogSoftwarePlugin < Noosfero::Plugin | @@ -341,6 +341,18 @@ class MpogSoftwarePlugin < Noosfero::Plugin | ||
341 | ) | 341 | ) |
342 | end | 342 | end |
343 | 343 | ||
344 | + def custom_community_search params | ||
345 | + if params[:type] == "Community" | ||
346 | + Community.search(params[:name]) | ||
347 | + elsif params[:type] == "Software" | ||
348 | + | ||
349 | + elsif params[:type] == "Institution" | ||
350 | + | ||
351 | + else | ||
352 | + | ||
353 | + end | ||
354 | + end | ||
355 | + | ||
344 | def controlled_vocabulary_transaction | 356 | def controlled_vocabulary_transaction |
345 | ControlledVocabulary.transaction do | 357 | ControlledVocabulary.transaction do |
346 | context.profile.software_info.controlled_vocabulary.update_attributes!(context.params[:controlled_vocabulary]) | 358 | context.profile.software_info.controlled_vocabulary.update_attributes!(context.params[:controlled_vocabulary]) |
views/search/search_community_filter.html.erb
1 | -<form action="/search/community" name="user_filter" method="POST" class="search_form"> | 1 | +<form action="/search/communities" name="community_filter" method="POST" class="search_form"> |
2 | <div id="search_content"> | 2 | <div id="search_content"> |
3 | <div class="search_options"> | 3 | <div class="search_options"> |
4 | 4 |