Commit 388eb5859a132e50c7db331e4d15359867b88209

Authored by Macartur Sousa
1 parent b101aa2a

Elasticsearch: Adding views

Adding views to uploaded_files and text_articles

Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
plugins/elasticsearch/helpers/elasticsearch_helper.rb
... ... @@ -2,10 +2,12 @@ module ElasticsearchHelper
2 2  
3 3 def self.searchable_types
4 4 {
5   - :all => { label: _("All Results")},
6   - :community => { label: _("Communities")},
7   - :event => { label: _("Events")},
8   - :person => { label: _("People")}
  5 + :all => { label: _("All Results")},
  6 + :text_article => { label: _("Articles")},
  7 + :uploaded_file => { label: _("Files")},
  8 + :community => { label: _("Communities")},
  9 + :event => { label: _("Events")},
  10 + :person => { label: _("People")}
9 11 }
10 12 end
11 13  
... ...
plugins/elasticsearch/views/elasticsearch_plugin/_text_article_display.html.erb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +<div class="text_article-header">
  2 + <%= text_article.created_at.strftime("%d %B %Y at %H:%M") %> - <%= text_article.setting[:author_name] %> - <span class="model-label"><%= _("Community") %></span>
  3 +</div>
  4 +<div class="body">
  5 + <h2><%= link_to text_article.name, text_article.url %></h2>
  6 + <p> <strong> <%= _("Abstract") %></strong>:<%= text_article.abstract %></p>
  7 +</div>
... ...
plugins/elasticsearch/views/elasticsearch_plugin/_uploaded_file_display.html.erb 0 → 100644
... ... @@ -0,0 +1,7 @@
  1 +<div class="uploaded_file-header">
  2 + <%= uploaded_file.created_at.strftime("%d %B %Y at %H:%M") %> - <%=uploaded_file.setting[:author_name]%> - <span class="model-label"><%= _("Files") %></span>
  3 +</div>
  4 +<div class="body">
  5 + <h2><%= link_to uploaded_file.name, uploaded_file.url %></h2>
  6 + <p> <strong><%= _("Type of file")%> </strong>: <%= uploaded_file.content_type %> </p>
  7 +</div>
... ...