pull/6827/head
Oliver Günther 9 years ago
parent c70240503b
commit 41b9b49ada
  1. 14
      app/views/documents/show.html.erb
  2. 23
      spec/controllers/documents_controller_spec.rb

@ -35,14 +35,14 @@ See doc/COPYRIGHT.rdoc for more details.
subtitle: "#{@document.category.name} - #{format_date @document.created_on}" do %> subtitle: "#{@document.category.name} - #{format_date @document.created_on}" do %>
<% if authorize_for(:documents, :edit) %> <% if authorize_for(:documents, :edit) %>
<li class="toolbar-item"> <li class="toolbar-item">
<%= link_to({:controller => '/documents', :action => 'edit', :id => @document}, class: 'button', accesskey: accesskey(:edit)) do %> <%= link_to({controller: '/documents', action: 'edit', id: @document}, class: 'button', accesskey: accesskey(:edit)) do %>
<i class="button--icon icon-edit"></i> <%= l(:button_edit) %> <i class="button--icon icon-edit"></i> <%= l(:button_edit) %>
<% end %> <% end %>
</li> </li>
<% end %> <% end %>
<% if authorize_for(:documents, :destroy) %> <% if authorize_for(:documents, :destroy) %>
<li class="toolbar-item"> <li class="toolbar-item">
<%= link_to({:controller => '/documents', :action => 'destroy', :id => @document}, class: 'button', data: { :confirm => l(:text_are_you_sure) }, :method => :delete) do %> <%= link_to({controller: '/documents', action: 'destroy', id: @document}, class: 'button', data: { confirm: l(:text_are_you_sure) }, method: :delete) do %>
<i class="button--icon icon-delete"></i> <%= l(:button_delete) %> <i class="button--icon icon-delete"></i> <%= l(:button_delete) %>
<% end %> <% end %>
</li> </li>
@ -50,18 +50,18 @@ See doc/COPYRIGHT.rdoc for more details.
<% end %> <% end %>
<div class="wiki"> <div class="wiki">
<%= textilizable @document.description, :attachments => @document.attachments %> <%= format_text @document.description, attachments: @document.attachments %>
</div> </div>
<h3><%= l(:label_attachment_plural) %></h3> <h3><%= l(:label_attachment_plural) %></h3>
<%= link_to_attachments @document %> <%= link_to_attachments @document %>
<% if authorize_for('documents', 'add_attachment') %> <% if authorize_for('documents', 'add_attachment') %>
<p><%= link_to l(:label_attachment_new), {}, :onclick => "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;", <p><%= link_to l(:label_attachment_new), {}, onclick: "Element.show('add_attachment_form'); Element.hide(this); Element.scrollTo('add_attachment_form'); return false;",
:id => 'attach_files_link' %></p> id: 'attach_files_link' %></p>
<%= form_tag(add_attachment_document_path(@document), method: :post, multipart: true, :id => "add_attachment_form", :style => "display:none;") do %> <%= form_tag(add_attachment_document_path(@document), method: :post, multipart: true, id: "add_attachment_form", style: "display:none;") do %>
<div class="box"> <div class="box">
<p><%= render :partial => 'attachments/form' %></p> <p><%= render partial: 'attachments/form' %></p>
</div> </div>
<%= styled_button_tag l(:button_add), class: "-highlight -with-icon icon-checkmark" %> <%= styled_button_tag l(:button_add), class: "-highlight -with-icon icon-checkmark" %>

@ -53,14 +53,25 @@ describe DocumentsController do
end end
describe "index" do describe "index" do
let(:long_description) {
<<-LOREM.strip_heredoc
Lorem ipsum dolor sit amet, consectetur adipiscing elit.\
Ut egestas, mi vehicula varius varius, ipsum massa fermentum orci,\
eget tristique ante sem vel mi. Nulla facilisi.\
Donec enim libero, luctus ac sagittis sit amet, vehicula sagittis magna.\
Duis ultrices molestie ante, eget scelerisque sem iaculis vitae.\
Etiam fermentum mauris vitae metus pharetra condimentum fermentum est pretium.\
Proin sollicitudin elementum quam quis pharetra.\
Aenean facilisis nunc quis elit volutpat mollis.\
Aenean eleifend varius euismod. Ut dolor est, congue eget dapibus eget, elementum eu odio.\
Integer et lectus neque, nec scelerisque nisi. EndOfLineHere
Praesent a nunc lorem, ac porttitor eros.
LOREM
}
before do before do
document.update_attributes(description:<<LOREM) document.update_attributes(description: long_description)
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut egestas, mi vehicula varius varius, ipsum massa fermentum orci, eget tristique ante sem vel mi. Nulla facilisi. Donec enim libero, luctus ac sagittis sit amet, vehicula sagittis magna. Duis ultrices molestie ante, eget scelerisque sem iaculis vitae. Etiam fermentum mauris vitae metus pharetra condimentum fermentum est pretium. Proin sollicitudin elementum quam quis pharetra. Aenean facilisis nunc quis elit volutpat mollis. Aenean eleifend varius euismod. Ut dolor est, congue eget dapibus eget, elementum eu odio. Integer et lectus neque, nec scelerisque nisi. EndOfLineHere
Vestibulum non velit mi. Aliquam scelerisque libero ut nulla fringilla a sollicitudin magna rhoncus. Praesent a nunc lorem, ac porttitor eros. Sed ac diam nec neque interdum adipiscing quis quis justo. Donec arcu nunc, fringilla eu dictum at, venenatis ac sem. Vestibulum quis elit urna, ac mattis sapien. Lorem ipsum dolor sit amet, consectetur adipiscing elit.
LOREM
get :index, project_id: project.identifier get :index, project_id: project.identifier
end end

Loading…
Cancel
Save