~ubuntu-branches/ubuntu/trusty/ruby-ferret/trusty

« back to all changes in this revision

Viewing changes to lib/ferret/browser/views/document/show.rhtml

  • Committer: Bazaar Package Importer
  • Author(s): Antonio Terceiro
  • Date: 2011-07-28 00:02:49 UTC
  • Revision ID: james.westby@ubuntu.com-20110728000249-v0443y69ftcpxwi6
Tags: upstream-0.11.6
ImportĀ upstreamĀ versionĀ 0.11.6

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<h3>View Document</h3>
 
2
<%= choose_document(@doc_id) %>
 
3
<hr/>
 
4
<%= paginate_docs %>
 
5
<% total_length = 0 %>
 
6
<div class="display">
 
7
<% if @doc %>
 
8
<h3>Fields</h3>
 
9
<dl>
 
10
<% @doc.each_pair do |field, value| %>
 
11
<% total_length += value.length %>
 
12
<dt><%= field %></dt>
 
13
<dd>
 
14
  <% if value.length > 50 %>
 
15
  <pre><%= value %></pre>
 
16
  <% else %>
 
17
  <%= value %>
 
18
  <% end %>
 
19
</dd>
 
20
<% end %>
 
21
</dl>
 
22
<hr/>
 
23
<% else %>
 
24
<p style="color:#933;">Document has been deleted</p>
 
25
<% end %>
 
26
</div>
 
27
<%= (total_length > 1000) ? paginate_docs : '' %>