mirror of
https://github.com/pinry/pinry.git
synced 2025-11-17 18:30:39 +01:00
Feature: Use real-link for referer and origianl image
This commit is contained in:
committed by
Isaac Bythewood
parent
eadeecf78f
commit
d7e89050a0
@@ -4,7 +4,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-image">
|
<div class="card-image">
|
||||||
<figure class="image">
|
<figure class="image">
|
||||||
<img :src="pinItem.original_url" alt="Image">
|
<img :src="pinItem.large_image_url" alt="Image">
|
||||||
</figure>
|
</figure>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-content">
|
<div class="card-content">
|
||||||
@@ -28,20 +28,24 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
<div class="is-pulled-right">
|
<div class="is-pulled-right">
|
||||||
<b-button tag="router-link"
|
<a :href="pinItem.referer">
|
||||||
to="/"
|
<b-button
|
||||||
class="meta-link"
|
v-show="pinItem.referer !== null"
|
||||||
type="is-warning">
|
class="meta-link"
|
||||||
|
type="is-warning">
|
||||||
Referer
|
Referer
|
||||||
</b-button>
|
</b-button>
|
||||||
|
</a>
|
||||||
|
<a :href="pinItem.original_image_url">
|
||||||
|
<b-button
|
||||||
|
v-show="pinItem.original_image_url !== null"
|
||||||
|
class="meta-link"
|
||||||
|
type="is-link">
|
||||||
|
Original Image
|
||||||
|
</b-button>
|
||||||
|
</a>
|
||||||
<b-button tag="router-link"
|
<b-button tag="router-link"
|
||||||
to="/"
|
:to="{ name: 'pin', params: { pinId: pinItem.id } }"
|
||||||
class="meta-link"
|
|
||||||
type="is-link">
|
|
||||||
Original URL
|
|
||||||
</b-button>
|
|
||||||
<b-button tag="router-link"
|
|
||||||
to="/"
|
|
||||||
class="meta-link"
|
class="meta-link"
|
||||||
type="is-success">
|
type="is-success">
|
||||||
Pin URL
|
Pin URL
|
||||||
|
|||||||
@@ -79,7 +79,9 @@ function createImageItem(pin) {
|
|||||||
image.tags = pin.tags;
|
image.tags = pin.tags;
|
||||||
image.author = pin.submitter.username;
|
image.author = pin.submitter.username;
|
||||||
image.avatar = `//gravatar.com/avatar/${pin.submitter.gravatar}`;
|
image.avatar = `//gravatar.com/avatar/${pin.submitter.gravatar}`;
|
||||||
image.original_url = pinHandler.escapeUrl(pin.image.image);
|
image.large_image_url = pinHandler.escapeUrl(pin.image.image);
|
||||||
|
image.original_image_url = pin.url;
|
||||||
|
image.referer = pin.referer;
|
||||||
image.orgianl_width = pin.image.width;
|
image.orgianl_width = pin.image.width;
|
||||||
image.style = {
|
image.style = {
|
||||||
width: `${pin.image.thumbnail.width}px`,
|
width: `${pin.image.thumbnail.width}px`,
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import Home from '../views/Home.vue';
|
|||||||
import Pins4Tag from '../views/Pins4Tag.vue';
|
import Pins4Tag from '../views/Pins4Tag.vue';
|
||||||
import Pins4User from '../views/Pins4User.vue';
|
import Pins4User from '../views/Pins4User.vue';
|
||||||
import Pins4Board from '../views/Pins4Board.vue';
|
import Pins4Board from '../views/Pins4Board.vue';
|
||||||
|
import Pins4Id from '../views/Pins4Id.vue';
|
||||||
|
|
||||||
Vue.use(VueRouter);
|
Vue.use(VueRouter);
|
||||||
|
|
||||||
@@ -28,6 +29,11 @@ const routes = [
|
|||||||
name: 'board',
|
name: 'board',
|
||||||
component: Pins4Board,
|
component: Pins4Board,
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: '/pins/:pinId',
|
||||||
|
name: 'pin',
|
||||||
|
component: Pins4Id,
|
||||||
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
const router = new VueRouter({
|
const router = new VueRouter({
|
||||||
|
|||||||
40
pinry-spa/src/views/Pins4Id.vue
Normal file
40
pinry-spa/src/views/Pins4Id.vue
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
<template>
|
||||||
|
<div class="pins-for-tag">
|
||||||
|
<PHeader></PHeader>
|
||||||
|
<Pins :pin-filters="filters"></Pins>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import PHeader from '../components/PHeader.vue';
|
||||||
|
import Pins from '../components/Pins.vue';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
name: 'p-header',
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
filters: { tagFilter: null },
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
PHeader,
|
||||||
|
Pins,
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.initializeTag();
|
||||||
|
},
|
||||||
|
beforeRouteUpdate(to, from, next) {
|
||||||
|
this.initializeTag();
|
||||||
|
next();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
initializeTag() {
|
||||||
|
this.filters.tagFilter = this.$route.params.tag;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
||||||
|
<style scoped lang="scss">
|
||||||
|
</style>
|
||||||
Reference in New Issue
Block a user