diff --git a/resources/js/app.js b/resources/js/app.js index 22256b98df..28e578e6d2 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -45,6 +45,7 @@ import './components/alpine/dislikeButton'; import './components/alpine/likeButton'; import './components/alpine/livewireDialog'; import './components/alpine/smallBookmarkButton'; +import './components/alpine/tabs'; import './components/alpine/toggle'; import './components/alpine/torrentGrouping'; diff --git a/resources/js/components/alpine/tabs.js b/resources/js/components/alpine/tabs.js new file mode 100644 index 0000000000..8960eb3c38 --- /dev/null +++ b/resources/js/components/alpine/tabs.js @@ -0,0 +1,26 @@ +document.addEventListener('alpine:init', () => { + Alpine.data('tabs', () => ({ + tab: null, + init() { + this.tab = this.$root.dataset.defaultTab; + }, + tabButton: { + ['x-on:click']() { + this.tab = this.$el.dataset.tab; + }, + ['x-bind:role']() { + return 'tab'; + }, + ['x-bind:class']() { + return this.tab === this.$el.dataset.tab + ? 'panel__tab panel__tab--active' + : 'panel__tab'; + }, + }, + tabPanel: { + ['x-show']() { + return this.tab === this.$el.dataset.tab; + }, + }, + })); +}); diff --git a/resources/views/torrent/partials/buttons.blade.php b/resources/views/torrent/partials/buttons.blade.php index 5d69969d50..1402321fb9 100644 --- a/resources/views/torrent/partials/buttons.blade.php +++ b/resources/views/torrent/partials/buttons.blade.php @@ -187,26 +187,12 @@ class="form__button form__button--outlined form__button--centered" -
+
- - +
  • Hierarchy
  • +
  • List
  • -
    +
    @if ($torrent->folder !== null) -
    +
    diff --git a/resources/views/torrent/partials/extra_meta.blade.php b/resources/views/torrent/partials/extra_meta.blade.php index be1af1f12f..17ac53739c 100644 --- a/resources/views/torrent/partials/extra_meta.blade.php +++ b/resources/views/torrent/partials/extra_meta.blade.php @@ -1,46 +1,17 @@ -
    - +

    Relations

    - - - +
  • Recommendations
  • +
  • Collection
  • +
  • Playlists
  • - -
    +
    @include('torrent.partials.recommendations')
    -
    +
    @include('torrent.partials.collection')
    -
    +
    @include('torrent.partials.playlists')