Class: TagBuilder::TagBwCd

Inherits:
Object
  • Object
show all
Includes:
TagMixin
Defined in:
lib/tag_builder/tag_bw_cd.rb

Overview

Analiza un tag para la relaciĆ³n entre dos documentos canonicos en una determina revision sistematica

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from TagMixin

#botones_html, #initialize_common, #mostrar, #resultado_usuario, #sin_votos?

Constructor Details

#initialize(votos) ⇒ TagBwCd

Returns a new instance of TagBwCd



35
36
37
38
39
40
# File 'lib/tag_builder/tag_bw_cd.rb', line 35

def initialize(votos)
  initialize_common(votos)
  @cd_start_id=votos[0][:cd_start]
  @cd_end_id=votos[0][:cd_end]

end

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id



33
34
35
# File 'lib/tag_builder/tag_bw_cd.rb', line 33

def id
  @id
end

#negativosObject (readonly)

Returns the value of attribute negativos



33
34
35
# File 'lib/tag_builder/tag_bw_cd.rb', line 33

def negativos
  @negativos
end

#positivosObject (readonly)

Returns the value of attribute positivos



33
34
35
# File 'lib/tag_builder/tag_bw_cd.rb', line 33

def positivos
  @positivos
end

#predeterminadoObject

Returns the value of attribute predeterminado



34
35
36
# File 'lib/tag_builder/tag_bw_cd.rb', line 34

def predeterminado
  @predeterminado
end

#textObject (readonly)

Returns the value of attribute text



33
34
35
# File 'lib/tag_builder/tag_bw_cd.rb', line 33

def text
  @text
end

Instance Method Details

#boton_negativo_html(ru) ⇒ Object



49
50
51
52
53
54
55
56
# File 'lib/tag_builder/tag_bw_cd.rb', line 49

def boton_negativo_html(ru)
  if ru.nil? or ru[:decision]=='yes'
    url_t="/tags/cd_start/#{@cd_start_id}/cd_end/#{@cd_end_id}/rs/#{@rs_id}/reject_tag"
    "<button class='btn btn-default boton_accion_tag_cd_rs_ref' cd_start-pk='#{@cd_start_id}' cd_end-pk='#{@cd_end_id}' rs-pk='#{@rs_id}' tag-pk='#{@tag_id}' data-url='#{url_t}'><span class='glyphicon glyphicon-minus'></span> <span class='badge '>#{negativos}</span></button>"
  else
    "<button class='btn btn-danger'><span class='glyphicon glyphicon-minus'></span> <span class='badge '>#{negativos}</span></button>"
  end
end

#boton_positivo_html(ru) ⇒ Object



41
42
43
44
45
46
47
48
# File 'lib/tag_builder/tag_bw_cd.rb', line 41

def boton_positivo_html(ru)
  if ru.nil? or ru[:decision]=='no'
    url_t="/tags/cd_start/#{@cd_start_id}/cd_end/#{@cd_end_id}/rs/#{@rs_id}/approve_tag"
    "<button class='btn btn-default boton_accion_tag_cd_rs_ref' cd_start-pk='#{@cd_start_id}' cd_end-pk='#{@cd_end_id}' rs-pk='#{@rs_id}' tag-pk='#{@tag_id}' data-url='#{url_t}'><span class='glyphicon glyphicon-plus'></span> <span class='badge '>#{positivos}</span></button>"
  else
    "<button class='btn btn-success'><span class='glyphicon glyphicon-plus'></span> <span class='badge '>#{positivos}</span></button>"
  end
end