add view_count
This commit is contained in:
1 parent
06fd820095
commit
180c91e81a
4 files changed
+10
No files matched your search
@@ -5,6 +5,8 @@ class PageContentsController < OrbitAdminController
|
||||
url_to_edit = OrbitHelper.user_can_edit?(page) ? "/admin/page_contents/new?page_id=#{page.id.to_s}" : ""
|
||||
{
|
||||
"html" => (page.page_contexts.last.content rescue ""),
|
||||
"view_count" => (page.page_contexts.last.view_count rescue ""),
|
||||
"view-count-head" =>t('page_content.view_count'),
|
||||
"url_to_edit" => url_to_edit
|
||||
}
|
||||
end
|
||||
|
||||
@@ -1,4 +1,10 @@
|
||||
<% data = action_data %>
|
||||
|
||||
<div class="view_count pull-right">
|
||||
<i class="fa fa-eye"><%= data["view-count-head"] %>:</i>
|
||||
<span class="view-count"><%= data["view_count"] %></span>
|
||||
</div>
|
||||
|
||||
<%= data["html"].html_safe %>
|
||||
|
||||
<% if !data["url_to_edit"].blank? %>
|
||||
|
||||
Reference in new issue
Block a user