diff --git a/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css b/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css index 48fc7c7..02879d9 100644 --- a/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css +++ b/src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css @@ -455,3 +455,463 @@ } +.action-search-sisp #content { + margin-top: 10px; + padding: 0px; +} + +.action-search-sisp .main-content { + border: none; + box-shadow: none; +} + +.action-search-sisp #content .main-content h2{ + color: #FF0366; + font-size: 16px; + font-family: "open_sansregular",Arial, Helvetica,sans-serif; + font-weight: 300; + text-transform: uppercase; +} + +.action-search-sisp #content .main-content h1{ + padding: 5px 0 10px 0; + border-bottom: 1px solid #D3D6DE; + font-family: Arial, Helvetica, sans-serif; + font-size: 35px; + font-variant: normal; +} + +/*** end of title and subtitle ***/ + +/*** Search Box ***/ +.action-search-sisp .search-form { + margin-top:28px; + padding: 0; + background: #ecedf1; + border-radius: 4px; + border: 1px solid #D3D6DE; + background-image:url("catalogo.png"); +} + +.action-search-sisp #software-search-container .search-form h3{ + margin: 0px 0px 3px 0px; + padding: 16px 0 20px 14px; + color: #2C4B6B; + font-family:"open_sansregular", Arial, Helvetica, sans-serif; + color: #2B51A8; + font-weight: bold; + font-size: 15px; + text-transform: uppercase; +} + +/*.action-search-sisp #content .search-form .project-software { + margin: 0 0 0 15px; +} + + It's TEMPORARY +.action-search-sisp #content .search-form .doubts-catalog-software { + display: none; +}*/ + +/**Radio Buttons***/ +.action-search-sisp .radio-buttons { + display: none; +} + +.action-search-sisp #public_software_radio_button, +.action-search-sisp #all_radio_button { + margin:5px 4px 15px 15px; + line-height: 20px; + position:absolute; +} + +.action-search-sisp .search-form label, +.action-search-sisp .search-form label{ + margin:0px 3px 4px 32px; + line-height: 22px; + font-size: 15px; + font-family: Arial; +} + +.action-search-sisp #software-search-container .search-form .doubts-catalog-software{ + padding-top: 2px; + background-color: #3867b7; + color: #ffffff; + font-weight: bold; + cursor: pointer; + height: 15px; + font-family: arial; + width: 17px; + display: inline-block; + text-align: center; + border-radius: 50%; +} + +/******/ + +.action-search-sisp #content .search-form .search-field .formfield { + width: 100%; + margin: 0; + padding: 0; +} + +.action-search-sisp #content .search-form .search-field #search-input { + width: 95%; + margin: 13px 0px 4px 13px; + padding: 7px; + background: #FFF; + border-radius: 4px; + border: 1px solid #D3D6DE; + font-size: 14px; +} + + +.action-search-sisp #content .search-form .search-field input.button{ + padding: 0px; + background-color: #3E67B1; + color: #FFF; + border: 1px solid #3E67B1; + font-family: "open_sansbold",Arial,sans-serif; + border-radius: 4px; +} + +.action-search-sisp #content .search-form .search-field input.button.submit { + width: auto; + height: 30px; + max-height: 30px; + margin: 14px; + padding: 0 14px 0 14px; + background: #3E67B1; + line-height: 14px; + border-radius: 4px; + color: #ffffff; + text-transform: uppercase; + font-family: "open_sansbold",Arial,sans-serif; + font-size: 14px; +} + +/* Filter options */ + +.action-search-sisp #filter-catalog-software { + background-color: #D3D6DE; +} + +.action-search-sisp #filter-option-catalog-software { + cursor: pointer; + padding: 14px; + background-color: #D3D6DE; + border: none; + border-bottom-left-radius: 4px; + border-bottom-right-radius: 4px; + font-size: 11px; + text-align: right; + text-transform: uppercase; +} + +.action-search-sisp #filter-option-catalog-close { + padding: 7px 7px 17px 10px; + display: none; +} +.action-search-sisp #filter-option-catalog-software:hover { + background-color: #c7c7c7; +} + +.action-search-sisp #filter-option-catalog-software:after { + content: ""; + margin-left: 5px; + padding: 3px 10.5px; + background: url("../images/bottom-arrow.png") no-repeat center; + background-color: #3E67B1; + border-radius: 4px; +} + +.action-search-sisp #filter-catalog-software #filter-categories-option { + border: none; + height: 0; + max-height: 620px; + position: relative; + overflow: hidden; + padding: 0 15px; +} + +.action-search-sisp #filter-catalog-software #filter-categories-catalog h4 { + margin: 20px 0 10px 5px; + background: transparent; + color: black; +} + +.action-search-sisp #filter-catalog-software input[type="checkbox"]{ + vertical-align: middle; + margin: 0 3px 2px 8px; +} + +.action-search-sisp #group-categories ul { + font-family: Arial; + font-size: 14px; + line-height: 31px; + columns: 2; + -webkit-columns: 2; + -moz-columns: 2; +} + +.action-search-sisp #group-categories li span { + font-family: Arial; + font-size: 14px; +} + +.action-search-sisp #filter-catalog-software .project-software{ + margin: 20px 0 30px; + border-top: 1px dotted; + border-bottom: 1px dotted; + font-weight: bold; + font-size: 15px; + font-family: Arial; + padding: 10px; +} + +.action-search-sisp #filter-catalog-software .project-software label { + font-weight: normal; +} + +.action-search-sisp #filter-catalog-software .project-software span { + padding: 2px 6px; + background: #FFF; + color: #3E67B1; + border-radius: 50%; + font-size: 16px; +} + +.action-search-sisp button#cleanup-filter-catalg { + cursor: pointer; + background-color: #3E67B1; + font-size: 14px; + font-family: Arial; + color: #ffffff; + border: 1px solid #2B65CD; + border-radius: 4px; + margin: 5px 0 0 5px; + padding: 5px 10px; +} + +.action-search-sisp button#close-filter-catalog { + cursor:pointer; + float: right; + border: none; + background: none; + font-size: 12px; + margin-top: 5px; + color: #000; + text-transform: uppercase; + padding: 5px; +} + +.action-search-sisp button#close-filter-catalog:after { + content: ""; + margin-left: 5px; + padding: 2.5px 10.5px; + background: url("../images/top-arrow.png") no-repeat center; + background-color: #3E67B1; + border-radius: 4px; +} + +/*** end of search box ***/ + +/*** Catalog Options ***/ + +.action-search-sisp #catalog-display-options { + font-size: 14px; + font-family: Arial; +} + +.action-search-sisp #catalog-display-options #catalog-display-options-count{ + padding: 45px 0 4px 0; + float: left; + width: 50%; +} + +.action-search-sisp #catalog-display-options #catalog-display-options-show-and-sort{ + padding: 38px 0 5px 0; + font-weight: bold; + float: left; + width: 50%; +} +.action-search-sisp #catalog-display-options #catalog-display-options-sort, +.action-search-sisp #catalog-display-options #catalog-display-options-show{ + position: relative; + float: left; + width: 50%; + text-align: right; +} + +/*** Search Results ***/ +.action-search-sisp #search-results { + border-top: 1px solid #d7d7d7; + margin-top: 66px; +} + +.action-search-sisp #search-results.only-one-result-box .search-software-item { + padding: 29px 0 31px 0; + background: #ffffff; + border-bottom: 1px solid #d7d7d7; +} + +.action-search-sisp #search-results #search-results-empty{ + padding: 30px 0 15px 0; + color: #172738; + font-size: 16px; + text-align: left; +} + + +.action-search-sisp #search-results .search-results-innerbox { + background: #ffffff; + border: none; +} + +/* Column left */ + +.action-search-sisp #search-results .search-software-item-column-left { + width: 140px; + height: 140px; + float: left; + border-right: 1px dotted #ccc; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard { + display: table; + margin: 0; + border: none; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard:hover { + border: none; + background: none; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard a:hover{ + color: #3E67B1; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard a.profile_link{ + float:left; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard:hover .menu-submenu-trigger { + display:none; +} + +.action-search-sisp #search-results .search-software-item-column-left .profile-image{ + width: 130px; + height: 130px; + margin-left: 130px; + margin-top: 35px; +} + +.action-search-sisp #search-results .search-software-item-column-left .vcard img { + max-width: 90px; + max-height: 130px; + height: auto; + margin-left:170px; +} + +.action-search-sisp #search-results .search-software-item-column-left .org { + display: none; +} + +.action-search-sisp #search-results .search-software-item-column-left .extra_info { + width: 140px; + padding-right: 20px; + top: 0px; + position: absolute; + color: #172738; + font-size: 13px; + font-family: Arial; + text-align: left; + opacity: inherit; +} + +.action-search-sisp #search-results .search-software-item-column-left .software-date { + margin-top: 20px; + width: 130px; +} + +.action-search-sisp #search-results .search-software-item-column-left .software-date::before{ + content: url("../images/ic-calendar.png"); + margin: 0px 7px 20px 0; + float: left; +} + +.action-search-sisp #search-results .search-software-item-column-left .star-container.catalog_rating_block { + width: 140px; + margin-left: 0px; +} + +.action-search-sisp #search-results .search-software-item-column-left .software-date-value { + margin-left: 23px; +} + +/* Column Right */ + +.action-search-sisp #search-results .search-software-item-column-right { + width: 65%; + float: left; + margin-left: 140px; + padding: 0 0 0 8px; + font-size: 15px; + font-family: Arial; +} + +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block h4{ + margin-top: 0; +} + +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block h4 a { + color: #172738; + font-size: 19px; +} + +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block:last-child { + margin-top: 30px; +} + +.action-search-sisp #search-results .search-software-item-column-right span{ + width: 100%; +} + +.action-search-sisp #search-results .search-software-item-column-right span b{ + font-weight: normal; + font-size: 13px; +} + +.action-search-sisp #search-results .search-software-item-column-right .search-software-content-block:last-child span{ + width: auto; + float: left; +} + +.action-search-sisp #search-results .search-software-content-block #categories-list li { + width: auto !important; /* force overwritting from base */ + margin-left: 7px !important; /* force overwritting from base */ + float: left; + color: #3E67B1; + font-size: 13px; + line-height: 18px; + text-decoration: underline; +} + +.action-search-sisp #search-results .search-software-content-block #categories-list li a { + color: #3E67B1; +} + +.action-search-sisp #search-results #individually-category br { + display: none; +} + +.action-search-sisp #search-results #individually-category a { + margin-right: 10px; + float: left; + color: #3E67B1; + font-size: 13px; + text-decoration: underline; +} + + diff --git a/src/noosfero-spb/software_communities/db/migrate/20151125175514_change_software_info_structure.rb b/src/noosfero-spb/software_communities/db/migrate/20151125175514_change_software_info_structure.rb new file mode 100644 index 0000000..3e0f464 --- /dev/null +++ b/src/noosfero-spb/software_communities/db/migrate/20151125175514_change_software_info_structure.rb @@ -0,0 +1,39 @@ +class ChangeSoftwareInfoStructure < ActiveRecord::Migration + def up + change_table :software_infos do |t| + t.text :agency_identification + t.text :softawre_requirements + t.text :hardware_requirements + t.text :documentation + t.text :system_applications + t.text :active_versions + t.text :estimated_cost + t.text :responsible + t.text :responsible_for_acquirement + t.text :system_info + t.text :development_info + t.text :maintenance + t.text :standards_adherence + t.text :plataform + t.text :sisp_type + end + end + + def down + remove_column :agency_identification + remove_column :softawre_requirements + remove_column :hardware_requirements + remove_column :documentation + remove_column :system_applications + remove_column :active_versions + remove_column :estimated_cost + remove_column :responsible + remove_column :responsible_for_acquirement + remove_column :system_info + remove_column :development_info + remove_column :maintenance + remove_column :standards_adherence + remove_column :plataform + remove_column :sisp_type + end +end diff --git a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb index 156ce2a..5c01f42 100644 --- a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb +++ b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb @@ -24,6 +24,17 @@ class SearchController render :layout=>false if request.xhr? end + def sisp + prepare_sisp_page + results = filter_sisp_list + @software_count = results.count + results = results.paginate(:per_page => @per_page, :page => params[:page]) + @searches[@asset] = {:results => results} + @search = results + + render :layout=>false if request.xhr? + end + protected def filter_communities_list @@ -51,6 +62,12 @@ class SearchController sort_communities_list filtered_community_list end + def filter_sisp_list + filtered_software_list = get_filtered_software_list + filtered_community_list = get_communities_sisp_list(filtered_software_list) + sort_communities_list filtered_community_list + end + def get_filter_category_ids category_ids = [] unless params[:selected_categories_id].blank? @@ -91,13 +108,22 @@ class SearchController def get_communities_list software_list filtered_community_list = [] software_list.each do |software| - if !@public_software_selected || software.public_software? + if (!@public_software_selected || software.public_software?) && (!software.sisp) filtered_community_list << software.community unless software.community.nil? end end filtered_community_list end + def get_communities_sisp_list software_list + filtered_community_list = [] + software_list.each do |software| + if software.sisp + filtered_community_list << software.community unless software.community.nil? + end + end + filtered_community_list + end def sort_communities_list communities_list communities_list.sort! {|a, b| a.name.downcase <=> b.name.downcase} @@ -117,7 +143,12 @@ class SearchController prepare_software_infos_category_groups prepare_software_infos_category_enable end - + def prepare_sisp_page + prepare_sisp_params + prepare_software_infos_message + prepare_software_infos_category_groups + prepare_software_infos_category_enable + end def prepare_software_infos_params @titles[:software_infos] = _("Result Search") @selected_categories_id = params[:selected_categories_id] @@ -128,6 +159,16 @@ class SearchController @per_page = prepare_per_page end + def prepare_sisp_params + @titles[:sisp] = _("Result Search") + @selected_categories_id = params[:selected_categories_id] + @selected_categories_id ||= [] + @selected_categories_id = @selected_categories_id.map(&:to_i) + @all_selected = params[:software_type] == "all" + @public_software_selected = !@all_selected + @per_page = prepare_per_page + end + def prepare_per_page return 15 if params[:software_display].nil? diff --git a/src/noosfero-spb/software_communities/lib/software_info.rb b/src/noosfero-spb/software_communities/lib/software_info.rb index 73e8a32..fbec209 100644 --- a/src/noosfero-spb/software_communities/lib/software_info.rb +++ b/src/noosfero-spb/software_communities/lib/software_info.rb @@ -89,6 +89,7 @@ class SoftwareInfo < ActiveRecord::Base validate :validate_acronym settings_items :another_license_version, :another_license_link + settings_items :sisp # used on find_by_contents def self.like_search name diff --git a/src/noosfero-spb/software_communities/public/views/search-software-catalog.js b/src/noosfero-spb/software_communities/public/views/search-software-catalog.js index 552b055..86db87a 100644 --- a/src/noosfero-spb/software_communities/public/views/search-software-catalog.js +++ b/src/noosfero-spb/software_communities/public/views/search-software-catalog.js @@ -3,19 +3,26 @@ modulejs.define('SearchSoftwareCatalog', ['jquery', 'NoosferoRoot', 'SoftwareCat var AJAX_URL = { software_infos: - NoosferoRoot.urlWithSubDirectory("/search/software_infos") + NoosferoRoot.urlWithSubDirectory("/search/software_infos"), + sisp: + NoosferoRoot.urlWithSubDirectory("/search/sisp"), }; function dispatch_search_ajax(enable_load) { var search_params = get_search_params(); + var full_url = window.location.href; + var url = AJAX_URL.software_infos; + if(full_url.indexOf("search/sisp") > -1){ + url = AJAX_URL.sisp; + } if(enable_load) { open_loading("Loading"); } $.ajax({ - url: AJAX_URL.software_infos, + url: url, type: "GET", data: search_params, success: update_search_page_on_ajax, diff --git a/src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb b/src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb index 976a13d..6ac45e3 100644 --- a/src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb +++ b/src/noosfero-spb/software_communities/views/search/_catalog_result_list.html.erb @@ -13,6 +13,7 @@ <% end %> <% end %> + <%name="software_infos"#TODO remove this %> <% display = display_filter(name, params[:display]) %>