Skip to content
Snippets Groups Projects
Select Git revision
  • develop default protected
  • Shleeble-develop-patch-44699
  • 170-channels-ui
  • 107-actor-api
  • rely-on-musicbrainz
  • fix-broken-playlist-cards
  • master
  • ollie/funkwhale-documentation-fixes
  • vuln-testing
  • plugins-v2
  • limit-album-tracks
  • 925-flac-transcoding
  • 865-sql-optimization
  • 890-notification
  • 839-donation-link
  • landing-page
  • plugins
  • add-new-shortcuts
  • 735-table-truncate
  • webdav
  • 0.20.1
  • 0.20.0
  • 0.20.0-rc1
  • 0.19.1
  • 0.19.0
  • 0.19.0-rc2
  • 0.19.0-rc1
  • 0.18.3
  • 0.18.2
  • 0.18.1
  • 0.18
  • 0.17
  • 0.16.3
  • 0.16.2
  • 0.16.1
  • 0.16
  • 0.15
  • 0.14.2
  • 0.14.1
  • 0.14
40 results

Profile.vue

Blame
  • Forked from funkwhale / funkwhale
    6781 commits behind the upstream repository.
    Profile.vue 1.66 KiB
    <template>
      <div class="main pusher" v-title="username + ''s Profile'">
        <div v-if="isLoading" class="ui vertical segment">
          <div :class="['ui', 'centered', 'active', 'inline', 'loader']"></div>
        </div>
        <template v-if="$store.state.auth.profile">
          <div :class="['ui', 'head', 'vertical', 'center', 'aligned', 'stripe', 'segment']">
            <h2 class="ui center aligned icon header">
              <i class="circular inverted user green icon"></i>
              <div class="content">
                {{ $store.state.auth.profile.username }}
                <div class="sub header" v-translate="{date: signupDate}">Registered since %{ date }</div>
              </div>
            </h2>
            <div class="ui basic green label">
              <translate>This is you!</translate>
            </div>
            <div v-if="$store.state.auth.profile.is_staff" class="ui yellow label">
              <i class="star icon"></i>
              <translate>Staff member</translate>
            </div>
            <router-link class="ui tiny basic button" :to="{path: '/settings'}">
              <i class="setting icon"> </i>
              <translate>Settings...</translate>
            </router-link>
    
          </div>
        </template>
      </div>
    </template>
    
    <script>
    const dateFormat = require('dateformat')
    
    export default {
      name: 'login',
      props: ['username'],
      created () {
        this.$store.dispatch('auth/fetchProfile')
      },
      computed: {
        signupDate () {
          let d = new Date(this.$store.state.auth.profile.date_joined)
          return dateFormat(d, 'longDate')
        },
        isLoading () {
          return !this.$store.state.auth.profile
        }
      }
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped>
    </style>