add wiki parent page view

This commit is contained in:
EricTYL 2019-11-28 16:45:46 +08:00
parent 347000d139
commit e20ea408dc
1 changed files with 34 additions and 0 deletions

View File

@ -0,0 +1,34 @@
<table class="table table-striped table-hover main-list">
<thead>
<tr class="sort-header">
<% @table_fields.each do |f| %>
<%= thead(f) %>
<% end %>
</tr>
</thead>
<tbody>
<tr>
<td><%= @wiki_parent_page.page_id%></td>
<td>
<a href="/<%= I18n.locale %><%= @wiki_parent_page.url %>" target="_blank"><%= @wiki_parent_page.name %></a>
<div class="quick-edit">
<ul class="nav nav-pills">
<% if can_edit_or_delete?(@wiki_parent_page) %>
<li><a href="/admin/page_contents/new?page_id=<%= @wiki_parent_page.id.to_s %>"><%= t(:edit) %></a></li>
<li><a href="/admin/wiki_pages/?page_id=<%= @wiki_parent_page.id.to_s %>"><%= t("page_content.wiki") %></a></li>
<% end %>
</ul>
</div>
</td>
<td><a href="/admin/page_contents/<%= @wiki_parent_page.id.to_s %>/view" ><%= @wiki_parent_page.page_contexts.last.version rescue nil %></a></td>
<td><%= format_value @wiki_parent_page.page_contexts.last.updated_at rescue nil %></td>
<td><%= User.find(@wiki_parent_page.page_contexts.last.update_user_id).user_name rescue nil %></td>
<td>
<% if can_edit_or_delete?(@wiki_parent_page) %>
<%= select_tag("category_id",options_for_select(@categories, (@wiki_parent_page.category_id.to_s rescue "")), prompt: t("select_category"), class: "category_select", style: "margin-bottom:0; width:150px;") %>
<button <%= !@wiki_parent_page.category_id.nil? ? "data-page-category-id=#{@wiki_parent_page.category_id.to_s}" : "" %> data-page-id="<%= @wiki_parent_page.id.to_s %>" class="btn btn-primary save_category hide">Save</button>
<% end %>
</td>
</tr>
</tbody>
</table>