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', 'latest-limit',
'popular_ads_limit', 'popular_ads_limit',
'default_view_type', 'default_view_type',
'hide_listing_standard_price',
'hide_zero_price', 'hide_zero_price',
'auto_approve', 'auto_approve',
'estimated_pending_time', 'estimated_pending_time',
'default_published_time', 'default_published_time',
'default_GET', 'default_GET',
'listing_page_image',
],
],
'create_ad' => [
'title' => 'visiosoft.module.advs::section.create_ad',
'fields' => [
'hide_standard_price_field', 'hide_standard_price_field',
'hide_options_field', 'hide_options_field',
'listing_page_image', 'hide_village_field',
'hide_configurations',
'make_map_required',
'show_breadcrumb_when_creating_ad', 'show_breadcrumb_when_creating_ad',
], ],
], ],

View File

@ -125,6 +125,34 @@ return [
'mode' => 'checkbox' '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' => [ 'enabled_currencies' => [
'bind' => 'streams::currencies.enabled', 'bind' => 'streams::currencies.enabled',
'env' => 'ADV_ENABLED_CURRENCIES', '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 // New create page
'options' => 'Options', 'options' => 'Options',
'category_selection' => 'Category Selection',
'listing_details' => 'Listing Details',
'preview' => 'Preview',
'congratulations' => 'Congratulations',
'free' => 'Free', 'free' => 'Free',
'ad_date' => 'Ad Date', 'ad_date' => 'Ad Date',

View File

@ -25,4 +25,5 @@ return [
'no_add_found' => 'No Ad Found!', 'no_add_found' => 'No Ad Found!',
'replicated_success' => 'The ad has been replicated successfully!', 'replicated_success' => 'The ad has been replicated successfully!',
'ad_doesnt_exist' => "This ad doesn't exist!", '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', 'ads' => 'Ads',
'user' => 'User', 'user' => 'User',
'filter' => 'Filter', 'filter' => 'Filter',
'create_ad' => 'Create Ad',
'options' => [ 'options' => [
'title' => 'Options', 'title' => 'Options',
], ],

View File

@ -100,6 +100,20 @@ return [
'hide_options_field' => [ 'hide_options_field' => [
'name' => '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' => [ 'enabled_currencies' => [
'name' => '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="col-md-3 text-left justify-content-center align-self-center">
<div class="row"> <div class="row">
<div class="col-md-12"> <div class="col-md-12">
{% if not setting_value('visiosoft.module.advs::hide_listing_standard_price') %}
<p class="theme-price-old small mb-0"><del> <p class="theme-price-old small mb-0"><del>
{{ adv.standard_price != adv.price and adv.standard_price != '0' {{ adv.standard_price != adv.price and adv.standard_price != '0'
? adv.standard_price.currency() ? adv.standard_price.currency()
: '' }} : '' }}
</del></p> </del></p>
{% endif %}
<b>{{ adv.price != '0' <b>{{ adv.price != '0'
? adv.price.currency() ? adv.price.currency()
: trans('visiosoft.module.advs::field.free') }}</b> : trans('visiosoft.module.advs::field.free') }}</b>

View File

@ -2,6 +2,8 @@
{% block content %} {% block content %}
<section class="clearfix home-default"> <section class="clearfix home-default">
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'new-create'} %}
<div> <div>
<nav aria-label="breadcrumb"> <nav aria-label="breadcrumb">
<ol class="breadcrumb"> <ol class="breadcrumb">
@ -204,6 +206,13 @@
var pick_option = "{{ trans('visiosoft.module.location::field.pick_option.name') }}" var pick_option = "{{ trans('visiosoft.module.location::field.pick_option.name') }}"
</script> </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", "visiosoft.module.advs::js/new-create.js") }}
{{ asset_add("scripts.js", "streams::js/form/form.js") }} {{ asset_add("scripts.js", "streams::js/form/form.js") }}
{{ asset_add("scripts.js", "streams::js/form/translations.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') %} {% extends layout('post-cat') %}
{% block styles %} {% block styles %}
{{ asset_style("visiosoft.module.advs::css/post-category.css") }} <style>
{{ asset_inline("visiosoft.module.advs::css/post-category.css") }}
</style>
{% endblock %} {% endblock %}
{% block content %} {% block content %}
<section class="clearfix ad-post-page"> <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') %} {% if setting_value('visiosoft.module.advs::show_breadcrumb_when_creating_ad') %}
{% include "visiosoft.module.advs::new-ad/partials/breadcrumb" %} {% include "visiosoft.module.advs::new-ad/partials/breadcrumb" %}
{% endif %} {% endif %}
<div id="ad-cat-section" class="border rounded shadow-sm bg-light py-4 px-3"> <div id="ad-cat-section" class="border rounded shadow-sm bg-light py-4 px-3">
<h5 class="mb-3"> <h5 class="mb-3">
<img src="{{ img('visiosoft.module.advs::images/ascend.svg').url }}" class="step-icon mr-1"> <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" %} {% extends "theme::layouts/default" %}
{% block content %} {% block content %}
{% include 'visiosoft.module.advs::new-ad/partials/steps' with {'step': 'preview'} %}
<div class="pt-5"> <div class="pt-5">
<p class="preview-paragraph"> <p class="preview-paragraph">
{{ trans('visiosoft.module.advs::field.preview_text.part_1') }} {{ trans('visiosoft.module.advs::field.preview_text.part_1') }}
@ -14,10 +16,12 @@
{% else %} {% else %}
{% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %} {% set continueLink = url_route('adv_detail_seo', [adv.slug, adv.id]) %}
{% endif %} {% endif %}
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}" <a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white"> class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}} {{trans('visiosoft.module.advs::button.create_configurations')}}
</a> </a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" <a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}"
class="btn preview-edit shadow-sm border"> class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }} {{ trans('visiosoft.module.advs::field.edit') }}
@ -31,10 +35,12 @@
<div class="preview-overlay position-absolute"></div> <div class="preview-overlay position-absolute"></div>
</div> </div>
<div class="preview-actions text-center"> <div class="preview-actions text-center">
{% if not setting_value('visiosoft.module.advs::hide_configurations') %}
<a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}" <a href="{{ route('visiosoft.module.advs::user.configrations.create') }}?ad={{ adv.id }}"
class="btn btn-warning shadow-sm mr-4 text-white"> class="btn btn-warning shadow-sm mr-4 text-white">
{{trans('visiosoft.module.advs::button.create_configurations')}} {{trans('visiosoft.module.advs::button.create_configurations')}}
</a> </a>
{% endif %}
<a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" class="btn preview-edit shadow-sm border"> <a href="{{ url_route('visiosoft.module.advs::edit_adv', [adv.id]) }}" class="btn preview-edit shadow-sm border">
{{ trans('visiosoft.module.advs::field.edit') }} {{ trans('visiosoft.module.advs::field.edit') }}
</a> </a>

View File

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

View File

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