hummingbird-me/kitsu-web

View on GitHub
app/templates/dashboard.hbs

Summary

Maintainability
Test Coverage
{{dashboard/quick-update}}

<div class="feed-container row {{if session.hasUser "quick-update-enabled" "guest-banner-enabled"}}">
  {{! Kitsu Dashboard Top }}
  {{ad-unit unit="kitsu.dashboard.top"
    targeting=(hash section="dashboard")
    sizes=(hash
      mobile=(array (array 320 100) (array 320 50))
      tablet=(array 728 90)
      desktop=(array (array 970 90) (array 728 90))
    )}}

  {{! Feed Aside }}
  <div class="feed-aside col-sm">
    {{! Onboarding Mobile }}
    {{#if (responsive "isSidebarLeftRightCollapse")}}
      {{#if (and session.hasUser (not session.account.feedCompleted))}}
        {{dashboard/onboarding/checklist-progress user=session.account class="sidebar-item onboarding-mobile"}}
      {{/if}}
    {{/if}}

    <div class="is-sticky">
      <ul>
        <li>
          <a href="#" class="timeline-link {{if (eq streamType "timeline") "active"}}" {{action "switchFeed" "timeline"}}>
            <span class="emoji">👀</span>
            {{t "dashboard.feed.following"}}
          </a>
        </li>
        {{#unless (has-feature "fresh_feeds")}}
          <li>
            <a href="#" class="timeline-link {{if (eq streamInterest "anime") "active"}}" {{action "switchFeed" "interest_timeline/anime"}}>
              <span class="emoji">📺</span>
              {{t "dashboard.feed.anime"}}
            </a>
          </li>
          <li>
            <a href="#" class="timeline-link {{if (eq streamInterest "manga") "active"}}" {{action "switchFeed" "interest_timeline/manga"}}>
              <span class="emoji">📙</span>
              {{t "dashboard.feed.manga"}}
            </a>
          </li>
        {{/unless}}
        <li>
          <a href="#" class="timeline-link {{if (eq streamType "global") "active"}}" {{action "switchFeed" "global"}}>
            <span class="emoji">🌎</span>
            {{t "dashboard.feed.global"}}
          </a>
        </li>
      </ul>

      {{! Groups }}
      {{dashboard/unread-groups class="sidebar-item"}}
    </div>
  </div>

  {{! Feed }}
  <div class="feed-stream col-md">
    {{#if (and session.hasUser (and (eq streamType "global") (eq session.account.postsCount 0)))}}
      {{dashboard/onboarding/feed-notice}}
    {{/if}}

    {{stream-feed/list
      subject=(if (eq streamType "interest_timeline") (capitalize streamInterest) "")
      streamType=streamType
      streamInterest=streamInterest
      streamId=streamId
      streamFilter=(if (eq streamType "global") "user" "all")
      hideFilter=(eq streamType "group_timeline")
      showFollowingFilter=(eq streamType "timeline")
      readOnly=(not (can "write post"))}}
  </div>

  <div class="feed-sidebar col-auto">
    <div class="is-sticky">
      {{! Site Announcements }}
      {{dashboard/site-announcements}}

      {{! Onboarding }}
      {{#unless (responsive "isSidebarLeftRightCollapse")}}
        {{#if (and session.hasUser (not session.account.feedCompleted))}}
          {{dashboard/onboarding/checklist-progress user=session.account class="sidebar-item"}}
        {{/if}}
      {{/unless}}

      {{! Kitsu Dashboard Sidebar Ad }}
      {{ad-unit unit="kitsu.dashboard.sidebar"
        targeting=(hash section="dashboard")
        sizes=(hash
          tablet=(array (array 336 280) (array 300 250))
        )
      }}

      {{! Footer }}
      {{sidebar-footer class="sidebar-item"}}
    </div>
  </div>
</div>