add view_count
This commit is contained in:
parent
06fd820095
commit
180c91e81a
|
@ -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? %>
|
||||
|
|
|
@ -2,6 +2,7 @@ en:
|
|||
|
||||
page_content:
|
||||
page: Page content
|
||||
view_count: View count
|
||||
save: Save
|
||||
all: All
|
||||
create_page_content_success: Page content was successfully created
|
||||
|
|
|
@ -2,6 +2,7 @@ zh_tw:
|
|||
|
||||
page_content:
|
||||
context: 內文
|
||||
view_count: 瀏覽人次
|
||||
create_page_content_success: 建立頁面內容成功
|
||||
editing_page_content: 編輯頁面內容
|
||||
all: All
|
||||
|
|
Loading…
Reference in New Issue