From 49381d9f8c6e77f98d902ad1975669ae5430dcaf Mon Sep 17 00:00:00 2001 From: Fabio Teixeira Date: Thu, 4 Dec 2014 11:15:30 -0200 Subject: [PATCH] View of software catalog as display full --- lib/software_info.rb | 9 +++++---- lib/softwares_block.rb | 2 +- public/style.css | 32 ++++++++++++++++++++++++++++++++ views/search/_catalog_filter.html.erb | 39 ++------------------------------------- views/search/_full_community.html.erb | 57 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 97 insertions(+), 42 deletions(-) create mode 100644 views/search/_full_community.html.erb diff --git a/lib/software_info.rb b/lib/software_info.rb index 4a2cc61..069a185 100644 --- a/lib/software_info.rb +++ b/lib/software_info.rb @@ -1,5 +1,10 @@ class SoftwareInfo < ActiveRecord::Base SEARCH_FILTERS = [] + SEARCH_DISPLAYS = %w[full] + + def self.default_search_display + 'full' + end attr_accessible :e_mag, :icp_brasil, :intern, :e_ping, :e_arq, :operating_platform attr_accessible :demonstration_url, :acronym, :objectives, :features, :license_info @@ -50,10 +55,6 @@ class SoftwareInfo < ActiveRecord::Base } } - def self.default_search_display - 'compact' - end - def validate_name_lenght if self.community.name.size > 100 self.errors.add(:base, _("Name is too long (maximum is %{count} characters)")) diff --git a/lib/softwares_block.rb b/lib/softwares_block.rb index 0f37f8e..9cfc29e 100644 --- a/lib/softwares_block.rb +++ b/lib/softwares_block.rb @@ -31,7 +31,7 @@ class SoftwaresBlock < CommunitiesBlock end when Environment lambda do |context| - link_to s_('softwares|View all'), :controller => 'search', :action => 'communities', :type => 'Software' + link_to s_('softwares|View all'), :controller => 'search', :action => 'software_infos' end else '' diff --git a/public/style.css b/public/style.css index f86144c..eefc29a 100644 --- a/public/style.css +++ b/public/style.css @@ -197,4 +197,36 @@ .improve_input_size { width: 315px !important; +} + +.search-community-content-block span { + width: auto; +} + +#catalog-list ul li { + display: inline; + margin-right: 5px; + font-size: 14px; + padding: 5px; + } + +#catalog-list ul li span { + cursor: pointer; + margin-left: 5px; +} + +.catalog-remove-item { + padding: 3px; + border: solid 1px #999; + border-radius: 3px; +} + +.category_box { + font-size: 11px; + border:1px solid #e9e8ed; + border-radius:8px; + background-color:#e9e8ed; + padding:3px 6px; + margin:10px 3px; + color: blue; } \ No newline at end of file diff --git a/views/search/_catalog_filter.html.erb b/views/search/_catalog_filter.html.erb index 3ab9c52..4a7e6fe 100644 --- a/views/search/_catalog_filter.html.erb +++ b/views/search/_catalog_filter.html.erb @@ -1,39 +1,3 @@ - - -
    @@ -46,6 +10,7 @@
- <%= text_field(:software, :catalog, :id=>"software-catalog") %> + <%= _("Categories filter") %>: + <%= text_field(:software, :catalog, :id=>"software-catalog", :placeholder=>_("Type a category name here")) %>
\ No newline at end of file diff --git a/views/search/_full_community.html.erb b/views/search/_full_community.html.erb new file mode 100644 index 0000000..57a8fa4 --- /dev/null +++ b/views/search/_full_community.html.erb @@ -0,0 +1,57 @@ +<% software = community.software_info %> +
  • +
    +
    + <%= profile_image_link community, :portrait, 'div', community.send(@filter + '_label') + show_date(community.created_at) %> +
    + +
    + +
    + + <% link_name = software.acronym.blank? ? community.name : "#{software.acronym} - #{community.name}" %> + <%= link_to_homepage(link_name, community.identifier, :class => "search-result-title") %> + + +

    + <% body_stripped = strip_tags(software.finality) %> + <%= excerpt(body_stripped, body_stripped.first(3), 200) if body_stripped %> +

    +
    + +
    + + <%= _("Software licence") %>: + <%= link_to(software.license_info.version, software.license_info.link, :target=>"blank", :class => "search-result-title") %> + +
    + +
    + + <%= _("Link software repository") %>: + <%= link_to(software.repository_link, software.repository_link, :target=>"blank", :class => "search-result-title") %> + +
    + +
    + + <%= _("Software Categories") %> + + + <% if not community.categories.empty? %> +
      + <% community.categories.each do |category| %> +
    • <%= category.name %>
    • + <% end %> +
    + <% else %> +

    + <%= _("This software doesn't has categories") %> +

    + <% end %> +
    +
    + +
    +
    +
  • -- libgit2 0.21.2