Module: AnnotationsHelper

Defined in:
app/helpers/annotations_helper.rb

Overview

Helpers that wrap sets of annotations of different types.

Instance Method Summary (collapse)

Instance Method Details

- (Object) annotation_id(object)



30
31
32
# File 'app/helpers/annotations_helper.rb', line 30

def annotation_id(object)
  "annotation_anchor_#{object.metamorphosize.class.name}_#{object.id}"
end

- (String) annotations_summary_tag(object)

Assumes the context is the object, not a multi-object summary

Returns:

  • (String)


6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/helpers/annotations_helper.rb', line 6

def annotations_summary_tag(object)
  (:div, class: %w{item panel separate-left separate-right separate-bottom}) do
    (:div, class: [:content]) do
      (:div, class: ['information-panel']) do
        (:h2, 'Annotations') +
          (:div,
          [citation_list_tag(object),
           identifier_list_tag(object), 
           data_attribute_list_tag(object), 
           note_list_tag(object), 
           tag_list_tag(object),
           alternate_values_list_tag(object)
        ].compact.join.html_safe, class: :annotations_summary_list, "data-annotator-list-object-id" => object.id)

      end
    end
  end

  # depictions
  # confidences
  # protocols

end

- (Object) radial_annotator(object)



34
35
36
# File 'app/helpers/annotations_helper.rb', line 34

def radial_annotator(object)
  (:div, '', 'data-global-id' => object.to_global_id.to_s, 'data-radial-annotator' => 'true')
end