Module: DocumentationHelper

Defined in:
app/helpers/documentation_helper.rb

Instance Method Summary (collapse)

Instance Method Details

- (Object) document_toggle_tag(object)

Parameters:

  • object (Object)


42
43
44
45
46
47
48
# File 'app/helpers/documentation_helper.rb', line 42

def document_toggle_tag(object) # TODO: Apparently unused...
  (:div, class: 'document_toggle_tag') do
    viewer_documents.each do |document_id|
      # content_tag(:span, link_to(content_tag(Document.find(document_id), '/view/pdf/link/or/onclick')))
    end
  end
end

- (Object) document_viewer_target(object)



15
16
17
# File 'app/helpers/documentation_helper.rb', line 15

def document_viewer_target(object)
  viewer_documents(object).first
end


10
11
12
13
# File 'app/helpers/documentation_helper.rb', line 10

def documentation_link(documentation)
  return nil if documentation.nil?
  link_to(documentation_tag(documentation).html_safe, documentation)
end

- (Object) documentation_tag(documentation)



3
4
5
6
7
8
# File 'app/helpers/documentation_helper.rb', line 3

def documentation_tag(documentation)
  return nil if documentation.nil?
  string = [documentation.documentation_object_type, ': ',
            object_tag(documentation.documentation_object)].join.html_safe
  string
end

- (Object) viewer_documents(object)



19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# File 'app/helpers/documentation_helper.rb', line 19

def viewer_documents(object)
  document_ids = []

  sessions_current_user.pinboard
  #  pinboard - top document
  #  pinboard -

  #    So- behaviour.
  #    We need to allow the user to choose a document to show.
  #    That document should be, in order of priority:
  #    1) the pinned Doucment that is_inserted = true
  #  2) the pinned Document
  #  3) the pinned Source that is_inserted (if it has a PDF)
  #  4) the pinned Source (if it has a PDF)
  #  If there is none of 1-4 you get help message saying what to do OR we just don’t display the slide out. I could
  # write a boolean returning method to dtermine if any of 1-4 are available.
  #    Just thought of another thing on way in - If a record has a citation, then the source for that Citation should
  # be pre-loaded (assuming source has PDF)


end