Commit bcf3cab2f7a1b2c35969cc2859ad1dd5d705db05
1 parent
2add0a3c
Exists in
elasticsearch_sort
Fixed text_articles and upload_files extensions
Signed-off-by: DylanGuedes <djmgguedes@gmail.com> Signed-off-by: Macartur Sousa <macartur.sc@gmail.com>
Showing
4 changed files
with
8 additions
and
2 deletions
Show diff stats
plugins/elasticsearch/lib/elasticsearch_indexed_model.rb
... | ... | @@ -2,6 +2,8 @@ module ElasticsearchIndexedModel |
2 | 2 | |
3 | 3 | def self.included base |
4 | 4 | base.send :include, Elasticsearch::Model |
5 | + base.send :include, Elasticsearch::Model::Callbacks | |
6 | + | |
5 | 7 | base.send :index_name, "#{Rails.env}_#{base.index_name}" |
6 | 8 | base.extend ClassMethods |
7 | 9 | base.class_eval do | ... | ... |
plugins/elasticsearch/lib/ext/text_article.rb
plugins/elasticsearch/views/elasticsearch_plugin/_text_article_display.html.erb
1 | 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> | |
2 | + <%= text_article.created_at.strftime("%d %B %Y at %H:%M") %> - <%= "#{text_article.author.name} -" if text_article.author %> <span class="model-label"><%= _("Article") %></span> | |
3 | 3 | </div> |
4 | 4 | <div class="body"> |
5 | 5 | <h2><%= link_to text_article.name, text_article.url %></h2> | ... | ... |
plugins/elasticsearch/views/elasticsearch_plugin/_uploaded_file_display.html.erb
1 | 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> | |
2 | + <%= uploaded_file.created_at.strftime("%d %B %Y at %H:%M") %> - <%= "#{uploaded_file.author.name} -" if uploaded_file.author %><span class="model-label"><%= _("Files") %></span> | |
3 | 3 | </div> |
4 | 4 | <div class="body"> |
5 | 5 | <h2><%= link_to uploaded_file.name, uploaded_file.url %></h2> | ... | ... |