Project

General

Profile

Patch #17924 » 0001-Structure-the-document-list.patch

Mizuki ISHIKAWA, 2021-08-17 02:33

View differences:

app/views/documents/_document.html.erb
<h4><%= link_to document.title, document_path(document) %></h4>
<p><em><%= format_time(document.updated_on) %></em></p>
<div class="document-item document-<%= document.id %>">
<h4 class="title"><%= link_to document.title, document_path(document) %></h4>
<div class="updated-on"><em><%= format_time(document.updated_on) %></em></div>
<div class="wiki">
<%= textilizable(truncate_lines(document.description), :object => document) %>
</div>
<div class="wiki description">
<%= textilizable(truncate_lines(document.description), :object => document) %>
</div>
</div>
app/views/documents/index.html.erb
<h2><%=l(:label_document_plural)%></h2>
<div id="document-list">
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
<% @grouped.keys.sort.__send__(@sort_by == 'date' ? :reverse_each : :each) do |group| %>
<h3><%= group %></h3>
<div class="document-group document-group-<%= group.to_s.parameterize %>">
<h3 class="group-name"><%= group %></h3>
<%= render :partial => 'documents/document', :collection => @grouped[group] %>
</div>
<% end %>
</div>
<% content_for :sidebar do %>
<h3><%= l(:label_sort_by, '') %></h3>
app/views/my/blocks/_documents.html.erb
<h3><%=l(:label_document_plural)%></h3>
<%= render :partial => 'documents/document', :collection => documents %>
<div id="document-list">
<%= render :partial => 'documents/document', :collection => documents %>
</div>
(2-2/7)