This commit is contained in:
Diatrex 2020-06-19 15:02:55 +03:00
commit fbe84591d5
53 changed files with 638 additions and 70 deletions

View File

@ -0,0 +1,57 @@
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsCreateOptionsStream extends Migration
{
/**
* This migration creates the stream.
* It should be deleted on rollback.
*
* @var bool
*/
protected $delete = true;
/**
* The stream definition.
*
* @var array
*/
protected $stream = [
'slug' => 'options',
'title_column' => 'name',
'translatable' => false,
'versionable' => false,
'trashable' => false,
'searchable' => false,
'sortable' => false,
];
/**
* This field will be added.
*/
protected $fields = [
"adv" => [
"type" => "anomaly.field_type.relationship",
"config" => [
"related" => \Visiosoft\AdvsModule\Adv\AdvModel::class,
]
]
];
/**
* The stream assignments.
*
* @var array
*/
protected $assignments = [
'name' => [
'required' => true,
],
'adv' => [
'required' => true,
],
];
}

View File

@ -16,4 +16,9 @@ return [
'write',
'delete',
],
'options' => [
'read',
'write',
'delete',
],
];

View File

@ -1,5 +1,5 @@
.ad-detail-tabs .nav-link.active {
background-color: #FFC106 !important;
background-color: #FFC106;
border-color: #ffc107 #ffc107 #ffc107;
}

View File

@ -1,6 +1,7 @@
.dropleft-edit {
right: 0;
top: 40%;
z-index: 5;
}
.dropleft-edit button {
transform: rotate(-90deg) translate(0, -100%);

View File

@ -15,8 +15,10 @@
max-height: 100px;
}
.list-classified .bg-light {
height: 100px;
@media only screen and (min-width: 768px) {
.list-classified .bg-light {
height: 100px;
}
}
.upper-list-banner {
@ -47,8 +49,6 @@
/* Mobile filter */
.mobile-list-action {
margin-left: -30px;
margin-right: -30px;
border: 1px solid #dee2e68a;
}
@ -76,6 +76,10 @@
background: #c9c9c9;
}
.mobile-list-action div:last-child a:after {
content: none;
}
.mobile-list-action i {
font-size: 19px;
color: #a1a1a1;
@ -105,4 +109,18 @@
#filterModal {
overflow-y: auto;
}
.result-text {
font-size: 13px;
margin: 0 -15px;
}
.result-text span:first-child {
font-weight: 500;
}
.result-text span:last-child {
color: #8f0100;
font-weight: 500;
}

View File

@ -141,4 +141,13 @@ $('.set_category').on('click', function () {
$('#filterModal').find('form').attr("action", '/advs/list');
$('#filterModal').modal('toggle');
})
});
// Move filter on small screen
$(window).on("load resize", function () {
const width = (window.innerWidth > 0) ? window.innerWidth : screen.width;
if (width <= 575) {
const detach = $('#listFilterForm').detach();
$('#modalListFilterForm').append(detach);
}
});

View File

@ -173,5 +173,17 @@ $('.ad-info-right-bar-video').tooltip({
html: true
});
$("#listFilterForm").submit(function(e) {
const inputs = $('#listFilterForm :input');
[...inputs].forEach((input) => {
if (input.type === 'checkbox' || input.type === 'radio') {
if ($(input).prop("checked") == false) {
$(input).prop('disabled', true);
}
} else {
if ($(input).val() == "" || $(input).find(':selected').val() == "") {
$(input).prop('disabled', true);
}
}
});
});

View File

@ -215,5 +215,44 @@ $(document).ready(function () {
price = parseInt(price.replace(/\./g, ''));
let decimal = parseInt($(".priceDecimalField").val());
$('.priceHidden').find('input').val(parseFloat(price + "." + decimal));
});
// Add dynamic option creation
$(".options-tags").select2({
tags: true,
tokenSeparators: [',']
});
let deletedOptions = [];
$('#selectOptions').on('select2:unselect', function (e) {
if (e.params.data.element.id) {
const id = e.params.data.element.id.substr(9);
deletedOptions.push(id);
} else {
let index = newOptions.indexOf(e.params.data.text);
if (index > -1) {
newOptions.splice(index, 1);
}
}
});
let newOptions = [];
$('#selectOptions').on('select2:select', function (e) {
if (e.params.data.element) {
let index = deletedOptions.indexOf(e.params.data.element.id.substr(9));
if (index > -1) {
deletedOptions.splice(index, 1);
}
} else {
newOptions.push(e.params.data.text)
}
});
$('#createEditAdvForm').submit(function () {
$(this).append(`<input type="hidden" name="deleted_options" value="${deletedOptions}" />`);
$(this).append(`<input type="hidden" name="new_options" value="${newOptions}" />`);
return true;
})
});

View File

@ -31,4 +31,5 @@ return [
'update_category' => [
'name' => 'Update Category'
],
'new_option' => 'New Option',
];

View File

@ -263,6 +263,8 @@ return [
"no_location" => "No location is selected.",
"continue" => 'Continue',
"gallery" => 'Gallery',
"ads" => 'Ads',
"were_found" => 'were found.',
// Pending screen
'pending_message_1' => 'The Ad is in the Approval Process',

View File

@ -49,4 +49,12 @@ return [
'delete' => 'Can delete cf values?',
],
],
'options' => [
'name' => 'Options',
'option' => [
'read' => 'Can read options?',
'write' => 'Can create/edit options?',
'delete' => 'Can delete options?',
],
],
];

View File

@ -40,4 +40,7 @@ return [
'general' => 'General',
'ads' => 'Ads',
'user' => 'User',
'options' => [
'title' => 'Options',
],
];

View File

@ -19,4 +19,7 @@ return [
'cf_values' => [
'name' => 'Cf values',
],
'options' => [
'name' => 'Options',
],
];

View File

@ -127,7 +127,7 @@ return [
'sort' => 'Tipi',
'sort_by' => 'Rendit Sipas',
'pick_option' => 'Zgjidh një mundësi',
'pick_ordering' => 'Merr Porosin',
'pick_ordering' => 'Renditje',
'price_high' => 'Cmimi i larte deri tek i uleti',
'price_low' => 'Cmimi i ulet deri tek i larte',
'newest' => 'Më të Rejat',

View File

@ -34,7 +34,7 @@
</div>
<!-- Detail With Block -->
{{ addBlock('ad-detail/details',{'adv':adv})|raw }}
{{ addBlock('ad-detail/details',{'adv':adv, 'options':options})|raw }}
{{ addBlock('ad-detail/widget-details',{'adv':adv})|raw }}
<!-- Detail With Block -->

View File

@ -1,5 +1,9 @@
{% extends layout('list') %}
{% block styles %}
{{ asset_style("visiosoft.module.advs::css/list.css") }}
{% endblock %}
{% block content %}
<section>
@ -15,7 +19,15 @@
</div>
<div class="col-md-9">
<div class="section recommended-classified">
{% if catText %}
<div class="result-text border py-2 px-3 mb-3 d-none d-sm-block">
<p class="mb-0">
<span>"{{ catText }}"</span>
<span>{{ advs.total }} {{ trans('visiosoft.module.advs::field.ads')|lower }}</span>
{{ trans('visiosoft.module.advs::field.were_found') }}
</p>
</div>
{% endif %}
<div class="row breadcrumb list-header">
<div class="col-md-6 my-2 d-none d-sm-block">
@ -61,7 +73,6 @@
</script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/list.js") }}
{{ asset_add("styles.css", "visiosoft.module.advs::css/list.css") }}
{% endblock %}
{% block customjs %}

View File

@ -6,14 +6,13 @@
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">{{ trans('visiosoft.module.advs::field.filter') }}
</h5>
<h5 class="modal-title">{{ trans('visiosoft.module.advs::field.filter') }}</h5>
<button type="button" class="close" data-dismiss="modal">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<div class="col-12 border p-2 mb-2 mx-0">
<div class="col-12 border p-2 mb-2 mx-0 category-filter-modal">
<label class="w-100">
<b>{{ trans('visiosoft.module.advs::button.categories') }}</b>
</label>
@ -36,7 +35,7 @@
{% endif %}
</a>
</div>
{% include "visiosoft.module.advs::list/partials/list-filter" %}
<div id="modalListFilterForm"></div>
</div>
</div>
</div>

View File

@ -1,5 +1,5 @@
{% set formHtml %}
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get">
<form action="{{ url_route('visiosoft.module.advs::list') }}" method="get" id="listFilterForm">
{% endset %}
{% set catSlug = null %}
{% set citySlug = null %}
@ -12,7 +12,7 @@
{% endif %}
{% if catSlug %}
{% set formHtml %}
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get">
<form action="{{ url_route('adv_list_seo', [catSlug, citySlug]) }}" method="get" id="listFilterForm">
{% endset %}
{% endif %}
{{ formHtml }}

View File

@ -2,7 +2,7 @@
{% block listContent %}
<div class="table-responsive table-classified">
<table class="table classified-list-table">
<table class="table classified-list-table table-striped">
<thead>
<tr>
<th scope="col" colspan="2"

View File

@ -20,6 +20,7 @@
<div class="col-md-12">
{% set form = form('advs', 'advs').entry(id).actions(['update']).get() %}
{{ form_open({
'id': 'createEditAdvForm',
'class': 'form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url': 'advs/save_adv',
@ -94,6 +95,22 @@
</div>
</div>
<div class="row form-group select-options">
<label for="selectOptions" class="col-sm-2">
Options
</label>
<div class="col-sm-10">
<select id="selectOptions" class="form-control options-tags" multiple="multiple"
name="options[]">
{% if count(options) %}
{% for option in options %}
<option id="advOption{{ option.id }}" selected="selected">{{ option.name }}</option>
{% endfor %}
{% endif %}
</select>
</div>
</div>
<div class="row form-group brand-name">
<div class="col-md-12">
<div class="field-group advs_desc">

View File

@ -213,10 +213,10 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
return $this->getAdv()->where('advs_advs.id', $id)->first();
}
public function addCart($item, $quantity = 1)
public function addCart($item, $quantity = 1, $name = null)
{
$cart = $this->dispatch(new GetCart());
$cart->add($item, $quantity);
$cart->add($item, $quantity, $name);
return $this->dispatch(new GetCart());
}

View File

@ -11,6 +11,8 @@ use Anomaly\Streams\Platform\Model\Advs\AdvsAdvsEntryModel;
use Visiosoft\AdvsModule\Adv\AdvModel;
use Visiosoft\AdvsModule\Adv\Form\AdvFormBuilder;
use Visiosoft\AdvsModule\Listener\AddAdvsSettingsScript;
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
use Visiosoft\AdvsModule\Option\OptionRepository;
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
use Visiosoft\LocationModule\Village\VillageRepository;
use Visiosoft\LocationModule\Village\VillageModel;
@ -299,7 +301,7 @@ class AdvsModuleServiceProvider extends AddonServiceProvider
VillageRepositoryInterface::class => VillageRepository::class,
CategoryRepositoryInterface::class => CategoryRepository::class,
CountryRepositoryInterface::class => CountryRepository::class,
AdvRepositoryInterface::class => AdvRepository::class,
OptionRepositoryInterface::class => OptionRepository::class,
];
/**

View File

@ -0,0 +1,43 @@
<?php namespace Visiosoft\AdvsModule\Http\Controller\Admin;
use Visiosoft\AdvsModule\Option\Form\OptionFormBuilder;
use Visiosoft\AdvsModule\Option\Table\OptionTableBuilder;
use Anomaly\Streams\Platform\Http\Controller\AdminController;
class OptionsController extends AdminController
{
/**
* Display an index of existing entries.
*
* @param OptionTableBuilder $table
* @return \Symfony\Component\HttpFoundation\Response
*/
public function index(OptionTableBuilder $table)
{
return $table->render();
}
/**
* Create a new entry.
*
* @param OptionFormBuilder $form
* @return \Symfony\Component\HttpFoundation\Response
*/
public function create(OptionFormBuilder $form)
{
return $form->render();
}
/**
* Edit an existing entry.
*
* @param OptionFormBuilder $form
* @param $id
* @return \Symfony\Component\HttpFoundation\Response
*/
public function edit(OptionFormBuilder $form, $id)
{
return $form->render($id);
}
}

View File

@ -14,6 +14,7 @@ use Visiosoft\AdvsModule\Adv\Event\showAdPhone;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Illuminate\Support\Facades\Cookie;
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
use Visiosoft\LocationModule\City\CityRepository;
use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use function PMA\Util\get;
@ -69,6 +70,8 @@ class AdvsController extends PublicController
private $settings_repository;
private $event;
private $optionRepository;
public function __construct(
UserRepositoryInterface $userRepository,
@ -89,6 +92,8 @@ class AdvsController extends PublicController
CategoryModel $categoryModel,
CategoryRepositoryInterface $category_repository,
OptionRepositoryInterface $optionRepository,
SettingRepositoryInterface $settings_repository,
Dispatcher $events,
@ -122,6 +127,7 @@ class AdvsController extends PublicController
$this->requestHttp = $request;
parent::__construct();
$this->optionRepository = $optionRepository;
}
@ -279,9 +285,26 @@ class AdvsController extends PublicController
$viewType = $this->requestHttp->cookie('viewType');
if (!isset($allCats)) {
if (count($mainCats) == 1 || count($mainCats) == 2) {
$catText = end($mainCats)['val'];
} elseif (count($mainCats) > 2) {
$catArray = array_slice($mainCats, 2);
$catText = '';
$loop = 0;
foreach ($catArray as $cat) {
$catText = !$loop ? $catText . $cat['val'] : $catText . ' ' . $cat['val'];
$loop++;
}
}
$this->template->set('showTitle', false);
$this->template->set('meta_title', $catText);
$this->template->set('meta_description', $catText);
}
$compact = compact('advs', 'countries', 'mainCats', 'subCats', 'checkboxes', 'request', 'param',
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges', 'seenList',
'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats');
'user', 'featured_advs', 'viewType', 'topfields', 'selectDropdown', 'selectRange', 'selectImage', 'ranges',
'seenList', 'searchedCountry', 'radio', 'categoryId', 'cityId', 'allCats', 'catText');
return $this->viewTypeBasedRedirect($viewType, $compact);
}
@ -367,6 +390,8 @@ class AdvsController extends PublicController
}
}
$options = $this->optionRepository->findAllBy('adv_id', $id);
if ($isCommentActive) {
$CommentModel = new CommentModel();
$comments = $CommentModel->getComments($adv->id)->get();
@ -388,7 +413,8 @@ class AdvsController extends PublicController
$this->template->set('meta_image', $coverPhoto);
if ($adv->created_by_id == isset(auth()->user()->id) OR $adv->status == "approved") {
return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints', 'recommended_advs', 'categories', 'features', 'comments', 'qrSRC'));
return $this->view->make('visiosoft.module.advs::ad-detail/detail', compact('adv', 'complaints',
'recommended_advs', 'categories', 'features', 'comments', 'qrSRC', 'options'));
} else {
return back();
}
@ -417,6 +443,8 @@ class AdvsController extends PublicController
}
}
$options = $this->optionRepository->findAllBy('adv_id', $id);
if ($this->adv_model->is_enabled('customfields')) {
$features = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->view($adv);
}
@ -424,7 +452,7 @@ class AdvsController extends PublicController
$isActiveDopings = $this->adv_model->is_enabled('dopings');
return $this->view->make('visiosoft.module.advs::new-ad/preview/preview',
compact('adv', 'categories', 'features', 'isActiveDopings'));
compact('adv', 'categories', 'features', 'isActiveDopings', 'options'));
}
public function getLocations()
@ -546,6 +574,26 @@ class AdvsController extends PublicController
}
}
// Create options
$deletedOptions = $request->deleted_options;
$newOptions = $request->new_options;
if (!empty($deletedOptions)) {
$deletedOptions = explode(',', $request->deleted_options);
$this->optionRepository->newQuery()
->whereIn('id', $deletedOptions)
->where('adv_id', $request->update_id)
->delete();
}
if (!empty($newOptions)) {
$newOptions = explode(',', $request->new_options);
foreach ($newOptions as $option) {
$this->optionRepository->create([
'name' => $option,
'adv_id' => $request->update_id,
]);
}
}
$adv->is_get_adv = $request->is_get_adv;
$adv->save();
@ -587,8 +635,9 @@ class AdvsController extends PublicController
}
$form->render($request->update_id);
$adv = $this->adv_repository->find($request->update_id);
if ($this->request->address_id != "") {
$adv = $form->getFormEntry();
$address = $address->find($this->request->address_id);
$adv->country_id = $address->country_id;
$adv->city = $address->city;
@ -601,8 +650,7 @@ class AdvsController extends PublicController
$post['id'] = $request->update_id;
$events->dispatch(new priceChange($post));//price history
if ($request->url == "") {
$LastAdv = $advModel->getLastUserAdv();
$advRepository->cover_image_update($LastAdv);
$advRepository->cover_image_update($adv);
}
if ($form->hasFormErrors()) {
@ -668,6 +716,8 @@ class AdvsController extends PublicController
}
}
$options = $this->optionRepository->findAllBy('adv_id', $id);
//Cloudinary Module
$isActiveCloudinary = new AdvModel();
$isActiveCloudinary = $isActiveCloudinary->is_enabled('cloudinary');
@ -688,7 +738,8 @@ class AdvsController extends PublicController
$custom_fields = app('Visiosoft\CustomfieldsModule\Http\Controller\cfController')->edit($adv, $categories, $cats);
}
return $this->view->make('visiosoft.module.advs::new-ad/new-create', compact('id', 'cats_d', 'request', 'Cloudinary', 'cities', 'adv', 'custom_fields'));
return $this->view->make('visiosoft.module.advs::new-ad/new-create', compact('id', 'cats_d',
'request', 'Cloudinary', 'cities', 'adv', 'custom_fields', 'options'));
}
public function statusAds($id, $type, SettingRepositoryInterface $settings, Dispatcher $events)
@ -946,11 +997,12 @@ class AdvsController extends PublicController
{
$id = $request->id;
$quantity = $request->quantity;
$name = $request->name;
$thisModel = new AdvModel();
$adv = $thisModel->isAdv($id);
$response = array();
if ($adv) {
$cart = $thisModel->addCart($adv, $quantity);
$cart = $thisModel->addCart($adv, $quantity, $name);
$response['status'] = "success";
} else {
$response['status'] = "error";

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option\Contract;
use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface OptionInterface extends EntryInterface
{
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option\Contract;
use Anomaly\Streams\Platform\Entry\Contract\EntryRepositoryInterface;
interface OptionRepositoryInterface extends EntryRepositoryInterface
{
}

View File

@ -0,0 +1,66 @@
<?php namespace Visiosoft\AdvsModule\Option\Form;
use Anomaly\Streams\Platform\Ui\Form\FormBuilder;
class OptionFormBuilder extends FormBuilder
{
/**
* The form fields.
*
* @var array|string
*/
protected $fields = [];
/**
* Additional validation rules.
*
* @var array|string
*/
protected $rules = [];
/**
* Fields to skip.
*
* @var array|string
*/
protected $skips = [];
/**
* The form actions.
*
* @var array|string
*/
protected $actions = [];
/**
* The form buttons.
*
* @var array|string
*/
protected $buttons = [
'cancel',
];
/**
* The form options.
*
* @var array
*/
protected $options = [];
/**
* The form sections.
*
* @var array
*/
protected $sections = [];
/**
* The form assets.
*
* @var array
*/
protected $assets = [];
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Entry\EntryCollection;
class OptionCollection extends EntryCollection
{
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Entry\EntryCriteria;
class OptionCriteria extends EntryCriteria
{
}

View File

@ -0,0 +1,9 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Visiosoft\AdvsModule\Option\Contract\OptionInterface;
use Anomaly\Streams\Platform\Model\Advs\AdvsOptionsEntryModel;
class OptionModel extends AdvsOptionsEntryModel implements OptionInterface
{
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Entry\EntryObserver;
class OptionObserver extends EntryObserver
{
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Entry\EntryPresenter;
class OptionPresenter extends EntryPresenter
{
}

View File

@ -0,0 +1,25 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Visiosoft\AdvsModule\Option\Contract\OptionRepositoryInterface;
use Anomaly\Streams\Platform\Entry\EntryRepository;
class OptionRepository extends EntryRepository implements OptionRepositoryInterface
{
/**
* The entry model.
*
* @var OptionModel
*/
protected $model;
/**
* Create a new OptionRepository instance.
*
* @param OptionModel $model
*/
public function __construct(OptionModel $model)
{
$this->model = $model;
}
}

View File

@ -0,0 +1,8 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Entry\EntryRouter;
class OptionRouter extends EntryRouter
{
}

View File

@ -0,0 +1,15 @@
<?php namespace Visiosoft\AdvsModule\Option;
use Anomaly\Streams\Platform\Database\Seeder\Seeder;
class OptionSeeder extends Seeder
{
/**
* Run the seeder.
*/
public function run()
{
//
}
}

View File

@ -0,0 +1,61 @@
<?php namespace Visiosoft\AdvsModule\Option\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
class OptionTableBuilder extends TableBuilder
{
/**
* The table views.
*
* @var array|string
*/
protected $views = [];
/**
* The table filters.
*
* @var array|string
*/
protected $filters = [];
/**
* The table columns.
*
* @var array|string
*/
protected $columns = [];
/**
* The table buttons.
*
* @var array|string
*/
protected $buttons = [
'edit'
];
/**
* The table actions.
*
* @var array|string
*/
protected $actions = [
'delete'
];
/**
* The table options.
*
* @var array
*/
protected $options = [];
/**
* The table assets.
*
* @var array
*/
protected $assets = [];
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

After

Width:  |  Height:  |  Size: 26 KiB

View File

@ -9,11 +9,11 @@
<div class="row p-2">
{% if setting_value('visiosoft.theme.base::latest_and_view_all_btn') %}
<div class="col-md-6">
<h4 class="p-2">{{ trans('theme::field.latest_ads') }}</h4>
<h4 class="p-2">{{ trans('visiosoft.theme.base::field.latest_ads') }}</h4>
</div>
<div class="col-md-6 text-right">
<a class="btn btn-outline-secondary"
href="{{ url_route('visiosoft.module.advs::list') }}">{{ trans('theme::field.show_all') }}</a>
href="{{ url_route('visiosoft.module.advs::list') }}">{{ trans('visiosoft.theme.base::field.show_all') }}</a>
</div>
{% endif %}

View File

@ -12,22 +12,22 @@
<html>
<head>
{% include "theme::partials/metadata" %}
{% include "visiosoft.theme.base::partials/metadata" %}
{% block styles %}{% endblock %}
</head>
<body>
{% include "theme::partials/header" %}
{% include "visiosoft.theme.base::partials/header" %}
{{ addBlock('layouts/default/section')|raw }}
<main id="main">
<div class="container">
{% include "theme::partials/messages" %}
{% include "visiosoft.theme.base::partials/messages" %}
{% if (request_path() == '/') %}
{% include "theme::index/default" %}
{% include "visiosoft.theme.base::index/default" %}
{% else %}
{% block content %}{% endblock %}
{% endif %}
@ -35,9 +35,9 @@
</div>
</main>
{% include "theme::partials/footer" %}
{% include "theme::partials/assets" %}
{% include "theme::partials/settings" %}
{% include "visiosoft.theme.base::partials/footer" %}
{% include "visiosoft.theme.base::partials/assets" %}
{% include "visiosoft.theme.base::partials/settings" %}
</body>
</html>

View File

@ -14,7 +14,7 @@
{{ asset_add("theme.js", "visiosoft.theme.base::js/jquery.maskedinput.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/intlTelInput.min.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/utils.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/phoneField.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/phonefield.js") }}
{{ asset_add("theme.js", "visiosoft.theme.base::js/jquery.inputmask.bundle.min.js") }}
{# Theme Scripts #}

View File

@ -1,5 +1,5 @@
<header id="header">
{% include "theme::partials/navigation" %}
{% include "visiosoft.theme.base::partials/navigation" %}
</header>

View File

@ -8,8 +8,11 @@
<!-- Meta Tags -->
<title>
{{ setting_value('streams::name', config_get('streams::distribution.name')) }}
&#8250;
{% set showTitle = template.showTitle is same as(false) ? false : true %}
{% if showTitle %}
{{ setting_value('streams::name', config_get('streams::distribution.name')) }}
&#8250;
{% endif %}
{{ trans(template.meta_title) }}
</title>

View File

@ -37,7 +37,7 @@
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
</li>
</ul>
{% endif %}
@ -56,7 +56,7 @@
<a class="nav-link" href="{{ url_route('profile::profile') }}">{{ trans('visiosoft.theme.base::field.profile') }}</a>
</li>
<li class="nav-item">
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("theme::button.post_ad.name") }}</a>
<a href="/advs/create_adv" class="btn btn-primary">{{ trans("visiosoft.theme.base::button.post_ad.name") }}</a>
</li>
</ul>
{% endif %}

View File

@ -154,7 +154,7 @@ class CategoryController extends AdminController
}
return $this->view->make('visiosoft.module.cats::cats/admin-cat', compact('formBuilder'));
return $this->view->make('visiosoft.module.cats::cats/admin-cat');
}
public function endsWith($string, $test) {

View File

@ -41,13 +41,15 @@ class AddViewAdsButton
protected function addViewAdsButton(UserTableBuilder $builder)
{
$buttons = $builder->getButtons();
$dropdown = array_merge($buttons['settings']['dropdown'], [
"ads" => [
"text" => trans('visiosoft.theme.defaultadmin::button.view_ads'),
"href" => "admin/advs?filter_User={entry.id}"
]
]);
$buttons['settings']['dropdown'] = $dropdown;
$builder->setButtons($buttons);
if (isset($buttons['settings'])) {
$dropdown = array_merge($buttons['settings']['dropdown'], [
"ads" => [
"text" => trans('visiosoft.theme.defaultadmin::button.view_ads'),
"href" => "admin/advs?filter_User={entry.id}"
]
]);
$buttons['settings']['dropdown'] = $dropdown;
$builder->setButtons($buttons);
}
}
}

View File

@ -102,4 +102,4 @@
<script>
var default_country = "{{ setting_value('visiosoft.module.location::default_country') }}"
</script>
{{ asset_add("scripts.js", "visiosoft.theme.base::js/phoneField.js") }}
{{ asset_add("scripts.js", "visiosoft.theme.base::js/phonefield.js") }}

View File

@ -3,14 +3,9 @@
bottom: 10%;
z-index: 1;
button {
color: rgba(0,0,0,.5);
border: 0;
padding: .25rem .75rem;
font-size: 1.25rem;
line-height: 1;
background-color: #E91E63;
border-radius: .25rem;
img {
width: 3rem;
height: 3rem;
}
}
@ -28,13 +23,15 @@
-webkit-transition: 300ms ease;
transition: 300ms ease;
@media only screen and (min-width: 768px) {
padding: 1.5rem 2.25rem;
height: initial;
position: initial;
-webkit-transform: initial;
-ms-transform: initial;
transform: initial;
}
@media only screen and (min-width: 992px) {
padding: 1.5rem 2.25rem;
}
&.reveal {
-webkit-transform: translateX(0%);

View File

@ -0,0 +1,11 @@
<svg xmlns="http://www.w3.org/2000/svg" width="55" height="55" viewBox="0 0 55 55">
<g id="Group_3192" data-name="Group 3192" transform="translate(-32 -493)">
<circle id="Ellipse_89" data-name="Ellipse 89" cx="27.5" cy="27.5" r="27.5" transform="translate(32 493)" fill="#22547c" opacity="0.73"/>
<g id="navbar_mobile_light" transform="translate(24 462.55)">
<rect id="rectangle" width="39" height="36" transform="translate(16 40.45)" fill="rgba(0,0,0,0)"/>
<rect id="Rectangle_137" data-name="Rectangle 137" width="30" height="3" transform="translate(21 64.45)" fill="#fff"/>
<rect id="Rectangle_138" data-name="Rectangle 138" width="30" height="3" transform="translate(21 56.45)" fill="#fff"/>
<rect id="Rectangle_139" data-name="Rectangle 139" width="30" height="3" transform="translate(21 48.45)" fill="#fff"/>
</g>
</g>
</svg>

After

Width:  |  Height:  |  Size: 872 B

View File

@ -1,7 +1,6 @@
<div class="col-12 navbar-dark py-2 d-md-none profile-nav-toggler">
<button class="rounded-circle p-2" id="navbarSideButton" type="button">
<span class="navbar-toggler-icon"></span>
</button>
<img src="{{ img('visiosoft.module.profile::images/nav-menu.svg').url }}" alt="nav icon" id="navbarSideButton"
class="ml-2">
</div>
<div class="col-10 col-sm-6 col-md-3 profile-navigation border rounded navbar-side bg-white" id="navbarSide">
<a href="{{ url_route('profile::profile') }}" class="px-3 mb-2 link-unstyled">

View File

@ -0,0 +1,32 @@
<?php
namespace Visiosoft\ProfileModule\Http\Middleware;
use Closure;
use Illuminate\Contracts\Auth\Guard;
use Illuminate\Http\Request;
class authCheck
{
private $auth;
private $request;
public function __construct(Guard $auth,Request $request)
{
$this->auth = $auth;
$this->request = $request;
}
/**
* @param Guard $auth
* @return \Illuminate\Http\RedirectResponse|\Illuminate\Routing\Redirector
*/
public function handle(Request $request, Closure $next)
{
if ($this->auth->check()) {
return redirect($this->request->get('redirect', '/'));
}
return $next($request);
}
}

View File

@ -6,6 +6,7 @@ use Visiosoft\ProfileModule\Adress\Contract\AdressRepositoryInterface;
use Visiosoft\ProfileModule\Adress\AdressRepository;
use Anomaly\Streams\Platform\Model\Profile\ProfileAdressEntryModel;
use Visiosoft\ProfileModule\Adress\AdressModel;
use Visiosoft\ProfileModule\Http\Middleware\authCheck;
use Visiosoft\ProfileModule\Profile\Password\ForgotPassFormBuilder;
use Visiosoft\ProfileModule\Profile\Password\PasswordFormBuilder;
use Visiosoft\ProfileModule\Profile\Profile\ProfileFormBuilder;
@ -105,6 +106,15 @@ class ProfileModuleServiceProvider extends AddonServiceProvider
],
'ajax/phone-validation' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@phoneValidation',
'register' => [
'middleware' => [
authCheck::class
],
'ttl' => 0,
'as' => 'anomaly.module.users::register',
'uses' => 'Anomaly\UsersModule\Http\Controller\RegisterController@register',
],
/* Login */
'login-in' => 'Visiosoft\ProfileModule\Http\Controller\UserAuthenticator@attempt',

View File

@ -47,7 +47,7 @@ class ValueTableBuilder extends TableBuilder
protected $buttons = [
'view' => [
'target' => '_blank',
'href' => 'admin/files/view/{entry.id}',
'href' => '/files/{entry.path}',
],
'remove' => [
'data-dismiss' => 'file',

View File

@ -77,7 +77,7 @@ return [
'separator' => ',',
'point' => '.',
'decimals' => 2,
'symbol' => 'L',
'symbol' => 'Leke',
],
'AMD' => [
'name' => 'Armenian Dram',