-<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>
\ No newline at end of file
<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-<%= @sort_by %>">
+ <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>
<h3><%=l(:label_document_plural)%></h3>
-<%= render :partial => 'documents/document', :collection => documents %>
+<div id="document-list">
+ <%= render :partial => 'documents/document', :collection => documents %>
+</div>
\ No newline at end of file
assert_select '#content' do
# ascending order of DocumentCategory#id.
['Uncategorized', 'Technical documentation'].each_with_index do |text, idx|
- assert_select "h3:nth-of-type(#{idx + 1})", :text => text
+ assert_select ".document-group:nth-of-type(#{idx + 1}) h3.group-name", :text => text
end
end
end
assert_select '#content' do
# descending order of date.
['2007-03-05', '2007-02-12'].each_with_index do |text, idx|
- assert_select "h3:nth-of-type(#{idx + 1})", :text => text
+ assert_select ".document-group:nth-of-type(#{idx + 1}) h3.group-name", :text => text
end
end
end
assert_select '#content' do
# ascending order of title.
['A', 'T'].each_with_index do |text, idx|
- assert_select "h3:nth-of-type(#{idx + 1})", :text => text
+ assert_select ".document-group:nth-of-type(#{idx + 1}) h3.group-name", :text => text
end
end
end
assert_select '#content' do
# ascending order of author.
['John Smith', 'Redmine Admin'].each_with_index do |text, idx|
- assert_select "h3:nth-of-type(#{idx + 1})", :text => text
+ assert_select ".document-group:nth-of-type(#{idx + 1}) h3.group-name", :text => text
end
end
end