Merge pull request #201 from openclassify/basetheme

fixed login and register form action
This commit is contained in:
Fatih Alp 2020-01-02 16:46:27 +03:00 committed by GitHub
commit 106476ae56
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 19 additions and 18 deletions

View File

@ -72,9 +72,13 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
public function userAdv()
{
if (Auth::user()->hasRole('admin')) {
return $this->getAdv();
} else {
return $this->getAdv()
->where('advs_advs.created_by_id', Auth::id());
}
return $this->getAdv()
->where('advs_advs.created_by_id', Auth::id());
}
public function getAdvByCat($cat_id)
@ -195,10 +199,10 @@ class AdvModel extends AdvsAdvsEntryModel implements AdvInterface
$country = CountryModel::query()->where('location_countries.id', $adv->country_id)->first();
$city = CityModel::query()->where('location_cities.id', $adv->city)->first();
if($country != null) {
if ($country != null) {
$adv->setAttribute('country_name', $country->name);
}
if($city != null) {
if ($city != null) {
$adv->setAttribute('city_name', $city->name);
}
}

View File

@ -3,18 +3,12 @@
{% block content %}
<div class="row justify-content-center">
<div class="col-12 col-sm-8 col-md-6 col-lg-4 text-left bg-light p-3 m-0">
{% set form = form('login').redirect(request_get('redirect', '/'))
.actions(
{'submit':
{'type':'primary',
'text':'<i class="fas fa-key"></i> '~trans('anomaly.module.users::button.login'),
'class':'w-100 py-2'
}
}).get() %}
{% set form = form('login')
.redirect(app.request.get('redirect'))
.get() %}
{{ form_open({
'class': 'row form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url': 'advs/save_adv',
'class':'aaa',
'url':form.options.url
})|raw }}
<div class="col-12">
{{ form.fields.email|raw }}
@ -31,8 +25,11 @@
</label>
</div>
<div class="col-12 row m-0">
<div class="col-6 pl-0 pr-1">
{{ form.actions|raw }}
<div class="col-6 pr-0 pl-1">
<button class="btn btn-sm btn-primary w-100 py-2">
<i class="fas fa-key"></i>
{{ trans('anomaly.module.users::button.login') }}
</button>
</div>
<div class="col-6 pr-0 pl-1">
<a href="{{ url('register') }}" class="btn btn-sm btn-success w-100 py-2">

View File

@ -14,7 +14,7 @@
{{ form_open({
'class': 'row form ' ~ form.options.class ,
'enctype': 'multipart/form-data',
'url': 'advs/save_adv',
'url':form.options.url
})|raw }}
<div class="col-12">
{{ form.fields.display_name|raw }}