diff --git a/lib/mpog_software_plugin.rb b/lib/mpog_software_plugin.rb index 5b8c002..d8fc558 100644 --- a/lib/mpog_software_plugin.rb +++ b/lib/mpog_software_plugin.rb @@ -134,7 +134,7 @@ class MpogSoftwarePlugin < Noosfero::Plugin end def js_files - ["mpog-software-validations.js", "mpog-user-validations.js", "mpog-institution-validations.js", "mpog-incomplete-registration.js"] + ["mpog-software-validations.js", "mpog-user-validations.js", "mpog-institution-validations.js", "mpog-incomplete-registration.js", "mpog-search.js"] end def add_new_organization_button @@ -325,8 +325,12 @@ class MpogSoftwarePlugin < Noosfero::Plugin end end - def add_new_user_search_filter - expanded_template('user_search/search_filter.html.erb') + def add_new_search_filter type + if type == "People" + expanded_template('search/search_user_filter.html.erb') + else type == "Community" + expanded_template('search/search_community_filter.html.erb') + end end def custom_people_search params diff --git a/public/mpog-search.js b/public/mpog-search.js new file mode 100644 index 0000000..d234763 --- /dev/null +++ b/public/mpog-search.js @@ -0,0 +1,32 @@ +(function(){ + + function show_institutions_fields() { + jQuery(".institution_fields").show(); + jQuery(".software_fields").hide(); + jQuery(".community_fields").hide(); + } + + function show_software_fields() { + jQuery(".institution_fields").hide(); + jQuery(".software_fields").show(); + jQuery(".community_fields").hide(); + } + + function show_community_fields() { + jQuery(".institution_fields").hide(); + jQuery(".software_fields").hide(); + jQuery(".community_fields").show(); + } + + function set_events() { + show_community_fields(); + + jQuery("#type_Community").click(show_community_fields); + + jQuery("#type_Software").click(show_software_fields); + + jQuery("#type_Institution").click(show_institutions_fields); + } + + jQuery(document).ready(set_events); +})(); diff --git a/views/search/search_community_filter.html.erb b/views/search/search_community_filter.html.erb new file mode 100644 index 0000000..e429705 --- /dev/null +++ b/views/search/search_community_filter.html.erb @@ -0,0 +1,127 @@ +
diff --git a/views/search/search_user_filter.html.erb b/views/search/search_user_filter.html.erb new file mode 100644 index 0000000..5ca0e16 --- /dev/null +++ b/views/search/search_user_filter.html.erb @@ -0,0 +1,35 @@ + \ No newline at end of file diff --git a/views/user_search/search_filter.html.erb b/views/user_search/search_filter.html.erb deleted file mode 100644 index 5ca0e16..0000000 --- a/views/user_search/search_filter.html.erb +++ /dev/null @@ -1,35 +0,0 @@ - \ No newline at end of file -- libgit2 0.21.2