diff --git a/assets/components/home/home.vue b/assets/components/home/home.vue
index 8bb14d48..2b69461a 100644
--- a/assets/components/home/home.vue
+++ b/assets/components/home/home.vue
@@ -5,6 +5,7 @@
@@ -24,6 +25,13 @@ async function mounted() {
await this.fetchReleases();
}
+function updated() {
+ if (this.from.name === 'scene' && this.from.hash === '#home') {
+ const releaseTile = document.querySelector(`#scene-${this.from.params.releaseId}`);
+ if (releaseTile) releaseTile.scrollIntoView();
+ }
+}
+
export default {
components: {
FilterBar,
@@ -34,8 +42,13 @@ export default {
releases: [],
networks: [],
pageTitle: null,
+ from: null,
};
},
+ beforeRouteEnter(to, from, next) {
+ next(vm => vm.$set(vm, 'from', from));
+ },
+ updated,
mounted,
methods: {
fetchReleases,
diff --git a/assets/components/releases/releases.vue b/assets/components/releases/releases.vue
index e4aed20e..ceb1746c 100644
--- a/assets/components/releases/releases.vue
+++ b/assets/components/releases/releases.vue
@@ -10,7 +10,10 @@
v-for="release in releases"
:key="`release-${release.id}`"
>
-
+
@@ -46,6 +49,10 @@ export default {
type: String,
default: null,
},
+ referer: {
+ type: String,
+ default: null,
+ },
},
computed: {
range,
diff --git a/assets/components/tile/release.vue b/assets/components/tile/release.vue
index 97390899..205d8849 100644
--- a/assets/components/tile/release.vue
+++ b/assets/components/tile/release.vue
@@ -1,7 +1,8 @@
-
+
-
{{ release.title }}
-
+
@@ -135,6 +132,10 @@ export default {
type: Object,
default: null,
},
+ referer: {
+ type: String,
+ default: null,
+ },
},
};
diff --git a/assets/js/fragments.js b/assets/js/fragments.js
index 5b60ad5c..89ddaba8 100644
--- a/assets/js/fragments.js
+++ b/assets/js/fragments.js
@@ -113,6 +113,7 @@ const releaseFields = `
title
date
slug
+ type
createdAt
url
${releaseActorsFragment}
diff --git a/assets/js/router.js b/assets/js/router.js
index 4db6fd13..e97da921 100644
--- a/assets/js/router.js
+++ b/assets/js/router.js
@@ -17,11 +17,15 @@ Vue.use(VueRouter);
const routes = [
{
path: '/',
+ redirect: { name: 'home' },
+ },
+ {
+ path: '/home',
component: Home,
name: 'home',
},
{
- path: '/scene/:releaseId/:releaseTitle?',
+ path: '/scene/:releaseId/:releaseSlug?',
component: Release,
name: 'scene',
},
@@ -74,6 +78,9 @@ const routes = [
const router = new VueRouter({
mode: 'history',
routes,
+ afterEach(to, from) {
+ console.log(to, from);
+ },
});
export default router;
diff --git a/migrations/20190325001339_releases.js b/migrations/20190325001339_releases.js
index 7a8e07c1..adb515c1 100644
--- a/migrations/20190325001339_releases.js
+++ b/migrations/20190325001339_releases.js
@@ -326,7 +326,8 @@ exports.up = knex => Promise.resolve()
.references('id')
.inTable('studios');
- table.string('type', 10);
+ table.string('type', 10)
+ .defaultTo('scene');
table.string('shoot_id');
table.string('entry_id');