app/views/qwerty_admin/documents/_document.html.erb in qwerty-0.0.1.pre vs app/views/qwerty_admin/documents/_document.html.erb in qwerty-0.0.3.pre

- old
+ new

@@ -14,11 +14,13 @@ <%= to_html truncate(document.summary, :length => 100) %> </div> <div class="span4 offset2"> - <%= link_to image_tag('qwerty/admin/icons/up.png'), up_qwerty_admin_document_path(document), :class => 'btn small' unless document.last? %> - <%= link_to image_tag('qwerty/admin/icons/down.png'), down_qwerty_admin_document_path(document), :class => 'btn small' unless document.first? %> + <% if document.get(:sort).try('include?', 'position') %> + <%= link_to image_tag('qwerty/admin/icons/up.png'), up_qwerty_admin_document_path(document), :class => "btn small#{' disabled' if document.first?}" %> + <%= link_to image_tag('qwerty/admin/icons/down.png'), down_qwerty_admin_document_path(document), :class => "btn small#{' disabled' if document.last?}" %> + <% end %> <%= link_to 'Edit', edit_qwerty_admin_document_path(document), :class => 'btn small' %> <%= link_to 'Live', document_path(document), :target => '_blank', :class => 'btn small' %> </div> </div>