This commit is contained in:
Diatrex 2020-10-08 11:39:05 +03:00
commit bebc6f0064
22 changed files with 318 additions and 216 deletions

View File

@ -28,17 +28,27 @@ return [
'estimated_pending_time',
'default_published_time',
'default_GET',
'add_canvas',
'hide_standard_price_field',
'listing_page_image',
],
],
'ads_image' => [
'title' => 'visiosoft.module.advs::section.ads_image',
'fields' => [
'image_resize_backend',
'full_image_width',
'full_image_height',
'medium_image_width',
'medium_image_height',
'thumbnail_width',
'thumbnail_height',
'picture_width',
'picture_height',
'add_canvas',
'image_canvas_width',
'image_canvas_height',
'watermark_type',
'watermark_text',
'watermark_image',
'watermark_position',
'listing_page_image',
'hide_standard_price_field',
],
],
'user' => [

View File

@ -108,71 +108,6 @@ return [
'default_value' => 0,
],
],
'thumbnail_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 270,
],
],
'add_canvas' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
'mode' => 'checkbox',
],
],
'thumbnail_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 180,
],
],
'picture_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'picture_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 400,
],
],
'watermark_type' => [
'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_type',
'env' => 'ADV_WATERMARK_TYPE',
'required' => true,
'config' => [
'options' => ['image' => 'Image', 'text' => 'Text'],
'default_value' => 'text',
]
],
'watermark_text' => [
'type' => 'anomaly.field_type.text',
'bind' => 'adv.watermark_text',
'env' => 'ADV_WATERMARK_TEXT',
],
'watermark_image' => [
'type' => 'anomaly.field_type.file',
'bind' => 'adv.watermark_image',
'env' => 'ADV_WATERMARK_IMAGE',
'config' => [
'default_value' => '',
],
],
'watermark_position' => [
'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_position',
'env' => 'ADV_WATERMARK_POSITION',
'required' => true,
'config' => [
'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right',
'bottom-left' => 'Bottom Left', 'center' => 'Middle'],
'default_value' => 'top-right',
]
],
'listing_page_image' => [
'type' => 'anomaly.field_type.file',
@ -255,4 +190,97 @@ return [
'default_value' => 15,
],
],
//Image Settings
'image_resize_backend' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
],
],
'full_image_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 800,
],
],
'full_image_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'medium_image_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'medium_image_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 400,
],
],
'thumbnail_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 270,
],
],
'thumbnail_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 180,
],
],
'add_canvas' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
],
],
'image_canvas_width' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 800,
],
],
'image_canvas_height' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'watermark_type' => [
'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_type',
'env' => 'ADV_WATERMARK_TYPE',
'required' => true,
'config' => [
'options' => ['image' => 'Image', 'text' => 'Text'],
'default_value' => 'text',
]
],
'watermark_text' => [
'type' => 'anomaly.field_type.text',
'bind' => 'adv.watermark_text',
'env' => 'ADV_WATERMARK_TEXT',
],
'watermark_image' => [
'type' => 'anomaly.field_type.file',
'bind' => 'adv.watermark_image',
'env' => 'ADV_WATERMARK_IMAGE',
],
'watermark_position' => [
'type' => 'anomaly.field_type.select',
'bind' => 'adv.watermark_position',
'env' => 'ADV_WATERMARK_POSITION',
'required' => true,
'config' => [
'options' => ['top-right' => 'Top Right', 'top-left' => 'Top Left', 'bottom-right' => 'Bottom Right',
'bottom-left' => 'Bottom Left', 'center' => 'Middle'],
'default_value' => 'top-right',
]
],
];

View File

@ -44,4 +44,5 @@ return [
'options' => [
'title' => 'Options',
],
'ads_image' => 'Ads Image',
];

View File

@ -79,21 +79,6 @@ return [
'default_GET' => [
'name' => 'Default Ad GET',
],
'add_canvas' => [
'name' => 'Add Canvas',
],
'thumbnail_width' => [
'name' => 'Thumbnail Width',
],
'thumbnail_height' => [
'name' => 'Thumbnail Height',
],
'picture_width' => [
'name' => 'Picture Width',
],
'picture_height' => [
'name' => 'Picture Height',
],
'twitter' => [
'name' => 'Twitter',
],
@ -106,18 +91,6 @@ return [
'google' => [
'name' => 'Google',
],
'watermark_type' => [
'name' => 'Watermark Type',
],
'watermark_text' => [
'name' => 'Watermark Text',
],
'watermark_image' => [
'name' => 'Watermark Image',
],
'watermark_position' => [
'name' => 'Watermark Position',
],
'listing_page_image' => [
'name' => 'Listing Page Image',
],
@ -158,4 +131,49 @@ return [
'popular_ads_limit' => [
'name' => 'Popular Ads Limit',
],
//Image
'image_resize_backend' => [
'name' => 'Image Resize Backend',
],
'full_image_width' => [
'name' => 'Full Image Width',
],
'full_image_height' => [
'name' => 'Full Image Height',
],
'medium_image_width' => [
'name' => 'Medium Image Width',
],
'medium_image_height' => [
'name' => 'Medium Image Height',
],
'thumbnail_width' => [
'name' => 'Thumbnail Width',
],
'thumbnail_height' => [
'name' => 'Thumbnail Height',
],
'add_canvas' => [
'name' => 'Add Canvas',
],
'image_canvas_width' => [
'name' => 'Image Canvas Width',
],
'image_canvas_height' => [
'name' => 'Image Canvas Height',
],
'watermark_type' => [
'name' => 'Watermark Type',
],
'watermark_text' => [
'name' => 'Watermark Text',
],
'watermark_image' => [
'name' => 'Watermark Image',
],
'watermark_position' => [
'name' => 'Watermark Position',
],
];

View File

@ -2,6 +2,7 @@
use Anomaly\Streams\Platform\Image\Command\MakeImageInstance;
use Anomaly\Streams\Platform\Model\Advs\AdvsCustomFieldsEntryModel;
use Carbon\Carbon;
use GuzzleHttp\Client;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\DB;
@ -371,4 +372,9 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
$neighborhood = $neighborhoodModel->newQuery()->find($this->neighborhood);
return $neighborhood ? $neighborhood->name : false;
}
public function expired()
{
return $this->finish_at ? $this->finish_at < Carbon::now() : true;
}
}

View File

@ -4,4 +4,5 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface AdvInterface extends EntryInterface
{
public function expired();
}

View File

@ -433,7 +433,7 @@ class AdvsController extends PublicController
$adv = $this->adv_repository->getListItemAdv($id);
if ($adv) {
if ($adv && !$adv->expired()) {
if ($this->adv_model->is_enabled('complaints')) {
$complaints = ComplaintsComplainTypesEntryModel::all();

View File

@ -223,6 +223,8 @@
height: 40px;
margin-top: -9px;
vertical-align: middle;
object-fit: contain;
object-position: center;
}
#topbar .logo svg .st0 {
transition: fill 300ms 500ms;
@ -2670,6 +2672,8 @@ body {
max-height: 82px;
margin-top: -30px;
vertical-align: middle;
object-fit: contain;
object-position: center;
}
#login .logo svg .st0 {
fill: #ffffff;

View File

@ -0,0 +1,19 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="25.7" viewBox="0 0 40 25.7">
<defs>
<linearGradient id="linear-gradient" x1="0.906" y1="0.743" x2="0.193" y2="0.743" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#fff"/>
<stop offset="1" stop-color="#c6c4c4"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="0.367" y1="0.156" x2="0.779" y2="0.997" xlink:href="#linear-gradient"/>
<linearGradient id="linear-gradient-3" x1="0.26" y1="0.715" x2="0.846" y2="0.216" xlink:href="#linear-gradient"/>
</defs>
<g id="oc_logo2" data-name="oc logo2" transform="translate(16875 -4360)">
<rect id="Rectangle_166" data-name="Rectangle 166" width="40" height="25.7" transform="translate(-16875 4360)" fill="#e2c756" opacity="0"/>
<g id="Group_16415" data-name="Group 16415" transform="translate(365.099 -0.303)">
<path id="Union_162" data-name="Union 162" d="M12.825,25.7h0ZM0,12.85a12.818,12.818,0,1,1,23.489,7.109,8.4,8.4,0,0,0-3.2-.69H16.277a7.31,7.31,0,1,0-3.555.882h6.534c4.015,0,7.851,4.117,7.851,5.549H12.774A12.818,12.818,0,0,1,0,12.85Z" transform="translate(-17233.715 4360.303)" fill="#fff"/>
<path id="Path_10942" data-name="Path 10942" d="M10721.25,13446.668a12.819,12.819,0,0,0,1.842-9.667,23.11,23.11,0,0,1-7.479,7.774,7.484,7.484,0,0,1-1.612,1.177h4A8.2,8.2,0,0,1,10721.25,13446.668Z" transform="translate(-27931.426 -9066.381)" opacity="0.49" fill="url(#linear-gradient)"/>
<path id="Path_10943" data-name="Path 10943" d="M9615.6,12634a12.736,12.736,0,0,0-9.6,5.741,22.812,22.812,0,0,1,10.778-.205,7.232,7.232,0,0,1,5.2,2.288A20.176,20.176,0,0,0,9615.6,12634Z" transform="translate(-26837.588 -8273.647)" opacity="0.49" fill="url(#linear-gradient-2)"/>
<path id="Path_10944" data-name="Path 10944" d="M9499,13345.158a12.865,12.865,0,0,0,8.006,7.852,23.372,23.372,0,0,1-3.057-10.4,7.239,7.239,0,0,1,.869-5.612A19.873,19.873,0,0,0,9499,13345.158Z" transform="translate(-26731.959 -8967.659)" opacity="0.49" fill="url(#linear-gradient-3)"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -0,0 +1,21 @@
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="40" height="25.7" viewBox="0 0 40 25.7">
<defs>
<linearGradient id="linear-gradient" x1="0.906" y1="0.743" x2="0.193" y2="0.743" gradientUnits="objectBoundingBox">
<stop offset="0" stop-color="#22547c"/>
<stop offset="1" stop-color="#0e3c61"/>
</linearGradient>
<linearGradient id="linear-gradient-2" x1="0.367" y1="0.156" x2="0.779" y2="0.997" xlink:href="#linear-gradient"/>
<linearGradient id="linear-gradient-3" x1="0.26" y1="0.715" x2="0.846" y2="0.216" xlink:href="#linear-gradient"/>
</defs>
<g id="oc_logo1" data-name="oc logo1" transform="translate(16924 -4360)">
<rect id="Rectangle_165" data-name="Rectangle 165" width="40" height="25.7" transform="translate(-16924 4360)" fill="#e2c756" opacity="0"/>
<g id="Group_16418" data-name="Group 16418" transform="translate(-16917.654 4360)">
<g id="Group_16370" data-name="Group 16370" transform="translate(0 0)">
<path id="Union_161" data-name="Union 161" d="M12.825,25.7h0ZM0,12.85a12.818,12.818,0,1,1,23.489,7.109,8.4,8.4,0,0,0-3.2-.69H16.277a7.31,7.31,0,1,0-3.555.882h6.534c4.015,0,7.851,4.117,7.851,5.549H12.774A12.818,12.818,0,0,1,0,12.85Z" fill="#22547c"/>
<path id="Path_4453" data-name="Path 4453" d="M10721.249,13446.667a12.814,12.814,0,0,0,1.841-9.667,23.133,23.133,0,0,1-7.479,7.775,7.526,7.526,0,0,1-1.61,1.176h4A8.229,8.229,0,0,1,10721.249,13446.667Z" transform="translate(-10697.711 -13426.683)" opacity="0.49" fill="url(#linear-gradient)"/>
<path id="Path_4455" data-name="Path 4455" d="M9615.6,12634a12.748,12.748,0,0,0-9.6,5.741,22.838,22.838,0,0,1,10.778-.205,7.235,7.235,0,0,1,5.2,2.289A20.174,20.174,0,0,0,9615.6,12634Z" transform="translate(-9603.875 -12633.949)" opacity="0.49" fill="url(#linear-gradient-2)"/>
<path id="Path_4456" data-name="Path 4456" d="M9499,13345.158a12.86,12.86,0,0,0,8,7.852,23.4,23.4,0,0,1-3.057-10.4,7.245,7.245,0,0,1,.871-5.614A19.88,19.88,0,0,0,9499,13345.158Z" transform="translate(-9498.241 -13327.961)" opacity="0.49" fill="url(#linear-gradient-3)"/>
</g>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 2.1 KiB

View File

@ -19,7 +19,7 @@
<div class="logo">
<a href="/admin" class="variant-logo">
{{ img('theme::img/icon.svg').data|raw }}
{{ img('theme::img/panel-icon.svg').data|raw }}
</a>
</div>

View File

@ -7,7 +7,7 @@
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{{ img('theme::img/login-icon.svg').data|raw }}
{% endif %}
{{ setting_value('visiosoft.theme.defaultadmin::title') }}
</div>
@ -21,7 +21,7 @@
{% if setting_value('visiosoft.theme.defaultadmin::login_icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::login_icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{{ img('theme::img/login-icon.svg').data|raw }}
{% endif %}
</div>

View File

@ -5,7 +5,7 @@
{% if setting_value('visiosoft.theme.defaultadmin::panel_icon') %}
<img src="{{ file(setting_value('visiosoft.theme.defaultadmin::panel_icon')).url }}" alt="site icon">
{% else %}
{{ img('theme::img/icon.svg').data|raw }}
{{ img('theme::img/panel-icon.svg').data|raw }}
{% endif %}
<span>{{ setting_value('visiosoft.theme.defaultadmin::title') }}</span>
</a>

View File

@ -1,23 +0,0 @@
<?php
return [
'imageCanvasW' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 800,
],
],
'imageCanvasH' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
'imageResizeH' => [
'type' => 'anomaly.field_type.integer',
'config' => [
'default_value' => 600,
],
],
];

View File

@ -16,8 +16,8 @@ $(function () {
var dropzone = new Dropzone('.dropzone:not(data-initialized)',
{
paramName: 'upload',
resizeWidth: 800,
resizeHeight: 600,
resizeWidth: settings_image['resize_width'],
resizeHeight: settings_image['resize_height'],
autoProcessQueue: true,
parallelUploads: 1,
resizeMethod: 'contain',

View File

@ -1,12 +1,13 @@
<?php
return [
'choose_folder' => 'Which folder would you like to upload to?',
'upload' => 'Add İmages | Upload İmages | Attach a photo',
'choose_files' => 'Which files would you like to use?',
'choose_folder' => 'Which folder would you like to upload to?',
'upload' => 'Add İmages | Upload İmages | Attach a photo',
'choose_files' => 'Which files would you like to use?',
'no_files_selected' => 'No files selected.',
'no_uploads' => 'No files uploaded.',
'overwrite' => 'has already been uploaded. Would you like to overwrite it?',
'uploading' => 'Uploading',
'loading' => 'Loading',
'no_uploads' => 'No files uploaded.',
'overwrite' => 'has already been uploaded. Would you like to overwrite it?',
'uploading' => 'Uploading',
'loading' => 'Loading',
'error_upload' => 'There was a problem uploading the file.',
];

View File

@ -1,16 +0,0 @@
<?php
return [
'imageCanvasW' => [
'name' => 'Image Canvas Width'
],
'imageCanvasH' => [
'name' => 'Image Canvas Height'
],
'imageResizeW' => [
'name' => 'Image Resize Width'
],
'imageResizeH' => [
'name' => 'Image Resize Height'
],
];

View File

@ -14,3 +14,9 @@
</div>
</div>
<script>
var settings_image = {
'resize_width':"{{ setting_value('visiosoft.module.advs::full_image_width') }}",
'resize_height':"{{ setting_value('visiosoft.module.advs::full_image_height') }}"
};
</script>

View File

@ -5,7 +5,6 @@ use Anomaly\Streams\Platform\Model\Files\FilesFilesEntryModel;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Storage;
use Visiosoft\MediaFieldType\Table\FileTableBuilder;
use Visiosoft\MediaFieldType\Table\UploadTableBuilder;
use Anomaly\FilesModule\File\FileUploader;
use Anomaly\FilesModule\Folder\Command\GetFolder;
@ -13,7 +12,6 @@ use Anomaly\FilesModule\Folder\Contract\FolderRepositoryInterface;
use Anomaly\Streams\Platform\Http\Controller\AdminController;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Intervention\Image\Facades\Image as WaterMark;
use Anomaly\SettingsModule\Setting\Contract\SettingRepositoryInterface;
use Anomaly\FilesModule\File\Contract\FileRepositoryInterface;
/**
@ -25,16 +23,20 @@ use Anomaly\FilesModule\File\Contract\FileRepositoryInterface;
*/
class UploadController extends AdminController
{
public $uploader;
public $folders;
public $files;
use DispatchesJobs;
/**
* Return the uploader.
*
* @param UploadTableBuilder $table
* @param $folder
* @return \Illuminate\View\View
*/
public function __construct(FileUploader $uploader, FolderRepositoryInterface $folders, FileRepositoryInterface $files)
{
$this->uploader = $uploader;
$this->folders = $folders;
$this->files = $files;
parent::__construct();
}
public function index(UploadTableBuilder $table, $folder)
{
return $this->view->make(
@ -46,90 +48,102 @@ class UploadController extends AdminController
);
}
/**
* Upload a file.
*
* @param FileUploader $uploader
* @param FolderRepositoryInterface $folders
* @return \Illuminate\Http\JsonResponse
*/
public function upload(FileUploader $uploader, FolderRepositoryInterface $folders, SettingRepositoryInterface $settings, FileRepositoryInterface $files)
public function upload()
{
if ($file = $uploader->upload($this->request->file('upload'), $folders->find($this->request->get('folder')))) {
$file = $this->uploader->upload($this->request->file('upload'), $this->folders->find($this->request->get('folder')));
if ($file) {
$watermarktype = $settings->value('visiosoft.module.advs::watermark_type');
$position = $settings->value('visiosoft.module.advs::watermark_position');
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.field_type.media::imageResizeH', 600),function ($constraint) {
$constraint->aspectRatio();
});
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, setting_value('visiosoft.module.advs::picture_height'),function ($constraint) {
$settings_key = [
'image_resize_backend',
'full_image_width',
'full_image_height',
'medium_image_width',
'medium_image_height',
'thumbnail_width',
'thumbnail_height',
'add_canvas',
'image_canvas_width',
'image_canvas_height',
'watermark_type',
'watermark_text',
'watermark_image',
'watermark_position'
];
$settings_value = array();
foreach ($settings_key as $key) {
$settings_value[$key] = setting_value('visiosoft.module.advs::' . $key);
}
$fullImg = WaterMark::make($this->request->file('upload')->getRealPath());
if ($settings_value['image_resize_backend']) {
$fullImg = $fullImg->resize(null, $settings_value['full_image_height'],
function ($constraint) {
$constraint->aspectRatio();
});
if (setting_value('visiosoft.module.advs::add_canvas')) {
}
$mdImg = WaterMark::make($this->request->file('upload')->getRealPath())
->resize(null, $settings_value['medium_image_height'], function ($constraint) {
$constraint->aspectRatio();
});
if ($settings_value['add_canvas']) {
$fullImg->resizeCanvas(
setting_value('visiosoft.field_type.media::imageCanvasW', 800),
setting_value('visiosoft.field_type.media::imageCanvasH', 600),
$settings_value['image_canvas_width'], $settings_value['image_canvas_height'],
'center', false, 'fff'
);
$mdImg->resizeCanvas(
setting_value('visiosoft.module.advs::picture_width', 400),
setting_value('visiosoft.module.advs::picture_height', 300),
$settings_value['medium_image_width'], $settings_value['medium_image_height'],
'center', false, 'fff'
);
}
foreach ([$fullImg, $mdImg] as $index => $image) {
if ($watermarktype == 'image') {
$watermarkimage_id = $settings->value('visiosoft.module.advs::watermark_image');
$watermarkimage = $files->find($watermarkimage_id);
if ($watermarkimage != null) {
$image_types = array('full' => $fullImg, 'medium' => $mdImg);
foreach ($image_types as $key => $image) {
if ($settings_value['watermark_type'] == 'image') {
if (!$watermarkimage = $this->files->find($settings_value['watermark_image'])) {
$watermark = WaterMark::make(app_storage_path() . '/files-module/local/' . $watermarkimage->path());
$image->insert($watermark, $position);
$image->insert($watermark, $settings_value['watermark_position']);
}
} else {
$watermarktext = $settings->value('visiosoft.module.advs::watermark_text');
$v = "top";
$h = "center";
$w = $image->width() / 2;
$h1 = $image->height() / 2;
$font_size = $w / 20;
$image->text($watermarktext, $w, $h1, function ($font) use ($v, $h, $font_size) {
$image->text($settings_value['watermark_text'], $w, $h1, function ($font) use ($v, $h, $font_size) {
$font->file(public_path('Antonio-Bold.ttf'));
$font->size($font_size);
$font->align($h);
$font->valign($v);
});
}
if ($index === 0) {
if ($key === "full") {
$fileName = $file->getAttributes()['name'];
} else {
$fileName = 'md-' . $file->getAttributes()['name'];
$files->create([
'folder_id' => $this->request->get('folder'),
'name' => $fileName,
'disk_id' => 1,
'size' => $image->filesize(),
'mime_type' => $image->mime,
'extension' => $image->extension,
]);
$this->createFile($this->request->get('folder'),$fileName,$image);
}
$image->save(app_storage_path() . '/files-module/local/images/' . $fileName);
}
return $this->response->json($file->getAttributes());
}
return $this->response->json(['error' => 'There was a problem uploading the file.'], 500);
return $this->response->json(['error' => trans('visiosoft.field_type.media::message.error_upload')], 500);
}
/**
* Return the recently uploaded files.
*
* @param FileTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function recent(UploadTableBuilder $table)
{
return $table->setUploaded(explode(',', $this->request->get('uploaded')))
@ -158,4 +172,16 @@ class UploadController extends AdminController
}
return response()->json(['status' => 'error']);
}
public function createFile($folder, $filename, $image)
{
$this->files->create([
'folder_id' => $folder,
'name' => $filename,
'disk_id' => 1,
'size' => $image->filesize(),
'mime_type' => $image->mime,
'extension' => $image->extension,
]);
}
}

View File

@ -50,7 +50,7 @@
<div>
{% set userForm = form('userProfile').entry(user.id).get() %}
{{ userForm.open()|raw }}
<div class="mt-4 d-flex profile--desc flex-column flex-lg-row text-lg-center">
<div class="mt-4 d-flex profile--desc flex-column flex-lg-row">
<div class="d-flex d-sm-block m-auto m-sm-0 mr-sm-3">
<img src="{{ profile_photo }}">
</div>

View File

@ -44,13 +44,13 @@ class DatabaseSeeder extends Seeder
$admin = $this->roles->findBySlug('admin');
$this->users->unguard();
$this->users->newQuery()->where('email', "admin@visiosoft.com.tr")->forceDelete();
$this->users->newQuery()->where('email', "info@openclassify.com")->forceDelete();
$visiosoft_administrator = $this->users->create(
[
'display_name' => 'Visiosoft Dev',
'email' => "admin@visiosoft.com.tr",
'username' => "visiosoft",
'password' => "visiosoft123",
'display_name' => 'openclassify',
'email' => "info@openclassify.com",
'username' => "openclassify",
'password' => "openclassify",
]
);
@ -108,4 +108,4 @@ class DatabaseSeeder extends Seeder
$this->call(widgetSeeder::class);
}
}
}

View File

@ -29,8 +29,8 @@ class widgetSeeder extends Seeder
->create(
[
'en' => [
'title' => 'ARecent News',
'description' => 'ARecent news from http://pyrocms.com/',
'title' => 'Recent News',
'description' => 'Recent news'
],
'extension' => 'anomaly.extension.xml_feed_widget',
'dashboard' => $dashboard,
@ -43,7 +43,7 @@ class widgetSeeder extends Seeder
[
'scope' => $widget->getId(),
'key' => 'anomaly.extension.xml_feed_widget::url',
'value' => 'http://www.pyrocms.com/posts/rss.xml',
'value' => 'https://openclassify.com/posts/rss.xml',
]
);
}