Skip to content

Commit

Permalink
Merge branch 'refs/heads/3.x'
Browse files Browse the repository at this point in the history
  • Loading branch information
sampoyigi committed Sep 14, 2024
2 parents 7dfd6de + 1692ea4 commit af1581d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 31 deletions.
2 changes: 1 addition & 1 deletion app/admin/assets/css/admin.css

Large diffs are not rendered by default.

36 changes: 20 additions & 16 deletions app/admin/assets/src/scss/components/_message.scss
Original file line number Diff line number Diff line change
@@ -1,27 +1,31 @@
.message-folders {
min-height: 100%;
min-height: 100%;

.panel-header {
padding: 15px;
background-color: $table-head-bg;
border-bottom: (2 * $table-border-width) solid $table-border-color;
}
.panel-header {
padding: 15px;
background-color: $table-head-bg;
border-bottom: calc(2 * var(--bs-border-width)) solid $table-border-color;
}
}

.message.unread a {
font-weight: 500;
font-weight: 500;
}

.conversation-heading {
padding: 15px 20px;
background-color: $gray-200;
border-bottom: 1px solid $gray-300;
padding: 15px 20px;
background-color: $gray-200;
border-bottom: 1px solid $gray-300;
}

.conversation-message {
border-radius: 0;
margin-bottom: 0;
background-color: $light;
border-radius: 0;
margin-bottom: 0;
background-color: $light;
}

.conversation-message-heading {
background-color: $gray-200;
border-bottom: 1px solid $gray-300;
padding: 10px 20px;
background-color: $gray-200;
border-bottom: 1px solid $gray-300;
padding: 10px 20px;
}
12 changes: 5 additions & 7 deletions app/system/console/commands/IgniterInstall.php
Original file line number Diff line number Diff line change
Expand Up @@ -145,30 +145,28 @@ protected function setSeederProperties()
DatabaseSeeder::$siteUrl = $this->ask('Site URL', Config::get('app.url'));

DatabaseSeeder::$seedDemo = $this->confirm('Install demo data?', DatabaseSeeder::$seedDemo);

DatabaseSeeder::$siteEmail = $this->ask('Admin Email', DatabaseSeeder::$siteEmail);
DatabaseSeeder::$staffName = $this->ask('Admin Name', DatabaseSeeder::$staffName);
}

protected function createSuperUser()
{
$email = $this->output->ask('Admin Email', DatabaseSeeder::$siteEmail, function ($answer) {
$staffName = $this->ask('Admin Name', DatabaseSeeder::$staffName);
$email = $this->output->ask('Admin Email', DatabaseSeeder::$siteEmail, function($answer) {
if (Staffs_model::whereStaffEmail($answer)->first()) {
throw new \RuntimeException('An administrator with that email already exists, please choose a different email.');
}

return $answer;
});

$username = $this->output->ask('Admin Username', 'admin', function ($answer) {
$username = $this->output->ask('Admin Username', 'admin', function($answer) {
if (Users_model::whereUsername($answer)->first()) {
throw new \RuntimeException('An administrator with that username already exists, please choose a different username.');
}

return $answer;
});

$password = $this->output->ask('Admin Password', '123456', function ($answer) {
$password = $this->output->ask('Admin Password', '123456', function($answer) {
if (!is_string($answer) || strlen($answer) < 6 || strlen($answer) > 32) {
throw new \RuntimeException('Please specify the administrator password, at least 6 characters and not more than 32 characters.');
}
Expand All @@ -178,7 +176,7 @@ protected function createSuperUser()

$user = AdminAuth::register([
'staff_email' => $email,
'staff_name' => DatabaseSeeder::$staffName,
'staff_name' => $staffName,
'language_id' => Languages_model::first()->language_id,
'staff_role_id' => Staff_roles_model::first()->staff_role_id,
'staff_status' => true,
Expand Down
4 changes: 2 additions & 2 deletions app/system/helpers/country_helper.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
*/
if (!function_exists('format_address')) {

function format_address($address, $useLineBreaks = true)
function format_address($address, $useLineBreaks = true, $useDefaultFormat = false)
{
return Country::addressFormat($address, $useLineBreaks);
return Country::addressFormat($address, $useLineBreaks, $useDefaultFormat);
}
}

Expand Down
11 changes: 6 additions & 5 deletions app/system/libraries/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Country

protected $countriesCollection = [];

public function addressFormat($address, $useLineBreaks = true)
public function addressFormat($address, $useLineBreaks = true, $useDefaultFormat = false)
{
$format = $this->getDefaultFormat();

Expand All @@ -38,6 +38,9 @@ public function addressFormat($address, $useLineBreaks = true)
if (!empty($address['format']))
$format = $address['format'];

if ($useDefaultFormat)
$format = $this->defaultFormat;

$formattedAddress = str_replace(['\r\n', '\r', '\n'], '<br />',
preg_replace(['/\s\s+/', '/\r\r+/', '/\n\n+/'], '<br />',
trim(str_replace([
Expand Down Expand Up @@ -110,8 +113,7 @@ protected function evalAddress($address)
foreach ($this->requiredAddressKeys as $key) {
if ($key == 'country') {
$this->processCountryValue($address[$key], $result);
}
else {
} else {
$result[$key] = $address[$key] ?? '';
}
}
Expand All @@ -124,8 +126,7 @@ protected function processCountryValue($country, &$result)
if (!is_string($country) && isset($country['country_name'])) {
$result['country'] = $country['country_name'];
$result['format'] = $country['format'];
}
elseif (is_numeric($country)) {
} elseif (is_numeric($country)) {
$this->loadCountries();

if ($countryModel = $this->countriesCollection->find($country)) {
Expand Down

0 comments on commit af1581d

Please sign in to comment.