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

<% token, akat = token_tworz_tag 
   stt = session[:tworz_tag]
   stt = stt[ token.id ] if stt
   if stt
     lemat, tag = stt[:lemat], stt[:tag]
   else
     lemat, tag = @lemat, nil
   end
-%>

<% if flash[ :tworz_tag ] -%>
<div id="notice">
  <%= flash[:tworz_tag] -%>
</div>
<% end -%>


<% remote_form_for :interpretacja_anot, @interpretacja_anot, 
   :url =>  {:action => :interpretacja_z_tagu, 
:id =>  token.id , :poziom => :morphosyntactic,
:akat => @akapit_transzy,
:status => 0, :escape => false} do |form| -%>

    <%=    link_to_remote  '–„–', 
      :url => {
        :action => :nowytag_skopiuj_orth, :id => token.id,
    :akat => @akapit_transzy,
    :poziom => :morphosyntactic, :escape => false
}
-%>

<span id="<%= "token_lemat#{token.id}" %>">
<%= render :partial => 'tworz_tag_lemat', :object => [token.id, lemat] -%>
</span>

<%= text_field "token_tag#{token.id}", 'tag', :value => tag, :size => 25 %>

<div class="auto_complete"
     id=<%="\"token_tag#{token.id}_tag_auto_complete\""%>>
</div>

<%= auto_complete_field "token_tag#{token.id}_tag",
    :url=>{ :action=>'autocomplete_tag', :id => token.id, :poziom=>
    :morphosyntactic, :akat => @akapit_transzy, :escape => false },
:tokens => ',',
:min_chars => -1  %>

    <%= submit_tag "zatwierdź" , :class => "submit" -%>
    
    <%=    link_to_remote  'anuluj', 
      :url => {
        :action =>:dyzamb_anulowana, :id => token.id, 
    :akat => @akapit_transzy,
    :poziom => :morphosyntactic, :escape => false
}
-%>

<% end # of form
-%>
