0001-Structure-the-document-list.patch

Mizuki ISHIKAWA, 2021-08-17 02:33

Download (2.52 KB)

View differences:

app/views/documents/_document.html.erb
1
<h4><%= link_to document.title, document_path(document) %></h4>
2
<p><em><%= format_time(document.updated_on) %></em></p>
1
<div class="document-item document-<%= document.id %>">
2
  <h4 class="title"><%= link_to document.title, document_path(document) %></h4>
3
  <div class="updated-on"><em><%= format_time(document.updated_on) %></em></div>
3 4

  
4
<div class="wiki">
5
  <%= textilizable(truncate_lines(document.description), :object => document) %>
6
</div>
5
  <div class="wiki description">
6
    <%= textilizable(truncate_lines(document.description), :object => document) %>
7
  </div>
8
</div>
app/views/documents/index.html.erb
16 16

  
17 17
<h2><%=l(:label_document_plural)%></h2>
18 18

  
19
<div id="document-list">
19 20
<% if @grouped.empty? %><p class="nodata"><%= l(:label_no_data) %></p><% end %>
20 21

  
21 22
<% @grouped.keys.sort.__send__(@sort_by == 'date' ? :reverse_each : :each) do |group| %>
22
    <h3><%= group %></h3>
23
  <div class="document-group document-group-<%= group.to_s.parameterize %>">
24
    <h3 class="group-name"><%= group %></h3>
23 25
    <%= render :partial => 'documents/document', :collection => @grouped[group] %>
26
  </div>
24 27
<% end %>
28
</div>
25 29

  
26 30
<% content_for :sidebar do %>
27 31
  <h3><%= l(:label_sort_by, '') %></h3>
app/views/my/blocks/_documents.html.erb
1 1
<h3><%=l(:label_document_plural)%></h3>
2 2

  
3
<%= render :partial => 'documents/document', :collection => documents %>
3
<div id="document-list">
4
  <%= render :partial => 'documents/document', :collection => documents %>
5
</div>
4
-