Skip to content
Snippets Groups Projects
App.vue 4.45 KiB
Newer Older
  • Learn to ignore specific revisions
  • <template>
      <div id="app">
        <sidebar></sidebar>
    
        <service-messages v-if="messages.length > 0" />
    
        <router-view :key="$route.fullPath"></router-view>
    
        <div class="ui fitted divider"></div>
    
        <div id="footer" class="ui vertical footer segment">
          <div class="ui container">
            <div class="ui stackable equal height stackable grid">
              <div class="three wide column">
    
                <i18next tag="h4" class="ui header" path="Links"></i18next>
    
                <div class="ui link list">
    
                  <router-link class="item" to="/about">
    
                    <i18next path="About this instance" />
    
                  <a href="https://funkwhale.audio" class="item" target="_blank">{{ $t('Official website') }}</a>
                  <a href="https://docs.funkwhale.audio" class="item" target="_blank">{{ $t('Documentation') }}</a>
                  <a href="https://code.eliotberriot.com/funkwhale/funkwhale" class="item" target="_blank">
                    <template v-if="version">{{ $t('Source code ({% version %})', {version: version}) }}</template>
                    <template v-else>{{ $t('Source code') }}</template>
                  </a>
                  <a href="https://code.eliotberriot.com/funkwhale/funkwhale/issues" class="item" target="_blank">{{ $t('Issue tracker') }}</a>
    
                </div>
              </div>
              <div class="ten wide column">
    
                <i18next tag="h4" class="ui header" path="About funkwhale" />
                <p>
                  <i18next path="Funkwhale is a free and open-source project run by volunteers. You can help us improve the platform by reporting bugs, suggesting features and share the project with your friends!"/>
                </p>
                <p>
                  <i18next path="The funkwhale logo was kindly designed and provided by Francis Gading."/>
                </p>
    
              </div>
            </div>
          </div>
        </div>
    
        <raven
          v-if="$store.state.instance.settings.raven.front_enabled.value"
          :dsn="$store.state.instance.settings.raven.front_dsn.value">
        </raven>
    
    Eliot Berriot's avatar
    Eliot Berriot committed
        <playlist-modal v-if="$store.state.auth.authenticated"></playlist-modal>
    
    import axios from 'axios'
    import _ from 'lodash'
    
    import {mapState} from 'vuex'
    
    import Sidebar from '@/components/Sidebar'
    
    import Raven from '@/components/Raven'
    
    import ServiceMessages from '@/components/ServiceMessages'
    
    Eliot Berriot's avatar
    Eliot Berriot committed
    import PlaylistModal from '@/components/playlists/PlaylistModal'
    
    
      components: {
        Sidebar,
    
    Eliot Berriot's avatar
    Eliot Berriot committed
        Raven,
    
      data () {
        return {
          nodeinfo: null
        }
      },
    
      created () {
        this.$store.dispatch('instance/fetchSettings')
    
    Eliot Berriot's avatar
    Eliot Berriot committed
        let self = this
    
        setInterval(() => {
          // used to redraw ago dates every minute
          self.$store.commit('ui/computeLastDate')
        }, 1000 * 60)
    
        this.fetchNodeInfo()
      },
      methods: {
        fetchNodeInfo () {
          let self = this
          axios.get('instance/nodeinfo/2.0/').then(response => {
            self.nodeinfo = response.data
          })
        }
      },
      computed: {
    
        ...mapState({
          messages: state => state.ui.messages
        }),
    
        version () {
          if (!this.nodeinfo) {
            return null
          }
          return _.get(this.nodeinfo, 'software.version')
        }
    
    }
    </script>
    
    <style lang="scss">
    // we do the import here instead in main.js
    // as resolve order is not deterministric in webpack
    // and we end up with CSS rules not applied,
    // see https://github.com/webpack/webpack/issues/215
    @import 'semantic/semantic.css';
    
    @import 'style/vendor/media';
    
    html, body {
      @include media("<desktop") {
    
        font-size: 90%;
    
    #app {
      font-family: 'Avenir', Helvetica, Arial, sans-serif;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }
    
    .main.pusher, .footer {
    
      @include media(">desktop") {
        margin-left: 350px !important;
      }
    
    .service-messages {
      position: fixed;
      bottom: 1em;
      left: 1em;
      @include media(">desktop") {
        left: 350px;
      }
    }
    
    .main-pusher {
    
    .ui.stripe.segment, #footer {
      padding: 2em;
      @include media(">tablet") {
        padding: 4em;
      }
    
    .ellipsis {
      text-overflow: ellipsis;
      white-space: nowrap;
      overflow: hidden;
    }
    
    
    .ui.small.text.container {
      max-width: 500px !important;
    }
    
    .button.icon.tiny {
        padding: 0.5em !important;
    }
    
    .sidebar {
      .logo {
        path {
          fill: white;
        }
      }
    }
    
    .discrete.link {
        color: rgba(0, 0, 0, 0.87);
    }
    
    .floated.buttons .button ~ .dropdown {
      border-left: none;
    }
    </style>