pagecontent/app/views/admin/page_contents/wiki_parent.html.erb

35 lines
1.7 KiB
Plaintext

<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>