Browse Source

Small adjustment for the post links (don't display links that are already handled as pictures)

pull/647/head
Timothée Jaussoin 8 years ago
parent
commit
b9fe4c9523
  1. 9
      app/Post.php
  2. 2
      app/widgets/Upload/upload.js

9
app/Post.php

@ -169,7 +169,14 @@ class Post extends Model
public function getLinksAttribute()
{
return $this->attachments()->where('category', 'link')->get();
return $this->attachments()->where('category', 'link')
->whereNotIn('href', function($query) {
$query->select('href')
->from('attachments')
->where('post_id', $this->id)
->where('category', 'picture')
->get();
})->get();
}
public function getFilesAttribute()

2
app/widgets/Upload/upload.js

@ -58,7 +58,7 @@ var Upload = {
var image = new Image();
image.onload = function()
{
var limit = 1600;
var limit = 1440;
var width = image.naturalWidth;
var height = image.naturalHeight;

Loading…
Cancel
Save