diff --git a/app/controllers/public/profile_search_controller.rb b/app/controllers/public/profile_search_controller.rb index a960fa3..4bf9075 100644 --- a/app/controllers/public/profile_search_controller.rb +++ b/app/controllers/public/profile_search_controller.rb @@ -6,12 +6,14 @@ class ProfileSearchController < PublicController before_filter :check_access_to_profile def index - @q = params[:q].blank? ? '' : params[:q] - @filtered_query = remove_stop_words(@q) - if params[:where] == 'environment' - redirect_to :controller => 'search', :query => @q - else - @results = profile.articles.published.find_by_contents(@filtered_query).paginate(:per_page => 10, :page => params[:page]) + @q = params[:q] + unless @q.blank? + @filtered_query = remove_stop_words(@q) + if params[:where] == 'environment' + redirect_to :controller => 'search', :query => @q + else + @results = profile.articles.published.find_by_contents(@filtered_query).paginate(:per_page => 10, :page => params[:page]) + end end end diff --git a/app/views/profile_search/_article.rhtml b/app/views/profile_search/_article.rhtml index 45fea5c..8f46328 100644 --- a/app/views/profile_search/_article.rhtml +++ b/app/views/profile_search/_article.rhtml @@ -1,5 +1,5 @@ -
  • - <%= link_to article.title, article.view_url, :class => 'result-title ' + icon_for_article(article) %> +
  • + <%= link_to article.title, article.view_url, :class => 'result-title' %>

    <%= link_to article.short_lead, article.url, {:class => 'article-details'} %>

    <%= link_to url_for(article.url), article.url, :class => 'article-url' %>
  • diff --git a/app/views/profile_search/_folder.rhtml b/app/views/profile_search/_folder.rhtml index c9bfd26..03f1395 100644 --- a/app/views/profile_search/_folder.rhtml +++ b/app/views/profile_search/_folder.rhtml @@ -1,5 +1,5 @@ -
  • - <%= link_to article.title, article.view_url, :class => 'result-title ' + icon_for_article(article) %> +
  • + <%= link_to article.title, article.view_url, :class => 'result-title' %>

    <%= link_to article.body.to_s, article.url, {:class => 'article-details'} %>

    <%= link_to url_for(article.url), article.url, :class => 'article-url' %>
  • diff --git a/app/views/profile_search/_uploaded_file.rhtml b/app/views/profile_search/_uploaded_file.rhtml index 9e7ae4b..b0cb1d6 100644 --- a/app/views/profile_search/_uploaded_file.rhtml +++ b/app/views/profile_search/_uploaded_file.rhtml @@ -1,10 +1,10 @@ <% if article.image? %>
  • - <%= link_to image_tag(article.public_filename(:thumb), :alt => article.display_title), article.view_url, :class => 'article-details' %> + <%= link_to image_tag(article.public_filename(:thumb), :alt => article.abstract, :title => article.abstract), article.view_url, :class => 'article-details' %>
  • <% else %> -
  • - <%= link_to article.title, article.view_url, :class => 'result-title ' + icon_for_article(article) %> +
  • + <%= link_to article.title, article.view_url, :class => 'result-title' %>

    <%= link_to article.title, article.short_lead, :class => 'article-details' %>

    <%= link_to url_for(article.url), article.url, :class => 'article-url' %>
  • diff --git a/app/views/profile_search/index.rhtml b/app/views/profile_search/index.rhtml index 84ac4fa..4d50023 100644 --- a/app/views/profile_search/index.rhtml +++ b/app/views/profile_search/index.rhtml @@ -1,18 +1,19 @@
    -

    <%= _("Search results on %s's profile") % profile.short_name %>

    +

    <%= _("Search on %s's profile") % profile.short_name %>

    <%= render :partial => 'shared/profile_search_form' %> -
    - <%= _("%s results found") % @results.total_entries %> -
    + <% if @results %> +
    + <%= _("%s results found") % @results.total_entries %> +
    - - - <%= pagination_links @results %> + + <%= pagination_links @results %> + <% end %>
    diff --git a/public/stylesheets/application.css b/public/stylesheets/application.css index 1b17688..5c3f508 100644 --- a/public/stylesheets/application.css +++ b/public/stylesheets/application.css @@ -4396,6 +4396,7 @@ h1#agenda-title { #profile-search-results ul { padding-left: 0px; + margin-left: 0px; } #profile-search-results form .formfield input { @@ -4415,9 +4416,8 @@ h1#agenda-title { #profile-search-results li.result-image { float: left; clear: none; - height: 150px; - margin-right: 10px; - margin-left: 10px; + height: 130px; + margin-right: 20px; } #profile-search-results .result-title { @@ -4445,7 +4445,7 @@ h1#agenda-title { #profile-search-results .results-list .icon { background-repeat: no-repeat; - background-position: left; + background-position: left 5px; padding: 0px 0px 3px 20px; border: none; } -- libgit2 0.21.2