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

<% #  wywołujemy go z tablicą [akat, token] 
# z partiala #token_sens wołanego z widoku anotuj.
   akat, tok, disaid, the_sens_id = token_wybs -%>

<fieldset>
  <% remote_form_for :sens_anot, the_sens_id,
:url =>  {:action => :wybor_sensu, 
  :id => tok.id,
  :akat => akat,
  :poziom => :word_senses, :escape => false
} do |form| %>

<%  ts187 = tok.sensy( akat.akat_hash )
ts187.each {|sens| -%>
    <%= radio_button :the_sens, # nazwa zmiennej instancyjnej (#{@the_sens})
  :sensy_id, # metoda tej zmiennej instancyjnej (akcesor atrybutu)
  sens.id, # wartość
  {:onclick => 
    ajax_request(  "/#{annotation_controller}/wybor_sensu/#{tok.token_id}?poziom=word_senses&akat=#{akat.id}&disamb_id=#{disaid}") }
 %>
<%= #"<b>" if interpr.disamb? 
-%>
<%= # #sens.id AP nie chce.
 -%> 
<%= sens.short_description -%> 
<%= render :partial => 'sens_pelny_opis_link', :object => [akat.id, ts187.id, sens]
-%>
<%= render :partial => 'sens_long', :object => [akat.id, ts187.id, sens]
-%>

<% if true or ts187.index( sens )+1< ts187.size
-%>
<br>
<% end -%>
<%= # "</b>" if interpr.disamb? 
-%>
<% } -%>


    <%= ## submit_tag "&#10004;" , :class => "submit" 
    # niepotrzebne i~mylące.
    -%>

<%=    link_to_remote  '&#10007;', 
:url =>{
        :action =>:sensowanie_anulowane, :id => tok.id, :akat => akat,
:escape => false } ## ,
##      :update => "sens-anot_#{akat.id}_#{tok.id}"
-%>

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

