Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement User Account Settings Page #117 #118

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions public/assets/css/custom.css
Original file line number Diff line number Diff line change
Expand Up @@ -724,6 +724,28 @@ div.polaroid {
background-color: unset;
}

.account-tabs .tab a {
color: rgba(38, 166, 154, 0.7);
}

.account-tabs .tab a:hover {
color:#26a69a;
}

.account-tabs .tab a:focus.active {
color:#26a69a;
background-color: rgba(38, 166, 154, 0.2);
}

.account-tabs .indicator {
background-color:#FFFFFF;
}

#account_profile,
#account_password {
margin: 0;
}

@media only screen and (max-width: 1500px) {
.content_no_img {
width: 100% !important;
Expand Down
5 changes: 5 additions & 0 deletions public/assets/js/custom.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ class Custom {
this.timeOut = null;

this.initPlugins();
this.initTabs();
this.events();
}

Expand Down Expand Up @@ -41,6 +42,10 @@ class Custom {
}, 1000)
}

initTabs() {
$('.account-tabs').tabs();
}

events() {
$(document).on('click', '.modal-trigger', this.modalTrigger.bind(this));
$(document).on('click', '.visibility-icon', this.visibilityIcon.bind(this));
Expand Down
52 changes: 52 additions & 0 deletions shared/Services/AccountService.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
<?php

/**
* Quantum PHP Framework
*
* An open source software development framework for PHP
*
* @package Quantum
* @author Arman Ag. <[email protected]>
* @copyright Copyright (c) 2018 Softberg LLC (https://softberg.org)
* @link http://quantum.softberg.org/
* @since 2.9.5
*/

namespace Shared\Services;

use ReflectionException;
use Quantum\Di\Exceptions\DiException;
use Quantum\Libraries\Database\Exceptions\ModelException;
use Quantum\Libraries\Database\Exceptions\DatabaseException;
use Quantum\Mvc\QtService;
use Quantum\Factory\ModelFactory;
use Quantum\Libraries\Config\Exceptions\ConfigException;
use Shared\Models\User;

/**
* Class AccountService
* @package Shared\Services
*/
class AccountService extends QtService
{
/**
* Update
* @param string $uuid
* @param array $data
* @throws ConfigException
* @throws DatabaseException
* @throws DiException
* @throws ModelException
* @throws ReflectionException
*/
public function update(string $uuid, array $data)
{
$userModel = ModelFactory::get(User::class);

$user = $userModel->findOneBy('uuid', $uuid);
$user->fillObjectProps($data);
$user->save();

return $userModel->findOneBy('uuid', $uuid);
}
}
4 changes: 4 additions & 0 deletions shared/resources/lang/am/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
'2fa' => 'Երկու գործոնով նույնականացում',
'resend_otp' => 'Կրկին ուղարկել',
'yes' => 'Այո',
'profile' => 'Profile',
'account_settings' => 'Հաշվի կարգավորումներ',
'current_password' => 'Ընթացիկ գաղտնաբառը',
'confirm_password' => 'Հաստատեք գաղտնաբառը',
'pagination' => [
'next' => 'Հաջորդ &raquo;',
'prev' => '&laquo; Նախորդ'
Expand Down
6 changes: 6 additions & 0 deletions shared/resources/lang/am/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'regex' => '{%1} դաշտը պետք է պարունակի արժեք վավեր ձևաչափով',
'jsonString' => '{%1} դաշտը պետք է ունենա վավեր JSON ձևաչափի',
'same' => '{%1} դաշտը պետք է լինի նույն արժեքը, ինչ {%2}',
'same_password' => '{%1} դաշտը պետք է լինի նույն արժեքը, ինչ Նոր գաղտնաբառը',
'unique' => '{%1} դաշտը պետք է պարունակի միայն ունիկալ արժեք',
'fileSize' => 'Ֆայլի չափը պետք է համապատասխանի {%1}',
'fileMimeType' => 'Ֆայլի mimetype-ը պետք է համապատասխանի {%1}',
Expand All @@ -43,4 +44,9 @@
'nonEqualValues' => 'Արժեքները հավասար չեն',
'unauthorizedRequest' => 'Չարտոնված հարցում',
'uniqueUser' => '{%1} դաշտի արժեքն արդեն առկա է մեր տվյալների բազայում',
'passwordsDoNotMatch' => 'Գաղտնաբառերը չեն համընկնում',
'incorrect_password' => 'Ներկայիս գաղտնաբառը սխալ է',
'new_password' => 'Նոր գաղտնաբառ',
'current_password' => 'Ընթացիկ գաղտնաբառը',
'confirm_password' => 'Հաստատեք գաղտնաբառը',
];
4 changes: 4 additions & 0 deletions shared/resources/lang/en/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,10 @@
'2fa' => '2 Factor Authentication',
'resend_otp' => 'Resend otp',
'yes' => 'Yes',
'account_settings' => 'Account Settings',
'profile' => 'Profile',
'current_password' => 'Current Password',
'confirm_password' => 'Confirm Password',
'pagination' => [
'next' => 'Next &raquo;',
'prev' => '&laquo; Prev'
Expand Down
6 changes: 6 additions & 0 deletions shared/resources/lang/en/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'regex' => 'The {%1} field needs to contain a value with valid format',
'jsonString' => 'The {%1} field needs to contain a valid JSON format string',
'same' => 'The {%1} field should be same as the {%2}',
'same_password' => 'The {%1} field should be same as the New password',
'unique' => 'The {%1} field should only contain unique value',
'fileSize' => 'The file size should correspond to the {%1}',
'fileMimeType' => 'The file mimetype should correspond to the {%1}',
Expand All @@ -43,6 +44,11 @@
'nonEqualValues' => 'Values are not equal',
'unauthorizedRequest' => 'Unauthorized request',
'uniqueUser' => 'The value of {%1} field is already exists in our database',
'passwordsDoNotMatch' => 'Passwords do not match',
'incorrect_password' => 'The current password is incorrect',
'new_password' => 'New password',
'current_password' => 'Current Password',
'confirm_password' => 'Confirm Password',
'captcha' => [
'timeout-or-duplicate' => 'Timeout or duplicate.',
'missing-input-secret' => 'The secret parameter is missing.',
Expand Down
4 changes: 4 additions & 0 deletions shared/resources/lang/ru/common.php
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,10 @@
'2fa' => 'Двухфакторная аутентификация',
'resend_otp' => 'Отправить повторно',
'yes' => 'Да',
'account_settings' => 'Настройки учетной записи',
'profile' => 'Профиль',
'current_password' => 'Текущий пароль',
'confirm_password' => 'Подтвердите пароль',
'pagination' => [
'next' => 'Следующий &raquo;',
'prev' => '&laquo; Предыдущий'
Expand Down
6 changes: 6 additions & 0 deletions shared/resources/lang/ru/validation.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
'regex' => 'Поле {%1} должно содержать правильное значение',
'jsonString' => 'Поле {%1} должно быть валидной JSON строкой',
'same' => 'Поле {%1} должно быть таким же, как {%2}',
'same_password' => 'Поле {%1} должно быть таким же, как Новый пароль',
'unique' => 'Поле {%1} должно содержать только уникальное значение',
'fileSize' => 'Размер файла должен соответствовать {%1}',
'fileMimeType' => 'Mimetype файла должен соответствовать {%1}',
Expand All @@ -43,4 +44,9 @@
'nonEqualValues' => 'Значения не равны',
'unauthorizedRequest' => 'Несанкционированный запрос',
'uniqueUser' => 'Значение поля {%1} уже существует в нашей базе данных',
'passwordsDoNotMatch' => 'Пароли не совпадают',
'incorrect_password' => 'Текущий пароль неверный',
'new_password' => 'Новый пароль',
'current_password' => 'Текущий пароль',
'confirm_password' => 'Подтвердите пароль',
];