Commit 49381d9f8c6e77f98d902ad1975669ae5430dcaf

Authored by Fabio Teixeira
1 parent dbedeb9f

View of software catalog as display full

Signed-off-by: David Carlos <ddavidcarlos1392@gmail.com>
Signed-off-by: Fabio Teixeira <fabio1079@gmail.com>
Signed-off-by: Parley Martins <parley@outlook.com>
lib/software_info.rb
1 class SoftwareInfo < ActiveRecord::Base 1 class SoftwareInfo < ActiveRecord::Base
2 SEARCH_FILTERS = [] 2 SEARCH_FILTERS = []
  3 + SEARCH_DISPLAYS = %w[full]
  4 +
  5 + def self.default_search_display
  6 + 'full'
  7 + end
3 8
4 attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform 9 attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform
5 attr_accessible :demonstration_url, :acronym, :objectives, :features, :license_info 10 attr_accessible :demonstration_url, :acronym, :objectives, :features, :license_info
@@ -50,10 +55,6 @@ class SoftwareInfo &lt; ActiveRecord::Base @@ -50,10 +55,6 @@ class SoftwareInfo &lt; ActiveRecord::Base
50 } 55 }
51 } 56 }
52 57
53 - def self.default_search_display  
54 - 'compact'  
55 - end  
56 -  
57 def validate_name_lenght 58 def validate_name_lenght
58 if self.community.name.size > 100 59 if self.community.name.size > 100
59 self.errors.add(:base, _("Name is too long (maximum is %{count} characters)")) 60 self.errors.add(:base, _("Name is too long (maximum is %{count} characters)"))
lib/softwares_block.rb
@@ -31,7 +31,7 @@ class SoftwaresBlock &lt; CommunitiesBlock @@ -31,7 +31,7 @@ class SoftwaresBlock &lt; CommunitiesBlock
31 end 31 end
32 when Environment 32 when Environment
33 lambda do |context| 33 lambda do |context|
34 - link_to s_('softwares|View all'), :controller => 'search', :action => 'communities', :type => 'Software' 34 + link_to s_('softwares|View all'), :controller => 'search', :action => 'software_infos'
35 end 35 end
36 else 36 else
37 '' 37 ''
public/style.css
@@ -197,4 +197,36 @@ @@ -197,4 +197,36 @@
197 197
198 .improve_input_size { 198 .improve_input_size {
199 width: 315px !important; 199 width: 315px !important;
  200 +}
  201 +
  202 +.search-community-content-block span {
  203 + width: auto;
  204 +}
  205 +
  206 +#catalog-list ul li {
  207 + display: inline;
  208 + margin-right: 5px;
  209 + font-size: 14px;
  210 + padding: 5px;
  211 + }
  212 +
  213 +#catalog-list ul li span {
  214 + cursor: pointer;
  215 + margin-left: 5px;
  216 +}
  217 +
  218 +.catalog-remove-item {
  219 + padding: 3px;
  220 + border: solid 1px #999;
  221 + border-radius: 3px;
  222 +}
  223 +
  224 +.category_box {
  225 + font-size: 11px;
  226 + border:1px solid #e9e8ed;
  227 + border-radius:8px;
  228 + background-color:#e9e8ed;
  229 + padding:3px 6px;
  230 + margin:10px 3px;
  231 + color: blue;
200 } 232 }
201 \ No newline at end of file 233 \ No newline at end of file
views/search/_catalog_filter.html.erb
1 -<!-- Remove CSS when design team send corrections -->  
2 -<style type="text/css">  
3 - #catalog-list ul li {  
4 - display: inline;  
5 - margin-right: 5px;  
6 - font-size: 14px;  
7 - padding: 5px;  
8 - }  
9 -  
10 - #catalog-list ul li span {  
11 - display: none;  
12 - cursor: pointer;  
13 - }  
14 -  
15 - #catalog-list ul li:hover span {  
16 - display: inline-block;  
17 - }  
18 -  
19 - .catalog-remove-item {  
20 - padding: 3px;  
21 - border: solid 1px #999;  
22 - border-radius: 3px;  
23 - background: #d4d4d4;  
24 - }  
25 -  
26 - .category_box {  
27 - font-size: 11px !important;  
28 - border:1px solid #e9e8ed;  
29 - border-radius:8px;  
30 - background-color:#e9e8ed;  
31 - padding:3px 6px;  
32 - margin:10px 3px;  
33 - color: blue;  
34 - }  
35 -</style>  
36 -  
37 <div> 1 <div>
38 <div id="catalog-list"> 2 <div id="catalog-list">
39 <ul> 3 <ul>
@@ -46,6 +10,7 @@ @@ -46,6 +10,7 @@
46 </div> 10 </div>
47 11
48 <div id="catalog-filter"> 12 <div id="catalog-filter">
49 - <%= text_field(:software, :catalog, :id=>"software-catalog") %> 13 + <span><%= _("Categories filter") %>:</span>
  14 + <%= text_field(:software, :catalog, :id=>"software-catalog", :placeholder=>_("Type a category name here")) %>
50 </div> 15 </div>
51 </div> 16 </div>
52 \ No newline at end of file 17 \ No newline at end of file
views/search/_full_community.html.erb 0 → 100644
@@ -0,0 +1,57 @@ @@ -0,0 +1,57 @@
  1 +<% software = community.software_info %>
  2 +<li class="search-profile-item">
  3 + <div class="search-enterprise-item">
  4 + <div class="search-enterprise-item-column-left">
  5 + <%= profile_image_link community, :portrait, 'div', community.send(@filter + '_label') + show_date(community.created_at) %>
  6 + </div>
  7 +
  8 + <div class="search-enterprise-item-column-right">
  9 +
  10 + <div class="search-community-content-block">
  11 + <span>
  12 + <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %>
  13 + <%= link_to_homepage(link_name, community.identifier, :class => "search-result-title") %>
  14 + </span>
  15 +
  16 + <p>
  17 + <% body_stripped = strip_tags(software.finality) %>
  18 + <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %>
  19 + </p>
  20 + </div>
  21 +
  22 + <div class="search-community-content-block">
  23 + <span>
  24 + <%= _("Software licence") %>:
  25 + <%= link_to(software.license_info.version, software.license_info.link, :target=>"blank", :class => "search-result-title") %>
  26 + </span>
  27 + </div>
  28 +
  29 + <div class="search-community-content-block">
  30 + <span>
  31 + <%= _("Link software repository") %>:
  32 + <%= link_to(software.repository_link, software.repository_link, :target=>"blank", :class => "search-result-title") %>
  33 + </span>
  34 + </div>
  35 +
  36 + <div class="search-community-content-block">
  37 + <span>
  38 + <%= _("Software Categories") %>
  39 + </span>
  40 +
  41 + <% if not community.categories.empty? %>
  42 + <ul>
  43 + <% community.categories.each do |category| %>
  44 + <li> <%= category.name %> </li>
  45 + <% end %>
  46 + </ul>
  47 + <% else %>
  48 + <p>
  49 + <span><%= _("This software doesn't has categories") %></span>
  50 + </p>
  51 + <% end %>
  52 + </div>
  53 + </div>
  54 +
  55 + <hr class="clearfix" />
  56 + </div>
  57 +</li>