about summary refs log tree commit diff
path: root/app/views/admin/trends/links/_preview_card.html.haml
blob: 8812feb31630242c5e7f5d96dd574907c70ab5ed (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
.batch-table__row{ class: [preview_card.requires_review? && 'batch-table__row--attention', !preview_card.requires_review? && !preview_card.trendable? && 'batch-table__row--muted'] }
  %label.batch-table__row__select.batch-table__row__select--aligned.batch-checkbox
    = f.check_box :preview_card_ids, { multiple: true, include_hidden: false }, preview_card.id

  .batch-table__row__content.pending-account
    .pending-account__header
      = link_to preview_card.title, preview_card.url

      %br/

      - if preview_card.provider_name.present?
        = preview_card.provider_name
        •

      - if preview_card.language.present?
        = standard_locale_name(preview_card.language)
        •

      = t('admin.trends.links.shared_by_over_week', count: preview_card.history.reduce(0) { |sum, day| sum + day.accounts })

      - if preview_card.trend.allowed?
        •
        %abbr{ title: t('admin.trends.tags.current_score', score: preview_card.trend.score) }= t('admin.trends.tags.trending_rank', rank: preview_card.trend.rank)

        - if preview_card.decaying?
          •
          = t('admin.trends.tags.peaked_on_and_decaying', date: l(preview_card.max_score_at.to_date, format: :short))
      - elsif preview_card.requires_review?
        •
        = t('admin.trends.pending_review')