extends ../layouts/main
block content

  include ../components/pagination-bar

  section.uk-section.uk-section-default.uk-section-small
    .uk-container

      article.uk-article
        .uk-margin-large
          .uk-margin
            h1.uk-article-title.uk-margin-remove.no-select= feed.title

            .uk-article-meta
              div(uk-grid)
                .uk-width-auto
                  a(href= feed.link, target="_blank", uk-tooltip={ title: "Visit site" }).no-select
                    if Array.isArray(feed.favicons) && (feed.favicons.length > 0)
                      span
                        img(src= feed.favicons[0], style="height: 24px; width: auto;")
                    else
                      span
                        i.fas.fa-external-link-alt
                    span.uk-margin-small-left Visit site

                .uk-width-auto
                  .no-select last updated #{moment(feed.published).fromNow()}

          .uk-text-lead.no-select= feed.description

        .uk-margin-large
          if Array.isArray(newsroom.entries) && (newsroom.entries.length > 0)
            ul.uk-list.uk-list-divider
              each entry in newsroom.entries
                li
                  .uk-text-bold
                    a(href= entry.link, target="_blank")= entry.title
                  .uk-text-small= entry.description
                  //- pre= JSON.stringify(entry, null, 2)
          else
            div There are no news feed entries.
        
        .uk-margin
          +renderPaginationBar(`/newsroom/${feed._id}`, newsroom.totalFeedEntryCount)