From 4266eb25d63fa2f67092e8c47147be25dd46d95a Mon Sep 17 00:00:00 2001 From: Fabio Teixeira Date: Wed, 16 Dec 2015 16:29:59 -0200 Subject: [PATCH] Software catalog bug fixes --- src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css | 46 ++++++++++++++++++++++++++-------------------- src/noosfero-spb/software_communities/lib/ext/search_controller.rb | 4 ++++ src/noosfero-spb/software_communities/views/search/_full_community.html.erb | 77 +++++++++++++++++++++++++++++++++++++---------------------------------------- src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb | 2 +- 4 files changed, 68 insertions(+), 61 deletions(-) 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 e607bf9..432630a 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 @@ -347,13 +347,6 @@ margin-top: 35px; } -.action-search-software_infos #search-results .search-software-item-column-left .vcard img { - max-width: 90px; - max-height: 130px; - height: auto; - margin-left:170px; -} - .action-search-software_infos #search-results .search-software-item-column-left .org { display: none; } @@ -395,12 +388,32 @@ .action-search-software_infos #search-results .search-software-item-column-right { width: 65%; float: left; - margin-left: 140px; + margin-left: 20px; padding: 0 0 0 8px; font-size: 15px; font-family: Arial; } +.action-search-software_infos #search-results .search-software-item-column-right .search-software-profile-img { + position: relative; + float: left; + width: 20%; + margin-top: 8px; +} + +.action-search-software_infos #search-results .search-software-item-column-right .search-software-profile-img img { + max-width: 90px; + max-height: 130px; + height: auto; +} + +.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block { + position: relative; + float: left; + width: 79%; + margin-top: 8px; +} + .action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block h4{ margin-top: 0; } @@ -410,22 +423,15 @@ font-size: 19px; } -.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block:last-child { - margin-top: 30px; -} - -.action-search-software_infos #search-results .search-software-item-column-right span{ - width: 100%; -} - -.action-search-software_infos #search-results .search-software-item-column-right span b{ +.action-search-software_infos #search-results .search-software-item-column-right .search-software-categories span { + width: auto; + float: left; font-weight: normal; font-size: 13px; } -.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block:last-child span{ - width: auto; - float: left; +.action-search-software_infos #search-results .search-software-item-column-right .search-software-categories { + margin-top: 30px; } .action-search-software_infos #search-results .search-software-content-block #categories-list li { 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 db4f8d7..8d0c7bc 100644 --- a/src/noosfero-spb/software_communities/lib/ext/search_controller.rb +++ b/src/noosfero-spb/software_communities/lib/ext/search_controller.rb @@ -4,6 +4,8 @@ require_dependency 'search_controller' class SearchController + DEFAULT_SOFTWARE_SORT = 'rating' + def self.catalog_list { :public_software => ["Software Público", "software_infos"], :sisp_software => ["SISP", "sisp"] } @@ -144,6 +146,8 @@ class SearchController def prepare_software_infos_params title @titles[title.to_sym] = _("Result Search") + params[:sort] ||= DEFAULT_SOFTWARE_SORT + @selected_categories_id = params[:selected_categories_id] @selected_categories_id ||= [] @selected_categories_id = @selected_categories_id.map(&:to_i) diff --git a/src/noosfero-spb/software_communities/views/search/_full_community.html.erb b/src/noosfero-spb/software_communities/views/search/_full_community.html.erb index 47a5475..b08f730 100644 --- a/src/noosfero-spb/software_communities/views/search/_full_community.html.erb +++ b/src/noosfero-spb/software_communities/views/search/_full_community.html.erb @@ -1,59 +1,56 @@ <% software = community.software_info %>
  • - <% organization_average_rating = '' %> - <% unless community.organization_ratings.empty?%> - <% organization_average_rating = render :partial => 'shared/organization_average_rating_block', :locals => {:community => community}%> - <% end %> - - <% software_publish_date = render :partial => 'shared/software_publish_date', :locals => {:community => community, :order => @order} %> -
    - <%= profile_image_link community, :portrait, 'div', organization_average_rating + software_publish_date %> +
    + <% unless community.organization_ratings.empty?%> + <%= render :partial => 'shared/organization_average_rating_block', :locals => {:community => community}%> + <% end %> + + <%=render :partial => 'shared/software_publish_date', :locals => {:community => community, :order => @order} %> +
    +
    + <%= link_to_homepage(profile_image(community, :portrait), community.identifier) %> +
    - <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %>

    <%= link_to_homepage(link_name, community.identifier) %>

    -
    - - <% body_stripped = strip_tags(software.finality) %> - <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %> - -
    -
    +
    + <% body_stripped = strip_tags(software.finality) %> + <%= link_to_homepage(excerpt(body_stripped, body_stripped.first(3), 200), community.identifier) if body_stripped %> +
    -
    - - - <%= _("Software Categories") %>: - - - - <% if !community.categories.empty? %> -
      - <% community.categories.each do |category| %> -
    • - <%= link_to _("#{category.name}"), { - :controller => :search, - :action => :software_infos, - :selected_categories_id => [category.id], - :software_type => params[:software_type] - } %> -
    • - <% end %> -
    - <% else %> +
    - <%= _("This software doesn't have categories") %> + <%= _("Software Categories") %>: - <% end %> -
    + + <% if !community.categories.empty? %> +
      + <% community.categories.each do |category| %> +
    • + <%= link_to _("#{category.name}"), { + :controller => :search, + :action => :software_infos, + :selected_categories_id => [category.id], + :software_type => params[:software_type] + } %> +
    • + <% end %> +
    + <% else %> + + <%= _("This software doesn't have categories") %> + + <% end %> +
    +

    diff --git a/src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb b/src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb index 015f82b..b3f3e6b 100644 --- a/src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb +++ b/src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb @@ -54,7 +54,7 @@ [_("Name A-Z"), 'asc'], [_("Name Z-A"), 'desc'], [_("Relevance"), 'relevance'], - [_("Favorites"), 'rating'] + [_("Rating"), 'rating'] ], :selected=>params[:sort]) ) %> -- libgit2 0.21.2