Skip to content
Snippets Groups Projects
Table.vue 2.81 KiB
Newer Older
  • Learn to ignore specific revisions
  •   <table class="ui compact very basic fixed single line unstackable table">
    
    Eliot Berriot's avatar
    Eliot Berriot committed
            <th colspan="6">{{ $gettext('Title') }}</th>
            <th colspan="6">{{ $gettext('Artist') }}</th>
            <th colspan="6">{{ $gettext('Album') }}</th>
    
          <track-row
            :display-position="displayPosition"
            :track="track"
            :key="index + '-' + track.id"
            v-for="(track, index) in tracks"></track-row>
    
        <tfoot class="full-width">
          <tr>
            <th colspan="3">
    
              <button @click="showDownloadModal = !showDownloadModal" class="ui basic button">
    
    Eliot Berriot's avatar
    Eliot Berriot committed
                {{ $gettext('Download') }}
    
              </button>
    
              <modal :show.sync="showDownloadModal">
    
    Eliot Berriot's avatar
    Eliot Berriot committed
                <div class="header">{{ $gettext('Download tracks') }}</div>
    
                <div class="content">
                  <div class="description">
    
    Eliot Berriot's avatar
    Eliot Berriot committed
                    <p>{{ $gettext('There is currently no way to download directly multiple tracks from funkwhale as a ZIP archive. However, you can use a command line tools such as cURL to easily download a list of tracks.') }}</p>
                    {{ $gettext('Simply copy paste the snippet below into a terminal to launch the download.') }}
                    <div class="ui warning message">
                      {{ $gettext('Keep your PRIVATE_TOKEN secret as it gives access to your account.') }}
                    </div>
    
    export PRIVATE_TOKEN="{{ $store.state.auth.token }}"
    
    <template v-for="track in tracks"><template v-if="track.files.length > 0">
    
    curl -G -o "{{ track.files[0].filename }}" <template v-if="$store.state.auth.authenticated">--header "Authorization: JWT $PRIVATE_TOKEN"</template> "{{ $store.getters['instance/absoluteUrl'](track.files[0].path) }}"</template></template>
    
    </pre>
                  </div>
                </div>
                <div class="actions">
    
                  <div class="ui black deny button"><translate>Cancel</translate></div>
    
                </div>
              </modal>
            </th>
            <th></th>
            <th colspan="4"></th>
            <th colspan="6"></th>
            <th colspan="6"></th>
            <th></th>
          </tr>
        </tfoot>
    
      </table>
    </template>
    
    <script>
    import backend from '@/audio/backend'
    
    
    import TrackRow from '@/components/audio/track/Row'
    
    import Modal from '@/components/semantic/Modal'
    
    
      props: {
        tracks: {type: Array, required: true},
        displayPosition: {type: Boolean, default: false}
      },
    
          backend: backend,
          showDownloadModal: false
    
        }
      }
    }
    </script>
    
    <!-- Add "scoped" attribute to limit CSS to this component only -->
    <style scoped>
    
    tr:not(:hover) .favorite-icon:not(.favorited) {
      display: none;
    }