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 1 class SoftwareInfo < ActiveRecord::Base
2 2 SEARCH_FILTERS = []
  3 + SEARCH_DISPLAYS = %w[full]
  4 +
  5 + def self.default_search_display
  6 + 'full'
  7 + end
3 8  
4 9 attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform
5 10 attr_accessible :demonstration_url, :acronym, :objectives, :features, :license_info
... ... @@ -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 58 def validate_name_lenght
58 59 if self.community.name.size > 100
59 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 31 end
32 32 when Environment
33 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 35 end
36 36 else
37 37 ''
... ...
public/style.css
... ... @@ -197,4 +197,36 @@
197 197  
198 198 .improve_input_size {
199 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 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 1 <div>
38 2 <div id="catalog-list">
39 3 <ul>
... ... @@ -46,6 +10,7 @@
46 10 </div>
47 11  
48 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 15 </div>
51 16 </div>
52 17 \ No newline at end of file
... ...
views/search/_full_community.html.erb 0 → 100644
... ... @@ -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>
... ...