Merge branch 'master' of https://github.com/openclassify/openclassify into muammertop

This commit is contained in:
Muammer Top 2020-11-13 09:57:54 +03:00
commit 75a5b2ee5c
15 changed files with 225 additions and 18 deletions

View File

@ -23,14 +23,23 @@ return [
'latest-limit',
'popular_ads_limit',
'default_view_type',
'hide_listing_standard_price',
'hide_zero_price',
'auto_approve',
'estimated_pending_time',
'default_published_time',
'default_GET',
'listing_page_image',
],
],
'create_ad' => [
'title' => 'visiosoft.module.advs::section.create_ad',
'fields' => [
'hide_standard_price_field',
'hide_options_field',
'listing_page_image',
'hide_village_field',
'hide_configurations',
'make_map_required',
'show_breadcrumb_when_creating_ad',
],
],

View File

@ -125,6 +125,34 @@ return [
'mode' => 'checkbox'
]
],
'hide_village_field' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'hide_configurations' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'make_map_required' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'hide_listing_standard_price' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => false,
'mode' => 'checkbox'
]
],
'enabled_currencies' => [
'bind' => 'streams::currencies.enabled',
'env' => 'ADV_ENABLED_CURRENCIES',

View File

@ -0,0 +1,86 @@
#stepProgressBar {
counter-reset: step;
.step {
text-align: center;
min-width: 0;
&.current {
&::after {
background: linear-gradient(to right, #209579 50%, #dfdfdf 50%);
}
.bullet {
color: #209579;
background-color: #fff;
border: .2rem solid #209579;
@media only screen and (min-width: 768px) {
border: .3rem solid #209579;
}
}
.step-text {
font-weight: 500;
}
& ~ * {
&::after {
background-color: #dfdfdf;
}
.bullet {
color: #999;
background-color: #DFDFDF;
}
}
}
&::after {
content: '';
position: absolute;
height: .16rem;
top: 0.96rem;
left: 0;
z-index: -1;
width: 100%;
background-color: #209579;
@media only screen and (min-width: 768px) {
height: .3rem;
top: 1.4rem;
}
}
.bullet {
height: 2rem;
width: 2rem;
border-radius: 100%;
color: #fff;
display: inline-block;
position: relative;
line-height: 20px;
background-color: #209579;
@media only screen and (min-width: 768px) {
height: 3rem;
width: 3rem;
}
&::before {
content: counter(step);
counter-increment: step;
font-size: 14px;
font-weight: 600;
@media only screen and (min-width: 768px) {
font-size: 20px;
}
}
}
.step-text {
color: #999;
font-size: 12px;
@media only screen and (min-width: 768px) {
font-size: initial;
}
}
}
}

View File

@ -0,0 +1,7 @@
$('#createEditAdvForm').submit(function () {
if ($('input[name=map_Val]').val().length === 0) {
alert(selectLocationAlert)
return false
}
return true
})

View File

@ -301,6 +301,10 @@ return [
// New create page
'options' => 'Options',
'category_selection' => 'Category Selection',
'listing_details' => 'Listing Details',
'preview' => 'Preview',
'congratulations' => 'Congratulations',
'free' => 'Free',
'ad_date' => 'Ad Date',

View File

@ -25,4 +25,5 @@ return [
'no_add_found' => 'No Ad Found!',
'replicated_success' => 'The ad has been replicated successfully!',
'ad_doesnt_exist' => "This ad doesn't exist!",
'select_location_error' => "Please select a location on the map!",
];

View File

@ -41,6 +41,7 @@ return [
'ads' => 'Ads',
'user' => 'User',
'filter' => 'Filter',
'create_ad' => 'Create Ad',
'options' => [
'title' => 'Options',
],

View File

@ -100,6 +100,20 @@ return [
'hide_options_field' => [
'name' => 'Hide Options Field',
],
'hide_village_field' => [
'name' => 'Hide Village Field',
],
'hide_configurations' => [
'name' => 'Hide the Configurations Button',
'instructions' => 'Hide the Configurations Button in the Ad Preview Page',
],
'make_map_required' => [
'name' => 'Make Map Required',
'instructions' => 'Require the user to place a pin on the map when creating an ad',
],
'hide_listing_standard_price' => [
'name' => 'Hide Listing Standard Price',
],
'enabled_currencies' => [
'name' => 'Enabled Currencies',
],

View File

@ -21,11 +21,13 @@
<div class="col-md-3 text-left justify-content-center align-self-center">
<div class="row">
<div class="col-md-12">
<p class="theme-price-old small mb-0"><del>
{{ adv.standard_price != adv.price and adv.standard_price != '0'
? adv.standard_price.currency()
: '' }}
</del></p>
{% if not setting_value('visiosoft.module.advs::hide_listing_standard_price') %}
<p class="theme-price-old small mb-0"><del>
{{ adv.standard_price != adv.price and adv.standard_price != '0'
? adv.standard_price.currency()
: '' }}
</del></p>
{% endif %}
<b>{{ adv.price != '0'
? adv.price.currency()
: trans('visiosoft.module.advs::field.free') }}</b>

View File

@ -2,6 +2,8 @@
{% block content %}
<section class="clearfix home-default">
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'new-create'} %}
<div>
<nav aria-label="breadcrumb">
<ol class="breadcrumb">
@ -204,6 +206,13 @@
var pick_option = "{{ trans('visiosoft.module.location::field.pick_option.name') }}"
</script>
{% if setting_value('visiosoft.module.advs::make_map_required') %}
<script>
let selectLocationAlert = "{{ trans('visiosoft.module.advs::message.select_location_error') }}"
</script>
{{ asset_add("scripts.js", "visiosoft.module.advs::js/required-map.js") }}
{% endif %}
{{ asset_add("scripts.js", "visiosoft.module.advs::js/new-create.js") }}
{{ asset_add("scripts.js", "streams::js/form/form.js") }}
{{ asset_add("scripts.js", "streams::js/form/translations.js") }}

View File

@ -0,0 +1,33 @@
<style>
{{ asset_inline("visiosoft.module.advs::css/step.scss") }}
</style>
<div id="stepProgressBar" class="mt-5 mb-4 row mx-0">
<div class="step col{{ step == 'post-cat' ? ' current' }}">
<div class="bullet d-flex align-items-center justify-content-center mx-auto"></div>
<p class="step-text text-truncate mb-0 mt-2 d-none d-sm-block">
{{ trans('visiosoft.module.advs::field.category_selection') }}
</p>
</div>
<div class="step col{{ step == 'new-create' ? ' current' }}">
<div class="bullet d-flex align-items-center justify-content-center mx-auto"></div>
<p class="step-text text-truncate mb-0 mt-2 d-none d-sm-block">
{{ trans('visiosoft.module.advs::field.listing_details') }}
</p>
</div>
<div class="step col{{ step == 'preview' ? ' current' }}">
<div class="bullet d-flex align-items-center justify-content-center mx-auto"></div>
<p class="step-text text-truncate mb-0 mt-2 d-none d-sm-block">
{{ trans('visiosoft.module.advs::field.preview') }}
</p>
</div>
{{ addBlock('new-ad/steps/step', {'step': step})|raw }}
<div class="step col">
<div class="bullet d-flex align-items-center justify-content-center mx-auto"></div>
<p class="step-text text-truncate mb-0 mt-2 d-none d-sm-block">
{{ trans('visiosoft.module.advs::field.congratulations') }}
</p>
</div>
</div>

View File

@ -1,14 +1,19 @@
{% extends layout('post-cat') %}
{% block styles %}
{{ asset_style("visiosoft.module.advs::css/post-category.css") }}
<style>
{{ asset_inline("visiosoft.module.advs::css/post-category.css") }}
</style>
{% endblock %}
{% block content %}
<section class="clearfix ad-post-page">
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'post-cat'} %}
{% if setting_value('visiosoft.module.advs::show_breadcrumb_when_creating_ad') %}
{% include "visiosoft.module.advs::new-ad/partials/breadcrumb" %}
{% endif %}
<div id="ad-cat-section" class="border rounded shadow-sm bg-light py-4 px-3">
<h5 class="mb-3">
<img src="{{ img('visiosoft.module.advs::images/ascend.svg').url }}" class="step-icon mr-1">

View File

@ -1,6 +1,8 @@
{% extends "theme::layouts/default" %}
{% block content %}
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'preview'} %}
<div class="pt-5">
<p class="preview-paragraph">
{{ trans('visiosoft.module.advs::field.preview_text.part_1') }}
@ -14,10 +16,12 @@
{% else %}
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
{% endif %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
</a>
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
</a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }}
@ -31,10 +35,12 @@
<div class="preview-overlay position-absolute"></div>
</div>
<div class="preview-actions text-center">
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
</a>
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}}
</a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }}
</a>

View File

@ -35,7 +35,7 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
}
public function searchAdvs(
$type, $param = null, $customParameters = null,
$type, $param = null, $customParameters = [],
$limit = null, $category = null, $city = null, $paginate = true
)
{

View File

@ -27,8 +27,10 @@
class="location-field district-data">{{ form.fields.district|raw }}</li>
<li class="neighborhood-data" data-content="{{ adv['neighborhood'] }}"
class="location-field neighborhood-data">{{ form.fields.neighborhood|raw }}</li>
<li class="village-data" data-content="{{ adv['village'] }}"
class="location-field">{{ form.fields.village|raw }}</li>
{% if not setting_value('visiosoft.module.advs::hide_village_field') %}
<li class="village-data" data-content="{{ adv['village'] }}"
class="location-field">{{ form.fields.village|raw }}</li>
{% endif %}
</ul>
</div>
<div class="col-sm-8">