<% #
 # This file is part of the Anotatornia suite.
 # 
 # Copyright © 2007, 2008, 2009, 2010 by Instytut Podstaw Informatyki
 # Polskiej Akademii Nauk (IPI PAN; Institute of Computer Science, Polish
 # Academy of Sciences; cf. www.ipipan.waw.pl).  All rights reserved.
 # 
 # This file may be distributed and/or modified under the terms of the
 # GNU General Public License version 3 as published by the Free Software
 # Foundation and appearing in the file COPYING included in the packaging
 # of this file.  (See http://www.gnu.org/licenses/translations.html for
 # unofficial translations.)
 # 
 # A commercial license is available from IPI PAN (contact
 # Michal.Ciesiolka.waw.pl or ipi.waw.pl for more
 # information).  Licensees holding a valid commercial license from IPI
 # PAN may use this file in accordance with that license.
 # 
 # This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING
 # THE WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
 # PURPOSE.
%>

<% # Partial wołany z~\file{pokaz_transze.rhtml} i~z~\file{wyszukaj_akapity.rhtml}. 
-%>
<table>
  <% for a in lista_akapitow # to jest tablica tablic #{[akat.akapit, akat]}.
       # dawniej było #{[akat.akapit, akat .status, akat.odrzucony?(, akat.uzytkownik_id)]}.
       a0, a1 = a
       -%>
  <tr valign="top"  class="<%= cycle('list-line-odd',
'list-line-even') %>" >
<td><%=  a0.akapit_id.to_s + 
( u = a1.get_uzid
 if u != session[ :uzid ]
'&nbsp;[' + Uzytkownik.find( u ).login + ']'
else ''
end )-%>
</td>
    <td><%= a0.tresc 
# to jest tablica [akapit, status] !
-%></td>
    <td>
<%= "(#{AkapitTranszy::STATI_kr[ a1.status ]}#{if a1.odrzucony? : '–' end})"
-%>
&nbsp;<%= editable = a1.editable_par?( session[ :uzid ] )
 link_to( 
if  a1.ma_Status?(:<, :zatwierdzony) and editable
  'Anotuj' 
elsif editable
  case a1.status
  when (AkapitTranszy::STATI[:zatwierdzony])
    "(czeka na drugiego)" 
  when (AkapitTranszy::STATI[:do_poprawki])
    "Popraw!" 
  when (AkapitTranszy::STATI[:po_poprawce])
    "(poprawiony, czeka na drugiego)"
  when (AkapitTranszy::STATI[:osądzany])
    "(pod&nbsp;sądem)"
  when (AkapitTranszy::STATI[:osądzony])
    "(osądzony)"
  else 'Oglądaj' 
  end # of #{case}.
else 'Oglądaj'
end + # of #{if}
  if pokr =  PoziomyAnotacji.
      krótkie( a1.poziomy_anotaśne( session[:rola_id] ) ) and
      pokr[0]
    ' <b>' + pokr.join(', ') + '</b>'
  else ''
  end,
{:action => 'ustal_akapit',
##         :transza => @transza, 
         :akapit => a0,
         :akat => a1,
         :status => a1.status,
         :anotator => a1.uzytkownik_id} # to będzie #nil gdy z widoku pokaz_transze, i~dobrze.
) -%></td>
   </tr>
<% end -%>
</table>

<%
### Local Variables: 
### mode: mmm
### End:
-%>
