Sha256: d48b33e42efd0c1b42df32f18423f0ec1e76157ecd308fac0a2e3d53ba0e14e5

Contents?: true

Size: 1.48 KB

Versions: 4

Compression:

Stored size: 1.48 KB

Contents

<h2><%= link_to @document.title, @document, :target => '_blank' %></h2>

<% if @document.image %>
<%= image_tag @document.image.thumb('100x100').png.url %>
<% end %>

<% if @document.node.leaf? %>
  <%= @document.body.try(:html_safe) %>
<% else %>
  <%= to_html @document.summary %>
<% end %>

<p>
  <%= link_to 'Edit', edit_qwerty_admin_document_path(@document), :class => 'btn small' %>
  <%= link_to 'Live', document_path(@document), :target => '_blank', :class => 'btn small' %>
  <%= link_to 'Delete', qwerty_admin_document_path(@document), :method => :delete, :confirm => 'Are you sure?', :class => 'btn small danger' unless @document.get(:can_delete) == false %>
</p>

<% @document.node.children.each do | node | %>
  <div class='node'>
    <h3><%= node.name.pluralize.capitalize %></h3>

    <% unless node.documents.empty? %>
      <div class="documents">
        <% documents = node.documents.order(node.get(:sort) || 'published_at desc').page(params["#{node.name}_page".to_sym]).per(10 / @document.node.children.size) %>
        <%= render :partial => documents %>
      </div>
    <% else %>
      <p>No <%= node.name.capitalize.pluralize %> have been added yet.</p>
    <% end %>

    <%= paginate documents, :route => :qwerty_admin_document_path, :param_name => "#{node.name}_page", :theme => :twitter %>

    <p>
    <%= link_to "Add #{node.name.capitalize}", new_qwerty_admin_document_path(:parent_id => @document.id, :node_id => node.id), :class => 'btn primary' %>
    </p>
  </div>
<% end %>

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
qwerty-0.0.7.pre app/views/qwerty_admin/documents/show.html.erb
qwerty-0.0.5.pre app/views/qwerty_admin/documents/show.html.erb
qwerty-0.0.4.pre app/views/qwerty_admin/documents/show.html.erb
qwerty-0.0.3.pre app/views/qwerty_admin/documents/show.html.erb