render

in www/board/agenda/views/elements/additional-info.js.rb [16:160]


  def render
    
    if @@item.rejected
      _p.rejected 'Report was not accepted'
    end

    if @@item.notes
      _p @@item.notes,
        class: ('notes' unless @@item.notes =~ /^new, monthly through/)
    end

    
    minutes = Minutes.get(@@item.title)
    if minutes
      _h4 'Minutes', id: "#{@prefix}minutes"
      _pre.comment minutes
    end

    
    if @@item.missing
      posted = Posted.get(@@item.title)
      unless posted.empty?
        _h4 'Posted reports', id: "#{@prefix}posted"
        _ul.posted_reports posted do |post|
          _li do
            _a post.subject, href: post.link
          end
        end
      end
    end

    
    draft = Reporter.find(@@item)
    if draft and @prefix
      _span.hilite do
        _em 'Unposted draft being prepared at '
        _a 'reporter.apache.org',
          href: "https://reporter.apache.org/wizard?#{draft.project}"
      end
    end

    
    if @@item.title != 'Action Items' and not @@item.actions.empty?
      _h4 id: "#{@prefix}actions" do
        _Link text: 'Action Items', href: 'Action-Items'
      end
      _ActionItems item: @@item, filter: {pmc: @@item.title}
    end

    unless @@item.special_orders.empty?
      _h4 'Special Orders', id: "#{@prefix}orders"
      _ul do
        @@item.special_orders.each do |resolution|
          _li do
            _Link text: resolution.title, href: resolution.href
          end
        end
      end
    end

    
    history = HistoricalComments.find(@@item.title)
    if not @@item.comments.empty? or (history and not @prefix)
      _h4 'Comments', id: "#{@prefix}comments"
      @@item.comments.each do |comment|
        _pre.comment do
          _Text raw: comment, filters: [hotlink]
        end
      end

      
      if @@item.pending
        _div.comment.commented.clickable onClick: -> {Main.navigate 'queue'} do
          _h5 'Pending Comment', id: "#{@prefix}pending"
          _pre.commented Flow.comment(@@item.pending, User.initials)
        end
      end

      
      if history and not @prefix
        history.each_pair do |date, comments|
          next if Agenda.file == "board_agenda_#{date}.txt"

          _h5.history do
            _span "\u2022 "
            _a date.gsub('_', '-'),
              href: HistoricalComments.link(date, @@item.title)

            link = nil


            
            if date > '2016_04' 
              
              dfr = date.gsub('_', '-')
              dto = Date.new(Date.now()).toISOString()[0...10]
              count = Responses.find(dfr, @@item.title)

              if count
                
                count -= 1 if date < '2017_11'

                if count == 0
                  link = "(no responses)"
                elsif count == 1
                  link = '(1 response)'
                else
                  link = "(#{count} responses)"
                end

              elsif Responses.loading
                link = '(loading)'
              else
                link = '(no responses)'
              end
            end

            if link
              _span ': '

              _a link,
                href: 'https://lists.apache.org/list.html?board@apache.org&' +
                  "d=dfr=#{dfr}|dto=#{dto}&header_subject=" +
                  "'Board%20feedback%20on%20#{dfr}%20#{@@item.title}%20report'"
            end
          end

          splitComments(comments).each do |comment|
            _pre.comment do
              _Text raw: comment, filters: [hotlink]
            end
          end
        end
      end
    else
      
      if @@item.pending
        _div.comment.commented.clickable onClick: -> {Main.navigate 'queue'} do
          _h5 'Pending Comment', id: "#{@prefix}pending"
          _pre.commented Flow.comment(@@item.pending, User.initials)
        end
      end
    end
  end