Merge pull request #1083 from openclassify/dia

#4010 design
This commit is contained in:
Muammer Top 2021-05-28 14:17:29 +03:00 committed by GitHub
commit 586595e43c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 72 additions and 18 deletions

View File

@ -0,0 +1,33 @@
<?php
use Anomaly\Streams\Platform\Database\Migration\Migration;
class VisiosoftModuleAdvsCreateShowPhoneNumberField extends Migration
{
public function __construct()
{
//Maria DB will be removed when the version is updated.
\Illuminate\Support\Facades\DB::getDoctrineSchemaManager()
->getDatabasePlatform()->registerDoctrineTypeMapping('point', 'string');
}
protected $delete = false;
protected $stream = [
'slug' => 'advs',
];
protected $fields = [
'show_phone_number' => [
'type' => 'anomaly.field_type.boolean',
'config' => [
'default_value' => true,
'mode' => 'checkbox',
],
],
];
protected $assignments = [
'show_phone_number'
];
}

View File

@ -337,6 +337,9 @@ return [
'owner' => 'Owner',
'default_owner_instruction' => 'The owner will default to the current user if no user is selected',
'create_page_subtitle' => 'Create the ad flawlessly by entering detailed information about your ad.',
'with_my_phone_numbers' => 'With my phone numbers',
'not_with_my_phone_numbers' => "I don't want to be reached by phone",
'how_can_you_be_contacted' => "How can you be contacted?",
// Listing page
'ad_title' => 'Ad title',

View File

@ -1,19 +1,19 @@
<div id="contactInfo" class="mb-3">
<h3>{{ trans('visiosoft.module.advs::field.contact_info') }}</h3>
{# TODO Add an option to show or hide phone number #}
{# <div id="reachInfo">#}
{# <p>Size nasıl ulaşılsın?</p>#}
{# <div>#}
{# <label class="mr-3">#}
{# <input type="radio" class="mr-1" checked>#}
{# Telefon numaralarım ile#}
{# </label>#}
{# <label>#}
{# <input type="radio" class="mr-1">#}
{# Telefonla ulaşılmak istemiyorum#}
{# </label>#}
{# </div>#}
{# </div>#}
<div id="reachInfo">
{% set showPhoneNumber = form.fields.show_phone_number.value %}
<p>{{ trans('visiosoft.module.advs::field.how_can_you_be_contacted') }}</p>
<div>
<label class="mr-3">
<input type="radio" class="mr-1" name="show_phone_number" value="1" {{ showPhoneNumber ? 'checked' }}>
{{ trans('visiosoft.module.advs::field.with_my_phone_numbers') }}
</label>
<label>
<input type="radio" class="mr-1" name="show_phone_number" value="0" {{ not showPhoneNumber ? 'checked' }}>
{{ trans('visiosoft.module.advs::field.not_with_my_phone_numbers') }}
</label>
</div>
</div>
<div id="contactSummary" class="d-flex justify-content-between flex-wrap">
<label>
{{ trans('visiosoft.module.profile::field.name.name') }}

View File

@ -14,10 +14,25 @@ use Visiosoft\CartsModule\Cart\Command\GetCart;
use Visiosoft\LocationModule\District\DistrictModel;
use Visiosoft\LocationModule\Neighborhood\NeighborhoodModel;
use Visiosoft\LocationModule\Village\Contract\VillageRepositoryInterface;
use Visiosoft\LocationModule\Village\VillageModel;
class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
{
public function getTransNameAttribute()
{
if (is_null($this->name)) {
$ad = DB::table('advs_advs')
->join('advs_advs_translations', 'advs_advs.id', '=', 'entry_id')
->select('name')
->where('advs_advs.id', $this->id)
->whereNotNull('name')
->first();
return $ad ? $ad->name : '-';
}
return $this->name;
}
public function is_enabled($slug)
{
if ($addon = app('module.collection')->get($slug)) {

View File

@ -4,6 +4,8 @@ use Anomaly\Streams\Platform\Entry\Contract\EntryInterface;
interface AdvInterface extends EntryInterface
{
public function getTransNameAttribute();
public function is_enabled($slug);
public function is_enabled_extension($slug);

View File

@ -82,7 +82,8 @@ class AdvFormBuilder extends FormBuilder
'doc_files',
'popular_adv',
'adv_day',
'product_options_value'
'product_options_value',
'show_phone_number'
];
if (setting_value('visiosoft.module.advs::show_finish_and_publish_date')) {

View File

@ -3,7 +3,7 @@
{% else %}
{% set showTheme = true %}
{% endif %}
{% if showTheme %}
{% if showTheme and params.adv.show_phone_number.value %}
{% set user = params.adv.created_by %}
{% if user.gsm_phone is not null %}
<div class="col-md-12 m-2 number-container">

View File

@ -33,7 +33,7 @@ class SignInFormHandler
(strpos(session('url')['intended'], 'admin') !== false) ? request()->session()->flush() : '';
}
$authenticator->login($user, $builder->getFormValue('remember_me'));
$authenticator->login($user, !!$builder->getFormValue('remember_me'));
$builder->setFormResponse($redirect->intended($builder->getFormOption('redirect', '/')));
}