<% #
 # 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.
%>

<% akat, czy_odrzucic = komentarz_dodaj -%>

<div id="komentarz_dodaj">
<% if  session[ :komentarz_dodaj ] -%>
     <fieldset>
  <% remote_form_for :komentarz_nowy, @komentarz_nowy, 
                   :url =>  {:action => :komentarz_zatwierdz, 
                            :id => akat.akapit_transzy_id,
    :akapit_id => akat.akapit_id } do |form| %>

  <% if czy_odrzucic -%>
  <%= form.select :przyczyna_odrzucenia,
      Komentarz::PO_select,   {:prompt => "wyb. przyczynę"}, { } -%>
<br/>
<% end # of if czy_odrzucic
%>
  <%= form.text_area :tresc, :rows => 4, :cols => 60 %>

    <%= submit_tag "zatwierdź" , :class => "submit" -%>


<%=    link_to_remote  'anuluj', 
      :url => {
    :action =>:komentarz_anulowany, 
    :id => akat.akapit_transzy_id } #,
  ## :update => 'komentarz_dodaj'
-%>

<% end #of form 
 -%>
  </fieldset>

<% else # not session[:komentarz_dodaj]
   -%>
  <% unless Rola.gosc?(session[:rola_id]) -%>
<%= link_to_remote  'dodaj komentarz', 
      :url => {
             :action =>:komentarz_dodaj, 
             :id => akat } #,
##     :update => 'komentarz_dodaj'
 -%>


<% end # of #{unless gosc?}.
end # of #session[:komentarz_dodaj]
-%>

</div>

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