Merge pull request #245 from openclassify/vedat

update column name && add background color
This commit is contained in:
Fatih Alp 2020-01-22 13:12:51 +03:00 committed by GitHub
commit e3e0fd96b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
31 changed files with 55 additions and 47 deletions

View File

@ -2,9 +2,10 @@
{% for adv in advs %}
<div class="col-md-12 mb-2 list-classified">
<a href="{{ adv.detail_url }}" class="text-dark">
<div class="row bg-light">
<div class="col-md-2 justify-content-center align-self-center border-right border-white">
<img class="img-thumbnail" src="{{ adv.cover_photo }}" alt="{{ adv.name }}">
<div class="row bg-light{% if adv.doping != null %} doping_type4 {% endif %}">
<div class="col-md-2 justify-content-center align-self-center text-center border-right border-white">
<img class="img-thumbnail" src="{{ adv.cover_photo }}" alt="{{ adv.name }}"
style="max-height:80px;">
</div>
<div class="col-md-7 justify-content-center align-self-center border-right border-white">
<div class="row">

View File

@ -20,8 +20,9 @@
</tr>
</thead>
<tbody>
{{ addBlock('ad-list/partials/table',{'featured_advs':featured_advs})|raw }}
{% for adv in advs %}
<tr class="text-center clickable-row" data-href='{{ adv.detail_url }}'>
<tr class="text-center clickable-row{% if adv.doping != null %} doping_type4 {% endif %}" data-href='{{ adv.detail_url }}'>
<td class="justify-content-center align-middle text-center td-image">
<a href="">
<img class="img-thumbnail" src="{{ adv.cover_photo }}" alt="{{ adv.name }}">

View File

@ -199,8 +199,6 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
$join->on('advs_advs.id', '=', 'dopings_dopings.adv_name_id');
$join->where('dopings_dopings.doping_type_id', '=', 4);
});
$query = $query->select('advs_advs.*', 'dopings_dopings.id as doping');
}
if (!empty($param['sort_by'])) {
switch ($param['sort_by']) {
@ -216,7 +214,13 @@ class AdvRepository extends EntryRepository implements AdvRepositoryInterface
}
} else {
$query = $query->orderBy('advs_advs.created_at', 'desc');
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name', 'advs_advs_translations.advs_desc as advs_desc');
if ($isActiveDopings) {
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
'advs_advs_translations.advs_desc as advs_desc', 'dopings_dopings.id as doping');
} else {
$query = $query->select('advs_advs.*', 'advs_advs_translations.name as name',
'advs_advs_translations.advs_desc as advs_desc');
}
}
if ($type == "list") {

View File

@ -21,7 +21,8 @@ return [
],
'icon' => [
'name' => 'Icon'
],
],
'please_wait' => 'Please wait.Deleting Sub Categories',
'category_selection' => 'Category Selection',
];

View File

@ -21,7 +21,8 @@ return [
],
'icon' => [
'name' => 'Icon'
],
],
'please_wait' => 'Lütfen bekleyin. Alt Kategoriler Siliniyor',
'category_selection' => 'Kategori Seçimi',
];

View File

@ -14,7 +14,7 @@ class VisiosoftModuleProfileCreateProfileFields extends Migration
*/
protected $fields = [
'name' => 'anomaly.field_type.text',
'user_no' => [
'user' => [
'type' => 'anomaly.field_type.relationship',
'config' => [
'related' => UserModel::class,

View File

@ -25,7 +25,7 @@ class VisiosoftModuleProfileCreateProfileStream extends Migration
* @var array
*/
protected $assignments = [
'user_no',
'user',
'file',
'email' => [
'required' => true

View File

@ -25,7 +25,7 @@ class VisiosoftModuleProfileCreateAdressStream extends Migration
* @var array
*/
protected $assignments = [
'user_no',
'user',
'adress_name' => [
'required' => true,
],

View File

@ -100,7 +100,7 @@ return [
'messages' => [
'name' => 'رسائل'
],
'user_no' => [
'user' => [
'name' => 'المستعمل'
],

View File

@ -133,7 +133,7 @@
"name" =>"Mitteilungen",
],
"user_no" => [
"user" => [
"name" =>"Nutzer",
],

View File

@ -133,7 +133,7 @@
"name" =>"Μηνύματα",
],
"user_no" => [
"user" => [
"name" =>"Χρήστης",
],

View File

@ -100,7 +100,7 @@ return [
'messages' => [
'name' => 'Messages'
],
'user_no' => [
'user' => [
'name' => 'User'
],

View File

@ -133,7 +133,7 @@
"name" =>"Mensajes",
],
"user_no" => [
"user" => [
"name" =>"Usuario",
],

View File

@ -133,7 +133,7 @@
"name" =>"پیام ها",
],
"user_no" => [
"user" => [
"name" =>"کاربر",
],

View File

@ -133,7 +133,7 @@
"name" =>"messages",
],
"user_no" => [
"user" => [
"name" =>"Utilisateur",
],

View File

@ -133,7 +133,7 @@
"name" =>"messaggi",
],
"user_no" => [
"user" => [
"name" =>"Utente",
],

View File

@ -133,7 +133,7 @@
"name" =>"berichten",
],
"user_no" => [
"user" => [
"name" =>"Gebruiker",
],

View File

@ -133,7 +133,7 @@
"name" =>"Mensagens",
],
"user_no" => [
"user" => [
"name" =>"Do utilizador",
],

View File

@ -133,7 +133,7 @@
"name" =>"Сообщения",
],
"user_no" => [
"user" => [
"name" =>"пользователь",
],

View File

@ -100,7 +100,7 @@ return [
'messages' => [
'name' => 'Mesajlar'
],
'user_no' => [
'user' => [
'name' => 'Kullanıcı'
],

View File

@ -22,9 +22,9 @@ class AdressModel extends ProfileAdressEntryModel implements AdressInterface
{
if($id != null)
{
return $this->query()->where('user_no_id',$id)->get();
return $this->query()->where('user_id',$id)->get();
}
return $this->query()->where('user_no_id',Auth::id())->get();
return $this->query()->where('user_id',Auth::id())->get();
}

View File

@ -23,7 +23,7 @@ class AdressTableBuilder extends TableBuilder
'search' => [
'filter' => 'search',
'fields' => [
'user_no',
'user',
],
],
];

View File

@ -52,7 +52,7 @@ class AdressController extends AdminController
public function adresList(AdressTableBuilder $table, $id)
{
$table->setColumns(['adress_name','user_no']);
$table->setColumns(['adress_name','user']);
$table->setButtons(['edit' => [
'href' => '/admin/profile/adress/editAdress/{entry.id}',
],]);

View File

@ -35,14 +35,14 @@ class ProfileController extends AdminController
public function edit(ProfileFormBuilder $form,$id)
{
$users = UsersUsersEntryModel::find($id);
$profiles = ProfileModel::query()->where('user_no_id',$id)->orderBy("id")->first();
$profiles = ProfileModel::query()->where('user_id',$id)->orderBy("id")->first();
if($profiles == null)
{
$newProfile = [];
$newProfile ['user_no_id'] = $id;
$newProfile ['user_id'] = $id;
$newProfile ['country_id'] = null;
ProfileModel::query()->create($newProfile);
$profiles = ProfileModel::query()->where('user_no_id',$id)->orderBy("id")->first();
$profiles = ProfileModel::query()->where('user_id',$id)->orderBy("id")->first();
}
$country = CountryModel::all();
return $this->view->make('visiosoft.module.profile::admin.profile.edit',compact('users','profiles','country','form'));
@ -81,7 +81,7 @@ class ProfileController extends AdminController
$all['file_id'] = $all['file'];
unset($all['file']);
unset($all['_token'],$all['action']);
ProfileModel::query()->where('user_no_id',$id)->update($all);
ProfileModel::query()->where('user_id',$id)->update($all);
$message = [];
$message[] = trans('visiosoft.module.profile::message.success_update');
return redirect('admin/profile')->with('success', $message);

View File

@ -75,7 +75,7 @@ class MyProfileController extends PublicController
if ($profiles == null) {
$newProfile = [];
$newProfile ['user_no_id'] = Auth::id();
$newProfile ['user_id'] = Auth::id();
$profileModel->getProfile()->create($newProfile);
@ -163,7 +163,7 @@ class MyProfileController extends PublicController
{
$adressModel = new AdressModel();
$adress = $adressModel->getAdressFirst($id);
if ($adress->getAttribute('user_no_id') == Auth::id()) {
if ($adress->getAttribute('user_id') == Auth::id()) {
$country = CountryModel::all();
return $this->view->make('visiosoft.module.profile::address/edit', compact('adress', 'country'));
}
@ -179,7 +179,7 @@ class MyProfileController extends PublicController
$adressModel = new AdressModel();
$adress = $adressModel->getAdressFirst($id);
if ($adress->getAttribute('user_no_id') == Auth::id()) {
if ($adress->getAttribute('user_id') == Auth::id()) {
$New_value = $request->all();
$New_value['country_id'] = $New_value['country'];
@ -201,7 +201,7 @@ class MyProfileController extends PublicController
}
$new_adress = $request->request->all();
unset($new_adress['action'], $new_adress['_to*ken']);
$new_adress['user_no_id'] = Auth::id();
$new_adress['user_id'] = Auth::id();
$adressModel = new AdressModel();
$adressModel->getAdress()->create($new_adress);
@ -226,7 +226,7 @@ class MyProfileController extends PublicController
}
$new_adress = $request->request->all();
unset($new_adress['action'], $new_adress['_token']);
$new_adress['user_no_id'] = Auth::id();
$new_adress['user_id'] = Auth::id();
$adressModel = new AdressModel();
$address = $adressModel->getAdress()->create($new_adress);

View File

@ -96,7 +96,7 @@ class UserAuthenticator
if (isset($credentials['username'])) {
$profile = $profileRepository->findProfileForLogin('gsm_phone', $credentials['username']);
if ($profile != null) {
$find_user = $profileRepository->findUserForLogin('id', $profile->user_no_id);
$find_user = $profileRepository->findUserForLogin('id', $profile->user_id);
$credentials['username'] = $find_user->username;
}
}

View File

@ -29,7 +29,7 @@ class ProfileFormHandler
$parameters['file_id'] = $builder->getPostValue('file');
$profileModel->where('user_no_id', Auth::id())
$profileModel->where('user_id', Auth::id())
->update($parameters);
$messages->success(trans('visiosoft.module.profile::message.success_update'));

View File

@ -10,7 +10,7 @@ class ProfileModel extends ProfileProfileEntryModel implements ProfileInterface
{
if($id != null)
{
return $this->query()->where('user_no_id',$id);
return $this->query()->where('user_id',$id);
}
return $this->query();
}

View File

@ -41,7 +41,7 @@ class ProfileRepository extends EntryRepository implements ProfileRepositoryInte
public function getProfile($id)
{
return ProfileModel::query()->where('user_no_id', $id)->first();
return ProfileModel::query()->where('user_id', $id)->first();
}
public function findUserForLogin($field, $val)
@ -50,7 +50,7 @@ class ProfileRepository extends EntryRepository implements ProfileRepositoryInte
if ($user == null) {
$profile = $this->findProfileForLogin('gsm_phone', $val);
if ($profile != null) {
$user = UserModel::query()->find($profile->user_no_id);
$user = UserModel::query()->find($profile->user_id);
}
}
return $user;
@ -127,14 +127,14 @@ class ProfileRepository extends EntryRepository implements ProfileRepositoryInte
public function findByUserID($id)
{
return $this->model->where('user_no_id', $id)->first();
return $this->model->where('user_id', $id)->first();
}
public function CheckPhoneNumber($phoneNumber)
{
return $this->model
->where('gsm_phone', $phoneNumber)
->where('user_no_id','!=', Auth::id())
->where('user_id','!=', Auth::id())
->first();
}

View File

@ -54,7 +54,7 @@ class Register2FormHandler
/* @var UserInterface $user */
$user = $builder->getFormEntry();
$profile_parameters['user_no_id'] = $user->getId();
$profile_parameters['user_id'] = $user->getId();
ProfileModel::query()->create($profile_parameters);
$activator->start($user);

View File

@ -39,7 +39,7 @@ class ValidateCredentials
//Is email or phone number
if (!filter_var($credentials['email'], FILTER_VALIDATE_EMAIL)) {
if ($profile = $this->profile->findPhoneNumber($credentials['email'])) {
if ($user = $this->repository->find($profile->user_no_id)) {
if ($user = $this->repository->find($profile->user_id)) {
$credentials['email'] = $user->email;
}
}