Commit 1213339a1f19fe8fa70b89a12539d12d35442125
1 parent
9596b3ae
Exists in
software_catalog_style_fixes
Software catalog bug fixes - issue #561
Signed-off-by: ArthurJahn <stutrzbecher@gmail.com> Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Showing
4 changed files
with
68 additions
and
61 deletions
Show diff stats
src/noosfero-spb/noosfero-spb-theme/css/software-catalog-page.css
@@ -347,13 +347,6 @@ | @@ -347,13 +347,6 @@ | ||
347 | margin-top: 35px; | 347 | margin-top: 35px; |
348 | } | 348 | } |
349 | 349 | ||
350 | -.action-search-software_infos #search-results .search-software-item-column-left .vcard img { | ||
351 | - max-width: 90px; | ||
352 | - max-height: 130px; | ||
353 | - height: auto; | ||
354 | - margin-left:170px; | ||
355 | -} | ||
356 | - | ||
357 | .action-search-software_infos #search-results .search-software-item-column-left .org { | 350 | .action-search-software_infos #search-results .search-software-item-column-left .org { |
358 | display: none; | 351 | display: none; |
359 | } | 352 | } |
@@ -395,12 +388,32 @@ | @@ -395,12 +388,32 @@ | ||
395 | .action-search-software_infos #search-results .search-software-item-column-right { | 388 | .action-search-software_infos #search-results .search-software-item-column-right { |
396 | width: 65%; | 389 | width: 65%; |
397 | float: left; | 390 | float: left; |
398 | - margin-left: 140px; | 391 | + margin-left: 20px; |
399 | padding: 0 0 0 8px; | 392 | padding: 0 0 0 8px; |
400 | font-size: 15px; | 393 | font-size: 15px; |
401 | font-family: Arial; | 394 | font-family: Arial; |
402 | } | 395 | } |
403 | 396 | ||
397 | +.action-search-software_infos #search-results .search-software-item-column-right .search-software-profile-img { | ||
398 | + position: relative; | ||
399 | + float: left; | ||
400 | + width: 20%; | ||
401 | + margin-top: 8px; | ||
402 | +} | ||
403 | + | ||
404 | +.action-search-software_infos #search-results .search-software-item-column-right .search-software-profile-img img { | ||
405 | + max-width: 90px; | ||
406 | + max-height: 130px; | ||
407 | + height: auto; | ||
408 | +} | ||
409 | + | ||
410 | +.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block { | ||
411 | + position: relative; | ||
412 | + float: left; | ||
413 | + width: 79%; | ||
414 | + margin-top: 8px; | ||
415 | +} | ||
416 | + | ||
404 | .action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block h4{ | 417 | .action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block h4{ |
405 | margin-top: 0; | 418 | margin-top: 0; |
406 | } | 419 | } |
@@ -410,22 +423,15 @@ | @@ -410,22 +423,15 @@ | ||
410 | font-size: 19px; | 423 | font-size: 19px; |
411 | } | 424 | } |
412 | 425 | ||
413 | -.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block:last-child { | ||
414 | - margin-top: 30px; | ||
415 | -} | ||
416 | - | ||
417 | -.action-search-software_infos #search-results .search-software-item-column-right span{ | ||
418 | - width: 100%; | ||
419 | -} | ||
420 | - | ||
421 | -.action-search-software_infos #search-results .search-software-item-column-right span b{ | 426 | +.action-search-software_infos #search-results .search-software-item-column-right .search-software-categories span { |
427 | + width: auto; | ||
428 | + float: left; | ||
422 | font-weight: normal; | 429 | font-weight: normal; |
423 | font-size: 13px; | 430 | font-size: 13px; |
424 | } | 431 | } |
425 | 432 | ||
426 | -.action-search-software_infos #search-results .search-software-item-column-right .search-software-content-block:last-child span{ | ||
427 | - width: auto; | ||
428 | - float: left; | 433 | +.action-search-software_infos #search-results .search-software-item-column-right .search-software-categories { |
434 | + margin-top: 30px; | ||
429 | } | 435 | } |
430 | 436 | ||
431 | .action-search-software_infos #search-results .search-software-content-block #categories-list li { | 437 | .action-search-software_infos #search-results .search-software-content-block #categories-list li { |
src/noosfero-spb/software_communities/lib/ext/search_controller.rb
@@ -2,6 +2,8 @@ require_dependency 'search_controller' | @@ -2,6 +2,8 @@ require_dependency 'search_controller' | ||
2 | 2 | ||
3 | class SearchController | 3 | class SearchController |
4 | 4 | ||
5 | + DEFAULT_SOFTWARE_SORT = 'rating' | ||
6 | + | ||
5 | def communities | 7 | def communities |
6 | delete_communities = [] | 8 | delete_communities = [] |
7 | valid_communities_string = Community.get_valid_communities_string | 9 | valid_communities_string = Community.get_valid_communities_string |
@@ -119,6 +121,8 @@ class SearchController | @@ -119,6 +121,8 @@ class SearchController | ||
119 | end | 121 | end |
120 | 122 | ||
121 | def prepare_software_infos_params | 123 | def prepare_software_infos_params |
124 | + params[:sort] ||= DEFAULT_SOFTWARE_SORT | ||
125 | + | ||
122 | @titles[:software_infos] = _("Result Search") | 126 | @titles[:software_infos] = _("Result Search") |
123 | @selected_categories_id = params[:selected_categories_id] | 127 | @selected_categories_id = params[:selected_categories_id] |
124 | @selected_categories_id ||= [] | 128 | @selected_categories_id ||= [] |
src/noosfero-spb/software_communities/views/search/_full_community.html.erb
1 | <% software = community.software_info %> | 1 | <% software = community.software_info %> |
2 | <li class="search-software-item"> | 2 | <li class="search-software-item"> |
3 | - <% organization_average_rating = '' %> | ||
4 | - <% unless community.organization_ratings.empty?%> | ||
5 | - <% organization_average_rating = render :partial => 'shared/organization_average_rating_block', :locals => {:community => community}%> | ||
6 | - <% end %> | ||
7 | - | ||
8 | - <% software_publish_date = render :partial => 'shared/software_publish_date', :locals => {:community => community, :order => @order} %> | ||
9 | - | ||
10 | <div class="search-software-item-column-left"> | 3 | <div class="search-software-item-column-left"> |
11 | - <%= profile_image_link community, :portrait, 'div', organization_average_rating + software_publish_date %> | 4 | + <div class="vcard"> |
5 | + <% unless community.organization_ratings.empty?%> | ||
6 | + <%= render :partial => 'shared/organization_average_rating_block', :locals => {:community => community}%> | ||
7 | + <% end %> | ||
8 | + | ||
9 | + <%=render :partial => 'shared/software_publish_date', :locals => {:community => community, :order => @order} %> | ||
10 | + </div> | ||
12 | </div> | 11 | </div> |
13 | 12 | ||
14 | <div class="search-software-item-column-right"> | 13 | <div class="search-software-item-column-right"> |
14 | + <div class="search-software-profile-img"> | ||
15 | + <%= link_to_homepage(profile_image(community, :portrait), community.identifier) %> | ||
16 | + </div> | ||
15 | 17 | ||
16 | <div class="search-software-content-block"> | 18 | <div class="search-software-content-block"> |
17 | - <span> | ||
18 | <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %> | 19 | <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %> |
19 | <h4> | 20 | <h4> |
20 | <%= link_to_homepage(link_name, community.identifier) %> | 21 | <%= link_to_homepage(link_name, community.identifier) %> |
21 | </h4> | 22 | </h4> |
22 | - </span> | ||
23 | - <span class="search-content-result"> | ||
24 | - <% body_stripped = strip_tags(software.finality) %> | ||
25 | - <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %> | ||
26 | - </span> | ||
27 | - </div> | ||
28 | 23 | ||
29 | - <br /> | 24 | + <div class="search-content-description"> |
25 | + <% body_stripped = strip_tags(software.finality) %> | ||
26 | + <%= link_to_homepage(excerpt(body_stripped, body_stripped.first(3), 200), community.identifier) if body_stripped %> | ||
27 | + </div> | ||
30 | 28 | ||
31 | - <div class="search-software-content-block"> | ||
32 | - <span> | ||
33 | - <b> | ||
34 | - <%= _("Software Categories") %>: | ||
35 | - </b> | ||
36 | - </span> | ||
37 | - | ||
38 | - <% if !community.categories.empty? %> | ||
39 | - <ul id="categories-list"> | ||
40 | - <% community.categories.each do |category| %> | ||
41 | - <li> | ||
42 | - <%= link_to _("#{category.name}"), { | ||
43 | - :controller => :search, | ||
44 | - :action => :software_infos, | ||
45 | - :selected_categories_id => [category.id], | ||
46 | - :software_type => params[:software_type] | ||
47 | - } %> | ||
48 | - </li> | ||
49 | - <% end %> | ||
50 | - </ul> | ||
51 | - <% else %> | 29 | + <div class="search-software-categories"> |
52 | <span> | 30 | <span> |
53 | - <%= _("This software doesn't have categories") %> | 31 | + <%= _("Software Categories") %>: |
54 | </span> | 32 | </span> |
55 | - <% end %> | ||
56 | - </div> | 33 | + |
34 | + <% if !community.categories.empty? %> | ||
35 | + <ul id="categories-list"> | ||
36 | + <% community.categories.each do |category| %> | ||
37 | + <li> | ||
38 | + <%= link_to _("#{category.name}"), { | ||
39 | + :controller => :search, | ||
40 | + :action => :software_infos, | ||
41 | + :selected_categories_id => [category.id], | ||
42 | + :software_type => params[:software_type] | ||
43 | + } %> | ||
44 | + </li> | ||
45 | + <% end %> | ||
46 | + </ul> | ||
47 | + <% else %> | ||
48 | + <span> | ||
49 | + <%= _("This software doesn't have categories") %> | ||
50 | + </span> | ||
51 | + <% end %> | ||
52 | + </div> | ||
53 | + </div><!-- /.content-block --> | ||
57 | </div> | 54 | </div> |
58 | 55 | ||
59 | <hr class="clearfix" /> | 56 | <hr class="clearfix" /> |
src/noosfero-spb/software_communities/views/search/_software_search_form.html.erb
@@ -52,7 +52,7 @@ | @@ -52,7 +52,7 @@ | ||
52 | [_("Name A-Z"), 'asc'], | 52 | [_("Name A-Z"), 'asc'], |
53 | [_("Name Z-A"), 'desc'], | 53 | [_("Name Z-A"), 'desc'], |
54 | [_("Relevance"), 'relevance'], | 54 | [_("Relevance"), 'relevance'], |
55 | - [_("Favorites"), 'rating'] | 55 | + [_("Rating"), 'rating'] |
56 | ], :selected=>params[:sort]) | 56 | ], :selected=>params[:sort]) |
57 | ) %> | 57 | ) %> |
58 | </div> | 58 | </div> |